admin管理员组文章数量:1301545
In my GLSL code in my vertex shader I have:
layout(location = 2) out flat uint out_uniform_index;
layout(location = 3) out vec2 out_pos_in_chamfer_box;
layout(location = 4) out flat vec2 out_chamfer_box_size;
In GLSL I think integers are flat automatically, but for floating point types you must label it specifically. I'm trying to use Slang and I don't know how to do this as it doesn't seem to have a "flat" keyword qualifier. Since Slang's syntax is related to HLSL I'm wondering if HLSL also doesn't have this qualifier. How do I do this in Slang?
In my GLSL code in my vertex shader I have:
layout(location = 2) out flat uint out_uniform_index;
layout(location = 3) out vec2 out_pos_in_chamfer_box;
layout(location = 4) out flat vec2 out_chamfer_box_size;
In GLSL I think integers are flat automatically, but for floating point types you must label it specifically. I'm trying to use Slang and I don't know how to do this as it doesn't seem to have a "flat" keyword qualifier. Since Slang's syntax is related to HLSL I'm wondering if HLSL also doesn't have this qualifier. How do I do this in Slang?
Share asked Feb 11 at 5:18 ZebrafishZebrafish 14.4k3 gold badges64 silver badges152 bronze badges1 Answer
Reset to default 1You can use nointerpolation keyword, from doc can be found here: https://learn.microsoft/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-struct
本文标签: How do I pass a value from the vertex shader as a flat variable in Slang and HLSLStack Overflow
版权声明:本文标题:How do I pass a value from the vertex shader as a flat variable in Slang and HLSL? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741677236a2391954.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论