mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 00:17:03 +00:00
hlsl: Implement compound assignment
Use the ExpandCompoundAssignment transform to convert compound assignments to regular assignments. Bug: tint:1325 Change-Id: Ic843964ec24d8a2f00f801823f8f8bbf1c6fab5c Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/85284 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
struct S {
|
||||
a : vec4<i32>,
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : S;
|
||||
RWByteAddressBuffer v : register(u0, space0);
|
||||
|
||||
fn foo() {
|
||||
v.a &= vec4<i32>(2);
|
||||
void foo() {
|
||||
v.Store4(0u, asuint((asint(v.Load4(0u)) & int4((2).xxxx))));
|
||||
}
|
||||
|
||||
Failed to generate: error: cannot assign to value of type 'vec4<i32>'
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
struct S {
|
||||
a : vec4<f32>,
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : S;
|
||||
RWByteAddressBuffer v : register(u0, space0);
|
||||
|
||||
fn foo() {
|
||||
v.a /= 2.0;
|
||||
void foo() {
|
||||
v.Store4(0u, asuint((asfloat(v.Load4(0u)) / 2.0f)));
|
||||
}
|
||||
|
||||
Failed to generate: error: cannot assign to value of type 'vec4<f32>'
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
struct S {
|
||||
a : vec4<i32>,
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : S;
|
||||
RWByteAddressBuffer v : register(u0, space0);
|
||||
|
||||
fn foo() {
|
||||
v.a /= vec4<i32>(2);
|
||||
void foo() {
|
||||
v.Store4(0u, asuint((asint(v.Load4(0u)) / int4((2).xxxx))));
|
||||
}
|
||||
|
||||
Failed to generate: error: cannot assign to value of type 'vec4<i32>'
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
struct S {
|
||||
a : vec4<f32>,
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : S;
|
||||
RWByteAddressBuffer v : register(u0, space0);
|
||||
|
||||
fn foo() {
|
||||
v.a -= 2.0;
|
||||
void foo() {
|
||||
v.Store4(0u, asuint((asfloat(v.Load4(0u)) - 2.0f)));
|
||||
}
|
||||
|
||||
Failed to generate: error: cannot assign to value of type 'vec4<f32>'
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
struct S {
|
||||
a : vec4<i32>,
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : S;
|
||||
RWByteAddressBuffer v : register(u0, space0);
|
||||
|
||||
fn foo() {
|
||||
v.a -= vec4<i32>(2);
|
||||
void foo() {
|
||||
v.Store4(0u, asuint((asint(v.Load4(0u)) - int4((2).xxxx))));
|
||||
}
|
||||
|
||||
Failed to generate: error: cannot assign to value of type 'vec4<i32>'
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
struct S {
|
||||
a : vec4<i32>,
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : S;
|
||||
RWByteAddressBuffer v : register(u0, space0);
|
||||
|
||||
fn foo() {
|
||||
v.a %= 2;
|
||||
void foo() {
|
||||
v.Store4(0u, asuint((asint(v.Load4(0u)) % 2)));
|
||||
}
|
||||
|
||||
Failed to generate: error: cannot assign to value of type 'vec4<i32>'
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
struct S {
|
||||
a : vec4<i32>,
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : S;
|
||||
RWByteAddressBuffer v : register(u0, space0);
|
||||
|
||||
fn foo() {
|
||||
v.a %= vec4<i32>(2);
|
||||
void foo() {
|
||||
v.Store4(0u, asuint((asint(v.Load4(0u)) % int4((2).xxxx))));
|
||||
}
|
||||
|
||||
Failed to generate: error: cannot assign to value of type 'vec4<i32>'
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
struct S {
|
||||
a : vec4<i32>,
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : S;
|
||||
RWByteAddressBuffer v : register(u0, space0);
|
||||
|
||||
fn foo() {
|
||||
v.a |= vec4<i32>(2);
|
||||
void foo() {
|
||||
v.Store4(0u, asuint((asint(v.Load4(0u)) | int4((2).xxxx))));
|
||||
}
|
||||
|
||||
Failed to generate: error: cannot assign to value of type 'vec4<i32>'
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
struct S {
|
||||
a : vec4<f32>,
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : S;
|
||||
RWByteAddressBuffer v : register(u0, space0);
|
||||
|
||||
fn foo() {
|
||||
v.a += 2.0;
|
||||
void foo() {
|
||||
v.Store4(0u, asuint((asfloat(v.Load4(0u)) + 2.0f)));
|
||||
}
|
||||
|
||||
Failed to generate: error: cannot assign to value of type 'vec4<f32>'
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
struct S {
|
||||
a : vec4<i32>,
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : S;
|
||||
RWByteAddressBuffer v : register(u0, space0);
|
||||
|
||||
fn foo() {
|
||||
v.a += vec4<i32>(2);
|
||||
void foo() {
|
||||
v.Store4(0u, asuint((asint(v.Load4(0u)) + int4((2).xxxx))));
|
||||
}
|
||||
|
||||
Failed to generate: error: cannot assign to value of type 'vec4<i32>'
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
struct S {
|
||||
a : vec4<f32>,
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : S;
|
||||
RWByteAddressBuffer v : register(u0, space0);
|
||||
|
||||
fn foo() {
|
||||
v.a *= mat4x4<f32>();
|
||||
void foo() {
|
||||
v.Store4(0u, asuint(mul(float4x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f), asfloat(v.Load4(0u)))));
|
||||
}
|
||||
|
||||
Failed to generate: error: cannot assign to value of type 'vec4<f32>'
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
struct S {
|
||||
a : vec4<f32>,
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : S;
|
||||
RWByteAddressBuffer v : register(u0, space0);
|
||||
|
||||
fn foo() {
|
||||
v.a *= 2.0;
|
||||
void foo() {
|
||||
v.Store4(0u, asuint((asfloat(v.Load4(0u)) * 2.0f)));
|
||||
}
|
||||
|
||||
Failed to generate: error: cannot assign to value of type 'vec4<f32>'
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
struct S {
|
||||
a : vec4<i32>,
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : S;
|
||||
RWByteAddressBuffer v : register(u0, space0);
|
||||
|
||||
fn foo() {
|
||||
v.a *= vec4<i32>(2);
|
||||
void foo() {
|
||||
v.Store4(0u, asuint((asint(v.Load4(0u)) * int4((2).xxxx))));
|
||||
}
|
||||
|
||||
Failed to generate: error: cannot assign to value of type 'vec4<i32>'
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
struct S {
|
||||
a : vec4<i32>,
|
||||
[numthreads(1, 1, 1)]
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : S;
|
||||
RWByteAddressBuffer v : register(u0, space0);
|
||||
|
||||
fn foo() {
|
||||
v.a ^= vec4<i32>(2);
|
||||
void foo() {
|
||||
v.Store4(0u, asuint((asint(v.Load4(0u)) ^ int4((2).xxxx))));
|
||||
}
|
||||
|
||||
Failed to generate: error: cannot assign to value of type 'vec4<i32>'
|
||||
|
||||
Reference in New Issue
Block a user