forked from KhronosGroup/SPIRV-Cross
-
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.
Merge pull request KhronosGroup#2218 from KhronosGroup/pr-2217
Merge PR 2217
- Loading branch information
Showing
9 changed files
with
152 additions
and
2 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
33 changes: 33 additions & 0 deletions
33
reference/opt/shaders-msl/comp/metal3_1_regression_patch.replace-recursive-inputs.msl3.comp
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,33 @@ | ||
#include <metal_stdlib> | ||
#include <simd/simd.h> | ||
|
||
using namespace metal; | ||
|
||
struct recurs_1; | ||
|
||
struct recurs | ||
{ | ||
int m1; | ||
device recurs_1* m2; | ||
}; | ||
|
||
struct recurs_1 | ||
{ | ||
int m1; | ||
device recurs_1* m2; | ||
}; | ||
|
||
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u); | ||
|
||
kernel void main0(device void* nums_vp [[buffer(0)]], texture2d<uint, access::write> tex [[texture(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) | ||
{ | ||
device auto& nums = *(device recurs*)nums_vp; | ||
int rslt = 0; | ||
rslt = nums.m1; | ||
int _28 = nums.m1 + nums.m2->m1; | ||
rslt = _28; | ||
int _37 = _28 + nums.m2->m2->m1; | ||
rslt = _37; | ||
tex.write(uint4(uint(_37), 0u, 0u, 1u), uint2(int2(gl_GlobalInvocationID.xy))); | ||
} | ||
|
31 changes: 31 additions & 0 deletions
31
reference/shaders-msl/comp/metal3_1_regression_patch.replace-recursive-inputs.msl3.comp
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,31 @@ | ||
#include <metal_stdlib> | ||
#include <simd/simd.h> | ||
|
||
using namespace metal; | ||
|
||
struct recurs; | ||
|
||
struct recurs | ||
{ | ||
int m1; | ||
device recurs* m2; | ||
}; | ||
|
||
struct recurs_1 | ||
{ | ||
int m1; | ||
device recurs_1* m2; | ||
}; | ||
|
||
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u); | ||
|
||
kernel void main0(device void* nums_vp [[buffer(0)]], texture2d<uint, access::write> tex [[texture(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) | ||
{ | ||
device auto& nums = *(device recurs*)nums_vp; | ||
int rslt = 0; | ||
rslt += nums.m1; | ||
rslt += nums.m2->m1; | ||
rslt += nums.m2->m2->m1; | ||
tex.write(uint4(uint(rslt), 0u, 0u, 1u), uint2(int2(gl_GlobalInvocationID.xy))); | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
shaders-msl/comp/metal3_1_regression_patch.replace-recursive-inputs.msl3.comp
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,21 @@ | ||
#version 450 | ||
#extension GL_EXT_buffer_reference2 : require | ||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; | ||
|
||
layout(buffer_reference) buffer recurs; | ||
layout(buffer_reference, buffer_reference_align = 16, set = 0, binding = 1, std140) buffer recurs | ||
{ | ||
int m1; | ||
recurs m2; | ||
} nums; | ||
|
||
layout(set = 0, binding = 0, r32ui) uniform writeonly uimage2D tex; | ||
|
||
void main() | ||
{ | ||
int rslt = 0; | ||
rslt += nums.m1; | ||
rslt += nums.m2.m1; | ||
rslt += nums.m2.m2.m1; | ||
imageStore(tex, ivec2(gl_GlobalInvocationID.xy), uvec4(rslt, 0u, 0u, 1u)); | ||
} |
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