-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow swizzle on n-dimension vectors #4277
Allow swizzle on n-dimension vectors #4277
Conversation
d5ab695
to
f18557b
Compare
After adding the check for
I am not sure where this error gets generated. So, it would be great if you can suggest if this is the right place to fix this, or if it needs fixing early on during IR generation. This is the generated IR before it goes into the checker:
side note: how do I get rid of the |
7d8a29b
to
1ff7505
Compare
the whole syntax: |
@@ -0,0 +1,14 @@ | |||
//TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -shaderobj |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend adding a spirv and a glsl/hlsl test to catch errors that may be cpp
specific.
The code asserts because The code works with |
When you have an error message like that, it means an assertion is failing.
It will take a lot of time to figure out what it means if you try to manually narrow it down to where the message comes from. |
I don't think it is the same thing, but recently Yong submitted a similar fix. |
Systematically support general vector types will take a lot more effort. We should just diagnose an error when the element type of a |
1ff7505
to
33bdd7b
Compare
This works great in |
So, based on what I can infer from the advise, I will update the test to explicitly call out the error scenario, and not permit vector of non basic types. |
Fixes bug shader-slang#3180 This test verifies the check for illegal swizzle on vector types, whose element is not a basic Type (int, float). The check captures the failure within swizzle access on a nested vector subscript element. vector<vector<int, 2>, 2> a int b = a[0].x; // illegal
33bdd7b
to
e873ade
Compare
Fixes bug #3180
Adds a test case to repro the failure
Fails when using either subscript operator or swizzle operator.