-
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.
HLSL-IR: implement insertBits full polyfill
Implemented as a general polyfill, but only used by the HLSL backend currently. Tested CTS using dawn_node with `-use-ir` and the following now pass: `webgpu:shader,execution,expression,call,builtin,insertBits:*` `webgpu:shader,validation,expression,call,builtin,insertBits:*` Bug: b/363199437 Bug: b/42251045 Change-Id: I985dbb178bd4778f2cd682c6226d9383416051db Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/206117 Reviewed-by: James Price <[email protected]> Commit-Queue: Antonio Maiorano <[email protected]>
- Loading branch information
Showing
26 changed files
with
1,227 additions
and
230 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
61 changes: 52 additions & 9 deletions
61
test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.ir.dxc.hlsl
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,11 +1,54 @@ | ||
SKIP: FAILED | ||
struct VertexOutput { | ||
float4 pos; | ||
uint2 prevent_dce; | ||
}; | ||
|
||
..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level | ||
******************************************************************** | ||
* 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. * | ||
******************************************************************** | ||
struct vertex_main_outputs { | ||
nointerpolation uint2 VertexOutput_prevent_dce : TEXCOORD0; | ||
float4 VertexOutput_pos : SV_Position; | ||
}; | ||
|
||
|
||
RWByteAddressBuffer prevent_dce : register(u0); | ||
uint2 insertBits_3c7ba5() { | ||
uint2 arg_0 = (1u).xx; | ||
uint2 arg_1 = (1u).xx; | ||
uint arg_2 = 1u; | ||
uint arg_3 = 1u; | ||
uint2 v = arg_0; | ||
uint2 v_1 = arg_1; | ||
uint v_2 = arg_2; | ||
uint v_3 = (v_2 + arg_3); | ||
uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); | ||
uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); | ||
uint2 v_6 = (((v_2 < 32u)) ? ((v_1 << uint2((v_2).xx))) : ((0u).xx)); | ||
uint2 v_7 = (v_6 & uint2((v_5).xx)); | ||
uint2 res = (v_7 | (v & uint2((~(v_5)).xx))); | ||
return res; | ||
} | ||
|
||
void fragment_main() { | ||
prevent_dce.Store2(0u, insertBits_3c7ba5()); | ||
} | ||
|
||
[numthreads(1, 1, 1)] | ||
void compute_main() { | ||
prevent_dce.Store2(0u, insertBits_3c7ba5()); | ||
} | ||
|
||
VertexOutput vertex_main_inner() { | ||
VertexOutput tint_symbol = (VertexOutput)0; | ||
tint_symbol.pos = (0.0f).xxxx; | ||
tint_symbol.prevent_dce = insertBits_3c7ba5(); | ||
VertexOutput v_8 = tint_symbol; | ||
return v_8; | ||
} | ||
|
||
vertex_main_outputs vertex_main() { | ||
VertexOutput v_9 = vertex_main_inner(); | ||
VertexOutput v_10 = v_9; | ||
VertexOutput v_11 = v_9; | ||
vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; | ||
return v_12; | ||
} | ||
|
||
tint executable returned error: exit status 0xc000001d |
Oops, something went wrong.