-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Metal] Ported BarrierReadAfterWrite test to Metal backend.
- Provide Metal shader for unit test. - Fixed memory issue in MTBuiltinPSOFactory. - Fixed MTLTexture usage flags for textures with Storage binding flags but without Sampled binding flags.
- Loading branch information
1 parent
e8d86d7
commit c68053f
Showing
13 changed files
with
95 additions
and
32 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
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,42 @@ | ||
// Cross compiled with SPIRV-Cross from ReadAfterWrite.hlsl | ||
// DO NOT EDIT | ||
|
||
#pragma clang diagnostic ignored "-Wmissing-prototypes" | ||
|
||
#include <metal_stdlib> | ||
|
||
using namespace metal; | ||
|
||
struct Entry | ||
{ | ||
uint a; | ||
uint b; | ||
}; | ||
|
||
struct type_RWStructuredBuffer_Entry | ||
{ | ||
Entry _m0[1]; | ||
}; | ||
|
||
struct type_Globals | ||
{ | ||
uint readPos; | ||
uint writePos; | ||
}; | ||
|
||
kernel void CSMain( | ||
constant type_Globals& _Globals [[buffer(0)]], | ||
device uint* buf1 [[buffer(1)]], | ||
device type_RWStructuredBuffer_Entry& buf2 [[buffer(2)]], | ||
texture1d<uint, access::read_write> tex1 [[texture(3)]], | ||
texture2d<uint, access::read_write> tex2 [[texture(4)]], | ||
uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) | ||
{ | ||
uint _38 = _Globals.readPos + gl_GlobalInvocationID.x; | ||
uint _44 = _Globals.writePos + gl_GlobalInvocationID.x; | ||
buf1[_44] = buf1[_38]; | ||
buf2._m0[_44] = buf2._m0[_38]; | ||
tex1.write(uint4(tex1.read(uint(_38)).x), uint(_44)); | ||
tex2.write(tex2.read(uint2(uint2(_38, 0u))).xy.xyyy, uint2(uint2(_44, 0u))); | ||
} | ||
|
Binary file not shown.
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