-
Notifications
You must be signed in to change notification settings - Fork 81
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
Hull shader input: VtxOutputGeo0 not array when it should be. #18
Comments
If you do nothing to the control points then fxc will not generate a control point phase unless you compile with /Od. So your HLSL has an assignment instructions but fxc ignores them and will be missing from the bytecode. This array size to use for VtxOutputGeo0 is simply not known. The driver has to generate the missing assignments, but does not know how many generate until draw time because it needs to know what the domain shader inputs are. A similar thing exists in opengl whereby you can have a evaluation shader without a control shader and the driver will generate one internally for you - although that is not allowed in the ES extension. So you might want to use this awful feature and not use a hull shader, just set GL_PATCH_DEFAULT_INNER_LEVEL and GL_PATCH_DEFAULT_OUTER_LEVEL. It should be possible for HLSLcc to be changed to handle this scenario if you guarantee that the domain shader will be compiled first and then information from that shader can be saved into the GLSLCrossDependencyData struct and used when compiling the hull shader. |
I thought as much. In the example given VtxOutputGeo0 is not actually used, a thought I had was to just not write it out into the GLSL? Used cross dependency data sounds good too, though in this particular case it seems like it would have no gain, correct me if I'm wrong of course. |
I believe if you have a control shader then it must write gl_Position otherwise you are feeding uninitialized positions to subsequent stages. I have pushed a change to remove the unused input variable. |
When working on getting triangle tessellation to work, I noticed a problem when doing a simple pass through for the control points that doesn't appear to be a problem with quads on my driver (though the code generation bug still exists).
Unless you are modifying the control points, VtxOutputGeo0 is not declared as an array (3 for tri, 4 for quad). This causes a link error for me. To work around this whilst testing things I modified the shader I was using to simply multiply the control points by a value to ensure their modification, VtxOutputGeo0 in this case was declared as an array of size 3. The code that works is as follows:
The code that shows the bug is as follows:
The text was updated successfully, but these errors were encountered: