KhronosGroup / Vulkan-LoaderAndValidationLayers

**Deprecated repository** for Vulkan loader and validation layers
Apache License 2.0
414 stars 172 forks source link

SPIR-V : Add Validation for Interface of Entry Point #2676

Open metora opened 6 years ago

metora commented 6 years ago

Hi

I write a Mesa-IR to SPIR-V Translator, and it's fine on NVIDIA and Adreno driver. But It's crash on MALI driver, so I found the problem is I lost add gl_Position..

OpEntryPoint Vertex %6 "main" %13 I lost the %13.

It's crash on MALI Offline Shader Compiler also.

Thanks

; SPIR-V ; Version: 1.0 ; Generator: X-LEGEND Mesa-IR/SPIR-V Translator; 0 ; Bound: 17 ; Schema: 0 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Vertex %6 "main" %13 OpSource ESSL 310 OpName %6 "main" OpName %10 "gl_PerVertex" OpMemberName %10 0 "gl_Position" OpDecorate %10 Block OpMemberDecorate %10 0 BuiltIn Position %2 = OpTypeFloat 32 %3 = OpTypeVector %2 4 %4 = OpTypeVoid %5 = OpTypeFunction %4 %8 = OpConstant %2 1 %9 = OpConstantComposite %3 %8 %8 %8 %8 %12 = OpTypePointer Output %3 %14 = OpTypeInt 32 1 %10 = OpTypeStruct %3 %11 = OpTypePointer Output %10 %13 = OpVariable %11 Output %15 = OpConstant %14 0 %6 = OpFunction %4 None %5 %7 = OpLabel %16 = OpAccessChain %12 %13 %15 OpStore %16 %9 OpReturn OpFunctionEnd

chrisforbes commented 6 years ago

We should probably enforce this in SPIRV-Tools rather than here.

chrisforbes commented 6 years ago

That is, SPIRV-Tools should enforce, for every entrypoint:

chrisforbes commented 6 years ago

I'm going to move this to the new repo: KhronosGroup/Vulkan-ValidationLayers