forked from shader-slang/slang
-
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.
Add SV_DrawIndex. (shader-slang#5787)
Co-authored-by: Ellie Hermaszewska <[email protected]>
- Loading branch information
1 parent
ef81bde
commit ebfbe58
Showing
7 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
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
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
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
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,18 @@ | ||
//TEST:SIMPLE(filecheck=SPIRV): -target spirv | ||
//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry vsMain -stage vertex -emit-spirv-via-glsl | ||
//TEST:SIMPLE(filecheck=GLSL): -target glsl -entry vsMain -stage vertex | ||
|
||
// SPIRV: OpDecorate %{{.*}} BuiltIn DrawIndex | ||
// GLSL: gl_DrawID | ||
|
||
struct VertexIn | ||
{ | ||
float3 position; | ||
int drawIndex : SV_DrawIndex; | ||
} | ||
|
||
[shader("vertex")] | ||
float4 vsMain(VertexIn vin) : SV_Position | ||
{ | ||
return float4(vin.position, vin.drawIndex); | ||
} |