KhronosGroup / SPIRV-Cross

SPIRV-Cross is a practical tool and library for performing reflection on SPIR-V and disassembling SPIR-V back to high level languages.
Apache License 2.0
2.02k stars 557 forks source link

spirv-cross yields invalid GLSL ('modf' : no matching overloaded function found) #1123

Closed afd closed 5 years ago

afd commented 5 years ago

Files to repro the problem

Doing:

spirv-cross generated_0.opt.spv --output temp.frag && glslangValidator temp.frag

gives:

ERROR: 0:2582: 'modf' : no matching overloaded function found 
ERROR: 0:2582: '=' :  cannot convert from ' const float' to ' temp highp 3-component vector of float'
ERROR: 0:2582: '' : compilation terminated 
ERROR: 3 compilation errors.  No code generated.

Found via GraphicsFuzz on spirv-cross git commit 4ce04480.

HansKristian-Work commented 5 years ago

Invalid SPIR-V (spirv-val output):

error: line 10847: GLSL.std.450 Modf: expected operand I data type to be equal to Result Type
  %9944 = OpExtInst %v3float %1 Modf %9943 %_GLF_color

This matches up with the error I'm seeing _GLF_color is vec4 here.