Open tomilov opened 4 years ago
My workaround is to replace spirv-opt
invocation to spirv-opt --skip-validation
then spirv-val --scalar-block-layout
.
But now I see noisy warning from validation layers:
vkDebug: Validation: 0: [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object: VK_NULL_HANDLE (Type = 0) | SPIR-V module not valid: Structure id 2601 decorated as Block for variable in Uniform storage class must follow relaxed uniform buffer layout rules: member 0 contains an array with stride 4 not satisfying alignment to 16
%_struct_2601 = OpTypeStruct %_arr_uint_uint_1056
I was looking into the --scalar-block-layout
stuff right now, my question is why can't the core SPIR-V tools just detect the present of #extension GL_EXT_scalar_block_layout
and enabled it then, why is there even a need for a flag as other extensions don't need to be opt'ed in like this
I was looking into the
--scalar-block-layout
stuff right now, my question is why can't the core SPIR-V tools just detect the present of#extension GL_EXT_scalar_block_layout
and enabled it then, why is there even a need for a flag as other extensions don't need to be opt'ed in like this
AFAICT, it's because this extension doesn't make any modification to the spir-v itself, the limitation being lifted is within the vulkan implementation. Sure would be nice to have an extension flag to set in the spirv to indicate that we want to make use of that though.
I believe this issue was fixed by https://github.com/KhronosGroup/SPIRV-Tools/pull/3314, which added the --scalar-block-layout
flag to spirv-opt
The following shader
pathtrace.rchit.glsl
compiled by
glslangValidator -g -V pathtrace.rchit.glsl -o pathtrace.rchit.debug.spv
. Output is to be optimized asspirv-opt -O pathtrace.rchit.debug.spv -o pathtrace.rchit.spv
, but the following error is occured:As I can see
--scalar-block-layout
is the option ofspirv-val
, notspirv-opt
. So I can't tell tospirv-opt
that extension is enabled.