-
Notifications
You must be signed in to change notification settings - Fork 692
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPIRV] Register all decls for a variable. (#6969)
Some variable can have multiple decls. In one case, there could be a declaration of a const static member variable that is later defined. All of these decls need to be in astDecls and associated with the same variable. The current code will only add the decl for the defintion. This leads to problems when trying to find the variable for the declaration. Fixes #6787
- Loading branch information
Showing
3 changed files
with
53 additions
and
13 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// RUN: %dxc -T ps_6_6 -E PSMain %s -spirv | FileCheck %s | ||
|
||
struct PSInput | ||
{ | ||
static const uint Val; | ||
uint Func() { return Val; } | ||
}; | ||
|
||
static const uint PSInput::Val = 3; | ||
|
||
// CHECK: OpStore %out_var_SV_Target0 %uint_3 | ||
uint PSMain(PSInput input) : SV_Target0 | ||
{ | ||
return input.Func(); | ||
} |