mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-05 03:35:56 +00:00
Update usage of arrayLength() intrinsic
The runtime array parameter is now passed as a pointer, instead of by value. Change-Id: I632814d2a2890dbe4476c2b01023a5ff8de42d21 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54485 Auto-Submit: James Price <jrprice@google.com> Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
2ee28d304f
commit
6681114e5e
@ -131,9 +131,9 @@ TEST_P(OpArrayLengthTest, Compute) {
|
||||
[[group(1), binding(0)]] var<storage, read_write> result : ResultBuffer;
|
||||
)" + mShaderInterface + R"(
|
||||
[[stage(compute)]] fn main() {
|
||||
result.data[0] = arrayLength(buffer1.data);
|
||||
result.data[1] = arrayLength(buffer2.data);
|
||||
result.data[2] = arrayLength(buffer3.data);
|
||||
result.data[0] = arrayLength(&buffer1.data);
|
||||
result.data[1] = arrayLength(&buffer2.data);
|
||||
result.data[2] = arrayLength(&buffer3.data);
|
||||
})")
|
||||
.c_str());
|
||||
wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&pipelineDesc);
|
||||
@ -171,9 +171,9 @@ TEST_P(OpArrayLengthTest, Fragment) {
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, (mShaderInterface + R"(
|
||||
[[stage(fragment)]] fn main() -> [[location(0)]] vec4<f32> {
|
||||
var fragColor : vec4<f32>;
|
||||
fragColor.r = f32(arrayLength(buffer1.data)) / 255.0;
|
||||
fragColor.g = f32(arrayLength(buffer2.data)) / 255.0;
|
||||
fragColor.b = f32(arrayLength(buffer3.data)) / 255.0;
|
||||
fragColor.r = f32(arrayLength(&buffer1.data)) / 255.0;
|
||||
fragColor.g = f32(arrayLength(&buffer2.data)) / 255.0;
|
||||
fragColor.b = f32(arrayLength(&buffer3.data)) / 255.0;
|
||||
fragColor.a = 0.0;
|
||||
return fragColor;
|
||||
})")
|
||||
@ -223,9 +223,9 @@ TEST_P(OpArrayLengthTest, Vertex) {
|
||||
|
||||
[[stage(vertex)]] fn main() -> VertexOut {
|
||||
var output : VertexOut;
|
||||
output.color.r = f32(arrayLength(buffer1.data)) / 255.0;
|
||||
output.color.g = f32(arrayLength(buffer2.data)) / 255.0;
|
||||
output.color.b = f32(arrayLength(buffer3.data)) / 255.0;
|
||||
output.color.r = f32(arrayLength(&buffer1.data)) / 255.0;
|
||||
output.color.g = f32(arrayLength(&buffer2.data)) / 255.0;
|
||||
output.color.b = f32(arrayLength(&buffer3.data)) / 255.0;
|
||||
output.color.a = 0.0;
|
||||
|
||||
output.position = vec4<f32>(0.0, 0.0, 0.0, 1.0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user