forked from microsoft/DirectXShaderCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPIR-V] add SPV_EXT_mesh_shader to opt allowlist (microsoft#6224)
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
Showing
3 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
Submodule SPIRV-Headers
updated
12 files
Submodule SPIRV-Tools
updated
16 files
23 changes: 23 additions & 0 deletions
23
tools/clang/test/CodeGenSPIRV/meshshading.ext.optimized.hlsl
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,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); | ||
} |