-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[msl] Fix read-write textureStore in entry points
When emitting calls to the `fence()` builtin member function, wrap the object in a `const_cast<>` to remove the `const` qualifier. We do this to work around an MSL bug that prevents us from being able to use texture fence intrinsics when texture handles are stored inside const-qualified structures. Fixed: 365570202 Change-Id: I8571804f063e60f544e2150f1454a6d7c63a4af3 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/206194 Auto-Submit: James Price <[email protected]> Reviewed-by: Antonio Maiorano <[email protected]> Commit-Queue: James Price <[email protected]>
- Loading branch information
Showing
373 changed files
with
490 additions
and
362 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@group(0) @binding(0) | ||
var tex : texture_storage_2d<rgba8unorm, read_write>; | ||
|
||
@compute @workgroup_size(1) | ||
fn main() { | ||
textureStore(tex, vec2(), vec4()); | ||
} |
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,7 @@ | ||
RWTexture2D<float4> tex : register(u0); | ||
|
||
[numthreads(1, 1, 1)] | ||
void main() { | ||
tex[(0).xx] = (0.0f).xxxx; | ||
return; | ||
} |
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,7 @@ | ||
RWTexture2D<float4> tex : register(u0); | ||
|
||
[numthreads(1, 1, 1)] | ||
void main() { | ||
tex[(0).xx] = (0.0f).xxxx; | ||
return; | ||
} |
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,12 @@ | ||
#version 310 es | ||
|
||
layout(binding = 0, rgba8) uniform highp writeonly image2D tex; | ||
void tint_symbol() { | ||
imageStore(tex, ivec2(0), vec4(0.0f)); | ||
} | ||
|
||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; | ||
void main() { | ||
tint_symbol(); | ||
return; | ||
} |
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,7 @@ | ||
|
||
RWTexture2D<float4> tex : register(u0); | ||
[numthreads(1, 1, 1)] | ||
void main() { | ||
tex[(0).xx] = (0.0f).xxxx; | ||
} | ||
|
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,7 @@ | ||
|
||
RWTexture2D<float4> tex : register(u0); | ||
[numthreads(1, 1, 1)] | ||
void main() { | ||
tex[(0).xx] = (0.0f).xxxx; | ||
} | ||
|
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,11 @@ | ||
SKIP: FAILED | ||
|
||
../../src/tint/lang/glsl/writer/printer/printer.cc:729 internal compiler error: TINT_UNREACHABLE | ||
******************************************************************** | ||
* The tint shader compiler has encountered an unexpected error. * | ||
* * | ||
* Please help us fix this issue by submitting a bug report at * | ||
* crbug.com/tint with the source program that triggered the bug. * | ||
******************************************************************** | ||
|
||
tint executable returned error: signal: trace/BPT trap |
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,12 @@ | ||
#include <metal_stdlib> | ||
using namespace metal; | ||
|
||
struct tint_module_vars_struct { | ||
texture2d<float, access::read_write> tex; | ||
}; | ||
|
||
kernel void tint_symbol(texture2d<float, access::read_write> tex [[texture(0)]]) { | ||
tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.tex=tex}; | ||
tint_module_vars.tex.write(float4(0.0f), uint2(int2(0))); | ||
const_cast<texture2d<float, access::read_write>thread &>(tint_module_vars.tex).fence(); | ||
} |
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,8 @@ | ||
#include <metal_stdlib> | ||
|
||
using namespace metal; | ||
kernel void tint_symbol(texture2d<float, access::read_write> tint_symbol_1 [[texture(0)]]) { | ||
tint_symbol_1.write(float4(0.0f), uint2(int2(0))); tint_symbol_1.fence(); | ||
return; | ||
} | ||
|
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 @@ | ||
; SPIR-V | ||
; Version: 1.3 | ||
; Generator: Google Tint Compiler; 1 | ||
; Bound: 16 | ||
; Schema: 0 | ||
OpCapability Shader | ||
OpMemoryModel Logical GLSL450 | ||
OpEntryPoint GLCompute %main "main" | ||
OpExecutionMode %main LocalSize 1 1 1 | ||
OpName %tex "tex" | ||
OpName %main "main" | ||
OpDecorate %tex DescriptorSet 0 | ||
OpDecorate %tex Binding 0 | ||
OpDecorate %tex Coherent | ||
%float = OpTypeFloat 32 | ||
%3 = OpTypeImage %float 2D 0 0 0 2 Rgba8 | ||
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 | ||
%tex = OpVariable %_ptr_UniformConstant_3 UniformConstant | ||
%void = OpTypeVoid | ||
%7 = OpTypeFunction %void | ||
%int = OpTypeInt 32 1 | ||
%v2int = OpTypeVector %int 2 | ||
%11 = OpConstantNull %v2int | ||
%v4float = OpTypeVector %float 4 | ||
%14 = OpConstantNull %v4float | ||
%main = OpFunction %void None %7 | ||
%8 = OpLabel | ||
%9 = OpLoad %3 %tex None | ||
OpImageWrite %9 %11 %14 None | ||
OpReturn | ||
OpFunctionEnd |
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,6 @@ | ||
@group(0) @binding(0) var tex : texture_storage_2d<rgba8unorm, read_write>; | ||
|
||
@compute @workgroup_size(1) | ||
fn main() { | ||
textureStore(tex, vec2(), vec4()); | ||
} |
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
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
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
Oops, something went wrong.