dawn-cmake/test/tint/bug/tint/1776.spvasm
Ben Clayton d257e28792 tint: Don't override alignment with @offset
Overriding the alignment to 1 would cause nested structures to be
incorrectly laid out. The fix: Don't override the alignment.

All struct layout validation works on the sem offsets, so none of this
has to change.

Bug: tint:1776
Change-Id: Ic01d45fb2790cd823ed9a55e336860ebdc351aea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112603
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-12-01 18:41:57 +00:00

45 lines
1.6 KiB
Plaintext

; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 19
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %sb_block "sb_block"
OpMemberName %sb_block 0 "inner"
OpName %S "S"
OpMemberName %S 0 "a"
OpMemberName %S 1 "b"
OpName %sb "sb"
OpName %main "main"
OpDecorate %sb_block Block
OpMemberDecorate %sb_block 0 Offset 0
OpMemberDecorate %S 0 Offset 0
OpMemberDecorate %S 1 Offset 16
OpDecorate %_runtimearr_S ArrayStride 32
OpDecorate %sb NonWritable
OpDecorate %sb DescriptorSet 0
OpDecorate %sb Binding 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%int = OpTypeInt 32 1
%S = OpTypeStruct %v4float %int
%_runtimearr_S = OpTypeRuntimeArray %S
%sb_block = OpTypeStruct %_runtimearr_S
%_ptr_StorageBuffer_sb_block = OpTypePointer StorageBuffer %sb_block
%sb = OpVariable %_ptr_StorageBuffer_sb_block StorageBuffer
%void = OpTypeVoid
%9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%int_1 = OpConstant %int 1
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
%main = OpFunction %void None %9
%12 = OpLabel
%17 = OpAccessChain %_ptr_StorageBuffer_S %sb %uint_0 %int_1
%18 = OpLoad %S %17
OpReturn
OpFunctionEnd