You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
glslang used to emit a cbuffer with p at offset 64, which complies with the normal Vulkan packing rules. It looks like in #3575 this was changed to emit an offset of 52. Doing so requires scalar block layout on the vulkan side and to me is an unexpected behaviour change:
$ glslang -D -V -S frag -e main test.hlsl
$ spirv-val --target-env vulkan1.1spv1.4 frag.spv
error: line 27: Structure id 14 decorated as Block for variable in Uniform storage class must
follow relaxed uniform buffer layout rules: member1 at offset 52 overlaps previous member
ending at offset 63
%consts = OpTypeStruct %_arr_float_uint_4 %float
$ spirv-val --target-env vulkan1.1spv1.4 --scalar-block-layout frag.spv
Compare to dxc which by default puts p at an offset of 64, but has options -fvk-use-dx-layout and -fvk-use-scalar-layout to emit D3D-packed layouts or scalar packed layouts respectively, though both require scalar block layout to remove this rule.
This effectively breaks backwards compatibility - was that deliberate? If so is there any way to at least opt-out to this behaviour if you don't want to have it opt-in?
The text was updated successfully, but these errors were encountered:
Given this HLSL shader:
glslang used to emit a cbuffer with
p
at offset 64, which complies with the normal Vulkan packing rules. It looks like in #3575 this was changed to emit an offset of 52. Doing so requires scalar block layout on the vulkan side and to me is an unexpected behaviour change:Compare to dxc which by default puts
p
at an offset of 64, but has options-fvk-use-dx-layout
and-fvk-use-scalar-layout
to emit D3D-packed layouts or scalar packed layouts respectively, though both require scalar block layout to remove this rule.This effectively breaks backwards compatibility - was that deliberate? If so is there any way to at least opt-out to this behaviour if you don't want to have it opt-in?
The text was updated successfully, but these errors were encountered: