Skip to content
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

HLSL parsing error when constructing half3x3 variable from 4 half3 arguments #898

Closed
SSPkrolik opened this issue May 19, 2017 · 3 comments
Closed

Comments

@SSPkrolik
Copy link

Here is a place in my fragment shader where the error happens (lines 186-188):

  fFlipNormal*=IN.bIsFrontFace?1.0f:-1.0f;   // line 186
  half3x3 mTangentToWS=half3x3(half3(1,0,0),half3(0,1,0),half3(0,0,1));  // line 187
  mTangentToWS=half3x3(IN.vTangent.xyz,IN.vBinormal.xyz,IN.vNormalWS.xyz*fFlipNormal);  // line 188

Here is the output of glslValidator utitliy:

rostislavd@rostislavd-VirtualBox:~/Projects/glslang/build$ install/bin/glslangValidator -D -V ../../Shaders/illumZPassPS.frag 
../../Shaders/illumZPassPS.frag
ERROR: ../../Shaders/illumZPassPS.frag:187: 'half3x3' : unknown variable 
ERROR: ../../Shaders/illumZPassPS.frag:187: ';' : Expected 
../../Shaders/illumZPassPS.frag(187): error at column 22, HLSL parsing failed.
ERROR: 3 compilation errors.  No code generated.


SPIR-V is not generated for failed compile or link

DirectX11 shader compiler compiles it just fine. Also I hadn't found that the feature is absent for HLSL parsing in issue #362

@johnkslang
Copy link
Member

It is the fourth line of #362:

Map half to float. See issue #492.

Is mapping half -> float sufficient for you? (Assuming that means mapping all half* types to corresponding float* types.)

@SSPkrolik
Copy link
Author

@johnkslang thx a lot, missed it. Yeah, the mapping would be quite enough.

@johnkslang
Copy link
Member

This should work now with 96f6552. FXC also complains if you try to use 4 half3 arguments, so I assume the title is a typo. The code example only has 3, and my testing shows this works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants