-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add WaveGetLane* support for Metal and WGSL #6371
Merged
csyonghe
merged 26 commits into
shader-slang:master
from
fairywreath:wgsl-global-param-builtin
Feb 28, 2025
Merged
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
dd7e4f9
support WaveGetLane* for WGSL and Metal
fairywreath 07bd6b7
update test and glsl support
fairywreath 3f334df
address review comments and fix metal test
fairywreath fd4d4e3
add missing pragma guard
fairywreath 87410a9
Merge branch 'master' into wgsl-global-param-builtin
fairywreath f2b97e9
update test
fairywreath 8221661
Merge branch 'master' into wgsl-global-param-builtin
fairywreath 260cccd
Revert "update test"
fairywreath 70e3eb1
update failing glsl metal test and added new test
fairywreath b670683
Merge branch 'master' into wgsl-global-param-builtin
fairywreath 51a565a
make hlsl and glsl outputs similar
fairywreath 1db6f43
update test
fairywreath 2824396
Merge branch 'master' into wgsl-global-param-builtin
fairywreath 1c42aa1
disable tests for Metal and cleanup
fairywreath 1fcc307
Merge branch 'master' into wgsl-global-param-builtin
fairywreath 94eadbd
comment fix
fairywreath 96a2e7b
add expected failures
fairywreath 397865f
Merge branch 'master' into wgsl-global-param-builtin
fairywreath 4dc0742
Merge branch 'master' into wgsl-global-param-builtin
fairywreath a8088ea
correct expected failures list
fairywreath bf11684
Merge branch 'master' into wgsl-global-param-builtin
fairywreath bb606e3
remove expected failure
fairywreath 51256fa
Merge branch 'master' into wgsl-global-param-builtin
fairywreath 9d6dd3f
add tests to expected failure
fairywreath a881dbe
Merge branch 'master' into wgsl-global-param-builtin
csyonghe 0ae2841
Merge branch 'master' into wgsl-global-param-builtin
csyonghe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -100,7 +100,7 @@ | |
#include "slang-ir-strip-default-construct.h" | ||
#include "slang-ir-strip-legalization-insts.h" | ||
#include "slang-ir-synthesize-active-mask.h" | ||
#include "slang-ir-translate-glsl-global-var.h" | ||
#include "slang-ir-translate-in-out-global-var.h" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can name it translate-global-varying-var. |
||
#include "slang-ir-uniformity.h" | ||
#include "slang-ir-user-type-hint.h" | ||
#include "slang-ir-validate.h" | ||
|
@@ -318,7 +318,7 @@ struct RequiredLoweringPassSet | |
bool bindingQuery; | ||
bool meshOutput; | ||
bool higherOrderFunc; | ||
bool glslGlobalVar; | ||
bool inOutGlobalVar; | ||
bool glslSSBO; | ||
bool byteAddressBuffer; | ||
bool dynamicResource; | ||
|
@@ -422,7 +422,7 @@ void calcRequiredLoweringPassSet( | |
case kIROp_GlobalInputDecoration: | ||
case kIROp_GlobalOutputDecoration: | ||
case kIROp_GetWorkGroupSize: | ||
result.glslGlobalVar = true; | ||
result.inOutGlobalVar = true; | ||
break; | ||
case kIROp_BindExistentialSlotsDecoration: | ||
result.bindExistential = true; | ||
|
@@ -641,8 +641,8 @@ Result linkAndOptimizeIR( | |
if (!isKhronosTarget(targetRequest) && requiredLoweringPassSet.glslSSBO) | ||
lowerGLSLShaderStorageBufferObjectsToStructuredBuffers(irModule, sink); | ||
|
||
if (requiredLoweringPassSet.glslGlobalVar) | ||
translateGLSLGlobalVar(codeGenContext, irModule); | ||
if (requiredLoweringPassSet.inOutGlobalVar) | ||
translateInOutGlobalVar(codeGenContext, irModule); | ||
|
||
if (requiredLoweringPassSet.resolveVaryingInputRef) | ||
resolveVaryingInputRef(irModule); | ||
|
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
// slang-ir-call-graph.h | ||
#pragma once | ||
|
||
#include "slang-ir-clone.h" | ||
#include "slang-ir-insts.h" | ||
|
||
|
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 was deleted.
Oops, something went wrong.
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,14 @@ | ||
// slang-ir-translate-in-out-global-var.h | ||
// #pragma once | ||
|
||
namespace Slang | ||
{ | ||
|
||
struct IRModule; | ||
struct CodeGenContext; | ||
|
||
/// Translate GLSL-flavored global in/out variables into | ||
/// entry point parameters with system value semantics. | ||
void translateInOutGlobalVar(CodeGenContext* context, IRModule* module); | ||
|
||
} // namespace Slang |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just use a single RequireTargetExtension for all targets?