dawn-cmake/test/tint/builtins/textureLoad/texture_param.wgsl.expected.wgsl
Stephen White b7e560dea0 GLSL: fix "uniform" qualifier on texture parameters.
Textures as function parameters should not have the "uniform"
qualifier. Fixed by handling StorageClass::kUniformConstant the
same as StorageClass::kUniform, and removing the unconditional
"uniform" qualifier output. (Global texture variables have
StorageClass::kUniformConstant set, while function parameters don't.)

Change-Id: I9d380550ac4554917527ff330171a76a90a290e8
Bug: tint:1492
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/85820
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-04-05 18:51:15 +00:00

26 lines
525 B
WebGPU Shading Language

@group(1) @binding(0) var arg_0 : texture_2d<i32>;
fn textureLoad2d(texture : texture_2d<i32>, coords : vec2<i32>, level : i32) -> vec4<i32> {
return textureLoad(texture, coords, level);
}
fn doTextureLoad() {
var res : vec4<i32> = textureLoad2d(arg_0, vec2<i32>(), 0);
}
@stage(vertex)
fn vertex_main() -> @builtin(position) vec4<f32> {
doTextureLoad();
return vec4<f32>();
}
@stage(fragment)
fn fragment_main() {
doTextureLoad();
}
@stage(compute) @workgroup_size(1)
fn compute_main() {
doTextureLoad();
}