summaryrefslogtreecommitdiffstats
path: root/tests/pipeline
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-02-16 13:55:32 -0800
committerGitHub <noreply@github.com>2023-02-16 13:55:32 -0800
commit4c4826d47eeef4675daae4ae53ff76f4d5ebd84a (patch)
treeed4af0ded878e4f06e9641ce61d26ffd7c89ccbc /tests/pipeline
parenteda88e513e8b1e2abc05e9dc8555f237d96472df (diff)
Overhaul global inst deduplication and cpp/cuda backend. (#2654)
* Overhaul global inst deduplication and cpp/cuda backend. * Update IR documentation. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/pipeline')
-rw-r--r--tests/pipeline/rasterization/mesh/component-write.slang.glsl12
-rw-r--r--tests/pipeline/rasterization/mesh/hello.slang.glsl8
-rw-r--r--tests/pipeline/rasterization/mesh/hello.slang.hlsl8
-rw-r--r--tests/pipeline/rasterization/mesh/primitive-output.slang.glsl7
4 files changed, 22 insertions, 13 deletions
diff --git a/tests/pipeline/rasterization/mesh/component-write.slang.glsl b/tests/pipeline/rasterization/mesh/component-write.slang.glsl
index 5234fb62f..143947504 100644
--- a/tests/pipeline/rasterization/mesh/component-write.slang.glsl
+++ b/tests/pipeline/rasterization/mesh/component-write.slang.glsl
@@ -2,26 +2,30 @@
#extension GL_EXT_mesh_shader : require
layout(row_major) uniform;
layout(row_major) buffer;
-const vec3 colors_0[3] = { vec3(1.00000000000000000000, 1.00000000000000000000, 0.00000000000000000000), vec3(0.00000000000000000000, 1.00000000000000000000, 1.00000000000000000000), vec3(1.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000) };
-const vec2 positions_0[3] = { vec2(0.00000000000000000000, -0.50000000000000000000), vec2(0.50000000000000000000, 0.50000000000000000000), vec2(-0.50000000000000000000, 0.50000000000000000000) };
+const vec2 positions_0[3] = { vec2(0.0, -0.5), vec2(0.5, 0.5), vec2(-0.5, 0.5) };
+const vec3 colors_0[3] = { vec3(1.0, 1.0, 0.0), vec3(0.0, 1.0, 1.0), vec3(1.0, 0.0, 1.0) };
layout(location = 0)
out vec3 _S1[3];
+
out gl_MeshPerVertexEXT
{
vec4 gl_Position;
} gl_MeshVerticesEXT[3];
+out uvec3 gl_PrimitiveTriangleIndicesEXT[1];
+
layout(local_size_x = 3, local_size_y = 1, local_size_z = 1) in;
layout(max_vertices = 3) out;
layout(max_primitives = 1) out;
layout(triangles) out;
void main()
{
+
SetMeshOutputsEXT(3U, 1U);
if(gl_LocalInvocationIndex < 3U)
{
- gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = vec4(positions_0[gl_LocalInvocationIndex], 0.00000000000000000000, 1.00000000000000000000);
+ gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = vec4(positions_0[gl_LocalInvocationIndex], 0.0, 1.0);
_S1[gl_LocalInvocationIndex] = colors_0[gl_LocalInvocationIndex];
}
else
@@ -34,6 +38,6 @@ void main()
else
{
}
+
return;
}
-
diff --git a/tests/pipeline/rasterization/mesh/hello.slang.glsl b/tests/pipeline/rasterization/mesh/hello.slang.glsl
index 3a0848dcb..0b3d4acb3 100644
--- a/tests/pipeline/rasterization/mesh/hello.slang.glsl
+++ b/tests/pipeline/rasterization/mesh/hello.slang.glsl
@@ -2,12 +2,12 @@
#extension GL_EXT_mesh_shader : require
layout(row_major) uniform;
layout(row_major) buffer;
-const vec3 colors_0[3] = { vec3(1.0, 1.0, 0.0), vec3(0.0, 1.0, 1.0), vec3(1.0, 0.0, 1.0) };
const vec2 positions_0[3] = { vec2(0.0, -0.5), vec2(0.5, 0.5), vec2(-0.5, 0.5) };
-
+const vec3 colors_0[3] = { vec3(1.0, 1.0, 0.0), vec3(0.0, 1.0, 1.0), vec3(1.0, 0.0, 1.0) };
layout(location = 0)
out vec3 _S1[3];
+
out gl_MeshPerVertexEXT
{
vec4 gl_Position;
@@ -21,6 +21,7 @@ layout(max_primitives = 1) out;
layout(triangles) out;
void main()
{
+
SetMeshOutputsEXT(3U, 1U);
if(gl_LocalInvocationIndex < 3U)
{
@@ -30,6 +31,7 @@ void main()
else
{
}
+
if(gl_LocalInvocationIndex < 1U)
{
gl_PrimitiveTriangleIndicesEXT[gl_LocalInvocationIndex] = uvec3(0U, 1U, 2U);
@@ -37,6 +39,6 @@ void main()
else
{
}
+
return;
}
-
diff --git a/tests/pipeline/rasterization/mesh/hello.slang.hlsl b/tests/pipeline/rasterization/mesh/hello.slang.hlsl
index a10dc6884..06871fedd 100644
--- a/tests/pipeline/rasterization/mesh/hello.slang.hlsl
+++ b/tests/pipeline/rasterization/mesh/hello.slang.hlsl
@@ -4,16 +4,15 @@
#endif
#pragma warning(disable: 3557)
-static const float3 colors_0[int(3)] = { float3(1.0, 1.0, 0.0), float3(0.0, 1.0, 1.0), float3(1.0, 0.0, 1.0) };
static const float2 positions_0[int(3)] = { float2(0.0, -0.5), float2(0.5, 0.5), float2(-0.5, 0.5) };
+static const float3 colors_0[int(3)] = { float3(1.0, 1.0, 0.0), float3(0.0, 1.0, 1.0), float3(1.0, 0.0, 1.0) };
struct Vertex_0
{
float4 pos_0 : SV_Position;
float3 color_0 : Color;
};
-[shader("mesh")]
-[numthreads(3, 1, 1)]
+[shader("mesh")][numthreads(3, 1, 1)]
[outputtopology("triangle")]
void main(uint tig_0 : SV_GROUPINDEX, vertices vertices out Vertex_0 verts_0[int(3)], indices indices out uint3 triangles_0[int(1)])
{
@@ -26,6 +25,7 @@ void main(uint tig_0 : SV_GROUPINDEX, vertices vertices out Vertex_0 verts_0[in
else
{
}
+
if(tig_0 < 1U)
{
triangles_0[tig_0] = uint3(0U, 1U, 2U);
@@ -33,6 +33,6 @@ void main(uint tig_0 : SV_GROUPINDEX, vertices vertices out Vertex_0 verts_0[in
else
{
}
+
return;
}
-
diff --git a/tests/pipeline/rasterization/mesh/primitive-output.slang.glsl b/tests/pipeline/rasterization/mesh/primitive-output.slang.glsl
index 35efcf4af..cfe266bec 100644
--- a/tests/pipeline/rasterization/mesh/primitive-output.slang.glsl
+++ b/tests/pipeline/rasterization/mesh/primitive-output.slang.glsl
@@ -2,9 +2,10 @@
#extension GL_EXT_mesh_shader : require
layout(row_major) uniform;
layout(row_major) buffer;
-const vec3 colors_0[3] = { vec3(1.0, 1.0, 0.0), vec3(0.0, 1.0, 1.0), vec3(1.0, 0.0, 1.0) };
const vec2 positions_0[3] = { vec2(0.0, -0.5), vec2(0.5, 0.5), vec2(-0.5, 0.5) };
+const vec3 colors_0[3] = { vec3(1.0, 1.0, 0.0), vec3(0.0, 1.0, 1.0), vec3(1.0, 0.0, 1.0) };
out uvec3 gl_PrimitiveTriangleIndicesEXT[1];
+
layout(location = 0)
out vec3 _S1[3];
@@ -28,6 +29,7 @@ layout(max_primitives = 1) out;
layout(triangles) out;
void main()
{
+
SetMeshOutputsEXT(3U, 1U);
if(gl_LocalInvocationIndex < 3U)
{
@@ -37,6 +39,7 @@ void main()
else
{
}
+
if(gl_LocalInvocationIndex < 1U)
{
gl_PrimitiveTriangleIndicesEXT[gl_LocalInvocationIndex] = uvec3(0U, 1U, 2U);
@@ -47,6 +50,6 @@ void main()
else
{
}
+
return;
}
-