More WGSL syntax updates

This CL updates more #'s to //'s and a missing set to group.

Change-Id: If417ed019319ed760e3b672770397857c6dfc40c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/39065
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
dan sinclair 2021-01-27 21:27:54 +00:00 committed by Commit Bot service account
parent e6f58411a9
commit aae37c2ea3
3 changed files with 10 additions and 10 deletions

View File

@ -70,20 +70,20 @@ namespace dawn_native {
var timestamp : Timestamp = timestamps.t[index];
# Return 0 for the unavailable value.
// Return 0 for the unavailable value.
if (availability.v[index] == 0u) {
timestamps.t[index].low = 0u;
timestamps.t[index].high = 0u;
return;
}
# Multiply the values in timestamps buffer by the period.
// Multiply the values in timestamps buffer by the period.
var period : f32 = params.period;
var w : u32 = 0u;
# If the product of low 32-bits and the period does not exceed the maximum of u32,
# directly do the multiplication, otherwise, use two u32 to represent the high
# 16-bits and low 16-bits of this u32, then multiply them by the period separately.
// If the product of low 32-bits and the period does not exceed the maximum of u32,
// directly do the multiplication, otherwise, use two u32 to represent the high
// 16-bits and low 16-bits of this u32, then multiply them by the period separately.
if (timestamp.low <= u32(f32(0xFFFFFFFFu) / period)) {
timestamps.t[index].low = u32(round(f32(timestamp.low) * period));
} else {
@ -99,8 +99,8 @@ namespace dawn_native {
timestamps.t[index].low = result;
}
# Get the nearest integer to the float result. For high 32-bits, the round
# function will greatly help reduce the accuracy loss of the final result.
// Get the nearest integer to the float result. For high 32-bits, the round
// function will greatly help reduce the accuracy loss of the final result.
timestamps.t[index].high = u32(round(f32(timestamp.high) * period)) + w;
}
)";

View File

@ -65,10 +65,10 @@ class DepthStencilStateTest : public DawnTest {
const pos : array<vec2<f32>, 6> = array<vec2<f32>, 6>(
vec2<f32>(-1.0, 1.0),
vec2<f32>(-1.0, -1.0),
vec2<f32>( 1.0, -1.0), # front-facing
vec2<f32>( 1.0, -1.0), // front-facing
vec2<f32>(-1.0, 1.0),
vec2<f32>( 1.0, 1.0),
vec2<f32>( 1.0, -1.0)); # back-facing
vec2<f32>( 1.0, -1.0)); // back-facing
Position = vec4<f32>(pos[VertexIndex], ubo.depth, 1.0);
})");

View File

@ -119,7 +119,7 @@ void FirstIndexOffsetTests::TestImpl(DrawMode mode,
[[offset(4)]] instance_index : u32;
};
[[set(0), binding(0)]] var<storage_buffer> idx_vals : [[access(read_write)]] IndexVals;
[[group(0), binding(0)]] var<storage_buffer> idx_vals : [[access(read_write)]] IndexVals;
[[stage(fragment)]] fn main() -> void {
)";