forked from KhronosGroup/SPIRV-Cross
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a73e68
commit 5762617
Showing
14 changed files
with
715 additions
and
21 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
reference/opt/shaders/mesh/mesh-shader-basic-lines.spv14.vk.nocompat.mesh.vk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#version 450 | ||
#extension GL_EXT_mesh_shader : require | ||
#extension GL_EXT_fragment_shading_rate : require | ||
layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) in; | ||
layout(max_vertices = 24, max_primitives = 22, lines) out; | ||
|
||
out gl_MeshPerVertexEXT | ||
{ | ||
vec4 gl_Position; | ||
float gl_PointSize; | ||
float gl_ClipDistance[1]; | ||
float gl_CullDistance[2]; | ||
} gl_MeshVerticesEXT[]; | ||
|
||
struct TaskPayload | ||
{ | ||
float a; | ||
float b; | ||
int c; | ||
}; | ||
|
||
layout(location = 0) out vec4 vOut[24]; | ||
layout(location = 2) out BlockOut | ||
{ | ||
vec4 a; | ||
vec4 b; | ||
} outputs[24]; | ||
|
||
layout(location = 1) perprimitiveEXT out vec4 vPrim[22]; | ||
layout(location = 4) perprimitiveEXT out BlockOutPrim | ||
{ | ||
vec4 a; | ||
vec4 b; | ||
} prim_outputs[22]; | ||
|
||
taskPayloadSharedEXT TaskPayload payload; | ||
shared float shared_float[16]; | ||
|
||
void main() | ||
{ | ||
SetMeshOutputsEXT(24u, 22u); | ||
vec3 _29 = vec3(gl_GlobalInvocationID); | ||
float _31 = _29.x; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = vec4(_31, _29.yz, 1.0); | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_PointSize = 2.0; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_ClipDistance[0] = 4.0; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[1] = 5.0; | ||
vOut[gl_LocalInvocationIndex] = vec4(_31, _29.yz, 2.0); | ||
outputs[gl_LocalInvocationIndex].a = vec4(5.0); | ||
outputs[gl_LocalInvocationIndex].b = vec4(6.0); | ||
barrier(); | ||
if (gl_LocalInvocationIndex < 22u) | ||
{ | ||
vPrim[gl_LocalInvocationIndex] = vec4(vec3(gl_WorkGroupID), 3.0); | ||
prim_outputs[gl_LocalInvocationIndex].a = vec4(payload.a); | ||
prim_outputs[gl_LocalInvocationIndex].b = vec4(payload.b); | ||
gl_PrimitiveLineIndicesEXT[gl_LocalInvocationIndex] = uvec2(0u, 1u) + uvec2(gl_LocalInvocationIndex); | ||
int _129 = int(gl_GlobalInvocationID.x); | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveID = _129; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_Layer = _129 + 1; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_ViewportIndex = _129 + 2; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_CullPrimitiveEXT = (gl_GlobalInvocationID.x & 1u) != 0u; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveShadingRateEXT = _129 + 3; | ||
} | ||
} | ||
|
66 changes: 66 additions & 0 deletions
66
reference/opt/shaders/mesh/mesh-shader-basic-points.spv14.vk.nocompat.mesh.vk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#version 450 | ||
#extension GL_EXT_mesh_shader : require | ||
#extension GL_EXT_fragment_shading_rate : require | ||
layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) in; | ||
layout(max_vertices = 24, max_primitives = 22, points) out; | ||
|
||
out gl_MeshPerVertexEXT | ||
{ | ||
vec4 gl_Position; | ||
float gl_PointSize; | ||
float gl_ClipDistance[1]; | ||
float gl_CullDistance[2]; | ||
} gl_MeshVerticesEXT[]; | ||
|
||
struct TaskPayload | ||
{ | ||
float a; | ||
float b; | ||
int c; | ||
}; | ||
|
||
layout(location = 0) out vec4 vOut[24]; | ||
layout(location = 2) out BlockOut | ||
{ | ||
vec4 a; | ||
vec4 b; | ||
} outputs[24]; | ||
|
||
layout(location = 1) perprimitiveEXT out vec4 vPrim[22]; | ||
layout(location = 4) perprimitiveEXT out BlockOutPrim | ||
{ | ||
vec4 a; | ||
vec4 b; | ||
} prim_outputs[22]; | ||
|
||
taskPayloadSharedEXT TaskPayload payload; | ||
shared float shared_float[16]; | ||
|
||
void main() | ||
{ | ||
SetMeshOutputsEXT(24u, 22u); | ||
vec3 _29 = vec3(gl_GlobalInvocationID); | ||
float _31 = _29.x; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = vec4(_31, _29.yz, 1.0); | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_PointSize = 2.0; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_ClipDistance[0] = 4.0; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[1] = 5.0; | ||
vOut[gl_LocalInvocationIndex] = vec4(_31, _29.yz, 2.0); | ||
outputs[gl_LocalInvocationIndex].a = vec4(5.0); | ||
outputs[gl_LocalInvocationIndex].b = vec4(6.0); | ||
barrier(); | ||
if (gl_LocalInvocationIndex < 22u) | ||
{ | ||
vPrim[gl_LocalInvocationIndex] = vec4(vec3(gl_WorkGroupID), 3.0); | ||
prim_outputs[gl_LocalInvocationIndex].a = vec4(payload.a); | ||
prim_outputs[gl_LocalInvocationIndex].b = vec4(payload.b); | ||
gl_PrimitivePointIndicesEXT[gl_LocalInvocationIndex] = gl_LocalInvocationIndex; | ||
int _124 = int(gl_GlobalInvocationID.x); | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveID = _124; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_Layer = _124 + 1; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_ViewportIndex = _124 + 2; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_CullPrimitiveEXT = (gl_GlobalInvocationID.x & 1u) != 0u; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveShadingRateEXT = _124 + 3; | ||
} | ||
} | ||
|
66 changes: 66 additions & 0 deletions
66
reference/opt/shaders/mesh/mesh-shader-basic-triangle.spv14.vk.nocompat.mesh.vk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#version 450 | ||
#extension GL_EXT_mesh_shader : require | ||
#extension GL_EXT_fragment_shading_rate : require | ||
layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) in; | ||
layout(max_vertices = 24, max_primitives = 22, triangles) out; | ||
|
||
out gl_MeshPerVertexEXT | ||
{ | ||
vec4 gl_Position; | ||
float gl_PointSize; | ||
float gl_ClipDistance[1]; | ||
float gl_CullDistance[2]; | ||
} gl_MeshVerticesEXT[]; | ||
|
||
struct TaskPayload | ||
{ | ||
float a; | ||
float b; | ||
int c; | ||
}; | ||
|
||
layout(location = 0) out vec4 vOut[24]; | ||
layout(location = 2) out BlockOut | ||
{ | ||
vec4 a; | ||
vec4 b; | ||
} outputs[24]; | ||
|
||
layout(location = 1) perprimitiveEXT out vec4 vPrim[22]; | ||
layout(location = 4) perprimitiveEXT out BlockOutPrim | ||
{ | ||
vec4 a; | ||
vec4 b; | ||
} prim_outputs[22]; | ||
|
||
taskPayloadSharedEXT TaskPayload payload; | ||
shared float shared_float[16]; | ||
|
||
void main() | ||
{ | ||
SetMeshOutputsEXT(24u, 22u); | ||
vec3 _29 = vec3(gl_GlobalInvocationID); | ||
float _31 = _29.x; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = vec4(_31, _29.yz, 1.0); | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_PointSize = 2.0; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_ClipDistance[0] = 4.0; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[1] = 5.0; | ||
vOut[gl_LocalInvocationIndex] = vec4(_31, _29.yz, 2.0); | ||
outputs[gl_LocalInvocationIndex].a = vec4(5.0); | ||
outputs[gl_LocalInvocationIndex].b = vec4(6.0); | ||
barrier(); | ||
if (gl_LocalInvocationIndex < 22u) | ||
{ | ||
vPrim[gl_LocalInvocationIndex] = vec4(vec3(gl_WorkGroupID), 3.0); | ||
prim_outputs[gl_LocalInvocationIndex].a = vec4(payload.a); | ||
prim_outputs[gl_LocalInvocationIndex].b = vec4(payload.b); | ||
gl_PrimitiveTriangleIndicesEXT[gl_LocalInvocationIndex] = uvec3(0u, 1u, 2u) + uvec3(gl_LocalInvocationIndex); | ||
int _128 = int(gl_GlobalInvocationID.x); | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveID = _128; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_Layer = _128 + 1; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_ViewportIndex = _128 + 2; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_CullPrimitiveEXT = (gl_GlobalInvocationID.x & 1u) != 0u; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveShadingRateEXT = _128 + 3; | ||
} | ||
} | ||
|
63 changes: 63 additions & 0 deletions
63
reference/shaders/mesh/mesh-shader-basic-lines.spv14.vk.nocompat.mesh.vk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#version 450 | ||
#extension GL_EXT_mesh_shader : require | ||
#extension GL_EXT_fragment_shading_rate : require | ||
layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) in; | ||
layout(max_vertices = 24, max_primitives = 22, lines) out; | ||
|
||
out gl_MeshPerVertexEXT | ||
{ | ||
vec4 gl_Position; | ||
float gl_PointSize; | ||
float gl_ClipDistance[1]; | ||
float gl_CullDistance[2]; | ||
} gl_MeshVerticesEXT[]; | ||
|
||
struct TaskPayload | ||
{ | ||
float a; | ||
float b; | ||
int c; | ||
}; | ||
|
||
layout(location = 0) out vec4 vOut[24]; | ||
layout(location = 2) out BlockOut | ||
{ | ||
vec4 a; | ||
vec4 b; | ||
} outputs[24]; | ||
|
||
layout(location = 1) perprimitiveEXT out vec4 vPrim[22]; | ||
layout(location = 4) perprimitiveEXT out BlockOutPrim | ||
{ | ||
vec4 a; | ||
vec4 b; | ||
} prim_outputs[22]; | ||
|
||
taskPayloadSharedEXT TaskPayload payload; | ||
shared float shared_float[16]; | ||
|
||
void main() | ||
{ | ||
SetMeshOutputsEXT(24u, 22u); | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = vec4(vec3(gl_GlobalInvocationID), 1.0); | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_PointSize = 2.0; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_ClipDistance[0] = 4.0; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[1] = 5.0; | ||
vOut[gl_LocalInvocationIndex] = vec4(vec3(gl_GlobalInvocationID), 2.0); | ||
outputs[gl_LocalInvocationIndex].a = vec4(5.0); | ||
outputs[gl_LocalInvocationIndex].b = vec4(6.0); | ||
barrier(); | ||
if (gl_LocalInvocationIndex < 22u) | ||
{ | ||
vPrim[gl_LocalInvocationIndex] = vec4(vec3(gl_WorkGroupID), 3.0); | ||
prim_outputs[gl_LocalInvocationIndex].a = vec4(payload.a); | ||
prim_outputs[gl_LocalInvocationIndex].b = vec4(payload.b); | ||
gl_PrimitiveLineIndicesEXT[gl_LocalInvocationIndex] = uvec2(0u, 1u) + uvec2(gl_LocalInvocationIndex); | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveID = int(gl_GlobalInvocationID.x); | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_Layer = int(gl_GlobalInvocationID.x) + 1; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_ViewportIndex = int(gl_GlobalInvocationID.x) + 2; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_CullPrimitiveEXT = (gl_GlobalInvocationID.x & 1u) != 0u; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveShadingRateEXT = int(gl_GlobalInvocationID.x) + 3; | ||
} | ||
} | ||
|
63 changes: 63 additions & 0 deletions
63
reference/shaders/mesh/mesh-shader-basic-points.spv14.vk.nocompat.mesh.vk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#version 450 | ||
#extension GL_EXT_mesh_shader : require | ||
#extension GL_EXT_fragment_shading_rate : require | ||
layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) in; | ||
layout(max_vertices = 24, max_primitives = 22, points) out; | ||
|
||
out gl_MeshPerVertexEXT | ||
{ | ||
vec4 gl_Position; | ||
float gl_PointSize; | ||
float gl_ClipDistance[1]; | ||
float gl_CullDistance[2]; | ||
} gl_MeshVerticesEXT[]; | ||
|
||
struct TaskPayload | ||
{ | ||
float a; | ||
float b; | ||
int c; | ||
}; | ||
|
||
layout(location = 0) out vec4 vOut[24]; | ||
layout(location = 2) out BlockOut | ||
{ | ||
vec4 a; | ||
vec4 b; | ||
} outputs[24]; | ||
|
||
layout(location = 1) perprimitiveEXT out vec4 vPrim[22]; | ||
layout(location = 4) perprimitiveEXT out BlockOutPrim | ||
{ | ||
vec4 a; | ||
vec4 b; | ||
} prim_outputs[22]; | ||
|
||
taskPayloadSharedEXT TaskPayload payload; | ||
shared float shared_float[16]; | ||
|
||
void main() | ||
{ | ||
SetMeshOutputsEXT(24u, 22u); | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = vec4(vec3(gl_GlobalInvocationID), 1.0); | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_PointSize = 2.0; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_ClipDistance[0] = 4.0; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[1] = 5.0; | ||
vOut[gl_LocalInvocationIndex] = vec4(vec3(gl_GlobalInvocationID), 2.0); | ||
outputs[gl_LocalInvocationIndex].a = vec4(5.0); | ||
outputs[gl_LocalInvocationIndex].b = vec4(6.0); | ||
barrier(); | ||
if (gl_LocalInvocationIndex < 22u) | ||
{ | ||
vPrim[gl_LocalInvocationIndex] = vec4(vec3(gl_WorkGroupID), 3.0); | ||
prim_outputs[gl_LocalInvocationIndex].a = vec4(payload.a); | ||
prim_outputs[gl_LocalInvocationIndex].b = vec4(payload.b); | ||
gl_PrimitivePointIndicesEXT[gl_LocalInvocationIndex] = gl_LocalInvocationIndex; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveID = int(gl_GlobalInvocationID.x); | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_Layer = int(gl_GlobalInvocationID.x) + 1; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_ViewportIndex = int(gl_GlobalInvocationID.x) + 2; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_CullPrimitiveEXT = (gl_GlobalInvocationID.x & 1u) != 0u; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveShadingRateEXT = int(gl_GlobalInvocationID.x) + 3; | ||
} | ||
} | ||
|
63 changes: 63 additions & 0 deletions
63
reference/shaders/mesh/mesh-shader-basic-triangle.spv14.vk.nocompat.mesh.vk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#version 450 | ||
#extension GL_EXT_mesh_shader : require | ||
#extension GL_EXT_fragment_shading_rate : require | ||
layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) in; | ||
layout(max_vertices = 24, max_primitives = 22, triangles) out; | ||
|
||
out gl_MeshPerVertexEXT | ||
{ | ||
vec4 gl_Position; | ||
float gl_PointSize; | ||
float gl_ClipDistance[1]; | ||
float gl_CullDistance[2]; | ||
} gl_MeshVerticesEXT[]; | ||
|
||
struct TaskPayload | ||
{ | ||
float a; | ||
float b; | ||
int c; | ||
}; | ||
|
||
layout(location = 0) out vec4 vOut[24]; | ||
layout(location = 2) out BlockOut | ||
{ | ||
vec4 a; | ||
vec4 b; | ||
} outputs[24]; | ||
|
||
layout(location = 1) perprimitiveEXT out vec4 vPrim[22]; | ||
layout(location = 4) perprimitiveEXT out BlockOutPrim | ||
{ | ||
vec4 a; | ||
vec4 b; | ||
} prim_outputs[22]; | ||
|
||
taskPayloadSharedEXT TaskPayload payload; | ||
shared float shared_float[16]; | ||
|
||
void main() | ||
{ | ||
SetMeshOutputsEXT(24u, 22u); | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = vec4(vec3(gl_GlobalInvocationID), 1.0); | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_PointSize = 2.0; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_ClipDistance[0] = 4.0; | ||
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[1] = 5.0; | ||
vOut[gl_LocalInvocationIndex] = vec4(vec3(gl_GlobalInvocationID), 2.0); | ||
outputs[gl_LocalInvocationIndex].a = vec4(5.0); | ||
outputs[gl_LocalInvocationIndex].b = vec4(6.0); | ||
barrier(); | ||
if (gl_LocalInvocationIndex < 22u) | ||
{ | ||
vPrim[gl_LocalInvocationIndex] = vec4(vec3(gl_WorkGroupID), 3.0); | ||
prim_outputs[gl_LocalInvocationIndex].a = vec4(payload.a); | ||
prim_outputs[gl_LocalInvocationIndex].b = vec4(payload.b); | ||
gl_PrimitiveTriangleIndicesEXT[gl_LocalInvocationIndex] = uvec3(0u, 1u, 2u) + uvec3(gl_LocalInvocationIndex); | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveID = int(gl_GlobalInvocationID.x); | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_Layer = int(gl_GlobalInvocationID.x) + 1; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_ViewportIndex = int(gl_GlobalInvocationID.x) + 2; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_CullPrimitiveEXT = (gl_GlobalInvocationID.x & 1u) != 0u; | ||
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveShadingRateEXT = int(gl_GlobalInvocationID.x) + 3; | ||
} | ||
} | ||
|
Oops, something went wrong.