Skip to content

Commit

Permalink
[SPIR-V] add SPV_EXT_mesh_shader to opt allowlist (microsoft#6224)
Browse files Browse the repository at this point in the history
Bring SPIRV-Tools changes required to optimize code using this
extension.

Fixes microsoft#6087

Signed-off-by: Nathan Gauër <[email protected]>
  • Loading branch information
Keenuts authored Jan 30, 2024
1 parent fadd627 commit 2fae54a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions tools/clang/test/CodeGenSPIRV/meshshading.ext.optimized.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// RUN: %dxc -T ms_6_6 -E main -spirv -fspv-target-env=vulkan1.3 %s | FileCheck %s

// CHECK: OpExtension "SPV_EXT_mesh_shader"

struct Object
{
float4 v: SV_POSITION;
};

RWStructuredBuffer<int> buffer;

// If optimizations are disabled, this function is not inlined.
// This means a RWStructuredBuffer will be created as a local variable,
// which is impossible in logical SPIR-V.
// Hence why should make sure the optimizations are enabled for mesh shaders.
void foo(RWStructuredBuffer<int> param) { }

[outputtopology("triangle")]
[numthreads(1, 1, 1)]
void main(out indices uint3 idx[3], out vertices Object vtx[3])
{
foo(buffer);
}

0 comments on commit 2fae54a

Please sign in to comment.