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 badges
Add a comment  | 

1 Answer 1

Reset to default 1

You 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