diff options
| author | Yong He <yonghe@outlook.com> | 2025-01-07 22:26:31 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-07 22:26:31 -0800 |
| commit | c43f6fa55aca23365c86c6ec1737d42be74d9d3e (patch) | |
| tree | 2c49bc1dbd12ae5f46d682a3f240465931471060 /tests/pipeline | |
| parent | 1a56f58fdd0c704e6dc0fad0f0ec33a25a35e60b (diff) | |
Lower varying parameters as pointers instead of SSA values. (#5919)
* Add executable test on matrix-typed vertex input.
* Fix emit logic of matrix layout qualifier.
* Pass fragment shader varying input by constref to allow EvaluateAttributeAtCentroid etc. to be implemented correctly.
Diffstat (limited to 'tests/pipeline')
5 files changed, 22 insertions, 55 deletions
diff --git a/tests/pipeline/rasterization/get-attribute-at-vertex-nv.slang b/tests/pipeline/rasterization/get-attribute-at-vertex-nv.slang deleted file mode 100644 index d7bdbc69c..000000000 --- a/tests/pipeline/rasterization/get-attribute-at-vertex-nv.slang +++ /dev/null @@ -1,17 +0,0 @@ -// get-attribute-at-vertex.slang - -// Basic test for `GetAttributeAtVertex` function - -//TEST:CROSS_COMPILE:-target dxil -capability GL_NV_fragment_shader_barycentric -entry main -stage fragment -profile sm_6_1 -//TEST:CROSS_COMPILE:-target spirv -capability GL_NV_fragment_shader_barycentric -entry main -stage fragment -profile glsl_450 - -[shader("fragment")] -void main( - pervertex float4 color : COLOR, - float3 bary : SV_Barycentrics, - out float4 result : SV_Target) -{ - result = bary.x * GetAttributeAtVertex(color, 0) - + bary.y * GetAttributeAtVertex(color, 1) - + bary.z * GetAttributeAtVertex(color, 2); -} diff --git a/tests/pipeline/rasterization/get-attribute-at-vertex-nv.slang.glsl b/tests/pipeline/rasterization/get-attribute-at-vertex-nv.slang.glsl deleted file mode 100644 index 820918d8b..000000000 --- a/tests/pipeline/rasterization/get-attribute-at-vertex-nv.slang.glsl +++ /dev/null @@ -1,20 +0,0 @@ -// get-attribute-at-vertex.slang.glsl -//TEST_IGNORE_FILE: - -#version 450 -#extension GL_EXT_fragment_shader_barycentric : require -layout(row_major) uniform; -layout(row_major) buffer; - -pervertexEXT layout(location = 0) -in vec4 color_0[3]; - -layout(location = 0) -out vec4 result_0; - -void main() -{ - result_0 = gl_BaryCoordEXT.x * ((color_0)[(0U)]) + gl_BaryCoordEXT.y * ((color_0)[(1U)]) + gl_BaryCoordEXT.z * ((color_0)[(2U)]); - return; -} - diff --git a/tests/pipeline/rasterization/get-attribute-at-vertex-nv.slang.hlsl b/tests/pipeline/rasterization/get-attribute-at-vertex-nv.slang.hlsl deleted file mode 100644 index a6b45eab4..000000000 --- a/tests/pipeline/rasterization/get-attribute-at-vertex-nv.slang.hlsl +++ /dev/null @@ -1,16 +0,0 @@ -// get-attribute-at-vertex.slang.hlsl - -//TEST_IGNORE_FILE: - -#pragma warning(disable: 3557) - -[shader("pixel")] -void main( - nointerpolation vector<float,4> color_0 : COLOR, - vector<float,3> bary_0 : SV_BARYCENTRICS, - out vector<float,4> result_0 : SV_TARGET) -{ - result_0 = bary_0.x * GetAttributeAtVertex(color_0, 0U) - + bary_0.y * GetAttributeAtVertex(color_0, 1U) - + bary_0.z * GetAttributeAtVertex(color_0, 2U); -} diff --git a/tests/pipeline/rasterization/get-attribute-at-vertex.slang b/tests/pipeline/rasterization/get-attribute-at-vertex.slang index 9ae347a3a..c334200fb 100644 --- a/tests/pipeline/rasterization/get-attribute-at-vertex.slang +++ b/tests/pipeline/rasterization/get-attribute-at-vertex.slang @@ -2,8 +2,6 @@ // Basic test for `GetAttributeAtVertex` function -//TEST:CROSS_COMPILE:-target dxil -entry main -stage fragment -profile sm_6_1 -//TEST:CROSS_COMPILE:-target spirv -entry main -stage fragment -profile glsl_450+GL_EXT_fragment_shader_barycentric //TEST:SIMPLE(filecheck=CHECK):-emit-spirv-directly -target spirv -entry main -stage fragment -profile glsl_450+GL_EXT_fragment_shader_barycentric // CHECK: OpCapability FragmentBarycentricKHR diff --git a/tests/pipeline/rasterization/varying-to-inout.slang b/tests/pipeline/rasterization/varying-to-inout.slang new file mode 100644 index 000000000..7a54fd82f --- /dev/null +++ b/tests/pipeline/rasterization/varying-to-inout.slang @@ -0,0 +1,22 @@ +// Test passing a varying parameter direclty to an inout parameter. + +//TEST:SIMPLE(filecheck=CHECK):-target spirv -entry main -stage fragment + +// CHECK: OpEntryPoint Fragment %main "main" +struct PS_IN +{ + float3 pos : SV_Position; + float4 color : COLOR; +} + +void test(inout PS_IN v) +{ + v.color = v.color + v.pos.x; +} + +[shader("fragment")] +float4 main(PS_IN psIn):SV_Target +{ + test(psIn); + return psIn.color; +} |
