Fix more WGSL vector constructors
Constructor arguments need to match the vector element type. Tint has new validation that now checks for this. Bug: tint:632 Change-Id: Ifcb994260c167e326ce5c0776915d44954dd8aa9 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/44767 Auto-Submit: Ben Clayton <bclayton@google.com> Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
175a7eb826
commit
e76a33b6eb
|
@ -999,7 +999,7 @@ TEST_P(BufferZeroInitTest, BoundAsUniformBuffer) {
|
||||||
[[group(0), binding(1)]] var outImage : [[access(write)]] texture_storage_2d<rgba8unorm>;
|
[[group(0), binding(1)]] var outImage : [[access(write)]] texture_storage_2d<rgba8unorm>;
|
||||||
|
|
||||||
[[stage(compute)]] fn main() -> void {
|
[[stage(compute)]] fn main() -> void {
|
||||||
if (all(ubo.value == vec4<u32>(0, 0, 0, 0))) {
|
if (all(ubo.value == vec4<u32>(0u, 0u, 0u, 0u))) {
|
||||||
textureStore(outImage, vec2<i32>(0, 0), vec4<f32>(0.0, 1.0, 0.0, 1.0));
|
textureStore(outImage, vec2<i32>(0, 0), vec4<f32>(0.0, 1.0, 0.0, 1.0));
|
||||||
} else {
|
} else {
|
||||||
textureStore(outImage, vec2<i32>(0, 0), vec4<f32>(1.0, 0.0, 0.0, 1.0));
|
textureStore(outImage, vec2<i32>(0, 0), vec4<f32>(1.0, 0.0, 0.0, 1.0));
|
||||||
|
@ -1041,7 +1041,7 @@ TEST_P(BufferZeroInitTest, BoundAsReadonlyStorageBuffer) {
|
||||||
[[group(0), binding(1)]] var outImage : [[access(write)]] texture_storage_2d<rgba8unorm>;
|
[[group(0), binding(1)]] var outImage : [[access(write)]] texture_storage_2d<rgba8unorm>;
|
||||||
|
|
||||||
[[stage(compute)]] fn main() -> void {
|
[[stage(compute)]] fn main() -> void {
|
||||||
if (all(ssbo.value == vec4<u32>(0, 0, 0, 0))) {
|
if (all(ssbo.value == vec4<u32>(0u, 0u, 0u, 0u))) {
|
||||||
textureStore(outImage, vec2<i32>(0, 0), vec4<f32>(0.0, 1.0, 0.0, 1.0));
|
textureStore(outImage, vec2<i32>(0, 0), vec4<f32>(0.0, 1.0, 0.0, 1.0));
|
||||||
} else {
|
} else {
|
||||||
textureStore(outImage, vec2<i32>(0, 0), vec4<f32>(1.0, 0.0, 0.0, 1.0));
|
textureStore(outImage, vec2<i32>(0, 0), vec4<f32>(1.0, 0.0, 0.0, 1.0));
|
||||||
|
|
|
@ -238,7 +238,7 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPong) {
|
||||||
|
|
||||||
[[stage(compute)]] fn main() -> void {
|
[[stage(compute)]] fn main() -> void {
|
||||||
dst.data[GlobalInvocationID.x] = src.data[GlobalInvocationID.x] +
|
dst.data[GlobalInvocationID.x] = src.data[GlobalInvocationID.x] +
|
||||||
vec4<u32>(0x1234, 0x1234, 0x1234, 0x1234);
|
vec4<u32>(0x1234u, 0x1234u, 0x1234u, 0x1234u);
|
||||||
}
|
}
|
||||||
)");
|
)");
|
||||||
|
|
||||||
|
@ -306,7 +306,7 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPongInOnePass) {
|
||||||
|
|
||||||
[[stage(compute)]] fn main() -> void {
|
[[stage(compute)]] fn main() -> void {
|
||||||
dst.data[GlobalInvocationID.x] = src.data[GlobalInvocationID.x] +
|
dst.data[GlobalInvocationID.x] = src.data[GlobalInvocationID.x] +
|
||||||
vec4<u32>(0x1234, 0x1234, 0x1234, 0x1234);
|
vec4<u32>(0x1234u, 0x1234u, 0x1234u, 0x1234u);
|
||||||
}
|
}
|
||||||
)");
|
)");
|
||||||
|
|
||||||
|
|
|
@ -208,8 +208,8 @@ class VertexFormatDeprecationTests : public DeprecationTests {
|
||||||
attribute += ";";
|
attribute += ";";
|
||||||
|
|
||||||
std::string attribAccess = dawn::VertexFormatNumComponents(vertexFormat) > 1
|
std::string attribAccess = dawn::VertexFormatNumComponents(vertexFormat) > 1
|
||||||
? "vec4<f32>(a.x, 0.0, 0.0, 1.0)"
|
? "vec4<f32>(f32(a.x), 0.0, 0.0, 1.0)"
|
||||||
: "vec4<f32>(a, 0.0, 0.0, 1.0)";
|
: "vec4<f32>(f32(a), 0.0, 0.0, 1.0)";
|
||||||
|
|
||||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, (attribute + R"(
|
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, (attribute + R"(
|
||||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
|
@ -272,4 +272,4 @@ DAWN_INSTANTIATE_TEST(VertexFormatDeprecationTests,
|
||||||
NullBackend(),
|
NullBackend(),
|
||||||
OpenGLBackend(),
|
OpenGLBackend(),
|
||||||
OpenGLESBackend(),
|
OpenGLESBackend(),
|
||||||
VulkanBackend());
|
VulkanBackend());
|
||||||
|
|
Loading…
Reference in New Issue