GLSL: Change Add[Spirv]BlockAttribute to support GLSL

Modify the AddSpirvBlockAttribute transform to fix top-level structure
access of uniform, storage and push-constant buffers for use in the
GLSL backend. The small change to the transform makes the transform
wrap host-sharable buffers, if they're also used as a
non-host-sharable structure. Also rename the transform to
AddBlockAttrbibute in order to reflect its wider applicability.

Change-Id: Ib2bf4ebf6bce72790791dbae9387032be765e4b9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101061
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White
2022-09-02 19:19:10 +00:00
committed by Dawn LUCI CQ
parent 822de46c74
commit 863d9edf59
362 changed files with 2316 additions and 3876 deletions

View File

@@ -1,10 +1,10 @@
SKIP: FAILED
binary/mul/vec3-mat4x3/f16.wgsl:3:14 error: using f16 types in 'uniform' storage class is not implemented yet
expressions/binary/mul/vec3-mat4x3/f16.wgsl:3:14 error: using f16 types in 'uniform' storage class is not implemented yet
matrix : mat4x3<f16>,
^^^^^^^^^^^
binary/mul/vec3-mat4x3/f16.wgsl:2:1 note: see layout of struct:
expressions/binary/mul/vec3-mat4x3/f16.wgsl:2:1 note: see layout of struct:
/* align(8) size(40) */ struct S {
/* offset( 0) align(8) size(32) */ matrix : mat4x3<f16>;
/* offset(32) align(8) size( 6) */ vector : vec3<f16>;
@@ -13,7 +13,7 @@ binary/mul/vec3-mat4x3/f16.wgsl:2:1 note: see layout of struct:
struct S {
^^^^^^
binary/mul/vec3-mat4x3/f16.wgsl:6:36 note: see declaration of variable
expressions/binary/mul/vec3-mat4x3/f16.wgsl:6:36 note: see declaration of variable
@group(0) @binding(0) var<uniform> data: S;
^^^^

View File

@@ -1,12 +1,7 @@
#version 310 es
precision mediump float;
struct S {
mat4x3 matrix;
vec3 vector;
};
layout(binding = 0) uniform S_1 {
layout(binding = 0) uniform S_ubo {
mat4x3 matrix;
vec3 vector;
} data;