Skip to content

Commit

Permalink
fix gl_CullDistance, gl_PrimitiveShadingRateEXT
Browse files Browse the repository at this point in the history
Not supported in MSL:
gl_CullDistance, gl_PrimitiveShadingRateEXT

Fixup type of gl_CullPrimitiveEXT:
short -> bool
  • Loading branch information
Try committed Oct 29, 2024
1 parent 3a0366b commit 7ab0030
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ struct gl_MeshPerVertexEXT
float4 gl_Position [[position]];
float gl_PointSize;
float gl_ClipDistance [[clip_distance]] [1];
float gl_CullDistance [[cull_distance]] [2];
};

struct BlockOut
Expand Down Expand Up @@ -105,19 +104,17 @@ struct spvPerVertex
float gl_PointSize;
float gl_ClipDistance [[clip_distance]] [1];
float gl_ClipDistance_0 [[user(clip0)]];
float gl_CullDistance_0 [[user(cull0)]];
float gl_CullDistance_1 [[user(cull1)]];
float4 vOut [[user(locn0)]];
float4 outputs_a [[user(locn2)]];
float4 outputs_b [[user(locn3)]];
};

struct spvPerPrimitive
{
int gl_PrimitiveID [[primitive_id]];
uint gl_PrimitiveID [[primitive_id]];
uint gl_Layer [[render_target_array_index]];
uint gl_ViewportIndex [[viewport_array_index]];
short gl_CullPrimitiveEXT [[primitive_culled]];
bool gl_CullPrimitiveEXT [[primitive_culled]];
float4 vPrim [[user(locn1)]];
float4 prim_outputs_a [[user(locn4)]];
float4 prim_outputs_b [[user(locn5)]];
Expand All @@ -129,14 +126,12 @@ static inline __attribute__((always_inline))
void _4(threadgroup spvUnsafeArray<uint2, 22>& gl_PrimitiveLineIndicesEXT, thread uint& gl_LocalInvocationIndex, threadgroup spvUnsafeArray<gl_MeshPerPrimitiveEXT, 22>& gl_MeshPrimitivesEXT, thread uint3& gl_GlobalInvocationID, threadgroup spvUnsafeArray<gl_MeshPerVertexEXT, 24>& gl_MeshVerticesEXT, threadgroup spvUnsafeArray<float4, 24>& vOut, threadgroup spvUnsafeArray<BlockOut, 24>& outputs, threadgroup spvUnsafeArray<float4, 22>& vPrim, thread uint3& gl_WorkGroupID, threadgroup spvUnsafeArray<BlockOutPrim, 22>& prim_outputs, threadgroup uint2& spvMeshSizes)
{
SetMeshOutputsEXT(gl_LocalInvocationIndex, spvMeshSizes, 24u, 22u);
float3 _163 = float3(gl_GlobalInvocationID);
float _164 = _163.x;
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = float4(_164, _163.yz, 1.0);
float3 _158 = float3(gl_GlobalInvocationID);
float _159 = _158.x;
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = float4(_159, _158.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[0] = 6.0;
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[1] = 5.0;
vOut[gl_LocalInvocationIndex] = float4(_164, _163.yz, 2.0);
vOut[gl_LocalInvocationIndex] = float4(_159, _158.yz, 2.0);
outputs[gl_LocalInvocationIndex].a = float4(5.0);
outputs[gl_LocalInvocationIndex].b = float4(6.0);
threadgroup_barrier(mem_flags::mem_threadgroup);
Expand All @@ -146,10 +141,10 @@ void _4(threadgroup spvUnsafeArray<uint2, 22>& gl_PrimitiveLineIndicesEXT, threa
prim_outputs[gl_LocalInvocationIndex].a = float4(0.0);
prim_outputs[gl_LocalInvocationIndex].b = float4(1.0);
gl_PrimitiveLineIndicesEXT[gl_LocalInvocationIndex] = uint2(0u, 1u) + uint2(gl_LocalInvocationIndex);
int _215 = int(gl_GlobalInvocationID.x);
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveID = _215;
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_Layer = _215 + 1;
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_ViewportIndex = _215 + 2;
int _206 = int(gl_GlobalInvocationID.x);
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveID = _206;
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_Layer = _206 + 1;
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_ViewportIndex = _206 + 2;
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_CullPrimitiveEXT = short((gl_GlobalInvocationID.x & 1u) != 0u);
}
}
Expand Down Expand Up @@ -186,10 +181,6 @@ void _4(threadgroup spvUnsafeArray<uint2, 22>& gl_PrimitiveLineIndicesEXT, threa
spvV.gl_PointSize = gl_MeshVerticesEXT[spvI].gl_PointSize;
spvV.gl_ClipDistance[0] = gl_MeshVerticesEXT[spvI].gl_ClipDistance[0];
spvV.gl_ClipDistance_0 = gl_MeshVerticesEXT[spvI].gl_ClipDistance[0];
spvV.gl_CullDistance[0] = gl_MeshVerticesEXT[spvI].gl_CullDistance[0];
spvV.gl_CullDistance_0 = gl_MeshVerticesEXT[spvI].gl_CullDistance[0];
spvV.gl_CullDistance[1] = gl_MeshVerticesEXT[spvI].gl_CullDistance[1];
spvV.gl_CullDistance_1 = gl_MeshVerticesEXT[spvI].gl_CullDistance[1];
spvV.outputs_a = outputs[spvI].a;
spvV.outputs_b = outputs[spvI].b;
spvMesh.set_vertex(spvI, spvV);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ struct gl_MeshPerVertexEXT
float4 gl_Position [[position]];
float gl_PointSize;
float gl_ClipDistance [[clip_distance]] [1];
float gl_CullDistance [[cull_distance]] [2];
};

struct BlockOut
Expand All @@ -88,7 +87,6 @@ struct gl_MeshPerPrimitiveEXT
uint gl_Layer [[render_target_array_index]];
uint gl_ViewportIndex [[viewport_array_index]];
bool gl_CullPrimitiveEXT [[primitive_culled]];

};

constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(2u, 3u, 4u);
Expand All @@ -106,8 +104,6 @@ struct spvPerVertex
float gl_PointSize;
float gl_ClipDistance [[clip_distance]] [1];
float gl_ClipDistance_0 [[user(clip0)]];
float gl_CullDistance_0 [[user(cull0)]];
float gl_CullDistance_1 [[user(cull1)]];
float4 vOut [[user(locn0)]];
float4 outputs_a [[user(locn2)]];
float4 outputs_b [[user(locn3)]];
Expand All @@ -118,11 +114,10 @@ struct spvPerPrimitive
float4 vPrim [[user(locn1)]];
float4 prim_outputs_a [[user(locn4)]];
float4 prim_outputs_b [[user(locn5)]];
int gl_PrimitiveID [[primitive_id]];
uint gl_PrimitiveID [[primitive_id]];
uint gl_Layer [[render_target_array_index]];
uint gl_ViewportIndex [[viewport_array_index]];
short gl_CullPrimitiveEXT [[primitive_culled]];
int gl_PrimitiveShadingRateEXT [[unsupported-built-in]];
bool gl_CullPrimitiveEXT [[primitive_culled]];
};

