summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/pipeline/rasterization/get-attribute-at-vertex.slang16
-rw-r--r--tests/pipeline/rasterization/get-attribute-at-vertex.slang.hlsl14
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/pipeline/rasterization/get-attribute-at-vertex.slang b/tests/pipeline/rasterization/get-attribute-at-vertex.slang
new file mode 100644
index 000000000..56fbcce78
--- /dev/null
+++ b/tests/pipeline/rasterization/get-attribute-at-vertex.slang
@@ -0,0 +1,16 @@
+// get-attribute-at-vertex.slang
+
+// Basic test for `GetAttributeAtVertex` function
+
+//TEST:CROSS_COMPILE:-target dxil -entry main -stage fragment -profile sm_6_1
+
+[shader("fragment")]
+void main(
+ nointerpolation 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.slang.hlsl b/tests/pipeline/rasterization/get-attribute-at-vertex.slang.hlsl
new file mode 100644
index 000000000..257b334bf
--- /dev/null
+++ b/tests/pipeline/rasterization/get-attribute-at-vertex.slang.hlsl
@@ -0,0 +1,14 @@
+// get-attribute-at-vertex.slang.hlsl
+
+//TEST_IGNORE_FILE:
+
+[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, (uint) int(0))
+ + bary_0.y * GetAttributeAtVertex(color_0, (uint) int(1))
+ + bary_0.z * GetAttributeAtVertex(color_0, (uint) int(2));
+}