using spvMesh_t = mesh<spvPerVertex, spvPerPrimitive, 24, 22, topology::triangle>;
Expand All @@ -131,14 +126,12 @@ static inline __attribute__((always_inline))
void _4(threadgroup spvUnsafeArray<gl_MeshPerVertexEXT, 24>& gl_MeshVerticesEXT, thread uint& gl_LocalInvocationIndex, thread uint3& gl_GlobalInvocationID, threadgroup spvUnsafeArray<float4, 24>& vOut, threadgroup spvUnsafeArray<BlockOut, 24>& outputs, threadgroup spvUnsafeArray<float4, 22>& vPrim, thread uint3& gl_WorkGroupID, threadgroup spvUnsafeArray<BlockOutPrim, 22>& prim_outputs, threadgroup spvUnsafeArray<uint3, 22>& gl_PrimitiveTriangleIndicesEXT, threadgroup spvUnsafeArray<gl_MeshPerPrimitiveEXT, 22>& gl_MeshPrimitivesEXT, threadgroup uint2& spvMeshSizes)
{
SetMeshOutputsEXT(gl_LocalInvocationIndex, spvMeshSizes, 24u, 22u);
float3 _29 = float3(gl_GlobalInvocationID);
float _31 = _29.x;
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = float4(_31, _29.yz, 1.0);
float3 _27 = float3(gl_GlobalInvocationID);
float _29 = _27.x;
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = float4(_29, _27.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[0] = 3.0;
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[1] = 5.0;
vOut[gl_LocalInvocationIndex] = float4(_31, _29.yz, 2.0);
vOut[gl_LocalInvocationIndex] = float4(_29, _27.yz, 2.0);
outputs[gl_LocalInvocationIndex].a = float4(5.0);
outputs[gl_LocalInvocationIndex].b = float4(6.0);
threadgroup_barrier(mem_flags::mem_threadgroup);
Expand All @@ -148,12 +141,11 @@ void _4(threadgroup spvUnsafeArray<gl_MeshPerVertexEXT, 24>& gl_MeshVerticesEXT,
prim_outputs[gl_LocalInvocationIndex].a = float4(0.0);
prim_outputs[gl_LocalInvocationIndex].b = float4(1.0);
gl_PrimitiveTriangleIndicesEXT[gl_LocalInvocationIndex] = uint3(0u, 1u, 2u) + uint3(gl_LocalInvocationIndex);
int _122 = int(gl_GlobalInvocationID.x);
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveID = _122;
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_Layer = _122 + 1;
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_ViewportIndex = _122 + 2;
int _116 = int(gl_GlobalInvocationID.x);
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveID = _116;
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_Layer = _116 + 1;
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_ViewportIndex = _116 + 2;
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_CullPrimitiveEXT = short((gl_GlobalInvocationID.x & 1u) != 0u);
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveShadingRateEXT = _122 + 3;
}
}

Expand Down Expand Up @@ -190,10 +182,6 @@ void _4(threadgroup spvUnsafeArray<gl_MeshPerVertexEXT, 24>& gl_MeshVerticesEXT,
spvV.gl_PointSize = gl_MeshVerticesEXT[spvI].gl_PointSize;
spvV.gl_ClipDistance[0] = gl_MeshVerticesEXT[spvI].gl_ClipDistance[0];
spvV.gl_ClipDistance_0 = gl_MeshVerticesEXT[spvI].gl_ClipDistance[0];
spvV.gl_CullDistance[0] = gl_MeshVerticesEXT[spvI].gl_CullDistance[0];
spvV.gl_CullDistance_0 = gl_MeshVerticesEXT[spvI].gl_CullDistance[0];
spvV.gl_CullDistance[1] = gl_MeshVerticesEXT[spvI].gl_CullDistance[1];
spvV.gl_CullDistance_1 = gl_MeshVerticesEXT[spvI].gl_CullDistance[1];
spvV.outputs_a = outputs[spvI].a;
spvV.outputs_b = outputs[spvI].b;
spvMesh.set_vertex(spvI, spvV);
Expand All @@ -209,7 +197,6 @@ void _4(threadgroup spvUnsafeArray<gl_MeshPerVertexEXT, 24>& gl_MeshVerticesEXT,
spvP.gl_Layer = gl_MeshPrimitivesEXT[spvI].gl_Layer;
spvP.gl_ViewportIndex = gl_MeshPrimitivesEXT[spvI].gl_ViewportIndex;
spvP.gl_CullPrimitiveEXT = gl_MeshPrimitivesEXT[spvI].gl_CullPrimitiveEXT;
spvP.gl_PrimitiveShadingRateEXT = gl_MeshPrimitivesEXT[spvI].gl_PrimitiveShadingRateEXT;
spvMesh.set_primitive(spvI, spvP);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ struct gl_MeshPerVertexEXT
float4 gl_Position [[position]];
float gl_PointSize;
float gl_ClipDistance [[clip_distance]] [1];
float gl_CullDistance [[cull_distance]] [2];
};

struct BlockOut
Expand Down Expand Up @@ -105,19 +104,17 @@ struct spvPerVertex
float gl_PointSize;
float gl_ClipDistance [[clip_distance]] [1];
float gl_ClipDistance_0 [[user(clip0)]];
float gl_CullDistance_0 [[user(cull0)]];
float gl_CullDistance_1 [[user(cull1)]];
float4 vOut [[user(locn0)]];
float4 outputs_a [[user(locn2)]];
float4 outputs_b [[user(locn3)]];
};

struct spvPerPrimitive
{
int gl_PrimitiveID [[primitive_id]];
uint gl_PrimitiveID [[primitive_id]];
uint gl_Layer [[render_target_array_index]];
uint gl_ViewportIndex [[viewport_array_index]];
short gl_CullPrimitiveEXT [[primitive_culled]];
bool gl_CullPrimitiveEXT [[primitive_culled]];
float4 vPrim [[user(locn1)]];
float4 prim_outputs_a [[user(locn4)]];
float4 prim_outputs_b [[user(locn5)]];
Expand All @@ -142,8 +139,6 @@ void main2(threadgroup spvUnsafeArray<uint2, 22>& gl_PrimitiveLineIndicesEXT, th
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = float4(float3(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[0] = 6.0;
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[1] = 5.0;
vOut[gl_LocalInvocationIndex] = float4(float3(gl_GlobalInvocationID), 2.0);
outputs[gl_LocalInvocationIndex].a = float4(5.0);
outputs[gl_LocalInvocationIndex].b = float4(6.0);
Expand Down Expand Up @@ -195,10 +190,6 @@ void _4(threadgroup spvUnsafeArray<uint2, 22>& gl_PrimitiveLineIndicesEXT, threa
spvV.gl_PointSize = gl_MeshVerticesEXT[spvI].gl_PointSize;
spvV.gl_ClipDistance[0] = gl_MeshVerticesEXT[spvI].gl_ClipDistance[0];
spvV.gl_ClipDistance_0 = gl_MeshVerticesEXT[spvI].gl_ClipDistance[0];
spvV.gl_CullDistance[0] = gl_MeshVerticesEXT[spvI].gl_CullDistance[0];
spvV.gl_CullDistance_0 = gl_MeshVerticesEXT[spvI].gl_CullDistance[0];
spvV.gl_CullDistance[1] = gl_MeshVerticesEXT[spvI].gl_CullDistance[1];
spvV.gl_CullDistance_1 = gl_MeshVerticesEXT[spvI].gl_CullDistance[1];
spvV.outputs_a = outputs[spvI].a;
spvV.outputs_b = outputs[spvI].b;
spvMesh.set_vertex(spvI, spvV);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ struct gl_MeshPerVertexEXT
float4 gl_Position [[position]];
float gl_PointSize;
float gl_ClipDistance [[clip_distance]] [1];
float gl_CullDistance [[cull_distance]] [2];
};

struct BlockOut
Expand All @@ -88,7 +87,6 @@ struct gl_MeshPerPrimitiveEXT
uint gl_Layer [[render_target_array_index]];
uint gl_ViewportIndex [[viewport_array_index]];
bool gl_CullPrimitiveEXT [[primitive_culled]];

};

constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(2u, 3u, 4u);
Expand All @@ -106,8 +104,6 @@ struct spvPerVertex
float gl_PointSize;
float gl_ClipDistance [[clip_distance]] [1];
float gl_ClipDistance_0 [[user(clip0)]];
float gl_CullDistance_0 [[user(cull0)]];
float gl_CullDistance_1 [[user(cull1)]];
float4 vOut [[user(locn0)]];
float4 outputs_a [[user(locn2)]];
float4 outputs_b [[user(locn3)]];
Expand All @@ -118,11 +114,10 @@ struct spvPerPrimitive
float4 vPrim [[user(locn1)]];
float4 prim_outputs_a [[user(locn4)]];
float4 prim_outputs_b [[user(locn5)]];
int gl_PrimitiveID [[primitive_id]];
uint gl_PrimitiveID [[primitive_id]];
uint gl_Layer [[render_target_array_index]];
uint gl_ViewportIndex [[viewport_array_index]];
short gl_CullPrimitiveEXT [[primitive_culled]];
int gl_PrimitiveShadingRateEXT [[unsupported-built-in]];
bool gl_CullPrimitiveEXT [[primitive_culled]];
};

using spvMesh_t = mesh<spvPerVertex, spvPerPrimitive, 24, 22, topology::triangle>;
Expand All @@ -134,8 +129,6 @@ void _4(threadgroup spvUnsafeArray<gl_MeshPerVertexEXT, 24>& gl_MeshVerticesEXT,
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = float4(float3(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[0] = 3.0;
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[1] = 5.0;
vOut[gl_LocalInvocationIndex] = float4(float3(gl_GlobalInvocationID), 2.0);
outputs[gl_LocalInvocationIndex].a = float4(5.0);
outputs[gl_LocalInvocationIndex].b = float4(6.0);
Expand All @@ -150,7 +143,6 @@ void _4(threadgroup spvUnsafeArray<gl_MeshPerVertexEXT, 24>& gl_MeshVerticesEXT,
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 = short((gl_GlobalInvocationID.x & 1u) != 0u);
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveShadingRateEXT = int(gl_GlobalInvocationID.x) + 3;
}
}

Expand Down Expand Up @@ -187,10 +179,6 @@ void _4(threadgroup spvUnsafeArray<gl_MeshPerVertexEXT, 24>& gl_MeshVerticesEXT,
spvV.gl_PointSize = gl_MeshVerticesEXT[spvI].gl_PointSize;
spvV.gl_ClipDistance[0] = gl_MeshVerticesEXT[spvI].gl_ClipDistance[0];
spvV.gl_ClipDistance_0 = gl_MeshVerticesEXT[spvI].gl_ClipDistance[0];
spvV.gl_CullDistance[0] = gl_MeshVerticesEXT[spvI].gl_CullDistance[0];
spvV.gl_CullDistance_0 = gl_MeshVerticesEXT[spvI].gl_CullDistance[0];
spvV.gl_CullDistance[1] = gl_MeshVerticesEXT[spvI].gl_CullDistance[1];
spvV.gl_CullDistance_1 = gl_MeshVerticesEXT[spvI].gl_CullDistance[1];
spvV.outputs_a = outputs[spvI].a;
spvV.outputs_b = outputs[spvI].b;
spvMesh.set_vertex(spvI, spvV);
Expand All @@ -206,7 +194,6 @@ void _4(threadgroup spvUnsafeArray<gl_MeshPerVertexEXT, 24>& gl_MeshVerticesEXT,
spvP.gl_Layer = gl_MeshPrimitivesEXT[spvI].gl_Layer;
spvP.gl_ViewportIndex = gl_MeshPrimitivesEXT[spvI].gl_ViewportIndex;
spvP.gl_CullPrimitiveEXT = gl_MeshPrimitivesEXT[spvI].gl_CullPrimitiveEXT;
spvP.gl_PrimitiveShadingRateEXT = gl_MeshPrimitivesEXT[spvI].gl_PrimitiveShadingRateEXT;
spvMesh.set_primitive(spvI, spvP);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ out gl_MeshPerVertexEXT
vec4 gl_Position;
float gl_PointSize;
float gl_ClipDistance[1];
float gl_CullDistance[2];
// float gl_CullDistance[2];
} gl_MeshVerticesEXT[];

layout(location = 0) out vec4 vOut[];
Expand Down Expand Up @@ -54,8 +54,8 @@ void main2()
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = vec4(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[0] = 6.0;
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[1] = 5.0;
// gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[0] = 6.0;
// gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[1] = 5.0;
vOut[gl_LocalInvocationIndex] = vec4(gl_GlobalInvocationID, 2.0);
outputs[gl_LocalInvocationIndex].a = vec4(5.0);
outputs[gl_LocalInvocationIndex].b = vec4(6.0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ out gl_MeshPerVertexEXT
vec4 gl_Position;
float gl_PointSize;
float gl_ClipDistance[1];
float gl_CullDistance[2];
// float gl_CullDistance[2];
} gl_MeshVerticesEXT[];

layout(location = 0) out vec4 vOut[];
Expand Down Expand Up @@ -43,10 +43,10 @@ void main()
{
SetMeshOutputsEXT(24, 22);
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position = vec4(gl_GlobalInvocationID, 1.0);
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_PointSize = 2.0;
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_PointSize = 2.0;
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_ClipDistance[0] = 4.0;
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[0] = 3.0;
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[1] = 5.0;
// gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[0] = 3.0;
// gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_CullDistance[1] = 5.0;
vOut[gl_LocalInvocationIndex] = vec4(gl_GlobalInvocationID, 2.0);
outputs[gl_LocalInvocationIndex].a = vec4(5.0);
outputs[gl_LocalInvocationIndex].b = vec4(6.0);
Expand All @@ -61,6 +61,6 @@ void main()
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 = bool(gl_GlobalInvocationID.x & 1);
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveShadingRateEXT = int(gl_GlobalInvocationID.x) + 3;
// gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveShadingRateEXT = int(gl_GlobalInvocationID.x) + 3;
}
}
Loading

0 comments on commit 7ab0030

Please sign in to comment.