summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp501
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui.h95
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp66
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp23
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h44
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp405
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/.appveyor.yml1
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/.travis.yml1
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/BUILD.bazel245
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/BUILD.gn29
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/CMakeLists.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/OGLCompilersDLL/CMakeLists.txt3
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/README.md2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/CMakeLists.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h1
-rwxr-xr-x[-rw-r--r--]3rdparty/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp244
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/InReadableOrder.cpp44
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h13
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp49
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp3
-rwxr-xr-x3rdparty/bgfx/3rdparty/glslang/SPIRV/spvIR.h51
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/StandAlone/CMakeLists.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/StandAlone/StandAlone.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/130.frag9
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/330.frag15
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/130.frag.out11
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/330.frag.out12
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/compoundsuffix.frag.hlsl2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.450.subgroup.frag.out442
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.entryPointRename.vert.bad.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.entryPointRename.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glspv.esversion.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glspv.version.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.PointSize.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.PointSize.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.amend.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.flatten.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.implicit-size.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.multidim.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.assoc.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attribute.expression.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attribute.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attributeC11.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attributeGlobalBuffer.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.basic.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.basic.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.boolConv.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.buffer.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.cast.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.cbuffer-identifier.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.charLit.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clip.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-5.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-6.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-7.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-8.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-9.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.color.hull.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.comparison.vec.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.conditional.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constantbuffer.frag.out5
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructArray.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructexpr.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructimat.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.coverage.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.dashI.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.deadFunctionMissingBody.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.depthGreater.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.depthLess.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.discard.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.doLoop.frag.out539
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.1.tese.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.2.tese.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.3.tese.out2
-rwxr-xr-x3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.earlydepthstencil.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry-in.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry-out.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry.rename.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flatten.return.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenSubset.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.float1.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.float4.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.forLoop.frag.out1463
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.format.rwtexture.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.fraggeom.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.global-const-init.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.groupid.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hlslOffset.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.1.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.2.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.3.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.4.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.void.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.identifier.sample.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.if.frag.out624
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.imagefetch-subvec4.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.implicitBool.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.include.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.inf.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.init.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.init2.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.inoutquals.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.int.dot.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsic.frexp.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsic.frexp.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.barriers.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.double.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.f3216.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.lit.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.negative.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.negative.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.isfinite.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.layout.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.layoutOverride.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.binary.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.unary.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logicalConvert.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.loopattr.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matNx1.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.bool.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.int.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matpack-1.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matrixindex.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.max.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.memberFunCall.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mintypes.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mip.operator.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mul-truncate.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiEntry.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiReturn.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.namespace.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.nonint-index.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.nonstaticMemberFunction.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.numericsuffixes.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.numthreads.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.opaque-type-bug.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.overload.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.params.default.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialInit.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line2.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line3.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line4.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precedence.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precedence2.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precise.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.preprocessor.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.atomic.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.binary.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.vec1.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promotions.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.atomics.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.bracket.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.register.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.dx9.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.dx9.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.dualmode.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalar-length.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalar2matrix.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalarCast.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scope.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.self_cast.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic-1.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semicolons.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.shapeConv.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.shapeConvRet.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sin.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.snorm.uav.comp.out2
-rwxr-xr-x3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.specConstant.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.staticFuncInit.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.string.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.stringtoken.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split-1.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.array.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.call.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structStructName.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out5
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.frag.out5
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out5
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structin.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.subpass.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.switch.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.swizzle.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.synthesizeInput.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.target.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.targetStruct1.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.targetStruct2.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.templatetypes.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texture.struct.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texturebuffer.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.this.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tristream-append.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tx.bracket.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tx.overload.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.half.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.identifier.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.type.conversion.valid.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.typedef.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.void.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.waveprefix.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequad.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequery.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequery.frag.out5
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavereduction.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavevote.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.whileLoop.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-1.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-2.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-3.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/link1.vk.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.dcefunc.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.everything.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.none.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.strip.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.templatetypes.everything.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.templatetypes.none.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.if.everything.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.if.none.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1a.everything.frag.out9
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1a.none.frag.out5
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1b.everything.frag.out9
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1b.none.frag.out5
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.specconst.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.switch.everything.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.switch.none.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.uniformarray.everything.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.uniformarray.none.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/size2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ssbo.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ubo.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.coopmat.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.LoopControl.frag.out2
-rwxr-xr-x3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.NonWritable.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogical.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogical.funcall.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogicalBool.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpEntryPoint.frag.out2
-rwxr-xr-x3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpSelect.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.constructComposite.comp.out2
-rwxr-xr-x3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.image.frag.out2
-rwxr-xr-x3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.sparseTexture.frag.out2
-rwxr-xr-x3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.texture.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.100ops.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.130.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.140.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.150.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.150.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage-int.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage-uint.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitxfb.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300BuiltIns.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layout.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layout.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layoutp.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.310.bitcast.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.310.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.320.meshShaderUserDefined.mesh.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.330.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.frag.nanclamp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.tese.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.420.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.430.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.430.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.noRedecl.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-int.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-ssbo.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-ubo.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.AnyHitShader.rahit.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.AofA.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ClosestHitShader.rchit.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.GeometryShaderPassthrough.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.IntersectShader.rint.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.MissShader.rmiss.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.OVR_multiview.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.Operations.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayCallable.rcall.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayConstants.rgen.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShader.rgen.out2
-rwxr-xr-x3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShader11.rgen.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShaderArray.rgen.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.accessChain.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.aggOps.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.always-discard.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.always-discard2.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.arbPostDepthCoverage.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.atomic.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.atomicInt64.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.barrier.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bitCast.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bool.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.boolInBlock.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.branch-return.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.buffer.autoassign.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle1.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle10.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle11.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle12.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle13.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle14.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle15.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle16.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle18.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle2.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle3.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle4.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle5.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle6.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle7.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle8.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle9.frag.out4
-rwxr-xr-x3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandleUvec2.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.builtInXFB.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.computeShaderDerivatives.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.computeShaderDerivatives2.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conditionalDemote.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conditionalDiscard.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constConstruct.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constStruct.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constructComposite.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out395
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conversion.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.coopmat.comp.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOut.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOutIndirect.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOutIndirect.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-continue.vert.out54
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-discard.frag.out31
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-loop-break.vert.out67
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-return.vert.out29
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-switch-break.vert.out40
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-complex-continue-after-return.vert.out55
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-complex-merge-after-return.vert.out51
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.debugInfo.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.deepRvalue.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.depthOut.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.deviceGroup.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.discard-dce.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.do-simple.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.do-while-continue-break.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.doWhileLoop.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.double.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.drawParams.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.earlyReturnDiscard.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.explicittypes.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.extPostDepthCoverage.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16Fetch.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16convertonlyarith.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16convertonlystorage.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float32.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float64.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.flowControl.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-complex-condition.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-continue-break.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-nobody.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-notest.vert.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-simple.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.forLoop.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.forwardFun.frag.out5
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentDensity-es.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentDensity.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentShaderBarycentric.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentShaderBarycentric2.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fsi.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fullyCovered.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionCall.frag.out5
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionParameterTypes.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionSemantics.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glFragColor.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glsl.register.noautoassign.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.hlslOffsets.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.image.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int16.amd.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int16.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int32.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int64.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int8.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.intOps.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.intcoopmat.comp.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.interpOps.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.layoutNested.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.length.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.localAggregates.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.loops.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.loopsArtificial.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matFun.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matrix.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matrix2.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.memoryQualifier.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.merge-unreachable.frag.out4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderBuiltins.mesh.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderPerViewBuiltins.mesh.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderPerViewUserDefined.mesh.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderRedeclBuiltins.mesh.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderRedeclPerViewBuiltins.mesh.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderSharedMem.mesh.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderTaskMem.mesh.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderUserDefined.mesh.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshTaskShader.task.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiStruct.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiStructFuncall.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiView.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiviewPerViewAttributes.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.newTexture.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noBuiltInLoc.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noDeadDecorations.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noWorkgroup.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonSquare.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonuniform.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonuniform2.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.offsets.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.paramMemory.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.perprimitiveNV.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pp.line.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precise.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precise.tese.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precision.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.prepost.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.privateVariableTypes.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pushConstant.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pushConstantAnon.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.qualifiers.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.queryL.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.rankShift.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.autoassign-2.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.autoassign.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.noautoassign.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.subpass.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.rw.autoassign.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sample.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sampleId.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.samplePosition.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.samplerlessTextureFunctions.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.scalarlayout.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.scalarlayoutfloat16.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.separate.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.set.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderBallot.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderDrawParams.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderFragMaskAMD.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderGroupVote.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderImageFootprint.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderStencilExport.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shadingRate.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shiftOps.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shortCircuit.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.simpleFunctionCall.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.simpleMat.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.smBuiltins.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.smBuiltins.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sparseTexture.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConst.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstant.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstant.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstantComposite.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstantOperations.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ssboAlias.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.stereoViewRendering.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.storageBuffer.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structAssignment.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structDeref.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structure.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.geom.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.tese.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupBallot.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupBasic.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupClustered.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesArithmetic.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesBallot.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesClustered.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesPartitioned.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesQuad.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesShuffle.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesShuffleRelative.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesVote.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupQuad.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupShuffle.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupVote.comp.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subpass.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.switch.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.swizzle.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.swizzleInversion.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.test.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.test.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.textureBuffer.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.types.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.uint.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.uniformArray.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.unit1.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.variableArrayIndex.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.varyingArray.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vecMatConstruct.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.viewportArray2.tesc.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.viewportArray2.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.voidFunction.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.volatileAtomic.comp.out40
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vulkan110.int16.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.while-continue-break.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.while-simple.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.whileLoop.frag.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb2.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb3.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOffsetOnBlockMembersAssignment.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOffsetOnStructMembersAssignment.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbStrideJustOnce.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/vulkan.ast.vert.out2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/web.comp.out157
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/baseResults/web.separate.frag.out178
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/glsl.450.subgroup.frag4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/hlsl.doLoop.frag24
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/hlsl.forLoop.frag50
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/hlsl.if.frag26
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/runtests23
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/spv.controlFlowAttributes.frag11
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-continue.vert14
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-discard.frag10
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-loop-break.vert19
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-return.vert10
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-switch-break.vert15
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-complex-continue-after-return.vert19
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-complex-merge-after-return.vert23
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/spv.volatileAtomic.comp8
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/web.comp50
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/web.separate.frag63
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/Test/web.testlist2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/WORKSPACE27
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/CMakeLists.txt9
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h68
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Include/intermediate.h3
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Include/revision.h2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp315
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp154
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp63
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp109
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp17
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.h1
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4258
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.y256
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp1902
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h484
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.h12
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp6
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h53
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Unix/CMakeLists.txt3
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Windows/CMakeLists.txt3
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Public/ShaderLang.h4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/gtests/CMakeLists.txt3
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/gtests/Spv.FromFile.cpp26
-rwxr-xr-x3rdparty/bgfx/3rdparty/glslang/gtests/TestFixture.h6
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/hlsl/CMakeLists.txt5
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/known_good.json4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/kokoro/linux-clang-release-bazel/build.sh60
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/kokoro/linux-clang-release-bazel/continuous.cfg35
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/kokoro/linux-clang-release-bazel/presubmit.cfg35
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/kokoro/macos-clang-release-bazel/build.sh60
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/kokoro/macos-clang-release-bazel/continuous.cfg35
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/kokoro/macos-clang-release-bazel/presubmit.cfg35
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/kokoro/windows-msvc-2015-release-bazel/build.bat75
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/kokoro/windows-msvc-2015-release-bazel/continuous.cfg35
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/kokoro/windows-msvc-2015-release-bazel/presubmit.cfg35
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan/vulkan_core.h104
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/.github/workflows/build.yml29
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/.travis.yml34
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/CMakeLists.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/Makefile2
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/README.md5
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/demo/GLTFLoader.js288
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/demo/babylon.MESHOPT_compression.js12
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/demo/demo.html10
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/demo/index.html6
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/demo/main.cpp8
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/demo/pirate.glbbin28780 -> 29008 bytes
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/demo/tests.cpp103
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/js/meshopt_decoder.js57
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/indexcodec.cpp3
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/meshoptimizer.h2
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/simplifier.cpp3
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexcodec.cpp368
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/tools/cgltf.h78
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/tools/gltfpack.cpp389
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/tools/vcachetuner.cpp115
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/.travis.yml4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/CMakeLists.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/gn/BUILD.gn63
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/main.cpp19
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-hlsl/asm/comp/bitcast_icmp.asm.comp28
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-hlsl/comp/atomic-decrement.asm.comp22
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-hlsl/comp/atomic-increment.asm.comp22
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-decrement.asm.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-increment.asm.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/bitcast_icmp.asm.comp29
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/buffer-write-relative-addr.asm.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/buffer-write.asm.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag99
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/single-function-private-lut.asm.frag43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/storage-class-output-initializer.asm.frag45
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/texture-atomics.asm.frag121
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/texture-atomics.asm.graphics-robust-access.frag122
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc101
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/complex-composite-constant-array.comp59
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/composite-array-initialization.comp103
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/composite-construct.comp95
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/inverse.comp15
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/spec-constant-work-group-size.comp43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/storage-buffer-std140-vector-array.comp49
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc45
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/array-lut-no-loop-variable.frag43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/array-of-array-lut.frag68
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/buffer-read-write.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/constant-array.frag52
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/constant-composites.frag46
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/fragment-component-padding.pad-fragment.frag43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag44
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/lut-promotion.frag95
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/mrt-array.frag41
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag23
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/texture-cube-array.frag22
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/texture-cube-array.ios.emulate-cube-array.frag58
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/load-control-point-array-of-matrix.tesc73
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/load-control-point-array-of-struct.tesc84
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/load-control-point-array.tesc70
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/input-types.tese16
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/load-control-point-array-of-matrix.tese85
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/load-control-point-array.tese78
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/triangle-tess-level.tese45
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/float-math.invariant-float-math.vert137
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/float-math.vert88
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/functions.vert9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/in_out_array_mat.vert43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/interface-block-block-composites.frag43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/interface-block-block-composites.vert43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/texture_buffer.vert3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag366
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/array-copy-error.asm.frag356
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/depth-compare.asm.frag314
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/global-constant-arrays.asm.frag1364
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag1413
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag356
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag503
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag213
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.frag121
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag122
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/hs-incorrect-base-type.asm.tesc399
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/hs-input-array-access.asm.tesc467
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/hs-texcoord-array.asm.tesc411
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.asm.tesc178
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese419
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese415
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese216
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-texcoord-array.asm.tese318
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/vert/array-missing-copies.asm.vert466
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert122
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/vert/texture-buffer.asm.vert387
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/asm/comp/bitcast_icmp.asm.comp27
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/asm/comp/phi-temporary-copy-loop-variable.asm.comp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/frag/struct-type-unrelated-alias.frag9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/tese/load-array-of-array.tese10
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp27
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/frag/empty-struct-in-struct.asm.frag37
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/frag/unordered-compare.asm.frag51
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl/asm/comp/bitcast_icmp.asm.comp28
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp38
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/storage-buffer-pointer-argument.asm.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/variable-pointers.asm.comp9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/empty-struct-in-struct.asm.frag35
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag235
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-callstack.msl2.asm.frag6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-control-flow.msl2.asm.frag9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-split-functions.msl2.asm.frag12
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/texture-access.swizzle.asm.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/vert/empty-struct-composite.asm.vert5
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/vert/op-load-forced-temporary-array.asm.frag43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/array-copy-threadgroup-memory.comp47
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/glsl.std450.comp15
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/std140-array-load-composite-construct.comp18
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/pixel-interlock-simple-callstack.msl2.frag6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-int.swizzle.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-leaf.swizzle.frag6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-uint.swizzle.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access.swizzle.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/array-of-vec3.comp17
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/array-of-vec4.comp17
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-scalar.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-std140.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-std430.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-scalar.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-std140.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-std430.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-scalar.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-std140.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-std430.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-scalar.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-std140.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-std430.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-scalar.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-std140.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-std430.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-scalar.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-std140.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-std430.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-scalar.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-std140.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-std430.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-scalar.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-std140.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-std430.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-scalar.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-std140.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-std430.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vert/functions_nested.vert18
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vert/pass-array-by-value.vert110
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vulkan/frag/texture-access-function.swizzle.vk.frag6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-decrement.asm.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-increment.asm.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/bitcast_icmp.asm.comp29
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/buffer-write-relative-addr.asm.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/buffer-write.asm.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/global-parameter-name-alias.asm.comp6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/image-load-store-short-vector.asm.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/struct-resource-name-aliasing.asm.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/variable-pointers-2.asm.comp6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/variable-pointers-store-forwarding.asm.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/vector-builtin-type-cast-func.asm.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/empty-struct.asm.frag11
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/extract-packed-from-composite.asm.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/function-overload-alias.asm.frag12
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/line-directive.line.asm.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag99
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/op-constant-null.asm.frag43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/pass-by-value.asm.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/single-function-private-lut.asm.frag97
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/storage-class-output-initializer.asm.frag45
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/texture-atomics.asm.frag121
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/texture-atomics.asm.graphics-robust-access.frag121
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/unknown-depth-state.asm.frag6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc113
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/extract-transposed-matrix-from-struct.asm.vert3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/invariant.msl21.asm.vert3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/uint-vertex-id-instance-id.asm.vert3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/access-private-workgroup-in-function.comp6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/array-length.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/array-length.msl2.argument.discrete.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/barriers.comp33
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/cfg-preserve-parameter.comp12
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/complex-composite-constant-array.comp65
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/complex-type-alias.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/composite-array-initialization.comp106
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/composite-construct.comp101
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/copy-array-of-arrays.comp215
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/functions.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/global-invocation-id-writable-ssbo-in-function.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/int64.invalid.msl22.comp53
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/inverse.comp15
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/shared-array-of-arrays.comp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/spec-constant-work-group-size.comp43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/storage-buffer-std140-vector-array.comp49
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/type-alias.comp6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc45
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/basic.desktop.sso.tesc3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/argument-buffers.msl2.argument.frag6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-lut-no-loop-variable.frag43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-of-array-lut.frag68
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.argument.discrete.swizzle.frag9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.swizzle.frag6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/buffer-read-write.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/constant-array.frag52
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/constant-composites.frag98
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/flush_params.frag6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/fp16.desktop.invalid.frag18
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/fragment-component-padding.pad-fragment.frag44
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/helper-invocation.msl21.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag58
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/image-query-lod.msl22.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/input-attachment-ms.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/input-attachment.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/lut-promotion.frag99
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/mrt-array.frag47
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/packing-test-3.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/private-variable-prototype-declaration.frag6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/readonly-ssbo.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sample-depth-separate-image-sampler.frag6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sample-position-func.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sampler-image-arrays.msl2.frag9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sampler.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/separate-image-sampler-argument.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/shader-arithmetic-8bit.frag12
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/shadow-compare-global-alias.invalid.frag12
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/stencil-export.msl21.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/texture-cube-array.frag25
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/texture-cube-array.ios.emulate-cube-array.frag61
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/write-depth-in-function.frag3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/load-control-point-array-of-matrix.tesc73
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/load-control-point-array-of-struct.tesc86
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/load-control-point-array.tesc70
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/water_tess.tesc15
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/input-array.tese3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/input-types.tese15
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/load-control-point-array-of-matrix.tese84
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/load-control-point-array.tese81
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/quad.tese3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/set-from-function.tese3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/triangle-tess-level.tese45
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/water_tess.tese9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/float-math.invariant-float-math.vert136
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/float-math.vert87
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/functions.vert9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/in_out_array_mat.vert47
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/interface-block-block-composites.frag43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/interface-block-block-composites.vert43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/leaf-function.capture.vert3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/read-from-row-major-array.vert9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/resource-arrays-leaf.ios.vert3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/return-array.vert109
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/set_builtin_in_func.vert3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/texture_buffer.vert3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/access-tracking-function-call-result.asm.comp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp30
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/empty-struct-in-struct.asm.frag31
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/unordered-compare.asm.frag33
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/vector-extract-dynamic-spec-constant.asm.frag27
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag366
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/array-copy-error.asm.frag350
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/depth-compare.asm.frag314
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/global-constant-arrays.asm.frag1365
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag1414
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag350
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag503
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag213
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/texture-atomics.asm.frag121
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag121
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/hs-incorrect-base-type.asm.tesc399
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/hs-input-array-access.asm.tesc467
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/hs-texcoord-array.asm.tesc411
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.asm.tesc178
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese420
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese415
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese217
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-texcoord-array.asm.tese318
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/vert/array-missing-copies.asm.vert466
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert122
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/vert/texture-buffer.asm.vert387
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/asm/comp/bitcast_icmp.asm.comp27
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/asm/comp/phi-temporary-copy-loop-variable.asm.comp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/frag/struct-type-unrelated-alias.frag23
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/tese/load-array-of-array.tese16
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp77
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/frag/empty-struct-in-struct.asm.frag61
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/frag/unordered-compare.asm.frag177
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl/asm/comp/bitcast_icmp.asm.comp101
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp77
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/asm/frag/empty-struct-in-struct.asm.frag61
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag646
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/comp/std140-array-load-composite-construct.comp13
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/packing/array-of-vec3.comp13
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/packing/array-of-vec4.comp13
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/asm/comp/bitcast_icmp.asm.comp101
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/comp/complex-composite-constant-array.comp19
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/array-of-array-lut.frag12
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag26
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag29
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/texture-cube-array.frag16
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/texture-cube-array.ios.emulate-cube-array.frag16
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tesc/load-control-point-array-of-matrix.tesc12
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tesc/load-control-point-array-of-struct.tesc21
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tesc/load-control-point-array.tesc12
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tese/load-control-point-array-of-matrix.tese13
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tese/load-control-point-array.tese13
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/vert/float-math.invariant-float-math.vert25
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/vert/float-math.vert25
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/comp/access-tracking-function-call-result.asm.comp54
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp77
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/frag/empty-struct-in-struct.asm.frag61
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/frag/unordered-compare.asm.frag177
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/frag/vector-extract-dynamic-spec-constant.asm.frag49
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag1087
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/array-copy-error.asm.frag878
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/depth-compare.asm.frag961
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/global-constant-arrays.asm.frag3556
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag3694
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag878
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag1230
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag589
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/texture-atomics.asm.frag242
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag242
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/hs-incorrect-base-type.asm.tesc1158
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/hs-input-array-access.asm.tesc1264
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/hs-texcoord-array.asm.tesc1144
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.asm.tesc352
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese1046
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese1175
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese547
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-texcoord-array.asm.tese715
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/vert/array-missing-copies.asm.vert1131
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert259
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/vert/texture-buffer.asm.vert1054
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders/asm/comp/bitcast_icmp.asm.comp101
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders/frag/struct-type-unrelated-alias.frag19
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/shaders/tese/load-array-of-array.tese10
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv.hpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_common.hpp5
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.cpp78
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.hpp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp49
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.h15
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_error_handling.hpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp330
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp17
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp100
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.cpp1911
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.hpp72
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_reflect.cpp9
-rwxr-xr-x3rdparty/bgfx/3rdparty/spirv-cross/test_shaders.py16
-rwxr-xr-x3rdparty/bgfx/3rdparty/spirv-cross/test_shaders.sh2
-rwxr-xr-x3rdparty/bgfx/3rdparty/spirv-cross/update_test_shaders.sh2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp112
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/BUILD.gn31
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/CHANGES56
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/DEPS2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/include/generated/build-version.inc2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/CMakeLists.txt16
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp7
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/CMakeLists.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/data_descriptor.cpp27
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/data_descriptor.h9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/equivalence_relation.h232
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fact_manager.cpp132
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fact_manager.h30
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/force_render_red.cpp8
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer.cpp35
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_context.cpp29
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_context.h36
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass.cpp101
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass.h41
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_add_no_contraction_decorations.cpp61
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_add_no_contraction_decorations.h39
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_add_useful_constructs.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_function_controls.cpp73
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_function_controls.h39
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_loop_controls.cpp121
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_loop_controls.h (renamed from 3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_relaxed_precision_decoration_opportunity_finder.h)27
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.cpp113
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.h40
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_selection_controls.cpp76
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_selection_controls.h39
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_apply_id_synonyms.cpp25
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_construct_composites.cpp363
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_construct_composites.h79
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_copy_objects.cpp134
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_obfuscate_constants.cpp25
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_split_blocks.cpp51
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_util.cpp129
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_util.h31
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/id_use_descriptor.cpp84
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/id_use_descriptor.h25
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/instruction_descriptor.cpp105
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/instruction_descriptor.h49
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/protobufs/spvtoolsfuzz.proto216
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation.cpp57
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_add_no_contraction_decoration.cpp110
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_add_no_contraction_decoration.h58
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_construct.cpp305
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_construct.h88
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_extract.cpp123
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_extract.h63
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_copy_object.cpp109
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_copy_object.h18
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_boolean_constant_with_constant_binary.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_constant_with_uniform.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_id_with_synonym.cpp146
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_function_control.cpp100
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_function_control.h58
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_loop_control.cpp216
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_loop_control.h79
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_memory_operands_mask.cpp201
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_memory_operands_mask.h76
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_selection_control.cpp60
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_selection_control.h54
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_split_block.cpp90
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_split_block.h5
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/link/CMakeLists.txt11
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/CMakeLists.txt11
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold.cpp6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp65
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/folding_rules.cpp131
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp1
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.h7
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.cpp53
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.cpp8
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/optimizer.cpp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.cpp22
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.h8
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp30
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.cpp41
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.h33
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/print.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/CMakeLists.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.cpp20
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.h4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reducer.cpp206
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reducer.h27
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reduction_util.cpp17
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reduction_util.h5
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_opname_instruction_reduction_opportunity_finder.cpp45
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_opname_instruction_reduction_opportunity_finder.h45
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_relaxed_precision_decoration_opportunity_finder.cpp49
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unreferenced_instruction_reduction_opportunity_finder.cpp93
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unreferenced_instruction_reduction_opportunity_finder.h4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp17
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.h5
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/text.cpp7
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/util/bitutils.h93
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_cfg.cpp68
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_composites.cpp20
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_derivatives.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_misc.cpp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/binary_header_get_test.cpp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/CMakeLists.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/equivalence_relation_test.cpp123
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/fuzzer_replayer_test.cpp705
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/fuzzer_shrinker_test.cpp6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/instruction_descriptor_test.cpp69
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_add_dead_continue_test.cpp46
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_add_no_contraction_decoration_test.cpp194
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_composite_construct_test.cpp1335
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_composite_extract_test.cpp392
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_copy_object_test.cpp235
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_replace_boolean_constant_with_constant_binary_test.cpp23
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_replace_constant_with_uniform_test.cpp61
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_replace_id_with_synonym_test.cpp1176
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_function_control_test.cpp251
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_loop_control_test.cpp968
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_memory_operands_mask_test.cpp432
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_selection_control_test.cpp219
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_split_block_test.cpp122
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzzers/BUILD.gn32
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzzers/spvtools_as_fuzzer.cpp70
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/fuzzers/spvtools_dis_fuzzer.cpp71
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp130
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/opt/fold_test.cpp137
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/opt/graphics_robust_access_test.cpp8
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/opt/if_conversion_test.cpp8
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/opt/inst_bindless_check_test.cpp409
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/opt/ir_context_test.cpp87
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/opt/optimizer_test.cpp48
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/opt/reduce_load_size_test.cpp28
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/opt/scalar_replacement_test.cpp31
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/opt/simplification_test.cpp35
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/opt/type_manager_test.cpp7
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/opt/vector_dce_test.cpp68
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/CMakeLists.txt2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/reducer_test.cpp255
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/remove_opname_instruction_test.cpp225
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/remove_relaxed_precision_decoration_test.cpp177
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/remove_unreferenced_instruction_test.cpp365
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/util/CMakeLists.txt1
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/util/bitutils_test.cpp193
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_cfg_test.cpp352
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_composites_test.cpp62
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_derivatives_test.cpp40
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_misc_test.cpp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/utils/update_build_version.py4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/.gitignore1
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/README.md7
-rwxr-xr-x3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/install.sh26
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/package.json33
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/spirv.configuration.json6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/spirv.json212
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/spirv.json.tmpl67
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/src/grammar/grammar.go75
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/src/tools/gen-grammar.go167
-rw-r--r--3rdparty/bgfx/README.md13
-rw-r--r--3rdparty/bgfx/bindings/cs/bgfx.cs11
-rw-r--r--3rdparty/bgfx/bindings/d/funcs.d4299
-rw-r--r--3rdparty/bgfx/bindings/d/types.d1028
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry.cpp3
-rw-r--r--3rdparty/bgfx/examples/common/example-glue.cpp10
-rw-r--r--3rdparty/bgfx/examples/common/shaderlib.sh65
-rw-r--r--3rdparty/bgfx/include/bgfx/bgfx.h6
-rw-r--r--3rdparty/bgfx/include/bgfx/c99/bgfx.h15
-rw-r--r--3rdparty/bgfx/include/bgfx/defines.h12
-rw-r--r--3rdparty/bgfx/scripts/bgfx.idl292
-rw-r--r--3rdparty/bgfx/scripts/bindings-cs.lua1
-rw-r--r--3rdparty/bgfx/scripts/bindings-d.lua414
-rw-r--r--3rdparty/bgfx/scripts/genie.lua4
-rw-r--r--3rdparty/bgfx/scripts/temp.bgfx.h9
-rw-r--r--3rdparty/bgfx/scripts/temp.bgfx.idl.inl6
-rw-r--r--3rdparty/bgfx/scripts/temp.defines.h9
-rw-r--r--3rdparty/bgfx/src/bgfx.cpp38
-rw-r--r--3rdparty/bgfx/src/bgfx.idl.inl6
-rw-r--r--3rdparty/bgfx/src/bgfx_p.h2
-rw-r--r--3rdparty/bgfx/src/bgfx_shader.sh30
-rw-r--r--3rdparty/bgfx/src/config.h4
-rw-r--r--3rdparty/bgfx/src/renderer.h7
-rw-r--r--3rdparty/bgfx/src/renderer_d3d11.cpp3
-rw-r--r--3rdparty/bgfx/src/renderer_d3d12.cpp4
-rw-r--r--3rdparty/bgfx/src/renderer_d3d9.cpp8
-rw-r--r--3rdparty/bgfx/src/renderer_gl.cpp217
-rw-r--r--3rdparty/bgfx/src/renderer_gl.h8
-rw-r--r--3rdparty/bgfx/src/renderer_mtl.mm14
-rw-r--r--3rdparty/bgfx/src/renderer_vk.cpp26
-rw-r--r--3rdparty/bimg/3rdparty/tinyexr/tinyexr.h227
-rw-r--r--3rdparty/bimg/src/bimg_p.h2
-rw-r--r--3rdparty/bx/include/bx/inline/math.inl13
-rw-r--r--3rdparty/bx/include/bx/math.h7
-rw-r--r--3rdparty/bx/include/bx/platform.h7
-rw-r--r--3rdparty/bx/scripts/toolchain.lua1
-rw-r--r--3rdparty/bx/src/mutex.cpp1
-rw-r--r--3rdparty/bx/src/thread.cpp1
-rw-r--r--3rdparty/bx/tests/math_test.cpp27
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/fs_chroma.binbin1556 -> 1560 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/fs_color.binbin751 -> 755 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/fs_deconverge.binbin674 -> 678 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/fs_defocus.binbin1294 -> 1298 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/fs_distortion.binbin4218 -> 4222 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/fs_ntsc_decode.binbin3712 -> 3716 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/fs_ntsc_encode.binbin1729 -> 1733 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/fs_phosphor.binbin636 -> 640 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/fs_post.binbin2635 -> 2639 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/fs_prescale.binbin398 -> 402 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/fs_scanline.binbin2091 -> 2095 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/vs_chroma.binbin577 -> 581 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/vs_color.binbin577 -> 581 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/vs_deconverge.binbin1338 -> 1342 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/vs_defocus.binbin577 -> 581 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/vs_distortion.binbin577 -> 581 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/vs_ntsc_decode.binbin577 -> 581 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/vs_ntsc_encode.binbin577 -> 581 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/vs_phosphor.binbin577 -> 581 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/vs_post.binbin577 -> 581 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/vs_prescale.binbin577 -> 581 bytes
-rw-r--r--bgfx/shaders/dx11/chains/hlsl/vs_scanline.binbin577 -> 581 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/fs_chroma.binbin1029 -> 1033 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/fs_color.binbin684 -> 688 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/fs_deconverge.binbin351 -> 355 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/fs_defocus.binbin791 -> 795 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/fs_distortion.binbin3147 -> 3151 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/fs_ntsc_decode.binbin4249 -> 4253 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/fs_ntsc_encode.binbin1750 -> 1754 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/fs_phosphor.binbin473 -> 477 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/fs_post.binbin2368 -> 2372 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/fs_prescale.binbin231 -> 235 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/fs_scanline.binbin2024 -> 2028 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/vs_chroma.binbin320 -> 324 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/vs_color.binbin320 -> 324 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/vs_deconverge.binbin1061 -> 1065 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/vs_defocus.binbin320 -> 324 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/vs_distortion.binbin320 -> 324 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/vs_ntsc_decode.binbin320 -> 324 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/vs_ntsc_encode.binbin320 -> 324 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/vs_phosphor.binbin320 -> 324 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/vs_post.binbin320 -> 324 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/vs_prescale.binbin320 -> 324 bytes
-rw-r--r--bgfx/shaders/dx9/chains/hlsl/vs_scanline.binbin320 -> 324 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/fs_chroma.binbin1697 -> 1886 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_chroma.binbin2183 -> 1551 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_color.binbin1215 -> 1219 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_deconverge.binbin918 -> 827 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_defocus.binbin1734 -> 1761 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_distortion.binbin6171 -> 4220 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_ntsc_decode.binbin6781 -> 4043 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_ntsc_encode.binbin3177 -> 2876 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_phosphor.binbin1069 -> 926 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_post.binbin4141 -> 4626 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_prescale.binbin574 -> 597 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_scanline.binbin3206 -> 2774 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/vs_chroma.binbin765 -> 831 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/vs_color.binbin765 -> 831 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/vs_deconverge.binbin1628 -> 2032 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/vs_defocus.binbin765 -> 831 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/vs_distortion.binbin765 -> 831 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/vs_ntsc_decode.binbin765 -> 831 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/vs_ntsc_encode.binbin765 -> 831 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/vs_phosphor.binbin765 -> 831 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/vs_post.binbin765 -> 831 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/vs_prescale.binbin765 -> 831 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/vs_scanline.binbin765 -> 831 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_chroma.binbin2972 -> 2972 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_color.binbin2363 -> 2363 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_deconverge.binbin1290 -> 1290 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_defocus.binbin2370 -> 2370 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_distortion.binbin7426 -> 7426 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_ntsc_decode.binbin7196 -> 7196 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_ntsc_encode.binbin3701 -> 3701 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_phosphor.binbin1856 -> 1856 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_post.binbin7539 -> 7539 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_prescale.binbin884 -> 884 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_scanline.binbin5175 -> 5155 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_chroma.binbin1305 -> 1305 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_color.binbin1305 -> 1305 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_deconverge.binbin3314 -> 3314 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_defocus.binbin1305 -> 1305 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_distortion.binbin1305 -> 1305 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.binbin1305 -> 1305 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.binbin1305 -> 1305 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_phosphor.binbin1305 -> 1305 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_post.binbin1305 -> 1305 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_prescale.binbin1305 -> 1305 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_scanline.binbin1305 -> 1305 bytes
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc16
-rw-r--r--src/osd/modules/render/bgfx/shaders/shader.mk8
1391 files changed, 78045 insertions, 11748 deletions
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp
index b0e823515c3..32b88a9657e 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp
@@ -5,8 +5,8 @@
// Newcomers, read 'Programmer guide' below for notes on how to setup Dear ImGui in your codebase.
// Get latest version at https://github.com/ocornut/imgui
// Releases change-log at https://github.com/ocornut/imgui/releases
-// Technical Support for Getting Started https://discourse.dearimgui.org/c/getting-started
-// Gallery (please post your screenshots/video there!): https://github.com/ocornut/imgui/issues/2529
+// Technical Support for Getting Started https://github.com/ocornut/imgui/wiki
+// Gallery (please post your screenshots/video there!): https://github.com/ocornut/imgui/issues/2847
// Developed by Omar Cornut and every direct or indirect contributors to the GitHub.
// See LICENSE.txt for copyright and licensing details (standard MIT License).
@@ -28,7 +28,7 @@ DOCUMENTATION
- MISSION STATEMENT
- END-USER GUIDE
-- PROGRAMMER GUIDE (read me!)
+- PROGRAMMER GUIDE
- Read first.
- How to update to a newer version of Dear ImGui.
- Getting started with integrating Dear ImGui in your code/engine.
@@ -36,26 +36,8 @@ DOCUMENTATION
- This is how a simple rendering function may look like.
- Using gamepad/keyboard navigation controls.
- API BREAKING CHANGES (read me when you update!)
-- FREQUENTLY ASKED QUESTIONS (FAQ), TIPS
- - Where is the documentation?
- - Which version should I get?
- - Who uses Dear ImGui?
- - Why the odd dual naming, "Dear ImGui" vs "ImGui"?
- - How can I tell whether to dispatch mouse/keyboard to imgui or to my application?
- - How can I display an image? What is ImTextureID, how does it works?
- - Why are multiple widgets reacting when I interact with a single one? How can I have
- multiple widgets with the same label or with an empty label? A primer on labels and the ID Stack...
- - How can I use my own math types instead of ImVec2/ImVec4?
- - How can I load a different font than the default?
- - How can I easily use icons in my application?
- - How can I load multiple fonts?
- - How can I display and input non-latin characters such as Chinese, Japanese, Korean, Cyrillic?
- - How can I interact with standard C++ types (such as std::string and std::vector)?
- - How can I use the drawing facilities without a Dear ImGui window? (using ImDrawList API)
- - How can I use Dear ImGui on a platform that doesn't have a mouse or a keyboard? (input share, remoting, gamepad)
- - I integrated Dear ImGui in my engine and the text or lines are blurry..
- - I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around..
- - How can I help?
+- FREQUENTLY ASKED QUESTIONS (FAQ)
+ - Read all answers online: https://www.dearimgui.org/faq, or in docs/FAQ.md (with a Markdown viewer)
CODE
(search for "[SECTION]" in the code to find them)
@@ -137,7 +119,7 @@ CODE
READ FIRST:
- - Read the FAQ below this section!
+ - Remember to read the FAQ (https://www.dearimgui.org/faq)
- Your code creates the UI, if your code doesn't run the UI is gone! The UI can be highly dynamic, there are no construction
or destruction steps, less superfluous data retention on your side, less state duplication, less state synchronization, less bugs.
- Call and read ImGui::ShowDemoWindow() for demo code demonstrating most features.
@@ -234,7 +216,7 @@ CODE
// At this point you've got the texture data and you need to upload that your your graphic system:
// After we have created the texture, store its pointer/identifier (_in whichever format your engine uses_) in 'io.Fonts->TexID'.
- // This will be passed back to your via the renderer. Basically ImTextureID == void*. Read FAQ below for details about ImTextureID.
+ // This will be passed back to your via the renderer. Basically ImTextureID == void*. Read FAQ for details about ImTextureID.
MyTexture* texture = MyEngine::CreateTextureFromMemoryPixels(pixels, width, height, TEXTURE_TYPE_RGBA32)
io.Fonts->TexID = (void*)texture;
@@ -320,8 +302,8 @@ CODE
- The examples/ folders contains many actual implementation of the pseudo-codes above.
- When calling NewFrame(), the 'io.WantCaptureMouse', 'io.WantCaptureKeyboard' and 'io.WantTextInput' flags are updated.
They tell you if Dear ImGui intends to use your inputs. When a flag is set you want to hide the corresponding inputs from the
- rest of your application. In every cases you need to pass on the inputs to Dear ImGui. Refer to the FAQ for more information.
- - Please read the FAQ below!. Amusingly, it is called a FAQ because people frequently run into the same issues!
+ rest of your application. In every cases you need to pass on the inputs to Dear ImGui.
+ - Refer to the FAQ for more information. Amusingly, it is called a FAQ because people frequently run into the same issues!
USING GAMEPAD/KEYBOARD NAVIGATION CONTROLS
@@ -369,9 +351,14 @@ CODE
When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files.
You can read releases logs https://github.com/ocornut/imgui/releases for more details.
+ - 2019/10/22 (1.74) - removed redirecting functions/enums that were marked obsolete in 1.52 (October 2017): Begin() (5 arguments signature), IsRootWindowOrAnyChildHovered(), AlignFirstTextHeightToWidgets(), SetNextWindowPosCenter(), ImFont::Glyph. Grep this log for details and new names, or see how they were implemented until 1.73.
+ - 2019/10/14 (1.74) - inputs: Fixed a miscalculation in the keyboard/mouse "typematic" repeat delay/rate calculation, used by keys and e.g. repeating mouse buttons as well as the GetKeyPressedAmount() function.
+ if you were using a non-default value for io.KeyRepeatRate (previous default was 0.250), you can add +io.KeyRepeatDelay to it to compensate for the fix.
+ The function was triggering on: 0.0 and (delay+rate*N) where (N>=1). Fixed formula responds to (N>=0). Effectively it made io.KeyRepeatRate behave like it was set to (io.KeyRepeatRate + io.KeyRepeatDelay).
+ If you never altered io.KeyRepeatRate nor used GetKeyPressedAmount() this won't affect you.
- 2019/07/15 (1.72) - removed TreeAdvanceToLabelPos() which is rarely used and only does SetCursorPosX(GetCursorPosX() + GetTreeNodeToLabelSpacing()). Kept redirection function (will obsolete).
- 2019/07/12 (1.72) - renamed ImFontAtlas::CustomRect to ImFontAtlasCustomRect. Kept redirection typedef (will obsolete).
- - 2019/06/14 (1.72) - removed redirecting functions/enums names that were marked obsolete in 1.51 (June 2017): ImGuiCol_Column*, ImGuiSetCond_*, IsItemHoveredRect(), IsPosHoveringAnyWindow(), IsMouseHoveringAnyWindow(), IsMouseHoveringWindow(), IMGUI_ONCE_UPON_A_FRAME. Grep this log for details and new names.
+ - 2019/06/14 (1.72) - removed redirecting functions/enums names that were marked obsolete in 1.51 (June 2017): ImGuiCol_Column*, ImGuiSetCond_*, IsItemHoveredRect(), IsPosHoveringAnyWindow(), IsMouseHoveringAnyWindow(), IsMouseHoveringWindow(), IMGUI_ONCE_UPON_A_FRAME. Grep this log for details and new names, or see how they were implemented until 1.71.
- 2019/06/07 (1.71) - rendering of child window outer decorations (bg color, border, scrollbars) is now performed as part of the parent window. If you have
overlapping child windows in a same parent, and relied on their relative z-order to be mapped to their submission order, this will affect your rendering.
This optimization is disabled if the parent window has no visual output, because it appears to be the most common situation leading to the creation of overlapping child windows.
@@ -569,8 +556,14 @@ CODE
- 2014/08/28 (1.09) - changed the behavior of IO.PixelCenterOffset following various rendering fixes
- FREQUENTLY ASKED QUESTIONS (FAQ), TIPS
- ======================================
+ FREQUENTLY ASKED QUESTIONS (FAQ)
+ ================================
+
+ Read all answers online: https://www.dearimgui.org/faq, or in docs/FAQ.md (with a Markdown viewer)
+ Some answers are copied down here to facilitate searching in code.
+
+ Q&A: Basics
+ ===========
Q: Where is the documentation?
A: This library is poorly documented at the moment and expects of the user to be acquainted with C/C++.
@@ -584,26 +577,20 @@ CODE
associated to it.
Q: Which version should I get?
- A: I occasionally tag Releases (https://github.com/ocornut/imgui/releases) but it is generally safe
- and recommended to sync to master/latest. The library is fairly stable and regressions tend to be
- fixed fast when reported. You may also peak at the 'docking' branch which includes:
- - Docking/Merging features (https://github.com/ocornut/imgui/issues/2109)
- - Multi-viewport features (https://github.com/ocornut/imgui/issues/1542)
- Many projects are using this branch and it is kept in sync with master regularly.
+ Q: Why the names "Dear ImGui" vs "ImGui"?
+ >> See https://www.dearimgui.org/faq
+
+ Q&A: Concerns
+ =============
Q: Who uses Dear ImGui?
- A: See "Quotes" (https://github.com/ocornut/imgui/wiki/Quotes) and
- "Software using Dear ImGui" (https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui) Wiki pages
- for a list of games/software which are publicly known to use dear imgui. Please add yours if you can!
-
- Q: Why the odd dual naming, "Dear ImGui" vs "ImGui"?
- A: The library started its life as "ImGui" due to the fact that I didn't give it a proper name when
- when I released 1.0, and had no particular expectation that it would take off. However, the term IMGUI
- (immediate-mode graphical user interface) was coined before and is being used in variety of other
- situations (e.g. Unity uses it own implementation of the IMGUI paradigm).
- To reduce the ambiguity without affecting existing code bases, I have decided on an alternate,
- longer name "Dear ImGui" that people can use to refer to this specific library.
- Please try to refer to this library as "Dear ImGui".
+ Q: Can you create elaborate/serious tools with Dear ImGui?
+ Q: Can you reskin the look of Dear ImGui?
+ Q: Why using C++ (as opposed to C)?
+ >> See https://www.dearimgui.org/faq
+
+ Q&A: Integration
+ ================
Q: How can I tell whether to dispatch mouse/keyboard to Dear ImGui or to my application?
A: You can read the 'io.WantCaptureMouse', 'io.WantCaptureKeyboard' and 'io.WantTextInput' flags from the ImGuiIO structure (e.g. if (ImGui::GetIO().WantCaptureMouse) { ... } )
@@ -620,75 +607,13 @@ CODE
have 'io.WantCaptureKeyboard=false'. Depending on your application logic it may or not be inconvenient. You might want to track which key-downs
were targeted for Dear ImGui, e.g. with an array of bool, and filter out the corresponding key-ups.)
- Q: How can I display an image? What is ImTextureID, how does it works?
- A: Short explanation:
- - Please read Wiki entry for examples: https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
- - You may use functions such as ImGui::Image(), ImGui::ImageButton() or lower-level ImDrawList::AddImage() to emit draw calls that will use your own textures.
- - Actual textures are identified in a way that is up to the user/engine. Those identifiers are stored and passed as ImTextureID (void*) value.
- - Loading image files from the disk and turning them into a texture is not within the scope of Dear ImGui (for a good reason).
- Please read documentations or tutorials on your graphics API to understand how to display textures on the screen before moving onward.
-
- Long explanation:
- - Dear ImGui's job is to create "meshes", defined in a renderer-agnostic format made of draw commands and vertices.
- At the end of the frame those meshes (ImDrawList) will be displayed by your rendering function. They are made up of textured polygons and the code
- to render them is generally fairly short (a few dozen lines). In the examples/ folder we provide functions for popular graphics API (OpenGL, DirectX, etc.).
- - Each rendering function decides on a data type to represent "textures". The concept of what is a "texture" is entirely tied to your underlying engine/graphics API.
- We carry the information to identify a "texture" in the ImTextureID type.
- ImTextureID is nothing more that a void*, aka 4/8 bytes worth of data: just enough to store 1 pointer or 1 integer of your choice.
- Dear ImGui doesn't know or understand what you are storing in ImTextureID, it merely pass ImTextureID values until they reach your rendering function.
- - In the examples/ bindings, for each graphics API binding we decided on a type that is likely to be a good representation for specifying
- an image from the end-user perspective. This is what the _examples_ rendering functions are using:
-
- OpenGL: ImTextureID = GLuint (see ImGui_ImplOpenGL3_RenderDrawData() function in imgui_impl_opengl3.cpp)
- DirectX9: ImTextureID = LPDIRECT3DTEXTURE9 (see ImGui_ImplDX9_RenderDrawData() function in imgui_impl_dx9.cpp)
- DirectX11: ImTextureID = ID3D11ShaderResourceView* (see ImGui_ImplDX11_RenderDrawData() function in imgui_impl_dx11.cpp)
- DirectX12: ImTextureID = D3D12_GPU_DESCRIPTOR_HANDLE (see ImGui_ImplDX12_RenderDrawData() function in imgui_impl_dx12.cpp)
-
- For example, in the OpenGL example binding we store raw OpenGL texture identifier (GLuint) inside ImTextureID.
- Whereas in the DirectX11 example binding we store a pointer to ID3D11ShaderResourceView inside ImTextureID, which is a higher-level structure
- tying together both the texture and information about its format and how to read it.
- - If you have a custom engine built over e.g. OpenGL, instead of passing GLuint around you may decide to use a high-level data type to carry information about
- the texture as well as how to display it (shaders, etc.). The decision of what to use as ImTextureID can always be made better knowing how your codebase
- is designed. If your engine has high-level data types for "textures" and "material" then you may want to use them.
- If you are starting with OpenGL or DirectX or Vulkan and haven't built much of a rendering engine over them, keeping the default ImTextureID
- representation suggested by the example bindings is probably the best choice.
- (Advanced users may also decide to keep a low-level type in ImTextureID, and use ImDrawList callback and pass information to their renderer)
-
- User code may do:
-
- // Cast our texture type to ImTextureID / void*
- MyTexture* texture = g_CoffeeTableTexture;
- ImGui::Image((void*)texture, ImVec2(texture->Width, texture->Height));
-
- The renderer function called after ImGui::Render() will receive that same value that the user code passed:
-
- // Cast ImTextureID / void* stored in the draw command as our texture type
- MyTexture* texture = (MyTexture*)pcmd->TextureId;
- MyEngineBindTexture2D(texture);
-
- Once you understand this design you will understand that loading image files and turning them into displayable textures is not within the scope of Dear ImGui.
- This is by design and is actually a good thing, because it means your code has full control over your data types and how you display them.
- If you want to display an image file (e.g. PNG file) into the screen, please refer to documentation and tutorials for the graphics API you are using.
-
- Refer to the Wiki to find simplified examples for loading textures with OpenGL, DirectX9 and DirectX11:
-
- https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
-
- C/C++ tip: a void* is pointer-sized storage. You may safely store any pointer or integer into it by casting your value to ImTextureID / void*, and vice-versa.
- Because both end-points (user code and rendering function) are under your control, you know exactly what is stored inside the ImTextureID / void*.
- Examples:
-
- GLuint my_tex = XXX;
- void* my_void_ptr;
- my_void_ptr = (void*)(intptr_t)my_tex; // cast a GLuint into a void* (we don't take its address! we literally store the value inside the pointer)
- my_tex = (GLuint)(intptr_t)my_void_ptr; // cast a void* into a GLuint
-
- ID3D11ShaderResourceView* my_dx11_srv = XXX;
- void* my_void_ptr;
- my_void_ptr = (void*)my_dx11_srv; // cast a ID3D11ShaderResourceView* into an opaque void*
- my_dx11_srv = (ID3D11ShaderResourceView*)my_void_ptr; // cast a void* into a ID3D11ShaderResourceView*
-
- Finally, you may call ImGui::ShowMetricsWindow() to explore/visualize/understand how the ImDrawList are generated.
+ Q: How can I use this without a mouse, without a keyboard or without a screen? (gamepad, input share, remote display)
+ Q: I integrated Dear ImGui in my engine and the text or lines are blurry..
+ Q: I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around..
+ >> See https://www.dearimgui.org/faq
+
+ Q&A: Usage
+ ----------
Q: Why are multiple widgets reacting when I interact with a single one?
Q: How can I have multiple widgets with the same label or with an empty label?
@@ -806,141 +731,25 @@ CODE
e.g. when displaying a list of objects, using indices or pointers as ID will preserve the
node open/closed state differently. See what makes more sense in your situation!
+ Q: How can I display an image? What is ImTextureID, how does it works?
+ >> See https://www.dearimgui.org/faq and https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
+
Q: How can I use my own math types instead of ImVec2/ImVec4?
- A: You can edit imconfig.h and setup the IM_VEC2_CLASS_EXTRA/IM_VEC4_CLASS_EXTRA macros to add implicit type conversions.
- This way you'll be able to use your own types everywhere, e.g. passing glm::vec2 to ImGui functions instead of ImVec2.
+ Q: How can I interact with standard C++ types (such as std::string and std::vector)?
+ Q: How can I display custom shapes? (using low-level ImDrawList API)
+ >> See https://www.dearimgui.org/faq
- Q: How can I load a different font than the default?
- A: Use the font atlas to load the TTF/OTF file you want:
- ImGuiIO& io = ImGui::GetIO();
- io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels);
- io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
- Default is ProggyClean.ttf, monospace, rendered at size 13, embedded in dear imgui's source code.
- (Tip: monospace fonts are convenient because they allow to facilitate horizontal alignment directly at the string level.)
- (Read the 'misc/fonts/README.txt' file for more details about font loading.)
-
- New programmers: remember that in C/C++ and most programming languages if you want to use a
- backslash \ within a string literal, you need to write it double backslash "\\":
- io.Fonts->AddFontFromFileTTF("MyDataFolder\MyFontFile.ttf", size_in_pixels); // WRONG (you are escape the M here!)
- io.Fonts->AddFontFromFileTTF("MyDataFolder\\MyFontFile.ttf", size_in_pixels); // CORRECT
- io.Fonts->AddFontFromFileTTF("MyDataFolder/MyFontFile.ttf", size_in_pixels); // ALSO CORRECT
+ Q&A: Fonts, Text
+ ================
+ Q: How can I load a different font than the default?
Q: How can I easily use icons in my application?
- A: The most convenient and practical way is to merge an icon font such as FontAwesome inside you
- main font. Then you can refer to icons within your strings.
- You may want to see ImFontConfig::GlyphMinAdvanceX to make your icon look monospace to facilitate alignment.
- (Read the 'misc/fonts/README.txt' file for more details about icons font loading.)
- With some extra effort, you may use colorful icon by registering custom rectangle space inside the font atlas,
- and copying your own graphics data into it. See misc/fonts/README.txt about using the AddCustomRectFontGlyph API.
-
Q: How can I load multiple fonts?
- A: Use the font atlas to pack them into a single texture:
- (Read the 'misc/fonts/README.txt' file and the code in ImFontAtlas for more details.)
-
- ImGuiIO& io = ImGui::GetIO();
- ImFont* font0 = io.Fonts->AddFontDefault();
- ImFont* font1 = io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels);
- ImFont* font2 = io.Fonts->AddFontFromFileTTF("myfontfile2.ttf", size_in_pixels);
- io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
- // the first loaded font gets used by default
- // use ImGui::PushFont()/ImGui::PopFont() to change the font at runtime
-
- // Options
- ImFontConfig config;
- config.OversampleH = 2;
- config.OversampleV = 1;
- config.GlyphOffset.y -= 1.0f; // Move everything by 1 pixels up
- config.GlyphExtraSpacing.x = 1.0f; // Increase spacing between characters
- io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_pixels, &config);
-
- // Combine multiple fonts into one (e.g. for icon fonts)
- static ImWchar ranges[] = { 0xf000, 0xf3ff, 0 };
- ImFontConfig config;
- config.MergeMode = true;
- io.Fonts->AddFontDefault();
- io.Fonts->AddFontFromFileTTF("fontawesome-webfont.ttf", 16.0f, &config, ranges); // Merge icon font
- io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_pixels, NULL, &config, io.Fonts->GetGlyphRangesJapanese()); // Merge japanese glyphs
-
Q: How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic?
- A: When loading a font, pass custom Unicode ranges to specify the glyphs to load.
-
- // Add default Japanese ranges
- io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels, NULL, io.Fonts->GetGlyphRangesJapanese());
-
- // Or create your own custom ranges (e.g. for a game you can feed your entire game script and only build the characters the game need)
- ImVector<ImWchar> ranges;
- ImFontGlyphRangesBuilder builder;
- builder.AddText("Hello world"); // Add a string (here "Hello world" contains 7 unique characters)
- builder.AddChar(0x7262); // Add a specific character
- builder.AddRanges(io.Fonts->GetGlyphRangesJapanese()); // Add one of the default ranges
- builder.BuildRanges(&ranges); // Build the final result (ordered ranges with all the unique characters submitted)
- io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels, NULL, ranges.Data);
-
- All your strings needs to use UTF-8 encoding. In C++11 you can encode a string literal in UTF-8
- by using the u8"hello" syntax. Specifying literal in your source code using a local code page
- (such as CP-923 for Japanese or CP-1251 for Cyrillic) will NOT work!
- Otherwise you can convert yourself to UTF-8 or load text data from file already saved as UTF-8.
-
- Text input: it is up to your application to pass the right character code by calling io.AddInputCharacter().
- The applications in examples/ are doing that.
- Windows: you can use the WM_CHAR or WM_UNICHAR or WM_IME_CHAR message (depending if your app is built using Unicode or MultiByte mode).
- You may also use MultiByteToWideChar() or ToUnicode() to retrieve Unicode codepoints from MultiByte characters or keyboard state.
- Windows: if your language is relying on an Input Method Editor (IME), you copy the HWND of your window to io.ImeWindowHandle in order for
- the default implementation of io.ImeSetInputScreenPosFn() to set your Microsoft IME position correctly.
+ >> See https://www.dearimgui.org/faq and misc/fonts/README.txt
- Q: How can I interact with standard C++ types (such as std::string and std::vector)?
- A: - Being highly portable (bindings for several languages, frameworks, programming style, obscure or older platforms/compilers),
- and aiming for compatibility & performance suitable for every modern real-time game engines, dear imgui does not use
- any of std C++ types. We use raw types (e.g. char* instead of std::string) because they adapt to more use cases.
- - To use ImGui::InputText() with a std::string or any resizable string class, see misc/cpp/imgui_stdlib.h.
- - To use combo boxes and list boxes with std::vector or any other data structure: the BeginCombo()/EndCombo() API
- lets you iterate and submit items yourself, so does the ListBoxHeader()/ListBoxFooter() API.
- Prefer using them over the old and awkward Combo()/ListBox() api.
- - Generally for most high-level types you should be able to access the underlying data type.
- You may write your own one-liner wrappers to facilitate user code (tip: add new functions in ImGui:: namespace from your code).
- - Dear ImGui applications often need to make intensive use of strings. It is expected that many of the strings you will pass
- to the API are raw literals (free in C/C++) or allocated in a manner that won't incur a large cost on your application.
- Please bear in mind that using std::string on applications with large amount of UI may incur unsatisfactory performances.
- Modern implementations of std::string often include small-string optimization (which is often a local buffer) but those
- are not configurable and not the same across implementations.
- - If you are finding your UI traversal cost to be too large, make sure your string usage is not leading to excessive amount
- of heap allocations. Consider using literals, statically sized buffers and your own helper functions. A common pattern
- is that you will need to build lots of strings on the fly, and their maximum length can be easily be scoped ahead.
- One possible implementation of a helper to facilitate printf-style building of strings: https://github.com/ocornut/Str
- This is a small helper where you can instance strings with configurable local buffers length. Many game engines will
- provide similar or better string helpers.
-
- Q: How can I use the drawing facilities without an ImGui window? (using ImDrawList API)
- A: - You can create a dummy window. Call Begin() with the NoBackground | NoDecoration | NoSavedSettings | NoInputs flags.
- (The ImGuiWindowFlags_NoDecoration flag itself is a shortcut for NoTitleBar | NoResize | NoScrollbar | NoCollapse)
- Then you can retrieve the ImDrawList* via GetWindowDrawList() and draw to it in any way you like.
- - You can call ImGui::GetBackgroundDrawList() or ImGui::GetForegroundDrawList() and use those draw list to display
- contents behind or over every other imgui windows (one bg/fg drawlist per viewport).
- - You can create your own ImDrawList instance. You'll need to initialize them ImGui::GetDrawListSharedData(), or create
- your own ImDrawListSharedData, and then call your rendered code with your own ImDrawList or ImDrawData data.
-
- Q: How can I use this without a mouse, without a keyboard or without a screen? (gamepad, input share, remote display)
- A: - You can control Dear ImGui with a gamepad. Read about navigation in "Using gamepad/keyboard navigation controls".
- (short version: map gamepad inputs into the io.NavInputs[] array + set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad)
- - You can share your computer mouse seamlessly with your console/tablet/phone using Synergy (https://symless.com/synergy)
- This is the preferred solution for developer productivity.
- In particular, the "micro-synergy-client" repository (https://github.com/symless/micro-synergy-client) has simple
- and portable source code (uSynergy.c/.h) for a small embeddable client that you can use on any platform to connect
- to your host computer, based on the Synergy 1.x protocol. Make sure you download the Synergy 1 server on your computer.
- Console SDK also sometimes provide equivalent tooling or wrapper for Synergy-like protocols.
- - You may also use a third party solution such as Remote ImGui (https://github.com/JordiRos/remoteimgui) which sends
- the vertices to render over the local network, allowing you to use Dear ImGui even on a screen-less machine.
- - For touch inputs, you can increase the hit box of widgets (via the style.TouchPadding setting) to accommodate
- for the lack of precision of touch inputs, but it is recommended you use a mouse or gamepad to allow optimizing
- for screen real-estate and precision.
-
- Q: I integrated Dear ImGui in my engine and the text or lines are blurry..
- A: In your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f).
- Also make sure your orthographic projection matrix and io.DisplaySize matches your actual framebuffer dimension.
-
- Q: I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around..
- A: You are probably mishandling the clipping rectangles in your render function.
- Rectangles provided by ImGui are defined as (x1=left,y1=top,x2=right,y2=bottom) and NOT as (x1,y1,width,height).
+ Q&A: Community
+ ==============
Q: How can I help?
A: - If you are experienced with Dear ImGui and C++, look at the github issues, look at the Wiki, read docs/TODO.txt
@@ -948,18 +757,10 @@ CODE
- Businesses: convince your company to fund development via support contracts/sponsoring! This is among the most useful thing you can do for dear imgui.
- Individuals: you can also become a Patron (http://www.patreon.com/imgui) or donate on PayPal! See README.
- Disclose your usage of dear imgui via a dev blog post, a tweet, a screenshot, a mention somewhere etc.
- You may post screenshot or links in the gallery threads (github.com/ocornut/imgui/issues/1902). Visuals are ideal as they inspire other programmers.
+ You may post screenshot or links in the gallery threads (github.com/ocornut/imgui/issues/2847). Visuals are ideal as they inspire other programmers.
But even without visuals, disclosing your use of dear imgui help the library grow credibility, and help other teams and programmers with taking decisions.
- If you have issues or if you need to hack into the library, even if you don't expect any support it is useful that you share your issues (on github or privately).
- - tip: you can call Begin() multiple times with the same name during the same frame, it will keep appending to the same window.
- this is also useful to set yourself in the context of another window (to get/set other settings)
- - tip: you can create widgets without a Begin()/End() block, they will go in an implicit window called "Debug".
- - tip: the ImGuiOnceUponAFrame helper will allow run the block of code only once a frame. You can use it to quickly add custom UI in the middle
- of a deep nested inner loop in your code.
- - tip: you can call Render() multiple times (e.g for VR renders).
- - tip: call and read the ShowDemoWindow() code in imgui_demo.cpp for more example of how to use ImGui!
-
*/
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
@@ -1211,7 +1012,7 @@ ImGuiIO::ImGuiIO()
MouseDoubleClickMaxDist = 6.0f;
for (int i = 0; i < ImGuiKey_COUNT; i++)
KeyMap[i] = -1;
- KeyRepeatDelay = 0.250f;
+ KeyRepeatDelay = 0.275f;
KeyRepeatRate = 0.050f;
UserData = NULL;
@@ -1564,7 +1365,7 @@ ImU32 ImHashStr(const char* data_p, size_t data_size, ImU32 seed)
FILE* ImFileOpen(const char* filename, const char* mode)
{
-#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__GNUC__)
+#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(__CYGWIN__) && !defined(__GNUC__)
// We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames. Converting both strings from UTF-8 to wchar format (using a single allocation, because we can)
const int filename_wsize = ImTextCountCharsFromUtf8(filename, NULL) + 1;
const int mode_wsize = ImTextCountCharsFromUtf8(mode, NULL) + 1;
@@ -2509,7 +2310,7 @@ void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, con
float ellipsis_glyph_width = glyph->X1; // Width of the glyph with no padding on either side
float ellipsis_total_width = ellipsis_glyph_width; // Full width of entire ellipsis
-
+
if (ellipsis_char_count > 1)
{
// Full ellipsis size without free spacing after it.
@@ -2517,7 +2318,7 @@ void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, con
ellipsis_glyph_width = glyph->X1 - glyph->X0 + spacing_between_dots;
ellipsis_total_width = ellipsis_glyph_width * (float)ellipsis_char_count - spacing_between_dots;
}
-
+
// We can now claim the space between pos_max.x and ellipsis_max.x
const float text_avail_width = ImMax((ImMax(pos_max.x, ellipsis_max_x) - ellipsis_total_width) - pos_min.x, 1.0f);
float text_size_clipped_x = font->CalcTextSizeA(font_size, text_avail_width, 0.0f, text, text_end_full, &text_end_ellipsis).x;
@@ -2978,13 +2779,18 @@ void ImGui::ItemSize(const ImVec2& size, float text_baseline_y)
if (window->SkipItems)
return;
+ // We increase the height in this function to accommodate for baseline offset.
+ // In theory we should be offsetting the starting position (window->DC.CursorPos), that will be the topic of a larger refactor,
+ // but since ItemSize() is not yet an API that moves the cursor (to handle e.g. wrapping) enlarging the height has the same effect.
+ const float offset_to_match_baseline_y = (text_baseline_y >= 0) ? ImMax(0.0f, window->DC.CurrLineTextBaseOffset - text_baseline_y) : 0.0f;
+ const float line_height = ImMax(window->DC.CurrLineSize.y, size.y + offset_to_match_baseline_y);
+
// Always align ourselves on pixel boundaries
- const float line_height = ImMax(window->DC.CurrLineSize.y, size.y);
//if (g.IO.KeyAlt) window->DrawList->AddRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(size.x, line_height), IM_COL32(255,0,0,200)); // [DEBUG]
window->DC.CursorPosPrevLine.x = window->DC.CursorPos.x + size.x;
window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y;
- window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); // Next line
- window->DC.CursorPos.y = (float)(int)(window->DC.CursorPos.y + line_height + g.Style.ItemSpacing.y); // Next line
+ window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x); // Next line
+ window->DC.CursorPos.y = IM_FLOOR(window->DC.CursorPos.y + line_height + g.Style.ItemSpacing.y); // Next line
window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x);
window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y - g.Style.ItemSpacing.y);
//if (g.IO.KeyAlt) window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, IM_COL32(255,0,0,255), 4); // [DEBUG]
@@ -4005,8 +3811,7 @@ void ImGui::Shutdown(ImGuiContext* context)
g.PrivateClipboard.clear();
g.InputTextState.ClearFreeMemory();
- for (int i = 0; i < g.SettingsWindows.Size; i++)
- IM_DELETE(g.SettingsWindows[i].Name);
+ g.SettingsWindowsNames.clear();
g.SettingsWindows.clear();
g.SettingsHandlers.clear();
@@ -4305,7 +4110,7 @@ void ImGui::Render()
}
// Calculate text size. Text can be multi-line. Optionally ignore text after a ## marker.
-// CalcTextSize("") should return ImVec2(0.0f, GImGui->FontSize)
+// CalcTextSize("") should return ImVec2(0.0f, g.FontSize)
ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_text_after_double_hash, float wrap_width)
{
ImGuiContext& g = *GImGui;
@@ -4323,7 +4128,7 @@ ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_tex
ImVec2 text_size = font->CalcTextSizeA(font_size, FLT_MAX, wrap_width, text, text_display_end, NULL);
// Round
- text_size.x = (float)(int)(text_size.x + 0.95f);
+ text_size.x = IM_FLOOR(text_size.x + 0.95f);
return text_size;
}
@@ -4407,14 +4212,22 @@ bool ImGui::IsKeyDown(int user_key_index)
return g.IO.KeysDown[user_key_index];
}
-int ImGui::CalcTypematicPressedRepeatAmount(float t, float t_prev, float repeat_delay, float repeat_rate)
+// t0 = previous time (e.g.: g.Time - g.IO.DeltaTime)
+// t1 = current time (e.g.: g.Time)
+// An event is triggered at:
+// t = 0.0f t = repeat_delay, t = repeat_delay + repeat_rate*N
+int ImGui::CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate)
{
- if (t == 0.0f)
+ if (t1 == 0.0f)
return 1;
- if (t <= repeat_delay || repeat_rate <= 0.0f)
+ if (t0 >= t1)
return 0;
- const int count = (int)((t - repeat_delay) / repeat_rate) - (int)((t_prev - repeat_delay) / repeat_rate);
- return (count > 0) ? count : 0;
+ if (repeat_rate <= 0.0f)
+ return (t0 < repeat_delay) && (t1 >= repeat_delay);
+ const int count_t0 = (t0 < repeat_delay) ? -1 : (int)((t0 - repeat_delay) / repeat_rate);
+ const int count_t1 = (t1 < repeat_delay) ? -1 : (int)((t1 - repeat_delay) / repeat_rate);
+ const int count = count_t1 - count_t0;
+ return count;
}
int ImGui::GetKeyPressedAmount(int key_index, float repeat_delay, float repeat_rate)
@@ -4424,7 +4237,7 @@ int ImGui::GetKeyPressedAmount(int key_index, float repeat_delay, float repeat_r
return 0;
IM_ASSERT(key_index >= 0 && key_index < IM_ARRAYSIZE(g.IO.KeysDown));
const float t = g.IO.KeysDownDuration[key_index];
- return CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, repeat_delay, repeat_rate);
+ return CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, repeat_delay, repeat_rate);
}
bool ImGui::IsKeyPressed(int user_key_index, bool repeat)
@@ -4476,7 +4289,7 @@ bool ImGui::IsMouseClicked(int button, bool repeat)
if (repeat && t > g.IO.KeyRepeatDelay)
{
// FIXME: 2019/05/03: Our old repeat code was wrong here and led to doubling the repeat rate, which made it an ok rate for repeat on mouse hold.
- int amount = CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate * 0.5f);
+ int amount = CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate * 0.50f);
if (amount > 0)
return true;
}
@@ -4935,8 +4748,8 @@ static ImVec2 CalcWindowSizeAfterConstraint(ImGuiWindow* window, ImVec2 new_size
g.NextWindowData.SizeCallback(&data);
new_size = data.DesiredSize;
}
- new_size.x = ImFloor(new_size.x);
- new_size.y = ImFloor(new_size.y);
+ new_size.x = IM_FLOOR(new_size.x);
+ new_size.y = IM_FLOOR(new_size.y);
}
// Minimum size
@@ -4957,8 +4770,8 @@ static ImVec2 CalcWindowContentSize(ImGuiWindow* window)
return window->ContentSize;
ImVec2 sz;
- sz.x = (float)(int)((window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : window->DC.CursorMaxPos.x - window->DC.CursorStartPos.x);
- sz.y = (float)(int)((window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : window->DC.CursorMaxPos.y - window->DC.CursorStartPos.y);
+ sz.x = IM_FLOOR((window->ContentSizeExplicit.x != 0.0f) ? window->ContentSizeExplicit.x : window->DC.CursorMaxPos.x - window->DC.CursorStartPos.x);
+ sz.y = IM_FLOOR((window->ContentSizeExplicit.y != 0.0f) ? window->ContentSizeExplicit.y : window->DC.CursorMaxPos.y - window->DC.CursorStartPos.y);
return sz;
}
@@ -5069,8 +4882,8 @@ static bool ImGui::UpdateManualResize(ImGuiWindow* window, const ImVec2& size_au
bool ret_auto_fit = false;
const int resize_border_count = g.IO.ConfigWindowsResizeFromEdges ? 4 : 0;
- const float grip_draw_size = (float)(int)ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f + g.FontSize * 0.2f);
- const float grip_hover_inner_size = (float)(int)(grip_draw_size * 0.75f);
+ const float grip_draw_size = IM_FLOOR(ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f + g.FontSize * 0.2f));
+ const float grip_hover_inner_size = IM_FLOOR(grip_draw_size * 0.75f);
const float grip_hover_outer_size = g.IO.ConfigWindowsResizeFromEdges ? WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS : 0.0f;
ImVec2 pos_target(FLT_MAX, FLT_MAX);
@@ -5378,7 +5191,7 @@ void ImGui::RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& titl
if (flags & ImGuiWindowFlags_UnsavedDocument)
{
ImVec2 marker_pos = ImVec2(ImMax(layout_r.Min.x, layout_r.Min.x + (layout_r.GetWidth() - text_size.x) * style.WindowTitleAlign.x) + text_size.x, layout_r.Min.y) + ImVec2(2 - marker_size_x, 0.0f);
- ImVec2 off = ImVec2(0.0f, (float)(int)(-g.FontSize * 0.25f));
+ ImVec2 off = ImVec2(0.0f, IM_FLOOR(-g.FontSize * 0.25f));
RenderTextClipped(marker_pos + off, layout_r.Max + off, UNSAVED_DOCUMENT_MARKER, NULL, NULL, ImVec2(0, style.WindowTitleAlign.y), &clip_r);
}
}
@@ -5716,9 +5529,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Handle manual resize: Resize Grips, Borders, Gamepad
int border_held = -1;
- ImU32 resize_grip_col[4] = { 0 };
+ ImU32 resize_grip_col[4] = {};
const int resize_grip_count = g.IO.ConfigWindowsResizeFromEdges ? 2 : 1; // 4
- const float resize_grip_draw_size = (float)(int)ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f + g.FontSize * 0.2f);
+ const float resize_grip_draw_size = IM_FLOOR(ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f + g.FontSize * 0.2f));
if (!window->Collapsed)
if (UpdateManualResize(window, size_auto_fit, &border_held, resize_grip_count, &resize_grip_col[0]))
use_current_size_for_scrollbar_x = use_current_size_for_scrollbar_y = true;
@@ -5786,9 +5599,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Default item width. Make it proportional to window size if window manually resizes
if (window->Size.x > 0.0f && !(flags & ImGuiWindowFlags_Tooltip) && !(flags & ImGuiWindowFlags_AlwaysAutoResize))
- window->ItemWidthDefault = (float)(int)(window->Size.x * 0.65f);
+ window->ItemWidthDefault = ImFloor(window->Size.x * 0.65f);
else
- window->ItemWidthDefault = (float)(int)(g.FontSize * 16.0f);
+ window->ItemWidthDefault = ImFloor(g.FontSize * 16.0f);
// SCROLLING
@@ -5877,14 +5690,14 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->WorkRect.Max.x = window->WorkRect.Min.x + work_rect_size_x;
window->WorkRect.Max.y = window->WorkRect.Min.y + work_rect_size_y;
- // [LEGACY] Contents Region
- // FIXME-OBSOLETE: window->ContentsRegionRect.Max is currently very misleading / partly faulty, but some BeginChild() patterns relies on it.
+ // [LEGACY] Content Region
+ // FIXME-OBSOLETE: window->ContentRegionRect.Max is currently very misleading / partly faulty, but some BeginChild() patterns relies on it.
// Used by:
// - Mouse wheel scrolling + many other things
- window->ContentsRegionRect.Min.x = window->Pos.x - window->Scroll.x + window->WindowPadding.x;
- window->ContentsRegionRect.Min.y = window->Pos.y - window->Scroll.y + window->WindowPadding.y + decoration_up_height;
- window->ContentsRegionRect.Max.x = window->ContentsRegionRect.Min.x + (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : (window->Size.x - window->WindowPadding.x * 2.0f - window->ScrollbarSizes.x));
- window->ContentsRegionRect.Max.y = window->ContentsRegionRect.Min.y + (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : (window->Size.y - window->WindowPadding.y * 2.0f - decoration_up_height - window->ScrollbarSizes.y));
+ window->ContentRegionRect.Min.x = window->Pos.x - window->Scroll.x + window->WindowPadding.x;
+ window->ContentRegionRect.Min.y = window->Pos.y - window->Scroll.y + window->WindowPadding.y + decoration_up_height;
+ window->ContentRegionRect.Max.x = window->ContentRegionRect.Min.x + (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : (window->Size.x - window->WindowPadding.x * 2.0f - window->ScrollbarSizes.x));
+ window->ContentRegionRect.Max.y = window->ContentRegionRect.Min.y + (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : (window->Size.y - window->WindowPadding.y * 2.0f - decoration_up_height - window->ScrollbarSizes.y));
// Setup drawing context
// (NB: That term "drawing context / DC" lost its meaning a long time ago. Initially was meant to hold transient data only. Nowadays difference between window-> and window->DC-> is dubious.)
@@ -6008,22 +5821,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
return !skip_items;
}
-// Old Begin() API with 5 parameters, avoid calling this version directly! Use SetNextWindowSize()/SetNextWindowBgAlpha() + Begin() instead.
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
-bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_first_use, float bg_alpha_override, ImGuiWindowFlags flags)
-{
- // Old API feature: we could pass the initial window size as a parameter. This was misleading because it only had an effect if the window didn't have data in the .ini file.
- if (size_first_use.x != 0.0f || size_first_use.y != 0.0f)
- SetNextWindowSize(size_first_use, ImGuiCond_FirstUseEver);
-
- // Old API feature: override the window background alpha with a parameter.
- if (bg_alpha_override >= 0.0f)
- SetNextWindowBgAlpha(bg_alpha_override);
-
- return Begin(name, p_open, flags);
-}
-#endif // IMGUI_DISABLE_OBSOLETE_FUNCTIONS
-
void ImGui::End()
{
ImGuiContext& g = *GImGui;
@@ -6182,8 +5979,8 @@ void ImGui::PushMultiItemsWidths(int components, float w_full)
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
const ImGuiStyle& style = g.Style;
- const float w_item_one = ImMax(1.0f, (float)(int)((w_full - (style.ItemInnerSpacing.x) * (components-1)) / (float)components));
- const float w_item_last = ImMax(1.0f, (float)(int)(w_full - (w_item_one + style.ItemInnerSpacing.x) * (components-1)));
+ const float w_item_one = ImMax(1.0f, IM_FLOOR((w_full - (style.ItemInnerSpacing.x) * (components-1)) / (float)components));
+ const float w_item_last = ImMax(1.0f, IM_FLOOR(w_full - (w_item_one + style.ItemInnerSpacing.x) * (components-1)));
window->DC.ItemWidthStack.push_back(w_item_last);
for (int i = 0; i < components-1; i++)
window->DC.ItemWidthStack.push_back(w_item_one);
@@ -6214,7 +6011,7 @@ float ImGui::CalcItemWidth()
float region_max_x = GetContentRegionMaxAbs().x;
w = ImMax(1.0f, region_max_x - window->DC.CursorPos.x + w);
}
- w = (float)(int)w;
+ w = IM_FLOOR(w);
return w;
}
@@ -6657,7 +6454,7 @@ void ImGui::SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond con
if (size.x > 0.0f)
{
window->AutoFitFramesX = 0;
- window->SizeFull.x = ImFloor(size.x);
+ window->SizeFull.x = IM_FLOOR(size.x);
}
else
{
@@ -6667,7 +6464,7 @@ void ImGui::SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond con
if (size.y > 0.0f)
{
window->AutoFitFramesY = 0;
- window->SizeFull.y = ImFloor(size.y);
+ window->SizeFull.y = IM_FLOOR(size.y);
}
else
{
@@ -6803,7 +6600,7 @@ ImVec2 ImGui::GetContentRegionMax()
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- ImVec2 mx = window->ContentsRegionRect.Max - window->Pos;
+ ImVec2 mx = window->ContentRegionRect.Max - window->Pos;
if (window->DC.CurrentColumns)
mx.x = window->WorkRect.Max.x - window->Pos.x;
return mx;
@@ -6814,7 +6611,7 @@ ImVec2 ImGui::GetContentRegionMaxAbs()
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- ImVec2 mx = window->ContentsRegionRect.Max;
+ ImVec2 mx = window->ContentRegionRect.Max;
if (window->DC.CurrentColumns)
mx.x = window->WorkRect.Max.x;
return mx;
@@ -6830,19 +6627,19 @@ ImVec2 ImGui::GetContentRegionAvail()
ImVec2 ImGui::GetWindowContentRegionMin()
{
ImGuiWindow* window = GImGui->CurrentWindow;
- return window->ContentsRegionRect.Min - window->Pos;
+ return window->ContentRegionRect.Min - window->Pos;
}
ImVec2 ImGui::GetWindowContentRegionMax()
{
ImGuiWindow* window = GImGui->CurrentWindow;
- return window->ContentsRegionRect.Max - window->Pos;
+ return window->ContentRegionRect.Max - window->Pos;
}
float ImGui::GetWindowContentRegionWidth()
{
ImGuiWindow* window = GImGui->CurrentWindow;
- return window->ContentsRegionRect.GetWidth();
+ return window->ContentRegionRect.GetWidth();
}
float ImGui::GetTextLineHeight()
@@ -7122,7 +6919,7 @@ void ImGui::EndGroup()
}
window->DC.CurrLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupCurrLineTextBaseOffset); // FIXME: Incorrect, we should grab the base offset from the *first line* of the group but it is hard to obtain now.
- ItemSize(group_bb.GetSize(), 0.0f);
+ ItemSize(group_bb.GetSize());
ItemAdd(group_bb, 0);
// If the current ActiveId was declared within the boundary of our group, we copy it to LastItemId so IsItemActive(), IsItemDeactivated() etc. will be functional on the entire group.
@@ -7319,7 +7116,7 @@ void ImGui::SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x
{
// We store a target position so centering can occur on the next frame when we are guaranteed to have a known window size
IM_ASSERT(center_x_ratio >= 0.0f && center_x_ratio <= 1.0f);
- window->ScrollTarget.x = (float)(int)(local_x + window->Scroll.x);
+ window->ScrollTarget.x = IM_FLOOR(local_x + window->Scroll.x);
window->ScrollTargetCenterRatio.x = center_x_ratio;
}
@@ -7329,7 +7126,7 @@ void ImGui::SetScrollFromPosY(ImGuiWindow* window, float local_y, float center_y
IM_ASSERT(center_y_ratio >= 0.0f && center_y_ratio <= 1.0f);
const float decoration_up_height = window->TitleBarHeight() + window->MenuBarHeight();
local_y -= decoration_up_height;
- window->ScrollTarget.y = (float)(int)(local_y + window->Scroll.y);
+ window->ScrollTarget.y = IM_FLOOR(local_y + window->Scroll.y);
window->ScrollTargetCenterRatio.y = center_y_ratio;
}
@@ -7513,19 +7310,6 @@ void ImGui::OpenPopupEx(ImGuiID id)
}
}
-bool ImGui::OpenPopupOnItemClick(const char* str_id, int mouse_button)
-{
- ImGuiWindow* window = GImGui->CurrentWindow;
- if (IsMouseReleased(mouse_button) && IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup))
- {
- ImGuiID id = str_id ? window->GetID(str_id) : window->DC.LastItemId; // If user hasn't passed an ID, we can use the LastItemID. Using LastItemID as a Popup ID won't conflict!
- IM_ASSERT(id != 0); // You cannot pass a NULL str_id if the last item has no identifier (e.g. a Text() item)
- OpenPopupEx(id);
- return true;
- }
- return false;
-}
-
void ImGui::ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to_window_under_popup)
{
ImGuiContext& g = *GImGui;
@@ -7695,6 +7479,19 @@ void ImGui::EndPopup()
End();
}
+bool ImGui::OpenPopupOnItemClick(const char* str_id, int mouse_button)
+{
+ ImGuiWindow* window = GImGui->CurrentWindow;
+ if (IsMouseReleased(mouse_button) && IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup))
+ {
+ ImGuiID id = str_id ? window->GetID(str_id) : window->DC.LastItemId; // If user hasn't passed an ID, we can use the LastItemID. Using LastItemID as a Popup ID won't conflict!
+ IM_ASSERT(id != 0); // You cannot pass a NULL str_id if the last item has no identifier (e.g. a Text() item)
+ OpenPopupEx(id);
+ return true;
+ }
+ return false;
+}
+
// This is a helper to handle the simplest case of associating one named popup to one given widget.
// You may want to handle this on user side if you have specific needs (e.g. tweaking IsItemHovered() parameters).
// You can pass a NULL str_id to use the identifier of the last item.
@@ -8183,6 +7980,7 @@ void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit)
if (!(window->Flags & ImGuiWindowFlags_NoNavInputs))
if (!(window->Flags & ImGuiWindowFlags_ChildWindow) || (window->Flags & ImGuiWindowFlags_Popup) || (window->NavLastIds[0] == 0) || force_reinit)
init_for_nav = true;
+ //IMGUI_DEBUG_LOG("[Nav] NavInitWindow() init_for_nav=%d, window=\"%s\", layer=%d\n", init_for_nav, window->Name, g.NavLayer);
if (init_for_nav)
{
SetNavID(0, g.NavLayer);
@@ -8232,11 +8030,11 @@ float ImGui::GetNavInputAmount(ImGuiNavInput n, ImGuiInputReadMode mode)
if (mode == ImGuiInputReadMode_Pressed) // Return 1.0f when just pressed, no repeat, ignore analog input.
return (t == 0.0f) ? 1.0f : 0.0f;
if (mode == ImGuiInputReadMode_Repeat)
- return (float)CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, g.IO.KeyRepeatDelay * 0.80f, g.IO.KeyRepeatRate * 0.80f);
+ return (float)CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay * 0.72f, g.IO.KeyRepeatRate * 0.80f);
if (mode == ImGuiInputReadMode_RepeatSlow)
- return (float)CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, g.IO.KeyRepeatDelay * 1.00f, g.IO.KeyRepeatRate * 2.00f);
+ return (float)CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay * 1.25f, g.IO.KeyRepeatRate * 2.00f);
if (mode == ImGuiInputReadMode_RepeatFast)
- return (float)CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, g.IO.KeyRepeatDelay * 0.80f, g.IO.KeyRepeatRate * 0.30f);
+ return (float)CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay * 0.72f, g.IO.KeyRepeatRate * 0.30f);
return 0.0f;
}
@@ -8299,6 +8097,7 @@ static void ImGui::NavUpdate()
if (g.NavInitResultId != 0 && (!g.NavDisableHighlight || g.NavInitRequestFromMove) && g.NavWindow)
{
// Apply result from previous navigation init request (will typically select the first item, unless SetItemDefaultFocus() has been called)
+ //IMGUI_DEBUG_LOG("[Nav] Apply NavInitRequest result: 0x%08X Layer %d in \"%s\"\n", g.NavInitResultId, g.NavLayer, g.NavWindow->Name);
if (g.NavInitRequestFromMove)
SetNavIDWithRectRel(g.NavInitResultId, g.NavLayer, g.NavInitResultRectRel);
else
@@ -8457,6 +8256,7 @@ static void ImGui::NavUpdate()
}
if (g.NavMoveRequest && g.NavId == 0)
{
+ //IMGUI_DEBUG_LOG("[Nav] NavInitRequest from move, window \"%s\", layer=%d\n", g.NavWindow->Name, g.NavLayer);
g.NavInitRequest = g.NavInitRequestFromMove = true;
g.NavInitResultId = 0;
g.NavDisableHighlight = false;
@@ -8468,7 +8268,7 @@ static void ImGui::NavUpdate()
{
// *Fallback* manual-scroll with Nav directional keys when window has no navigable item
ImGuiWindow* window = g.NavWindow;
- const float scroll_speed = ImFloor(window->CalcFontSize() * 100 * g.IO.DeltaTime + 0.5f); // We need round the scrolling speed because sub-pixel scroll isn't reliably supported.
+ const float scroll_speed = IM_ROUND(window->CalcFontSize() * 100 * g.IO.DeltaTime); // We need round the scrolling speed because sub-pixel scroll isn't reliably supported.
if (window->DC.NavLayerActiveMask == 0x00 && window->DC.NavHasScroll && g.NavMoveRequest)
{
if (g.NavMoveDir == ImGuiDir_Left || g.NavMoveDir == ImGuiDir_Right)
@@ -9406,8 +9206,10 @@ ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name)
if (const char* p = strstr(name, "###"))
name = p;
#endif
- settings->Name = ImStrdup(name);
- settings->ID = ImHashStr(name);
+ size_t name_len = strlen(name);
+ settings->NameOffset = g.SettingsWindowsNames.size();
+ g.SettingsWindowsNames.append(name, name + name_len + 1); // Append with zero terminator
+ settings->ID = ImHashStr(name, name_len);
return settings;
}
@@ -9588,7 +9390,8 @@ static void SettingsHandlerWindow_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl
for (int i = 0; i != g.SettingsWindows.Size; i++)
{
const ImGuiWindowSettings* settings = &g.SettingsWindows[i];
- buf->appendf("[%s][%s]\n", handler->TypeName, settings->Name);
+ const char* settings_name = g.SettingsWindowsNames.c_str() + settings->NameOffset;
+ buf->appendf("[%s][%s]\n", handler->TypeName, settings_name);
buf->appendf("Pos=%d,%d\n", settings->Pos.x, settings->Pos.y);
buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y);
buf->appendf("Collapsed=%d\n", settings->Collapsed);
@@ -9795,8 +9598,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
}
// State
- enum { WRT_OuterRect, WRT_OuterRectClipped, WRT_InnerRect, WRT_InnerClipRect, WRT_WorkRect, WRT_Contents, WRT_ContentsRegionRect, WRT_Count }; // Windows Rect Type
- const char* wrt_rects_names[WRT_Count] = { "OuterRect", "OuterRectClipped", "InnerRect", "InnerClipRect", "WorkRect", "Contents", "ContentsRegionRect" };
+ enum { WRT_OuterRect, WRT_OuterRectClipped, WRT_InnerRect, WRT_InnerClipRect, WRT_WorkRect, WRT_Content, WRT_ContentRegionRect, WRT_Count }; // Windows Rect Type
+ const char* wrt_rects_names[WRT_Count] = { "OuterRect", "OuterRectClipped", "InnerRect", "InnerClipRect", "WorkRect", "Content", "ContentRegionRect" };
static bool show_windows_rects = false;
static int show_windows_rect_type = WRT_WorkRect;
static bool show_windows_begin_order = false;
@@ -9827,8 +9630,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
else if (rect_type == WRT_InnerRect) { return window->InnerRect; }
else if (rect_type == WRT_InnerClipRect) { return window->InnerClipRect; }
else if (rect_type == WRT_WorkRect) { return window->WorkRect; }
- else if (rect_type == WRT_Contents) { ImVec2 min = window->InnerRect.Min - window->Scroll + window->WindowPadding; return ImRect(min, min + window->ContentSize); }
- else if (rect_type == WRT_ContentsRegionRect) { return window->ContentsRegionRect; }
+ else if (rect_type == WRT_Content) { ImVec2 min = window->InnerRect.Min - window->Scroll + window->WindowPadding; return ImRect(min, min + window->ContentSize); }
+ else if (rect_type == WRT_ContentRegionRect) { return window->ContentRegionRect; }
IM_ASSERT(0);
return ImRect();
}
@@ -9963,7 +9766,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
NodeColumns(&window->ColumnsStorage[n]);
ImGui::TreePop();
}
- ImGui::BulletText("Storage: %d bytes", window->StateStorage.Data.size_in_bytes());
+ NodeStorage(&window->StateStorage, "Storage");
ImGui::TreePop();
}
@@ -9988,6 +9791,18 @@ void ImGui::ShowMetricsWindow(bool* p_open)
ImGui::TreePop();
}
}
+
+ static void NodeStorage(ImGuiStorage* storage, const char* label)
+ {
+ if (!ImGui::TreeNode(label, "%s: %d entries, %d bytes", label, storage->Data.Size, storage->Data.size_in_bytes()))
+ return;
+ for (int n = 0; n < storage->Data.Size; n++)
+ {
+ const ImGuiStorage::ImGuiStoragePair& p = storage->Data[n];
+ ImGui::BulletText("Key 0x%08X Value { i: %d }", p.key, p.val_i); // Important: we currently don't store a type, real value may not be integer.
+ }
+ ImGui::TreePop();
+ }
};
Funcs::NodeWindows(g.Windows, "Windows");
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h
index a8eb2e93772..97b7d699296 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h
@@ -27,7 +27,7 @@ Index of this file:
#pragma once
-// Configuration file with compile-time options (edit imconfig.h or define IMGUI_USER_CONFIG to your own filename)
+// Configuration file with compile-time options (edit imconfig.h or #define IMGUI_USER_CONFIG to your own filename)
#ifdef IMGUI_USER_CONFIG
#include IMGUI_USER_CONFIG
#endif
@@ -39,8 +39,9 @@ Index of this file:
// Header mess
//-----------------------------------------------------------------------------
-#include <float.h> // FLT_MAX
-#include <stdarg.h> // va_list
+// Includes
+#include <float.h> // FLT_MIN, FLT_MAX
+#include <stdarg.h> // va_list, va_start, va_end
#include <stddef.h> // ptrdiff_t, NULL
#include <string.h> // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp
@@ -65,15 +66,14 @@ Index of this file:
#include <assert.h>
#define IM_ASSERT(_EXPR) assert(_EXPR) // You can override the default assert handler by editing imconfig.h
#endif
-
#if 0 // defined(__clang__) || defined(__GNUC__)
-#define IM_FMTARGS(FMT) __attribute__((format(printf, FMT, FMT+1))) // Apply printf-style warnings to user functions.
+#define IM_FMTARGS(FMT) __attribute__((format(printf, FMT, FMT+1))) // To apply printf-style warnings to our functions.
#define IM_FMTLIST(FMT) __attribute__((format(printf, FMT, 0)))
#else
#define IM_FMTARGS(FMT)
#define IM_FMTLIST(FMT)
#endif
-#define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR)/sizeof(*_ARR))) // Size of a static C-style array. Don't use on pointers!
+#define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR) / sizeof(*_ARR))) // Size of a static C-style array. Don't use on pointers!
#define IM_UNUSED(_VAR) ((void)_VAR) // Used to silence "unused variable warnings". Often useful as asserts may be stripped out from final builds.
#if (__cplusplus >= 201100)
#define IM_OFFSETOF(_TYPE,_MEMBER) offsetof(_TYPE, _MEMBER) // Offset of _MEMBER within _TYPE. Standardized as offsetof() in C++11
@@ -124,7 +124,7 @@ struct ImGuiTextBuffer; // Helper to hold and append into a text buf
struct ImGuiTextFilter; // Helper to parse and apply text filters (e.g. "aaaaa[,bbbb][,ccccc]")
// Typedefs and Enums/Flags (declared as int for compatibility with old C++, to allow using as flags and to not pollute the top of this file)
-// Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
+// Use your programming IDE "Go to definition" facility on the names in the central column below to find the actual flags/enum lists.
#ifndef ImTextureID
typedef void* ImTextureID; // User data to identify a texture (this is whatever to you want it to be! read the FAQ about ImTextureID in imgui.cpp)
#endif
@@ -158,7 +158,7 @@ typedef int (*ImGuiInputTextCallback)(ImGuiInputTextCallbackData *data);
typedef void (*ImGuiSizeCallback)(ImGuiSizeCallbackData* data);
// Scalar data types
-typedef signed char ImS8; // 8-bit signed integer == char
+typedef signed char ImS8; // 8-bit signed integer
typedef unsigned char ImU8; // 8-bit unsigned integer
typedef signed short ImS16; // 16-bit signed integer
typedef unsigned short ImU16; // 16-bit unsigned integer
@@ -202,14 +202,14 @@ struct ImVec4
//-----------------------------------------------------------------------------
// ImGui: Dear ImGui end-user API
-// (Inside a namespace so you can add extra functions in your own separate file. Please don't modify imgui.cpp/.h!)
+// (Inside a namespace so you can add extra functions in your own separate file. Please don't modify imgui source files!)
//-----------------------------------------------------------------------------
namespace ImGui
{
// Context creation and access
// Each context create its own ImFontAtlas by default. You may instance one yourself and pass it to CreateContext() to share a font atlas between imgui contexts.
- // All those functions are not reliant on the current context.
+ // None of those functions is reliant on the current context.
IMGUI_API ImGuiContext* CreateContext(ImFontAtlas* shared_font_atlas = NULL);
IMGUI_API void DestroyContext(ImGuiContext* ctx = NULL); // NULL = destroy current context
IMGUI_API ImGuiContext* GetCurrentContext();
@@ -246,8 +246,9 @@ namespace ImGui
// which clicking will set the boolean to false when clicked.
// - Begin() return false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting
// anything to the window. Always call a matching End() for each Begin() call, regardless of its return value!
- // [this is due to legacy reason and is inconsistent with most other functions such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc.
- // where the EndXXX call should only be called if the corresponding BeginXXX function returned true.]
+ // [Important: due to legacy reason, this is inconsistent with most other functions such as BeginMenu/EndMenu,
+ // BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function
+ // returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.]
// - Note that the bottom of window stack always contains a window called "Debug".
IMGUI_API bool Begin(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0);
IMGUI_API void End();
@@ -256,13 +257,13 @@ namespace ImGui
// - Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window. Child windows can embed their own child.
// - For each independent axis of 'size': ==0.0f: use remaining host window size / >0.0f: fixed size / <0.0f: use remaining window size minus abs(size) / Each axis can use a different mode, e.g. ImVec2(0,400).
// - BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting anything to the window.
- // Always call a matching EndChild() for each BeginChild() call, regardless of its return value [this is due to legacy reason and is inconsistent with most other functions such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function returned true.]
+ // Always call a matching EndChild() for each BeginChild() call, regardless of its return value [as with Begin: this is due to legacy reason and inconsistent with most BeginXXX functions apart from the regular Begin() which behaves like BeginChild().]
IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags flags = 0);
IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags flags = 0);
IMGUI_API void EndChild();
// Windows Utilities
- // - "current window" = the window we are appending into while inside a Begin()/End() block. "next window" = next window we will Begin() into.
+ // - 'current window' = the window we are appending into while inside a Begin()/End() block. 'next window' = next window we will Begin() into.
IMGUI_API bool IsWindowAppearing();
IMGUI_API bool IsWindowCollapsed();
IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags=0); // is current window focused? or its root/child, depending on flags. see flags for options.
@@ -343,6 +344,7 @@ namespace ImGui
// Cursor / Layout
// - By "cursor" we mean the current output position.
// - The typical widget behavior is to output themselves at the current cursor position, then move the cursor one line down.
+ // - You can call SameLine() between widgets to undo the last carriage return and output at the right of the preceeding widget.
IMGUI_API void Separator(); // separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.
IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f); // call between widgets or groups to layout them horizontally. X position given in window coordinates.
IMGUI_API void NewLine(); // undo a SameLine() or force a new line when in an horizontal-layout context.
@@ -384,8 +386,8 @@ namespace ImGui
IMGUI_API ImGuiID GetID(const void* ptr_id);
// Widgets: Text
- IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // raw text without formatting. Roughly equivalent to Text("%s", text) but: A) doesn't require null terminated string if 'text_end' is specified, B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text.
- IMGUI_API void Text(const char* fmt, ...) IM_FMTARGS(1); // simple formatted text
+ IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // raw text without formatting. Roughly equivalent to Text("%s", text) but: A) doesn't require null terminated string if 'text_end' is specified, B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text.
+ IMGUI_API void Text(const char* fmt, ...) IM_FMTARGS(1); // formatted text
IMGUI_API void TextV(const char* fmt, va_list args) IM_FMTLIST(1);
IMGUI_API void TextColored(const ImVec4& col, const char* fmt, ...) IM_FMTARGS(2); // shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();
IMGUI_API void TextColoredV(const ImVec4& col, const char* fmt, va_list args) IM_FMTLIST(2);
@@ -400,6 +402,7 @@ namespace ImGui
// Widgets: Main
// - Most widgets return true when the value has been changed or when pressed/selected
+ // - You may also use one of the many IsItemXXX functions (e.g. IsItemActive, IsItemHovered, etc.) to query widget state.
IMGUI_API bool Button(const char* label, const ImVec2& size = ImVec2(0,0)); // button
IMGUI_API bool SmallButton(const char* label); // button with FramePadding=(0,0) to easily embed within text
IMGUI_API bool InvisibleButton(const char* str_id, const ImVec2& size); // button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.)
@@ -414,7 +417,7 @@ namespace ImGui
IMGUI_API void Bullet(); // draw a small circle and keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses
// Widgets: Combo Box
- // - The new BeginCombo()/EndCombo() api allows you to manage your contents and selection state however you want it, by creating e.g. Selectable() items.
+ // - The BeginCombo()/EndCombo() api allows you to manage your contents and selection state however you want it, by creating e.g. Selectable() items.
// - The old Combo() api are helpers over BeginCombo()/EndCombo() which are kept available for convenience purpose.
IMGUI_API bool BeginCombo(const char* label, const char* preview_value, ImGuiComboFlags flags = 0);
IMGUI_API void EndCombo(); // only call EndCombo() if BeginCombo() returns true!
@@ -439,8 +442,8 @@ namespace ImGui
IMGUI_API bool DragInt3(const char* label, int v[3], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%d");
IMGUI_API bool DragInt4(const char* label, int v[4], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%d");
IMGUI_API bool DragIntRange2(const char* label, int* v_current_min, int* v_current_max, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%d", const char* format_max = NULL);
- IMGUI_API bool DragScalar(const char* label, ImGuiDataType data_type, void* v, float v_speed, const void* v_min = NULL, const void* v_max = NULL, const char* format = NULL, float power = 1.0f);
- IMGUI_API bool DragScalarN(const char* label, ImGuiDataType data_type, void* v, int components, float v_speed, const void* v_min = NULL, const void* v_max = NULL, const char* format = NULL, float power = 1.0f);
+ IMGUI_API bool DragScalar(const char* label, ImGuiDataType data_type, void* p_data, float v_speed, const void* p_min = NULL, const void* p_max = NULL, const char* format = NULL, float power = 1.0f);
+ IMGUI_API bool DragScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, float v_speed, const void* p_min = NULL, const void* p_max = NULL, const char* format = NULL, float power = 1.0f);
// Widgets: Sliders
// - CTRL+Click on any slider to turn them into an input box. Manually input values aren't clamped and can go off-bounds.
@@ -454,11 +457,11 @@ namespace ImGui
IMGUI_API bool SliderInt2(const char* label, int v[2], int v_min, int v_max, const char* format = "%d");
IMGUI_API bool SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* format = "%d");
IMGUI_API bool SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* format = "%d");
- IMGUI_API bool SliderScalar(const char* label, ImGuiDataType data_type, void* v, const void* v_min, const void* v_max, const char* format = NULL, float power = 1.0f);
- IMGUI_API bool SliderScalarN(const char* label, ImGuiDataType data_type, void* v, int components, const void* v_min, const void* v_max, const char* format = NULL, float power = 1.0f);
+ IMGUI_API bool SliderScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format = NULL, float power = 1.0f);
+ IMGUI_API bool SliderScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, const void* p_min, const void* p_max, const char* format = NULL, float power = 1.0f);
IMGUI_API bool VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* format = "%.3f", float power = 1.0f);
IMGUI_API bool VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* format = "%d");
- IMGUI_API bool VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType data_type, void* v, const void* v_min, const void* v_max, const char* format = NULL, float power = 1.0f);
+ IMGUI_API bool VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format = NULL, float power = 1.0f);
// Widgets: Input with Keyboard
// - If you want to use InputText() with a dynamic string type such as std::string or your own, see misc/cpp/imgui_stdlib.h
@@ -475,8 +478,8 @@ namespace ImGui
IMGUI_API bool InputInt3(const char* label, int v[3], ImGuiInputTextFlags flags = 0);
IMGUI_API bool InputInt4(const char* label, int v[4], ImGuiInputTextFlags flags = 0);
IMGUI_API bool InputDouble(const char* label, double* v, double step = 0.0, double step_fast = 0.0, const char* format = "%.6f", ImGuiInputTextFlags flags = 0);
- IMGUI_API bool InputScalar(const char* label, ImGuiDataType data_type, void* v, const void* step = NULL, const void* step_fast = NULL, const char* format = NULL, ImGuiInputTextFlags flags = 0);
- IMGUI_API bool InputScalarN(const char* label, ImGuiDataType data_type, void* v, int components, const void* step = NULL, const void* step_fast = NULL, const char* format = NULL, ImGuiInputTextFlags flags = 0);
+ IMGUI_API bool InputScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_step = NULL, const void* p_step_fast = NULL, const char* format = NULL, ImGuiInputTextFlags flags = 0);
+ IMGUI_API bool InputScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, const void* p_step = NULL, const void* p_step_fast = NULL, const char* format = NULL, ImGuiInputTextFlags flags = 0);
// Widgets: Color Editor/Picker (tip: the ColorEdit* functions have a little colored preview square that can be left-clicked to open a picker, and right-clicked to open an option menu.)
// - Note that in C++ a 'float v[X]' function argument is the _same_ as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible.
@@ -510,7 +513,7 @@ namespace ImGui
// Widgets: Selectables
// - A selectable highlights when hovered, and can display another color when selected.
- // - Neighbors selectable extend their highlight bounds in order to leave no gap between them.
+ // - Neighbors selectable extend their highlight bounds in order to leave no gap between them. This is so a series of selected Selectable appear contiguous.
IMGUI_API bool Selectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0,0)); // "bool selected" carry the selection state (read-only). Selectable() is clicked is returns true so you can modify your selection state. size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height
IMGUI_API bool Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0,0)); // "bool* p_selected" point to the selection state (read-write), as a convenient helper.
@@ -536,16 +539,19 @@ namespace ImGui
IMGUI_API void Value(const char* prefix, float v, const char* float_format = NULL);
// Widgets: Menus
- IMGUI_API bool BeginMainMenuBar(); // create and append to a full screen menu-bar.
- IMGUI_API void EndMainMenuBar(); // only call EndMainMenuBar() if BeginMainMenuBar() returns true!
+ // - Use BeginMenuBar() on a window ImGuiWindowFlags_MenuBar to append to its menu bar.
+ // - Use BeginMainMenuBar() to create a menu bar at the top of the screen.
IMGUI_API bool BeginMenuBar(); // append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window).
IMGUI_API void EndMenuBar(); // only call EndMenuBar() if BeginMenuBar() returns true!
+ IMGUI_API bool BeginMainMenuBar(); // create and append to a full screen menu-bar.
+ IMGUI_API void EndMainMenuBar(); // only call EndMainMenuBar() if BeginMainMenuBar() returns true!
IMGUI_API bool BeginMenu(const char* label, bool enabled = true); // create a sub-menu entry. only call EndMenu() if this returns true!
IMGUI_API void EndMenu(); // only call EndMenu() if BeginMenu() returns true!
IMGUI_API bool MenuItem(const char* label, const char* shortcut = NULL, bool selected = false, bool enabled = true); // return true when activated. shortcuts are displayed for convenience but not processed by ImGui at the moment
IMGUI_API bool MenuItem(const char* label, const char* shortcut, bool* p_selected, bool enabled = true); // return true when activated + toggle (*p_selected) if p_selected != NULL
// Tooltips
+ // - Tooltip are windows following the mouse which do not take focus away.
IMGUI_API void BeginTooltip(); // begin/append a tooltip window. to create full-featured tooltip (with any kind of items).
IMGUI_API void EndTooltip();
IMGUI_API void SetTooltip(const char* fmt, ...) IM_FMTARGS(1); // set a text-only tooltip, typically use with ImGui::IsItemHovered(). override any previous call to SetTooltip().
@@ -557,7 +563,7 @@ namespace ImGui
// - Unless modal, they can be closed by clicking anywhere outside them, or by pressing ESCAPE.
// - Their visibility state (~bool) is held internally by imgui instead of being held by the programmer as we are used to with regular Begin() calls.
// User can manipulate the visibility state by calling OpenPopup().
- // (*) One can use IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup) to bypass it and detect hovering even when normally blocked by a popup.
+ // (*) You can use IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup) to bypass it and detect hovering even when normally blocked by a popup.
// Those three properties are connected. The library needs to hold their visibility state because it can close popups at any time.
IMGUI_API void OpenPopup(const char* str_id); // call to mark popup as open (don't call every frame!). popups are closed when user click outside, or if CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. By default, Selectable()/MenuItem() are calling CloseCurrentPopup(). Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level).
IMGUI_API bool BeginPopup(const char* str_id, ImGuiWindowFlags flags = 0); // return true if the popup is open, and you can start outputting to it. only call EndPopup() if BeginPopup() returns true!
@@ -573,6 +579,7 @@ namespace ImGui
// Columns
// - You can also use SameLine(pos_x) to mimic simplified columns.
// - The columns API is work-in-progress and rather lacking (columns are arguably the worst part of dear imgui at the moment!)
+ // - By end of the 2019 we will expose a new 'Table' api which will replace columns.
IMGUI_API void Columns(int count = 1, const char* id = NULL, bool border = true);
IMGUI_API void NextColumn(); // next column, defaults to current row or next row if the current row is finished
IMGUI_API int GetColumnIndex(); // get current column index
@@ -583,7 +590,6 @@ namespace ImGui
IMGUI_API int GetColumnsCount();
// Tab Bars, Tabs
- // [BETA API] API may evolve!
IMGUI_API bool BeginTabBar(const char* str_id, ImGuiTabBarFlags flags = 0); // create and append into a TabBar
IMGUI_API void EndTabBar(); // only call EndTabBar() if BeginTabBar() returns true!
IMGUI_API bool BeginTabItem(const char* label, bool* p_open = NULL, ImGuiTabItemFlags flags = 0);// create a Tab. Returns true if the Tab is selected.
@@ -951,12 +957,12 @@ enum ImGuiKey_
ImGuiKey_Enter,
ImGuiKey_Escape,
ImGuiKey_KeyPadEnter,
- ImGuiKey_A, // for text edit CTRL+A: select all
- ImGuiKey_C, // for text edit CTRL+C: copy
- ImGuiKey_V, // for text edit CTRL+V: paste
- ImGuiKey_X, // for text edit CTRL+X: cut
- ImGuiKey_Y, // for text edit CTRL+Y: redo
- ImGuiKey_Z, // for text edit CTRL+Z: undo
+ ImGuiKey_A, // for text edit CTRL+A: select all
+ ImGuiKey_C, // for text edit CTRL+C: copy
+ ImGuiKey_V, // for text edit CTRL+V: paste
+ ImGuiKey_X, // for text edit CTRL+X: cut
+ ImGuiKey_Y, // for text edit CTRL+Y: redo
+ ImGuiKey_Z, // for text edit CTRL+Z: undo
ImGuiKey_COUNT
};
@@ -1277,7 +1283,7 @@ struct ImVector
inline const T* find(const T& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data == v) break; else ++data; return data; }
inline bool find_erase(const T& v) { const T* it = find(v); if (it < Data + Size) { erase(it); return true; } return false; }
inline bool find_erase_unsorted(const T& v) { const T* it = find(v); if (it < Data + Size) { erase_unsorted(it); return true; } return false; }
- inline int index_from_ptr(const T* it) const { IM_ASSERT(it >= Data && it <= Data+Size); const ptrdiff_t off = it - Data; return (int)off; }
+ inline int index_from_ptr(const T* it) const { IM_ASSERT(it >= Data && it < Data + Size); const ptrdiff_t off = it - Data; return (int)off; }
};
//-----------------------------------------------------------------------------
@@ -1572,11 +1578,6 @@ namespace ImGui
static inline bool IsRootWindowOrAnyChildFocused() { return IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows); }
static inline void SetNextWindowContentWidth(float w) { SetNextWindowContentSize(ImVec2(w, 0.0f)); }
static inline float GetItemsLineHeightWithSpacing() { return GetFrameHeightWithSpacing(); }
- // OBSOLETED in 1.52 (between Aug 2017 and Oct 2017)
- IMGUI_API bool Begin(const char* name, bool* p_open, const ImVec2& size_on_first_use, float bg_alpha_override = -1.0f, ImGuiWindowFlags flags = 0); // Use SetNextWindowSize(size, ImGuiCond_FirstUseEver) + SetNextWindowBgAlpha() instead.
- static inline bool IsRootWindowOrAnyChildHovered() { return IsWindowHovered(ImGuiHoveredFlags_RootAndChildWindows); }
- static inline void AlignFirstTextHeightToWidgets() { AlignTextToFramePadding(); }
- static inline void SetNextWindowPosCenter(ImGuiCond c=0) { ImGuiIO& io = GetIO(); SetNextWindowPos(ImVec2(io.DisplaySize.x * 0.5f, io.DisplaySize.y * 0.5f), c, ImVec2(0.5f, 0.5f)); }
}
typedef ImGuiInputTextCallback ImGuiTextEditCallback; // OBSOLETED in 1.63 (from Aug 2018): made the names consistent
typedef ImGuiInputTextCallbackData ImGuiTextEditCallbackData;
@@ -1629,11 +1630,11 @@ struct ImGuiTextBuffer
IMGUI_API static char EmptyString[1];
ImGuiTextBuffer() { }
- inline char operator[](int i) { IM_ASSERT(Buf.Data != NULL); return Buf.Data[i]; }
+ inline char operator[](int i) const { IM_ASSERT(Buf.Data != NULL); return Buf.Data[i]; }
const char* begin() const { return Buf.Data ? &Buf.front() : EmptyString; }
const char* end() const { return Buf.Data ? &Buf.back() : EmptyString; } // Buf is zero-terminated, so end() will point on the zero-terminator
int size() const { return Buf.Size ? Buf.Size - 1 : 0; }
- bool empty() { return Buf.Size <= 1; }
+ bool empty() const { return Buf.Size <= 1; }
void clear() { Buf.clear(); }
void reserve(int capacity) { Buf.reserve(capacity); }
const char* c_str() const { return Buf.Data ? Buf.Data : EmptyString; }
@@ -2110,7 +2111,7 @@ struct ImFontAtlas
IMGUI_API bool Build(); // Build pixels data. This is called automatically for you by the GetTexData*** functions.
IMGUI_API void GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 1 byte per-pixel
IMGUI_API void GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 4 bytes-per-pixel
- bool IsBuilt() { return Fonts.Size > 0 && (TexPixelsAlpha8 != NULL || TexPixelsRGBA32 != NULL); }
+ bool IsBuilt() const { return Fonts.Size > 0 && (TexPixelsAlpha8 != NULL || TexPixelsRGBA32 != NULL); }
void SetTexID(ImTextureID id) { TexID = id; }
//-------------------------------------------
@@ -2143,7 +2144,7 @@ struct ImFontAtlas
const ImFontAtlasCustomRect*GetCustomRectByIndex(int index) const { if (index < 0) return NULL; return &CustomRects[index]; }
// [Internal]
- IMGUI_API void CalcCustomRectUV(const ImFontAtlasCustomRect* rect, ImVec2* out_uv_min, ImVec2* out_uv_max);
+ IMGUI_API void CalcCustomRectUV(const ImFontAtlasCustomRect* rect, ImVec2* out_uv_min, ImVec2* out_uv_max) const;
IMGUI_API bool GetMouseCursorTexData(ImGuiMouseCursor cursor, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2]);
//-------------------------------------------
@@ -2224,10 +2225,6 @@ struct ImFont
IMGUI_API void AddGlyph(ImWchar c, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x);
IMGUI_API void AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst = true); // Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built.
IMGUI_API void SetFallbackChar(ImWchar c);
-
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- typedef ImFontGlyph Glyph; // OBSOLETED in 1.52+
-#endif
};
#if defined(__clang__)
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp
index 036d90688de..3eedda458b1 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp
@@ -100,12 +100,17 @@ Index of this file:
// Play it nice with Windows users. Notepad in 2017 still doesn't display text data with Unix-style \n.
#ifdef _WIN32
#define IM_NEWLINE "\r\n"
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
#else
#define IM_NEWLINE "\n"
#endif
+#if defined(_MSC_VER) && !defined(snprintf)
+#define snprintf _snprintf
+#endif
+#if defined(_MSC_VER) && !defined(vsnprintf)
+#define vsnprintf _vsnprintf
+#endif
+
//-----------------------------------------------------------------------------
// [SECTION] Forward Declarations, Helpers
//-----------------------------------------------------------------------------
@@ -923,7 +928,7 @@ static void ShowDemoWindowWidgets()
if (ImGui::TreeNode("In columns"))
{
ImGui::Columns(3, NULL, false);
- static bool selected[16] = { 0 };
+ static bool selected[16] = {};
for (int i = 0; i < 16; i++)
{
char label[32]; sprintf(label, "Item %d", i);
@@ -1075,7 +1080,7 @@ static void ShowDemoWindowWidgets()
// Create a dummy array of contiguous float values to plot
// Tip: If your float aren't contiguous but part of a structure, you can pass a pointer to your first float and the sizeof() of your structure in the Stride parameter.
- static float values[90] = { 0 };
+ static float values[90] = {};
static int values_offset = 0;
static double refresh_time = 0.0;
if (!animate || refresh_time == 0.0)
@@ -1176,7 +1181,7 @@ static void ShowDemoWindowWidgets()
// Generate a dummy default palette. The palette will persist and can be edited.
static bool saved_palette_init = true;
- static ImVec4 saved_palette[32] = { };
+ static ImVec4 saved_palette[32] = {};
if (saved_palette_init)
{
for (int n = 0; n < IM_ARRAYSIZE(saved_palette); n++)
@@ -1506,24 +1511,21 @@ static void ShowDemoWindowWidgets()
if (ImGui::TreeNode("Drag and Drop"))
{
+ if (ImGui::TreeNode("Drag and drop in standard widgets"))
{
// ColorEdit widgets automatically act as drag source and drag target.
// They are using standardized payload strings IMGUI_PAYLOAD_TYPE_COLOR_3F and IMGUI_PAYLOAD_TYPE_COLOR_4F to allow your own widgets
// to use colors in their drag and drop interaction. Also see the demo in Color Picker -> Palette demo.
- ImGui::BulletText("Drag and drop in standard widgets");
- ImGui::SameLine();
HelpMarker("You can drag from the colored squares.");
- ImGui::Indent();
- static float col1[3] = { 1.0f,0.0f,0.2f };
- static float col2[4] = { 0.4f,0.7f,0.0f,0.5f };
+ static float col1[3] = { 1.0f, 0.0f, 0.2f };
+ static float col2[4] = { 0.4f, 0.7f, 0.0f, 0.5f };
ImGui::ColorEdit3("color 1", col1);
ImGui::ColorEdit4("color 2", col2);
- ImGui::Unindent();
+ ImGui::TreePop();
}
+ if (ImGui::TreeNode("Drag and drop to copy/swap items"))
{
- ImGui::BulletText("Drag and drop to copy/swap items");
- ImGui::Indent();
enum Mode
{
Mode_Copy,
@@ -1577,7 +1579,31 @@ static void ShowDemoWindowWidgets()
}
ImGui::PopID();
}
- ImGui::Unindent();
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Drag to reorder items (simple)"))
+ {
+ // Simple reordering
+ HelpMarker("We don't use the drag and drop api at all here! Instead we query when the item is held but not hovered, and order items accordingly.");
+ static const char* item_names[] = { "Item One", "Item Two", "Item Three", "Item Four", "Item Five" };
+ for (int n = 0; n < IM_ARRAYSIZE(item_names); n++)
+ {
+ const char* item = item_names[n];
+ ImGui::Selectable(item);
+
+ if (ImGui::IsItemActive() && !ImGui::IsItemHovered())
+ {
+ int n_next = n + (ImGui::GetMouseDragDelta(0).y < 0.f ? -1 : 1);
+ if (n_next >= 0 && n_next < IM_ARRAYSIZE(item_names))
+ {
+ item_names[n] = item_names[n_next];
+ item_names[n_next] = item;
+ ImGui::ResetMouseDragDelta();
+ }
+ }
+ }
+ ImGui::TreePop();
}
ImGui::TreePop();
@@ -1607,10 +1633,10 @@ static void ShowDemoWindowWidgets()
if (item_type == 10){ ret = ImGui::TreeNodeEx("ITEM: TreeNode w/ ImGuiTreeNodeFlags_OpenOnDoubleClick", ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_NoTreePushOnOpen); } // Testing tree node with ImGuiButtonFlags_PressedOnDoubleClick button policy.
if (item_type == 11){ const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::ListBox("ITEM: ListBox", &current, items, IM_ARRAYSIZE(items), IM_ARRAYSIZE(items)); }
- // Display the value of IsItemHovered() and other common item state functions.
+ // Display the value of IsItemHovered() and other common item state functions.
// Note that the ImGuiHoveredFlags_XXX flags can be combined.
- // Because BulletText is an item itself and that would affect the output of IsItemXXX functions,
- // we query every state in a single call to avoid storing them and to simplify the code
+ // Because BulletText is an item itself and that would affect the output of IsItemXXX functions,
+ // we query every state in a single call to avoid storing them and to simplify the code
ImGui::BulletText(
"Return value = %d\n"
"IsItemFocused() = %d\n"
@@ -1653,7 +1679,7 @@ static void ShowDemoWindowWidgets()
if (embed_all_inside_a_child_window)
ImGui::BeginChild("outer_child", ImVec2(0, ImGui::GetFontSize() * 20), true);
- // Testing IsWindowFocused() function with its various flags.
+ // Testing IsWindowFocused() function with its various flags.
// Note that the ImGuiFocusedFlags_XXX flags can be combined.
ImGui::BulletText(
"IsWindowFocused() = %d\n"
@@ -3242,7 +3268,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
if (ImGui::Button("Revert Ref"))
style = *ref;
ImGui::SameLine();
- HelpMarker("Save/Revert in local non-persistent storage. Default Colors definition are not affected. Use \"Export Colors\" below to save them somewhere.");
+ HelpMarker("Save/Revert in local non-persistent storage. Default Colors definition are not affected. Use \"Export\" below to save them somewhere.");
ImGui::Separator();
@@ -3290,7 +3316,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
{
static int output_dest = 0;
static bool output_only_modified = true;
- if (ImGui::Button("Export Unsaved"))
+ if (ImGui::Button("Export"))
{
if (output_dest == 0)
ImGui::LogToClipboard();
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp
index 65960b67fc4..674fc99c222 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp
@@ -1752,7 +1752,7 @@ int ImFontAtlas::AddCustomRectFontGlyph(ImFont* font, ImWchar id, int width, int
return CustomRects.Size - 1; // Return index
}
-void ImFontAtlas::CalcCustomRectUV(const ImFontAtlasCustomRect* rect, ImVec2* out_uv_min, ImVec2* out_uv_max)
+void ImFontAtlas::CalcCustomRectUV(const ImFontAtlasCustomRect* rect, ImVec2* out_uv_min, ImVec2* out_uv_max) const
{
IM_ASSERT(TexWidth > 0 && TexHeight > 0); // Font atlas needs to be built before we can calculate UV coordinates
IM_ASSERT(rect->IsPacked()); // Make sure the rectangle has been packed
@@ -2069,7 +2069,7 @@ bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
const float descent = ImFloor(unscaled_descent * font_scale + ((unscaled_descent > 0.0f) ? +1 : -1));
ImFontAtlasBuildSetupFont(atlas, dst_font, &cfg, ascent, descent);
const float font_off_x = cfg.GlyphOffset.x;
- const float font_off_y = cfg.GlyphOffset.y + (float)(int)(dst_font->Ascent + 0.5f);
+ const float font_off_y = cfg.GlyphOffset.y + IM_ROUND(dst_font->Ascent);
for (int glyph_i = 0; glyph_i < src_tmp.GlyphsCount; glyph_i++)
{
@@ -2080,7 +2080,7 @@ bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
const float char_advance_x_mod = ImClamp(char_advance_x_org, cfg.GlyphMinAdvanceX, cfg.GlyphMaxAdvanceX);
float char_off_x = font_off_x;
if (char_advance_x_org != char_advance_x_mod)
- char_off_x += cfg.PixelSnapH ? (float)(int)((char_advance_x_mod - char_advance_x_org) * 0.5f) : (char_advance_x_mod - char_advance_x_org) * 0.5f;
+ char_off_x += cfg.PixelSnapH ? ImFloor((char_advance_x_mod - char_advance_x_org) * 0.5f) : (char_advance_x_mod - char_advance_x_org) * 0.5f;
// Register glyph
stbtt_aligned_quad q;
@@ -2591,7 +2591,7 @@ void ImFont::AddGlyph(ImWchar codepoint, float x0, float y0, float x1, float y1,
glyph.AdvanceX = advance_x + ConfigData->GlyphExtraSpacing.x; // Bake spacing into AdvanceX
if (ConfigData->PixelSnapH)
- glyph.AdvanceX = (float)(int)(glyph.AdvanceX + 0.5f);
+ glyph.AdvanceX = IM_ROUND(glyph.AdvanceX);
// Compute rough surface usage metrics (+1 to account for average padding, +0.99 to round)
DirtyLookupTables = true;
@@ -2833,8 +2833,8 @@ void ImFont::RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
if (const ImFontGlyph* glyph = FindGlyph(c))
{
float scale = (size >= 0.0f) ? (size / FontSize) : 1.0f;
- pos.x = (float)(int)pos.x + DisplayOffset.x;
- pos.y = (float)(int)pos.y + DisplayOffset.y;
+ pos.x = IM_FLOOR(pos.x + DisplayOffset.x);
+ pos.y = IM_FLOOR(pos.y + DisplayOffset.y);
draw_list->PrimReserve(6, 4);
draw_list->PrimRectUV(ImVec2(pos.x + glyph->X0 * scale, pos.y + glyph->Y0 * scale), ImVec2(pos.x + glyph->X1 * scale, pos.y + glyph->Y1 * scale), ImVec2(glyph->U0, glyph->V0), ImVec2(glyph->U1, glyph->V1), col);
}
@@ -2846,8 +2846,8 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
text_end = text_begin + strlen(text_begin); // ImGui:: functions generally already provides a valid text_end, so this is merely to handle direct calls.
// Align to be pixel perfect
- pos.x = (float)(int)pos.x + DisplayOffset.x;
- pos.y = (float)(int)pos.y + DisplayOffset.y;
+ pos.x = IM_FLOOR(pos.x + DisplayOffset.x);
+ pos.y = IM_FLOOR(pos.y + DisplayOffset.y);
float x = pos.x;
float y = pos.y;
if (y > clip_rect.w)
@@ -3201,9 +3201,9 @@ static unsigned int stb_adler32(unsigned int adler32, unsigned char *buffer, uns
{
const unsigned long ADLER_MOD = 65521;
unsigned long s1 = adler32 & 0xffff, s2 = adler32 >> 16;
- unsigned long blocklen, i;
+ unsigned long blocklen = buflen % 5552;
- blocklen = buflen % 5552;
+ unsigned long i;
while (buflen) {
for (i=0; i + 7 < blocklen; i += 8) {
s1 += buffer[0], s2 += s1;
@@ -3230,10 +3230,9 @@ static unsigned int stb_adler32(unsigned int adler32, unsigned char *buffer, uns
static unsigned int stb_decompress(unsigned char *output, const unsigned char *i, unsigned int /*length*/)
{
- unsigned int olen;
if (stb__in4(0) != 0x57bC0000) return 0;
if (stb__in4(4) != 0) return 0; // error! stream is > 4GB
- olen = stb_decompress_length(i);
+ const unsigned int olen = stb_decompress_length(i);
stb__barrier_in_b = i;
stb__barrier_out_e = output + olen;
stb__barrier_out_b = output;
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h
index df96fd8bce3..c1998107b22 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h
@@ -144,6 +144,8 @@ extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer
#define IM_STATIC_ASSERT(_COND) typedef char static_assertion_##__line__[(_COND)?1:-1]
#define IM_F32_TO_INT8_UNBOUND(_VAL) ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f))) // Unsaturated, for display purpose
#define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f)) // Saturated, always output 0..255
+#define IM_FLOOR(_VAL) ((float)(int)(_VAL)) // ImFloor() is not inlined in MSVC debug builds
+#define IM_ROUND(_VAL) ((float)(int)((_VAL) + 0.5f)) //
// Debug Logging
#ifndef IMGUI_DEBUG_LOG
@@ -261,8 +263,8 @@ static inline float ImSaturate(float f)
static inline float ImLengthSqr(const ImVec2& lhs) { return lhs.x*lhs.x + lhs.y*lhs.y; }
static inline float ImLengthSqr(const ImVec4& lhs) { return lhs.x*lhs.x + lhs.y*lhs.y + lhs.z*lhs.z + lhs.w*lhs.w; }
static inline float ImInvLength(const ImVec2& lhs, float fail_value) { float d = lhs.x*lhs.x + lhs.y*lhs.y; if (d > 0.0f) return 1.0f / ImSqrt(d); return fail_value; }
-static inline float ImFloor(float f) { return (float)(int)f; }
-static inline ImVec2 ImFloor(const ImVec2& v) { return ImVec2((float)(int)v.x, (float)(int)v.y); }
+static inline float ImFloor(float f) { return (float)(int)(f); }
+static inline ImVec2 ImFloor(const ImVec2& v) { return ImVec2((float)(int)(v.x), (float)(int)(v.y)); }
static inline int ImModPositive(int a, int b) { return (a + b) % b; }
static inline float ImDot(const ImVec2& a, const ImVec2& b) { return a.x * b.x + a.y * b.y; }
static inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a) { return ImVec2(v.x * cos_a - v.y * sin_a, v.x * sin_a + v.y * cos_a); }
@@ -569,7 +571,7 @@ struct IMGUI_API ImRect
void TranslateY(float dy) { Min.y += dy; Max.y += dy; }
void ClipWith(const ImRect& r) { Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); } // Simple version, may lead to an inverted rectangle, which is fine for Contains/Overlaps test but not for display.
void ClipWithFull(const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); } // Full version, ensure both points are fully clipped.
- void Floor() { Min.x = (float)(int)Min.x; Min.y = (float)(int)Min.y; Max.x = (float)(int)Max.x; Max.y = (float)(int)Max.y; }
+ void Floor() { Min.x = IM_FLOOR(Min.x); Min.y = IM_FLOOR(Min.y); Max.x = IM_FLOOR(Max.x); Max.y = IM_FLOOR(Max.y); }
bool IsInverted() const { return Min.x > Max.x || Min.y > Max.y; }
};
@@ -622,7 +624,7 @@ struct IMGUI_API ImGuiMenuColumns
ImGuiMenuColumns();
void Update(int count, float spacing, bool clear);
float DeclColumns(float w0, float w1, float w2);
- float CalcExtraSpace(float avail_w);
+ float CalcExtraSpace(float avail_w) const;
};
// Internal state of the currently focused/edited text input box
@@ -660,15 +662,16 @@ struct IMGUI_API ImGuiInputTextState
};
// Windows data saved in imgui.ini file
+// Because we never destroy or rename ImGuiWindowSettings, we can store the names in a separate buffer easily.
struct ImGuiWindowSettings
{
- char* Name;
+ int NameOffset; // Offset into SettingsWindowNames[]
ImGuiID ID;
ImVec2ih Pos;
ImVec2ih Size;
bool Collapsed;
- ImGuiWindowSettings() { Name = NULL; ID = 0; Pos = Size = ImVec2ih(0, 0); Collapsed = false; }
+ ImGuiWindowSettings() { NameOffset = -1; ID = 0; Pos = Size = ImVec2ih(0, 0); Collapsed = false; }
};
struct ImGuiSettingsHandler
@@ -1037,6 +1040,7 @@ struct ImGuiContext
ImGuiTextBuffer SettingsIniData; // In memory .ini settings
ImVector<ImGuiSettingsHandler> SettingsHandlers; // List of .ini settings handlers
ImVector<ImGuiWindowSettings> SettingsWindows; // ImGuiWindow .ini settings entries (parsed from the last loaded .ini file and maintained on saving)
+ ImGuiTextBuffer SettingsWindowsNames; // Names for SettingsWindows
// Logging
bool LogEnabled;
@@ -1336,9 +1340,9 @@ struct IMGUI_API ImGuiWindow
ImRect OuterRectClipped; // == Window->Rect() just after setup in Begin(). == window->Rect() for root window.
ImRect InnerRect; // Inner rectangle (omit title bar, menu bar, scroll bar)
ImRect InnerClipRect; // == InnerRect shrunk by WindowPadding*0.5f on each side, clipped within viewport or parent clip rect.
- ImRect WorkRect; // Cover the whole scrolling region, shrunk by WindowPadding*1.0f on each side. This is meant to replace ContentsRegionRect over time (from 1.71+ onward).
+ ImRect WorkRect; // Cover the whole scrolling region, shrunk by WindowPadding*1.0f on each side. This is meant to replace ContentRegionRect over time (from 1.71+ onward).
ImRect ClipRect; // Current clipping/scissoring rectangle, evolve as we are using PushClipRect(), etc. == DrawList->clip_rect_stack.back().
- ImRect ContentsRegionRect; // FIXME: This is currently confusing/misleading. It is essentially WorkRect but not handling of scrolling. We currently rely on it as right/bottom aligned sizing operation need some size to rely on.
+ ImRect ContentRegionRect; // FIXME: This is currently confusing/misleading. It is essentially WorkRect but not handling of scrolling. We currently rely on it as right/bottom aligned sizing operation need some size to rely on.
int LastFrameActive; // Last frame number the window was Active.
float LastTimeActive; // Last timestamp the window was Active (using float as we don't need high precision there)
@@ -1413,7 +1417,7 @@ enum ImGuiTabBarFlagsPrivate_
// Extend ImGuiTabItemFlags_
enum ImGuiTabItemFlagsPrivate_
{
- ImGuiTabItemFlags_NoCloseButton = 1 << 20 // Store whether p_open is set or not, which we need to recompute WidthContents during layout.
+ ImGuiTabItemFlags_NoCloseButton = 1 << 20 // Store whether p_open is set or not, which we need to recompute ContentWidth during layout.
};
// Storage for one active tab item (sizeof() 26~32 bytes)
@@ -1426,9 +1430,9 @@ struct ImGuiTabItem
int NameOffset; // When Window==NULL, offset to name within parent ImGuiTabBar::TabsNames
float Offset; // Position relative to beginning of tab
float Width; // Width currently displayed
- float WidthContents; // Width of actual contents, stored during BeginTabItem() call
+ float ContentWidth; // Width of actual contents, stored during BeginTabItem() call
- ImGuiTabItem() { ID = Flags = 0; LastFrameVisible = LastFrameSelected = -1; NameOffset = -1; Offset = Width = WidthContents = 0.0f; }
+ ImGuiTabItem() { ID = Flags = 0; LastFrameVisible = LastFrameSelected = -1; NameOffset = -1; Offset = Width = ContentWidth = 0.0f; }
};
// Storage for a tab bar (sizeof() 92~96 bytes)
@@ -1542,8 +1546,8 @@ namespace ImGui
IMGUI_API void PushOverrideID(ImGuiID id);
// Basic Helpers for widget code
- IMGUI_API void ItemSize(const ImVec2& size, float text_baseline_y = 0.0f);
- IMGUI_API void ItemSize(const ImRect& bb, float text_baseline_y = 0.0f);
+ IMGUI_API void ItemSize(const ImVec2& size, float text_baseline_y = -1.0f);
+ IMGUI_API void ItemSize(const ImRect& bb, float text_baseline_y = -1.0f);
IMGUI_API bool ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb = NULL);
IMGUI_API bool ItemHoverable(const ImRect& bb, ImGuiID id);
IMGUI_API bool IsClippedEx(const ImRect& bb, ImGuiID id, bool clip_even_when_logged);
@@ -1581,7 +1585,7 @@ namespace ImGui
IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
IMGUI_API float GetNavInputAmount(ImGuiNavInput n, ImGuiInputReadMode mode);
IMGUI_API ImVec2 GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInputReadMode mode, float slow_factor = 0.0f, float fast_factor = 0.0f);
- IMGUI_API int CalcTypematicPressedRepeatAmount(float t, float t_prev, float repeat_delay, float repeat_rate);
+ IMGUI_API int CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate);
IMGUI_API void ActivateItem(ImGuiID id); // Remotely activate a button, checkbox, tree node etc. given its unique ID. activation is queued and processed on the next frame when the item is encountered again.
IMGUI_API void SetNavID(ImGuiID id, int nav_layer);
IMGUI_API void SetNavIDWithRectRel(ImGuiID id, int nav_layer, const ImRect& rect_rel);
@@ -1648,7 +1652,7 @@ namespace ImGui
IMGUI_API void RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x_start_norm, float x_end_norm, float rounding);
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- // 2019/06/07: Updating prototypes of some of the internal functions. Leaving those for reference for a short while.
+ // [1.71: 2019/06/07: Updating prototypes of some of the internal functions. Leaving those for reference for a short while]
inline void RenderArrow(ImVec2 pos, ImGuiDir dir, float scale=1.0f) { ImGuiWindow* window = GetCurrentWindow(); RenderArrow(window->DrawList, pos, GetColorU32(ImGuiCol_Text), dir, scale); }
inline void RenderBullet(ImVec2 pos) { ImGuiWindow* window = GetCurrentWindow(); RenderBullet(window->DrawList, pos, GetColorU32(ImGuiCol_Text)); }
#endif
@@ -1666,8 +1670,8 @@ namespace ImGui
// Widgets low-level behaviors
IMGUI_API bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags = 0);
- IMGUI_API bool DragBehavior(ImGuiID id, ImGuiDataType data_type, void* v, float v_speed, const void* v_min, const void* v_max, const char* format, float power, ImGuiDragFlags flags);
- IMGUI_API bool SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* v, const void* v_min, const void* v_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb);
+ IMGUI_API bool DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v_speed, const void* p_min, const void* p_max, const char* format, float power, ImGuiDragFlags flags);
+ IMGUI_API bool SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb);
IMGUI_API bool SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f, float hover_visibility_delay = 0.0f);
IMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end = NULL);
IMGUI_API bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0); // Consume previous SetNextItemOpen() data, if any. May return true when logging
@@ -1683,13 +1687,13 @@ namespace ImGui
// Data type helpers
IMGUI_API const ImGuiDataTypeInfo* DataTypeGetInfo(ImGuiDataType data_type);
- IMGUI_API int DataTypeFormatString(char* buf, int buf_size, ImGuiDataType data_type, const void* data_ptr, const char* format);
+ IMGUI_API int DataTypeFormatString(char* buf, int buf_size, ImGuiDataType data_type, const void* p_data, const char* format);
IMGUI_API void DataTypeApplyOp(ImGuiDataType data_type, int op, void* output, void* arg_1, const void* arg_2);
- IMGUI_API bool DataTypeApplyOpFromText(const char* buf, const char* initial_value_buf, ImGuiDataType data_type, void* data_ptr, const char* format);
+ IMGUI_API bool DataTypeApplyOpFromText(const char* buf, const char* initial_value_buf, ImGuiDataType data_type, void* p_data, const char* format);
// InputText
IMGUI_API bool InputTextEx(const char* label, const char* hint, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);
- IMGUI_API bool TempInputTextScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* data_ptr, const char* format);
+ IMGUI_API bool TempInputTextScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format);
inline bool TempInputTextIsActive(ImGuiID id) { ImGuiContext& g = *GImGui; return (g.ActiveId == id && g.TempInputTextId == id); }
// Color
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp
index 2d52e409fa2..e6f61616d5b 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp
@@ -213,7 +213,7 @@ void ImGui::TextEx(const char* text, const char* text_end, ImGuiTextFlags flags)
text_size.y = (pos - text_pos).y;
ImRect bb(text_pos, text_pos + text_size);
- ItemSize(text_size);
+ ItemSize(text_size, 0.0f);
ItemAdd(bb, 0);
}
else
@@ -222,7 +222,7 @@ void ImGui::TextEx(const char* text, const char* text_end, ImGuiTextFlags flags)
const ImVec2 text_size = CalcTextSize(text_begin, text_end, false, wrap_width);
ImRect bb(text_pos, text_pos + text_size);
- ItemSize(text_size);
+ ItemSize(text_size, 0.0f);
if (!ItemAdd(bb, 0))
return;
@@ -359,17 +359,18 @@ void ImGui::BulletTextV(const char* fmt, va_list args)
const char* text_begin = g.TempBuffer;
const char* text_end = text_begin + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
const ImVec2 label_size = CalcTextSize(text_begin, text_end, false);
- const float text_base_offset_y = ImMax(0.0f, window->DC.CurrLineTextBaseOffset); // Latch before ItemSize changes it
- const float line_height = ImMax(ImMin(window->DC.CurrLineSize.y, g.FontSize + g.Style.FramePadding.y*2), g.FontSize);
- const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(g.FontSize + (label_size.x > 0.0f ? (label_size.x + style.FramePadding.x*2) : 0.0f), ImMax(line_height, label_size.y))); // Empty text doesn't add padding
- ItemSize(bb);
+ const ImVec2 total_size = ImVec2(g.FontSize + (label_size.x > 0.0f ? (label_size.x + style.FramePadding.x * 2) : 0.0f), label_size.y); // Empty text doesn't add padding
+ ImVec2 pos = window->DC.CursorPos;
+ pos.y += window->DC.CurrLineTextBaseOffset;
+ ItemSize(total_size, 0.0f);
+ const ImRect bb(pos, pos + total_size);
if (!ItemAdd(bb, 0))
return;
// Render
ImU32 text_col = GetColorU32(ImGuiCol_Text);
- RenderBullet(window->DrawList, bb.Min + ImVec2(style.FramePadding.x + g.FontSize*0.5f, line_height*0.5f), text_col);
- RenderText(bb.Min+ImVec2(g.FontSize + style.FramePadding.x*2, text_base_offset_y), text_begin, text_end, false);
+ RenderBullet(window->DrawList, bb.Min + ImVec2(style.FramePadding.x + g.FontSize*0.5f, g.FontSize*0.5f), text_col);
+ RenderText(bb.Min + ImVec2(g.FontSize + style.FramePadding.x * 2, 0.0f), text_begin, text_end, false);
}
//-------------------------------------------------------------------------
@@ -487,7 +488,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
{
hovered = true;
SetHoveredID(id);
- if (CalcTypematicPressedRepeatAmount(g.HoveredIdTimer + 0.0001f, g.HoveredIdTimer + 0.0001f - g.IO.DeltaTime, 0.01f, 0.70f)) // FIXME: Our formula for CalcTypematicPressedRepeatAmount() is fishy
+ if (CalcTypematicRepeatAmount(g.HoveredIdTimer + 0.0001f - g.IO.DeltaTime, g.HoveredIdTimer + 0.0001f, 0.70f, 0.00f))
{
pressed = true;
FocusWindow(window);
@@ -691,7 +692,7 @@ bool ImGui::ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size, ImGuiBu
const ImGuiID id = window->GetID(str_id);
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
const float default_size = GetFrameHeight();
- ItemSize(size, (size.y >= default_size) ? g.Style.FramePadding.y : 0.0f);
+ ItemSize(size, (size.y >= default_size) ? g.Style.FramePadding.y : -1.0f);
if (!ItemAdd(bb, id))
return false;
@@ -808,7 +809,7 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, floa
const bool horizontal = (axis == ImGuiAxis_X);
ImRect bb = bb_frame;
- bb.Expand(ImVec2(-ImClamp((float)(int)((bb_frame_width - 2.0f) * 0.5f), 0.0f, 3.0f), -ImClamp((float)(int)((bb_frame_height - 2.0f) * 0.5f), 0.0f, 3.0f)));
+ bb.Expand(ImVec2(-ImClamp(IM_FLOOR((bb_frame_width - 2.0f) * 0.5f), 0.0f, 3.0f), -ImClamp(IM_FLOOR((bb_frame_height - 2.0f) * 0.5f), 0.0f, 3.0f)));
// V denote the main, longer axis of the scrollbar (= height for a vertical scrollbar)
const float scrollbar_size_v = horizontal ? bb.GetWidth() : bb.GetHeight();
@@ -851,7 +852,7 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, floa
// Apply scroll
// It is ok to modify Scroll here because we are being called in Begin() after the calculation of ContentSize and before setting up our starting position
const float scroll_v_norm = ImSaturate((clicked_v_norm - g.ScrollbarClickDeltaToGrabCenter - grab_h_norm * 0.5f) / (1.0f - grab_h_norm));
- *p_scroll_v = (float)(int)(0.5f + scroll_v_norm * scroll_max);//(win_size_contents_v - win_size_v));
+ *p_scroll_v = IM_ROUND(scroll_v_norm * scroll_max);//(win_size_contents_v - win_size_v));
// Update values for rendering
scroll_ratio = ImSaturate(*p_scroll_v / scroll_max);
@@ -1004,12 +1005,12 @@ bool ImGui::Checkbox(const char* label, bool* v)
if (window->DC.ItemFlags & ImGuiItemFlags_MixedValue)
{
// Undocumented tristate/mixed/indeterminate checkbox (#2644)
- ImVec2 pad(ImMax(1.0f, (float)(int)(square_sz / 3.6f)), ImMax(1.0f, (float)(int)(square_sz / 3.6f)));
+ ImVec2 pad(ImMax(1.0f, IM_FLOOR(square_sz / 3.6f)), ImMax(1.0f, IM_FLOOR(square_sz / 3.6f)));
window->DrawList->AddRectFilled(check_bb.Min + pad, check_bb.Max - pad, check_col, style.FrameRounding);
}
else if (*v)
{
- const float pad = ImMax(1.0f, (float)(int)(square_sz / 6.0f));
+ const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f));
RenderCheckMark(check_bb.Min + ImVec2(pad, pad), check_col, square_sz - pad*2.0f);
}
@@ -1057,8 +1058,8 @@ bool ImGui::RadioButton(const char* label, bool active)
return false;
ImVec2 center = check_bb.GetCenter();
- center.x = (float)(int)center.x + 0.5f;
- center.y = (float)(int)center.y + 0.5f;
+ center.x = IM_ROUND(center.x);
+ center.y = IM_ROUND(center.y);
const float radius = (square_sz - 1.0f) * 0.5f;
bool hovered, held;
@@ -1070,7 +1071,7 @@ bool ImGui::RadioButton(const char* label, bool active)
window->DrawList->AddCircleFilled(center, radius, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), 16);
if (active)
{
- const float pad = ImMax(1.0f, (float)(int)(square_sz / 6.0f));
+ const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f));
window->DrawList->AddCircleFilled(center, radius - pad, GetColorU32(ImGuiCol_CheckMark), 16);
}
@@ -1347,7 +1348,7 @@ bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float
// Render
const ImU32 col = GetColorU32(held ? ImGuiCol_SeparatorActive : (hovered && g.HoveredIdTimer >= hover_visibility_delay) ? ImGuiCol_SeparatorHovered : ImGuiCol_Separator);
- window->DrawList->AddRectFilled(bb_render.Min, bb_render.Max, col, g.Style.FrameRounding);
+ window->DrawList->AddRectFilled(bb_render.Min, bb_render.Max, col, 0.0f);
return held;
}
@@ -1505,8 +1506,10 @@ bool ImGui::BeginCombo(const char* label, const char* preview_value, ImGuiComboF
SetNextWindowPos(pos);
}
+ // We don't use BeginPopupEx() solely because we have a custom name string, which we could make an argument to BeginPopupEx()
+ ImGuiWindowFlags window_flags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_Popup | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoMove;
+
// Horizontally align ourselves with the framed text
- ImGuiWindowFlags window_flags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_Popup | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings;
PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(style.FramePadding.x, style.WindowPadding.y));
bool ret = Begin(name, NULL, window_flags);
PopStyleVar();
@@ -1678,25 +1681,25 @@ const ImGuiDataTypeInfo* ImGui::DataTypeGetInfo(ImGuiDataType data_type)
return &GDataTypeInfo[data_type];
}
-int ImGui::DataTypeFormatString(char* buf, int buf_size, ImGuiDataType data_type, const void* data_ptr, const char* format)
+int ImGui::DataTypeFormatString(char* buf, int buf_size, ImGuiDataType data_type, const void* p_data, const char* format)
{
// Signedness doesn't matter when pushing integer arguments
if (data_type == ImGuiDataType_S32 || data_type == ImGuiDataType_U32)
- return ImFormatString(buf, buf_size, format, *(const ImU32*)data_ptr);
+ return ImFormatString(buf, buf_size, format, *(const ImU32*)p_data);
if (data_type == ImGuiDataType_S64 || data_type == ImGuiDataType_U64)
- return ImFormatString(buf, buf_size, format, *(const ImU64*)data_ptr);
+ return ImFormatString(buf, buf_size, format, *(const ImU64*)p_data);
if (data_type == ImGuiDataType_Float)
- return ImFormatString(buf, buf_size, format, *(const float*)data_ptr);
+ return ImFormatString(buf, buf_size, format, *(const float*)p_data);
if (data_type == ImGuiDataType_Double)
- return ImFormatString(buf, buf_size, format, *(const double*)data_ptr);
+ return ImFormatString(buf, buf_size, format, *(const double*)p_data);
if (data_type == ImGuiDataType_S8)
- return ImFormatString(buf, buf_size, format, *(const ImS8*)data_ptr);
+ return ImFormatString(buf, buf_size, format, *(const ImS8*)p_data);
if (data_type == ImGuiDataType_U8)
- return ImFormatString(buf, buf_size, format, *(const ImU8*)data_ptr);
+ return ImFormatString(buf, buf_size, format, *(const ImU8*)p_data);
if (data_type == ImGuiDataType_S16)
- return ImFormatString(buf, buf_size, format, *(const ImS16*)data_ptr);
+ return ImFormatString(buf, buf_size, format, *(const ImS16*)p_data);
if (data_type == ImGuiDataType_U16)
- return ImFormatString(buf, buf_size, format, *(const ImU16*)data_ptr);
+ return ImFormatString(buf, buf_size, format, *(const ImU16*)p_data);
IM_ASSERT(0);
return 0;
}
@@ -1753,7 +1756,7 @@ void ImGui::DataTypeApplyOp(ImGuiDataType data_type, int op, void* output, void*
// User can input math operators (e.g. +100) to edit a numerical values.
// NB: This is _not_ a full expression evaluator. We should probably add one and replace this dumb mess..
-bool ImGui::DataTypeApplyOpFromText(const char* buf, const char* initial_value_buf, ImGuiDataType data_type, void* data_ptr, const char* format)
+bool ImGui::DataTypeApplyOpFromText(const char* buf, const char* initial_value_buf, ImGuiDataType data_type, void* p_data, const char* format)
{
while (ImCharIsBlankA(*buf))
buf++;
@@ -1779,7 +1782,7 @@ bool ImGui::DataTypeApplyOpFromText(const char* buf, const char* initial_value_b
int data_backup[2];
const ImGuiDataTypeInfo* type_info = ImGui::DataTypeGetInfo(data_type);
IM_ASSERT(type_info->Size <= sizeof(data_backup));
- memcpy(data_backup, data_ptr, type_info->Size);
+ memcpy(data_backup, p_data, type_info->Size);
if (format == NULL)
format = type_info->ScanFmt;
@@ -1788,7 +1791,7 @@ bool ImGui::DataTypeApplyOpFromText(const char* buf, const char* initial_value_b
int arg1i = 0;
if (data_type == ImGuiDataType_S32)
{
- int* v = (int*)data_ptr;
+ int* v = (int*)p_data;
int arg0i = *v;
float arg1f = 0.0f;
if (op && sscanf(initial_value_buf, format, &arg0i) < 1)
@@ -1803,7 +1806,7 @@ bool ImGui::DataTypeApplyOpFromText(const char* buf, const char* initial_value_b
{
// For floats we have to ignore format with precision (e.g. "%.2f") because sscanf doesn't take them in
format = "%f";
- float* v = (float*)data_ptr;
+ float* v = (float*)p_data;
float arg0f = *v, arg1f = 0.0f;
if (op && sscanf(initial_value_buf, format, &arg0f) < 1)
return false;
@@ -1817,7 +1820,7 @@ bool ImGui::DataTypeApplyOpFromText(const char* buf, const char* initial_value_b
else if (data_type == ImGuiDataType_Double)
{
format = "%lf"; // scanf differentiate float/double unlike printf which forces everything to double because of ellipsis
- double* v = (double*)data_ptr;
+ double* v = (double*)p_data;
double arg0f = *v, arg1f = 0.0;
if (op && sscanf(initial_value_buf, format, &arg0f) < 1)
return false;
@@ -1832,7 +1835,7 @@ bool ImGui::DataTypeApplyOpFromText(const char* buf, const char* initial_value_b
{
// All other types assign constant
// We don't bother handling support for legacy operators since they are a little too crappy. Instead we will later implement a proper expression evaluator in the future.
- sscanf(buf, format, data_ptr);
+ sscanf(buf, format, p_data);
}
else
{
@@ -1840,18 +1843,18 @@ bool ImGui::DataTypeApplyOpFromText(const char* buf, const char* initial_value_b
int v32;
sscanf(buf, format, &v32);
if (data_type == ImGuiDataType_S8)
- *(ImS8*)data_ptr = (ImS8)ImClamp(v32, (int)IM_S8_MIN, (int)IM_S8_MAX);
+ *(ImS8*)p_data = (ImS8)ImClamp(v32, (int)IM_S8_MIN, (int)IM_S8_MAX);
else if (data_type == ImGuiDataType_U8)
- *(ImU8*)data_ptr = (ImU8)ImClamp(v32, (int)IM_U8_MIN, (int)IM_U8_MAX);
+ *(ImU8*)p_data = (ImU8)ImClamp(v32, (int)IM_U8_MIN, (int)IM_U8_MAX);
else if (data_type == ImGuiDataType_S16)
- *(ImS16*)data_ptr = (ImS16)ImClamp(v32, (int)IM_S16_MIN, (int)IM_S16_MAX);
+ *(ImS16*)p_data = (ImS16)ImClamp(v32, (int)IM_S16_MIN, (int)IM_S16_MAX);
else if (data_type == ImGuiDataType_U16)
- *(ImU16*)data_ptr = (ImU16)ImClamp(v32, (int)IM_U16_MIN, (int)IM_U16_MAX);
+ *(ImU16*)p_data = (ImU16)ImClamp(v32, (int)IM_U16_MIN, (int)IM_U16_MAX);
else
IM_ASSERT(0);
}
- return memcmp(data_backup, data_ptr, type_info->Size) != 0;
+ return memcmp(data_backup, p_data, type_info->Size) != 0;
}
static float GetMinimumStepAtDecimalPrecision(int decimal_precision)
@@ -2021,7 +2024,7 @@ bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const
return true;
}
-bool ImGui::DragBehavior(ImGuiID id, ImGuiDataType data_type, void* v, float v_speed, const void* v_min, const void* v_max, const char* format, float power, ImGuiDragFlags flags)
+bool ImGui::DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v_speed, const void* p_min, const void* p_max, const char* format, float power, ImGuiDragFlags flags)
{
ImGuiContext& g = *GImGui;
if (g.ActiveId == id)
@@ -2036,30 +2039,32 @@ bool ImGui::DragBehavior(ImGuiID id, ImGuiDataType data_type, void* v, float v_s
switch (data_type)
{
- case ImGuiDataType_S8: { ImS32 v32 = (ImS32)*(ImS8*)v; bool r = DragBehaviorT<ImS32, ImS32, float >(ImGuiDataType_S32, &v32, v_speed, v_min ? *(const ImS8*) v_min : IM_S8_MIN, v_max ? *(const ImS8*)v_max : IM_S8_MAX, format, power, flags); if (r) *(ImS8*)v = (ImS8)v32; return r; }
- case ImGuiDataType_U8: { ImU32 v32 = (ImU32)*(ImU8*)v; bool r = DragBehaviorT<ImU32, ImS32, float >(ImGuiDataType_U32, &v32, v_speed, v_min ? *(const ImU8*) v_min : IM_U8_MIN, v_max ? *(const ImU8*)v_max : IM_U8_MAX, format, power, flags); if (r) *(ImU8*)v = (ImU8)v32; return r; }
- case ImGuiDataType_S16: { ImS32 v32 = (ImS32)*(ImS16*)v; bool r = DragBehaviorT<ImS32, ImS32, float >(ImGuiDataType_S32, &v32, v_speed, v_min ? *(const ImS16*)v_min : IM_S16_MIN, v_max ? *(const ImS16*)v_max : IM_S16_MAX, format, power, flags); if (r) *(ImS16*)v = (ImS16)v32; return r; }
- case ImGuiDataType_U16: { ImU32 v32 = (ImU32)*(ImU16*)v; bool r = DragBehaviorT<ImU32, ImS32, float >(ImGuiDataType_U32, &v32, v_speed, v_min ? *(const ImU16*)v_min : IM_U16_MIN, v_max ? *(const ImU16*)v_max : IM_U16_MAX, format, power, flags); if (r) *(ImU16*)v = (ImU16)v32; return r; }
- case ImGuiDataType_S32: return DragBehaviorT<ImS32, ImS32, float >(data_type, (ImS32*)v, v_speed, v_min ? *(const ImS32* )v_min : IM_S32_MIN, v_max ? *(const ImS32* )v_max : IM_S32_MAX, format, power, flags);
- case ImGuiDataType_U32: return DragBehaviorT<ImU32, ImS32, float >(data_type, (ImU32*)v, v_speed, v_min ? *(const ImU32* )v_min : IM_U32_MIN, v_max ? *(const ImU32* )v_max : IM_U32_MAX, format, power, flags);
- case ImGuiDataType_S64: return DragBehaviorT<ImS64, ImS64, double>(data_type, (ImS64*)v, v_speed, v_min ? *(const ImS64* )v_min : IM_S64_MIN, v_max ? *(const ImS64* )v_max : IM_S64_MAX, format, power, flags);
- case ImGuiDataType_U64: return DragBehaviorT<ImU64, ImS64, double>(data_type, (ImU64*)v, v_speed, v_min ? *(const ImU64* )v_min : IM_U64_MIN, v_max ? *(const ImU64* )v_max : IM_U64_MAX, format, power, flags);
- case ImGuiDataType_Float: return DragBehaviorT<float, float, float >(data_type, (float*)v, v_speed, v_min ? *(const float* )v_min : -FLT_MAX, v_max ? *(const float* )v_max : FLT_MAX, format, power, flags);
- case ImGuiDataType_Double: return DragBehaviorT<double,double,double>(data_type, (double*)v, v_speed, v_min ? *(const double*)v_min : -DBL_MAX, v_max ? *(const double*)v_max : DBL_MAX, format, power, flags);
+ case ImGuiDataType_S8: { ImS32 v32 = (ImS32)*(ImS8*)p_v; bool r = DragBehaviorT<ImS32, ImS32, float>(ImGuiDataType_S32, &v32, v_speed, p_min ? *(const ImS8*) p_min : IM_S8_MIN, p_max ? *(const ImS8*)p_max : IM_S8_MAX, format, power, flags); if (r) *(ImS8*)p_v = (ImS8)v32; return r; }
+ case ImGuiDataType_U8: { ImU32 v32 = (ImU32)*(ImU8*)p_v; bool r = DragBehaviorT<ImU32, ImS32, float>(ImGuiDataType_U32, &v32, v_speed, p_min ? *(const ImU8*) p_min : IM_U8_MIN, p_max ? *(const ImU8*)p_max : IM_U8_MAX, format, power, flags); if (r) *(ImU8*)p_v = (ImU8)v32; return r; }
+ case ImGuiDataType_S16: { ImS32 v32 = (ImS32)*(ImS16*)p_v; bool r = DragBehaviorT<ImS32, ImS32, float>(ImGuiDataType_S32, &v32, v_speed, p_min ? *(const ImS16*)p_min : IM_S16_MIN, p_max ? *(const ImS16*)p_max : IM_S16_MAX, format, power, flags); if (r) *(ImS16*)p_v = (ImS16)v32; return r; }
+ case ImGuiDataType_U16: { ImU32 v32 = (ImU32)*(ImU16*)p_v; bool r = DragBehaviorT<ImU32, ImS32, float>(ImGuiDataType_U32, &v32, v_speed, p_min ? *(const ImU16*)p_min : IM_U16_MIN, p_max ? *(const ImU16*)p_max : IM_U16_MAX, format, power, flags); if (r) *(ImU16*)p_v = (ImU16)v32; return r; }
+ case ImGuiDataType_S32: return DragBehaviorT<ImS32, ImS32, float >(data_type, (ImS32*)p_v, v_speed, p_min ? *(const ImS32* )p_min : IM_S32_MIN, p_max ? *(const ImS32* )p_max : IM_S32_MAX, format, power, flags);
+ case ImGuiDataType_U32: return DragBehaviorT<ImU32, ImS32, float >(data_type, (ImU32*)p_v, v_speed, p_min ? *(const ImU32* )p_min : IM_U32_MIN, p_max ? *(const ImU32* )p_max : IM_U32_MAX, format, power, flags);
+ case ImGuiDataType_S64: return DragBehaviorT<ImS64, ImS64, double>(data_type, (ImS64*)p_v, v_speed, p_min ? *(const ImS64* )p_min : IM_S64_MIN, p_max ? *(const ImS64* )p_max : IM_S64_MAX, format, power, flags);
+ case ImGuiDataType_U64: return DragBehaviorT<ImU64, ImS64, double>(data_type, (ImU64*)p_v, v_speed, p_min ? *(const ImU64* )p_min : IM_U64_MIN, p_max ? *(const ImU64* )p_max : IM_U64_MAX, format, power, flags);
+ case ImGuiDataType_Float: return DragBehaviorT<float, float, float >(data_type, (float*)p_v, v_speed, p_min ? *(const float* )p_min : -FLT_MAX, p_max ? *(const float* )p_max : FLT_MAX, format, power, flags);
+ case ImGuiDataType_Double: return DragBehaviorT<double,double,double>(data_type, (double*)p_v, v_speed, p_min ? *(const double*)p_min : -DBL_MAX, p_max ? *(const double*)p_max : DBL_MAX, format, power, flags);
case ImGuiDataType_COUNT: break;
}
IM_ASSERT(0);
return false;
}
-bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* v, float v_speed, const void* v_min, const void* v_max, const char* format, float power)
+// Note: p_data, p_min and p_max are _pointers_ to a memory address holding the data. For a Drag widget, p_min and p_max are optional.
+// Read code of e.g. SliderFloat(), SliderInt() etc. or examples in 'Demo->Widgets->Data Types' to understand how to use this function directly.
+bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data, float v_speed, const void* p_min, const void* p_max, const char* format, float power)
{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
if (power != 1.0f)
- IM_ASSERT(v_min != NULL && v_max != NULL); // When using a power curve the drag needs to have known bounds
+ IM_ASSERT(p_min != NULL && p_max != NULL); // When using a power curve the drag needs to have known bounds
ImGuiContext& g = *GImGui;
const ImGuiStyle& style = g.Style;
@@ -2102,7 +2107,7 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* v, floa
}
}
if (temp_input_is_active || temp_input_start)
- return TempInputTextScalar(frame_bb, id, label, data_type, v, format);
+ return TempInputTextScalar(frame_bb, id, label, data_type, p_data, format);
// Draw frame
const ImU32 frame_col = GetColorU32(g.ActiveId == id ? ImGuiCol_FrameBgActive : g.HoveredId == id ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg);
@@ -2110,13 +2115,13 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* v, floa
RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, style.FrameRounding);
// Drag behavior
- const bool value_changed = DragBehavior(id, data_type, v, v_speed, v_min, v_max, format, power, ImGuiDragFlags_None);
+ const bool value_changed = DragBehavior(id, data_type, p_data, v_speed, p_min, p_max, format, power, ImGuiDragFlags_None);
if (value_changed)
MarkItemEdited(id);
// Display value using user-provided display format so user can add prefix/suffix/decorations to the value.
char value_buf[64];
- const char* value_buf_end = value_buf + DataTypeFormatString(value_buf, IM_ARRAYSIZE(value_buf), data_type, v, format);
+ const char* value_buf_end = value_buf + DataTypeFormatString(value_buf, IM_ARRAYSIZE(value_buf), data_type, p_data, format);
RenderTextClipped(frame_bb.Min, frame_bb.Max, value_buf, value_buf_end, NULL, ImVec2(0.5f, 0.5f));
if (label_size.x > 0.0f)
@@ -2126,7 +2131,7 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* v, floa
return value_changed;
}
-bool ImGui::DragScalarN(const char* label, ImGuiDataType data_type, void* v, int components, float v_speed, const void* v_min, const void* v_max, const char* format, float power)
+bool ImGui::DragScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, float v_speed, const void* p_min, const void* p_max, const char* format, float power)
{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
@@ -2143,10 +2148,10 @@ bool ImGui::DragScalarN(const char* label, ImGuiDataType data_type, void* v, int
PushID(i);
if (i > 0)
SameLine(0, g.Style.ItemInnerSpacing.x);
- value_changed |= DragScalar("", data_type, v, v_speed, v_min, v_max, format, power);
+ value_changed |= DragScalar("", data_type, p_data, v_speed, p_min, p_max, format, power);
PopID();
PopItemWidth();
- v = (void*)((char*)v + type_size);
+ p_data = (void*)((char*)p_data + type_size);
}
PopID();
@@ -2487,39 +2492,41 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
// For 32-bits and larger types, slider bounds are limited to half the natural type range.
// So e.g. an integer Slider between INT_MAX-10 and INT_MAX will fail, but an integer Slider between INT_MAX/2-10 and INT_MAX/2 will be ok.
// It would be possible to lift that limitation with some work but it doesn't seem to be worth it for sliders.
-bool ImGui::SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* v, const void* v_min, const void* v_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb)
+bool ImGui::SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb)
{
switch (data_type)
{
- case ImGuiDataType_S8: { ImS32 v32 = (ImS32)*(ImS8*)v; bool r = SliderBehaviorT<ImS32, ImS32, float >(bb, id, ImGuiDataType_S32, &v32, *(const ImS8*)v_min, *(const ImS8*)v_max, format, power, flags, out_grab_bb); if (r) *(ImS8*)v = (ImS8)v32; return r; }
- case ImGuiDataType_U8: { ImU32 v32 = (ImU32)*(ImU8*)v; bool r = SliderBehaviorT<ImU32, ImS32, float >(bb, id, ImGuiDataType_U32, &v32, *(const ImU8*)v_min, *(const ImU8*)v_max, format, power, flags, out_grab_bb); if (r) *(ImU8*)v = (ImU8)v32; return r; }
- case ImGuiDataType_S16: { ImS32 v32 = (ImS32)*(ImS16*)v; bool r = SliderBehaviorT<ImS32, ImS32, float >(bb, id, ImGuiDataType_S32, &v32, *(const ImS16*)v_min, *(const ImS16*)v_max, format, power, flags, out_grab_bb); if (r) *(ImS16*)v = (ImS16)v32; return r; }
- case ImGuiDataType_U16: { ImU32 v32 = (ImU32)*(ImU16*)v; bool r = SliderBehaviorT<ImU32, ImS32, float >(bb, id, ImGuiDataType_U32, &v32, *(const ImU16*)v_min, *(const ImU16*)v_max, format, power, flags, out_grab_bb); if (r) *(ImU16*)v = (ImU16)v32; return r; }
+ case ImGuiDataType_S8: { ImS32 v32 = (ImS32)*(ImS8*)p_v; bool r = SliderBehaviorT<ImS32, ImS32, float>(bb, id, ImGuiDataType_S32, &v32, *(const ImS8*)p_min, *(const ImS8*)p_max, format, power, flags, out_grab_bb); if (r) *(ImS8*)p_v = (ImS8)v32; return r; }
+ case ImGuiDataType_U8: { ImU32 v32 = (ImU32)*(ImU8*)p_v; bool r = SliderBehaviorT<ImU32, ImS32, float>(bb, id, ImGuiDataType_U32, &v32, *(const ImU8*)p_min, *(const ImU8*)p_max, format, power, flags, out_grab_bb); if (r) *(ImU8*)p_v = (ImU8)v32; return r; }
+ case ImGuiDataType_S16: { ImS32 v32 = (ImS32)*(ImS16*)p_v; bool r = SliderBehaviorT<ImS32, ImS32, float>(bb, id, ImGuiDataType_S32, &v32, *(const ImS16*)p_min, *(const ImS16*)p_max, format, power, flags, out_grab_bb); if (r) *(ImS16*)p_v = (ImS16)v32; return r; }
+ case ImGuiDataType_U16: { ImU32 v32 = (ImU32)*(ImU16*)p_v; bool r = SliderBehaviorT<ImU32, ImS32, float>(bb, id, ImGuiDataType_U32, &v32, *(const ImU16*)p_min, *(const ImU16*)p_max, format, power, flags, out_grab_bb); if (r) *(ImU16*)p_v = (ImU16)v32; return r; }
case ImGuiDataType_S32:
- IM_ASSERT(*(const ImS32*)v_min >= IM_S32_MIN/2 && *(const ImS32*)v_max <= IM_S32_MAX/2);
- return SliderBehaviorT<ImS32, ImS32, float >(bb, id, data_type, (ImS32*)v, *(const ImS32*)v_min, *(const ImS32*)v_max, format, power, flags, out_grab_bb);
+ IM_ASSERT(*(const ImS32*)p_min >= IM_S32_MIN/2 && *(const ImS32*)p_max <= IM_S32_MAX/2);
+ return SliderBehaviorT<ImS32, ImS32, float >(bb, id, data_type, (ImS32*)p_v, *(const ImS32*)p_min, *(const ImS32*)p_max, format, power, flags, out_grab_bb);
case ImGuiDataType_U32:
- IM_ASSERT(*(const ImU32*)v_max <= IM_U32_MAX/2);
- return SliderBehaviorT<ImU32, ImS32, float >(bb, id, data_type, (ImU32*)v, *(const ImU32*)v_min, *(const ImU32*)v_max, format, power, flags, out_grab_bb);
+ IM_ASSERT(*(const ImU32*)p_max <= IM_U32_MAX/2);
+ return SliderBehaviorT<ImU32, ImS32, float >(bb, id, data_type, (ImU32*)p_v, *(const ImU32*)p_min, *(const ImU32*)p_max, format, power, flags, out_grab_bb);
case ImGuiDataType_S64:
- IM_ASSERT(*(const ImS64*)v_min >= IM_S64_MIN/2 && *(const ImS64*)v_max <= IM_S64_MAX/2);
- return SliderBehaviorT<ImS64, ImS64, double>(bb, id, data_type, (ImS64*)v, *(const ImS64*)v_min, *(const ImS64*)v_max, format, power, flags, out_grab_bb);
+ IM_ASSERT(*(const ImS64*)p_min >= IM_S64_MIN/2 && *(const ImS64*)p_max <= IM_S64_MAX/2);
+ return SliderBehaviorT<ImS64, ImS64, double>(bb, id, data_type, (ImS64*)p_v, *(const ImS64*)p_min, *(const ImS64*)p_max, format, power, flags, out_grab_bb);
case ImGuiDataType_U64:
- IM_ASSERT(*(const ImU64*)v_max <= IM_U64_MAX/2);
- return SliderBehaviorT<ImU64, ImS64, double>(bb, id, data_type, (ImU64*)v, *(const ImU64*)v_min, *(const ImU64*)v_max, format, power, flags, out_grab_bb);
+ IM_ASSERT(*(const ImU64*)p_max <= IM_U64_MAX/2);
+ return SliderBehaviorT<ImU64, ImS64, double>(bb, id, data_type, (ImU64*)p_v, *(const ImU64*)p_min, *(const ImU64*)p_max, format, power, flags, out_grab_bb);
case ImGuiDataType_Float:
- IM_ASSERT(*(const float*)v_min >= -FLT_MAX/2.0f && *(const float*)v_max <= FLT_MAX/2.0f);
- return SliderBehaviorT<float, float, float >(bb, id, data_type, (float*)v, *(const float*)v_min, *(const float*)v_max, format, power, flags, out_grab_bb);
+ IM_ASSERT(*(const float*)p_min >= -FLT_MAX/2.0f && *(const float*)p_max <= FLT_MAX/2.0f);
+ return SliderBehaviorT<float, float, float >(bb, id, data_type, (float*)p_v, *(const float*)p_min, *(const float*)p_max, format, power, flags, out_grab_bb);
case ImGuiDataType_Double:
- IM_ASSERT(*(const double*)v_min >= -DBL_MAX/2.0f && *(const double*)v_max <= DBL_MAX/2.0f);
- return SliderBehaviorT<double,double,double>(bb, id, data_type, (double*)v, *(const double*)v_min, *(const double*)v_max, format, power, flags, out_grab_bb);
+ IM_ASSERT(*(const double*)p_min >= -DBL_MAX/2.0f && *(const double*)p_max <= DBL_MAX/2.0f);
+ return SliderBehaviorT<double,double,double>(bb, id, data_type, (double*)p_v, *(const double*)p_min, *(const double*)p_max, format, power, flags, out_grab_bb);
case ImGuiDataType_COUNT: break;
}
IM_ASSERT(0);
return false;
}
-bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* v, const void* v_min, const void* v_max, const char* format, float power)
+// Note: p_data, p_min and p_max are _pointers_ to a memory address holding the data. For a slider, they are all required.
+// Read code of e.g. SliderFloat(), SliderInt() etc. or examples in 'Demo->Widgets->Data Types' to understand how to use this function directly.
+bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format, float power)
{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
@@ -2566,7 +2573,7 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* v, co
}
}
if (temp_input_is_active || temp_input_start)
- return TempInputTextScalar(frame_bb, id, label, data_type, v, format);
+ return TempInputTextScalar(frame_bb, id, label, data_type, p_data, format);
// Draw frame
const ImU32 frame_col = GetColorU32(g.ActiveId == id ? ImGuiCol_FrameBgActive : g.HoveredId == id ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg);
@@ -2575,7 +2582,7 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* v, co
// Slider behavior
ImRect grab_bb;
- const bool value_changed = SliderBehavior(frame_bb, id, data_type, v, v_min, v_max, format, power, ImGuiSliderFlags_None, &grab_bb);
+ const bool value_changed = SliderBehavior(frame_bb, id, data_type, p_data, p_min, p_max, format, power, ImGuiSliderFlags_None, &grab_bb);
if (value_changed)
MarkItemEdited(id);
@@ -2585,7 +2592,7 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* v, co
// Display value using user-provided display format so user can add prefix/suffix/decorations to the value.
char value_buf[64];
- const char* value_buf_end = value_buf + DataTypeFormatString(value_buf, IM_ARRAYSIZE(value_buf), data_type, v, format);
+ const char* value_buf_end = value_buf + DataTypeFormatString(value_buf, IM_ARRAYSIZE(value_buf), data_type, p_data, format);
RenderTextClipped(frame_bb.Min, frame_bb.Max, value_buf, value_buf_end, NULL, ImVec2(0.5f,0.5f));
if (label_size.x > 0.0f)
@@ -2681,7 +2688,7 @@ bool ImGui::SliderInt4(const char* label, int v[4], int v_min, int v_max, const
return SliderScalarN(label, ImGuiDataType_S32, v, 4, &v_min, &v_max, format);
}
-bool ImGui::VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType data_type, void* v, const void* v_min, const void* v_max, const char* format, float power)
+bool ImGui::VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format, float power)
{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
@@ -2721,7 +2728,7 @@ bool ImGui::VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType d
// Slider behavior
ImRect grab_bb;
- const bool value_changed = SliderBehavior(frame_bb, id, data_type, v, v_min, v_max, format, power, ImGuiSliderFlags_Vertical, &grab_bb);
+ const bool value_changed = SliderBehavior(frame_bb, id, data_type, p_data, p_min, p_max, format, power, ImGuiSliderFlags_Vertical, &grab_bb);
if (value_changed)
MarkItemEdited(id);
@@ -2732,7 +2739,7 @@ bool ImGui::VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType d
// Display value using user-provided display format so user can add prefix/suffix/decorations to the value.
// For the vertical slider we allow centered text to overlap the frame padding
char value_buf[64];
- const char* value_buf_end = value_buf + DataTypeFormatString(value_buf, IM_ARRAYSIZE(value_buf), data_type, v, format);
+ const char* value_buf_end = value_buf + DataTypeFormatString(value_buf, IM_ARRAYSIZE(value_buf), data_type, p_data, format);
RenderTextClipped(ImVec2(frame_bb.Min.x, frame_bb.Min.y + style.FramePadding.y), frame_bb.Max, value_buf, value_buf_end, NULL, ImVec2(0.5f,0.0f));
if (label_size.x > 0.0f)
RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);
@@ -2845,7 +2852,7 @@ int ImParseFormatPrecision(const char* fmt, int default_precision)
// Create text input in place of another active widget (e.g. used when doing a CTRL+Click on drag/slider widgets)
// FIXME: Facilitate using this in variety of other situations.
-bool ImGui::TempInputTextScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* data_ptr, const char* format)
+bool ImGui::TempInputTextScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format)
{
ImGuiContext& g = *GImGui;
@@ -2858,7 +2865,7 @@ bool ImGui::TempInputTextScalar(const ImRect& bb, ImGuiID id, const char* label,
char fmt_buf[32];
char data_buf[32];
format = ImParseFormatTrimDecorations(format, fmt_buf, IM_ARRAYSIZE(fmt_buf));
- DataTypeFormatString(data_buf, IM_ARRAYSIZE(data_buf), data_type, data_ptr, format);
+ DataTypeFormatString(data_buf, IM_ARRAYSIZE(data_buf), data_type, p_data, format);
ImStrTrimBlanks(data_buf);
g.CurrentWindow->DC.CursorPos = bb.Min;
@@ -2873,14 +2880,16 @@ bool ImGui::TempInputTextScalar(const ImRect& bb, ImGuiID id, const char* label,
}
if (value_changed)
{
- value_changed = DataTypeApplyOpFromText(data_buf, g.InputTextState.InitialTextA.Data, data_type, data_ptr, NULL);
+ value_changed = DataTypeApplyOpFromText(data_buf, g.InputTextState.InitialTextA.Data, data_type, p_data, NULL);
if (value_changed)
MarkItemEdited(id);
}
return value_changed;
}
-bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* data_ptr, const void* step, const void* step_fast, const char* format, ImGuiInputTextFlags flags)
+// Note: p_data, p_step, p_step_fast are _pointers_ to a memory address holding the data. For an Input widget, p_step and p_step_fast are optional.
+// Read code of e.g. InputFloat(), InputInt() etc. or examples in 'Demo->Widgets->Data Types' to understand how to use this function directly.
+bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_step, const void* p_step_fast, const char* format, ImGuiInputTextFlags flags)
{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
@@ -2893,7 +2902,7 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* data_p
format = DataTypeGetInfo(data_type)->PrintFmt;
char buf[64];
- DataTypeFormatString(buf, IM_ARRAYSIZE(buf), data_type, data_ptr, format);
+ DataTypeFormatString(buf, IM_ARRAYSIZE(buf), data_type, p_data, format);
bool value_changed = false;
if ((flags & (ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsScientific)) == 0)
@@ -2901,7 +2910,7 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* data_p
flags |= ImGuiInputTextFlags_AutoSelectAll;
flags |= ImGuiInputTextFlags_NoMarkEdited; // We call MarkItemEdited() ourselve by comparing the actual data rather than the string.
- if (step != NULL)
+ if (p_step != NULL)
{
const float button_size = GetFrameHeight();
@@ -2909,7 +2918,7 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* data_p
PushID(label);
SetNextItemWidth(ImMax(1.0f, CalcItemWidth() - (button_size + style.ItemInnerSpacing.x) * 2));
if (InputText("", buf, IM_ARRAYSIZE(buf), flags)) // PushId(label) + "" gives us the expected ID from outside point of view
- value_changed = DataTypeApplyOpFromText(buf, g.InputTextState.InitialTextA.Data, data_type, data_ptr, format);
+ value_changed = DataTypeApplyOpFromText(buf, g.InputTextState.InitialTextA.Data, data_type, p_data, format);
// Step buttons
const ImVec2 backup_frame_padding = style.FramePadding;
@@ -2920,13 +2929,13 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* data_p
SameLine(0, style.ItemInnerSpacing.x);
if (ButtonEx("-", ImVec2(button_size, button_size), button_flags))
{
- DataTypeApplyOp(data_type, '-', data_ptr, data_ptr, g.IO.KeyCtrl && step_fast ? step_fast : step);
+ DataTypeApplyOp(data_type, '-', p_data, p_data, g.IO.KeyCtrl && p_step_fast ? p_step_fast : p_step);
value_changed = true;
}
SameLine(0, style.ItemInnerSpacing.x);
if (ButtonEx("+", ImVec2(button_size, button_size), button_flags))
{
- DataTypeApplyOp(data_type, '+', data_ptr, data_ptr, g.IO.KeyCtrl && step_fast ? step_fast : step);
+ DataTypeApplyOp(data_type, '+', p_data, p_data, g.IO.KeyCtrl && p_step_fast ? p_step_fast : p_step);
value_changed = true;
}
@@ -2944,7 +2953,7 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* data_p
else
{
if (InputText(label, buf, IM_ARRAYSIZE(buf), flags))
- value_changed = DataTypeApplyOpFromText(buf, g.InputTextState.InitialTextA.Data, data_type, data_ptr, format);
+ value_changed = DataTypeApplyOpFromText(buf, g.InputTextState.InitialTextA.Data, data_type, p_data, format);
}
if (value_changed)
MarkItemEdited(window->DC.LastItemId);
@@ -2952,7 +2961,7 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* data_p
return value_changed;
}
-bool ImGui::InputScalarN(const char* label, ImGuiDataType data_type, void* v, int components, const void* step, const void* step_fast, const char* format, ImGuiInputTextFlags flags)
+bool ImGui::InputScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, const void* p_step, const void* p_step_fast, const char* format, ImGuiInputTextFlags flags)
{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
@@ -2969,10 +2978,10 @@ bool ImGui::InputScalarN(const char* label, ImGuiDataType data_type, void* v, in
PushID(i);
if (i > 0)
SameLine(0, g.Style.ItemInnerSpacing.x);
- value_changed |= InputScalar("", data_type, v, step, step_fast, format, flags);
+ value_changed |= InputScalar("", data_type, p_data, p_step, p_step_fast, format, flags);
PopID();
PopItemWidth();
- v = (void*)((char*)v + type_size);
+ p_data = (void*)((char*)p_data + type_size);
}
PopID();
@@ -3338,6 +3347,10 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
return false;
}
+ // We ignore Ascii representation of delete (emitted from Backspace on OSX, see #2578, #2817)
+ if (c == 127)
+ return false;
+
// Filter private Unicode range. GLFW on OSX seems to send private characters for special keys like arrow keys (FIXME)
if (c >= 0xE000 && c <= 0xF8FF)
return false;
@@ -3419,11 +3432,14 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
BeginGroup();
const ImGuiID id = window->GetID(label);
const ImVec2 label_size = CalcTextSize(label, NULL, true);
- ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), (is_multiline ? g.FontSize * 8.0f : label_size.y) + style.FramePadding.y*2.0f); // Arbitrary default of 8 lines high for multi-line
- const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + size);
- const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? (style.ItemInnerSpacing.x + label_size.x) : 0.0f, 0.0f));
+ const ImVec2 frame_size = CalcItemSize(size_arg, CalcItemWidth(), (is_multiline ? g.FontSize * 8.0f : label_size.y) + style.FramePadding.y*2.0f); // Arbitrary default of 8 lines high for multi-line
+ const ImVec2 total_size = ImVec2(frame_size.x + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), frame_size.y);
+
+ const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
+ const ImRect total_bb(frame_bb.Min, frame_bb.Min + total_size);
ImGuiWindow* draw_window = window;
+ ImVec2 inner_size = frame_size;
if (is_multiline)
{
if (!ItemAdd(total_bb, id, &frame_bb))
@@ -3438,9 +3454,9 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
EndGroup();
return false;
}
- draw_window = GetCurrentWindow();
+ draw_window = g.CurrentWindow; // Child window
draw_window->DC.NavLayerActiveMaskNext |= draw_window->DC.NavLayerCurrentMask; // This is to ensure that EndChild() will display a navigation highlight
- size.x -= draw_window->ScrollbarSizes.x;
+ inner_size.x -= draw_window->ScrollbarSizes.x;
}
else
{
@@ -3523,6 +3539,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
// Declare our inputs
IM_ASSERT(ImGuiNavInput_COUNT < 32);
+ g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right);
if (is_multiline || (flags & ImGuiInputTextFlags_CallbackHistory))
g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Up) | (1 << ImGuiDir_Down);
g.ActiveIdUsingNavInputMask |= (1 << ImGuiNavInput_Cancel);
@@ -3929,7 +3946,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
RenderFrame(frame_bb.Min, frame_bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding);
}
- const ImVec4 clip_rect(frame_bb.Min.x, frame_bb.Min.y, frame_bb.Min.x + size.x, frame_bb.Min.y + size.y); // Not using frame_bb.Max because we have adjusted size
+ const ImVec4 clip_rect(frame_bb.Min.x, frame_bb.Min.y, frame_bb.Min.x + inner_size.x, frame_bb.Min.y + inner_size.y); // Not using frame_bb.Max because we have adjusted size
ImVec2 draw_pos = is_multiline ? draw_window->DC.CursorPos : frame_bb.Min + style.FramePadding;
ImVec2 text_size(0.0f, 0.0f);
@@ -4010,7 +4027,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
// Store text height (note that we haven't calculated text width at all, see GitHub issues #383, #1224)
if (is_multiline)
- text_size = ImVec2(size.x, line_count * g.FontSize);
+ text_size = ImVec2(inner_size.x, line_count * g.FontSize);
}
// Scroll
@@ -4019,11 +4036,11 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
// Horizontal scroll in chunks of quarter width
if (!(flags & ImGuiInputTextFlags_NoHorizontalScroll))
{
- const float scroll_increment_x = size.x * 0.25f;
+ const float scroll_increment_x = inner_size.x * 0.25f;
if (cursor_offset.x < state->ScrollX)
- state->ScrollX = (float)(int)ImMax(0.0f, cursor_offset.x - scroll_increment_x);
- else if (cursor_offset.x - size.x >= state->ScrollX)
- state->ScrollX = (float)(int)(cursor_offset.x - size.x + scroll_increment_x);
+ state->ScrollX = IM_FLOOR(ImMax(0.0f, cursor_offset.x - scroll_increment_x));
+ else if (cursor_offset.x - inner_size.x >= state->ScrollX)
+ state->ScrollX = IM_FLOOR(cursor_offset.x - inner_size.x + scroll_increment_x);
}
else
{
@@ -4036,8 +4053,8 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
float scroll_y = draw_window->Scroll.y;
if (cursor_offset.y - g.FontSize < scroll_y)
scroll_y = ImMax(0.0f, cursor_offset.y - g.FontSize);
- else if (cursor_offset.y - size.y >= scroll_y)
- scroll_y = cursor_offset.y - size.y;
+ else if (cursor_offset.y - inner_size.y >= scroll_y)
+ scroll_y = cursor_offset.y - inner_size.y;
draw_pos.y += (draw_window->Scroll.y - scroll_y); // Manipulate cursor pos immediately avoid a frame of lag
draw_window->Scroll.y = scroll_y;
}
@@ -4071,7 +4088,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
else
{
ImVec2 rect_size = InputTextCalcTextSizeW(p, text_selected_end, &p, NULL, true);
- if (rect_size.x <= 0.0f) rect_size.x = (float)(int)(g.Font->GetCharAdvance((ImWchar)' ') * 0.50f); // So we can see selected empty lines
+ if (rect_size.x <= 0.0f) rect_size.x = IM_FLOOR(g.Font->GetCharAdvance((ImWchar)' ') * 0.50f); // So we can see selected empty lines
ImRect rect(rect_pos + ImVec2(0.0f, bg_offy_up - g.FontSize), rect_pos +ImVec2(rect_size.x, bg_offy_dn));
rect.ClipWith(clip_rect);
if (rect.Overlaps(clip_rect))
@@ -4108,7 +4125,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
{
// Render text only (no selection, no cursor)
if (is_multiline)
- text_size = ImVec2(size.x, InputTextCalcTextLenAndLineCount(buf_display, &buf_display_end) * g.FontSize); // We don't need width
+ text_size = ImVec2(inner_size.x, InputTextCalcTextLenAndLineCount(buf_display, &buf_display_end) * g.FontSize); // We don't need width
else if (!is_displaying_hint && g.ActiveId == id)
buf_display_end = buf_display + state->CurLenA;
else if (!is_displaying_hint)
@@ -4238,8 +4255,8 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
if ((flags & (ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV)) != 0 && (flags & ImGuiColorEditFlags_NoInputs) == 0)
{
// RGB/HSV 0..255 Sliders
- const float w_item_one = ImMax(1.0f, (float)(int)((w_inputs - (style.ItemInnerSpacing.x) * (components-1)) / (float)components));
- const float w_item_last = ImMax(1.0f, (float)(int)(w_inputs - (w_item_one + style.ItemInnerSpacing.x) * (components-1)));
+ const float w_item_one = ImMax(1.0f, IM_FLOOR((w_inputs - (style.ItemInnerSpacing.x) * (components-1)) / (float)components));
+ const float w_item_last = ImMax(1.0f, IM_FLOOR(w_inputs - (w_item_one + style.ItemInnerSpacing.x) * (components-1)));
const bool hide_prefix = (w_item_one <= CalcTextSize((flags & ImGuiColorEditFlags_Float) ? "M:0.000" : "M:000").x);
static const char* ids[4] = { "##X", "##Y", "##Z", "##W" };
@@ -4514,7 +4531,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
float sv_picker_size = ImMax(bars_width * 1, width - (alpha_bar ? 2 : 1) * (bars_width + style.ItemInnerSpacing.x)); // Saturation/Value picking box
float bar0_pos_x = picker_pos.x + sv_picker_size + style.ItemInnerSpacing.x;
float bar1_pos_x = bar0_pos_x + bars_width + style.ItemInnerSpacing.x;
- float bars_triangles_half_sz = (float)(int)(bars_width * 0.20f);
+ float bars_triangles_half_sz = IM_FLOOR(bars_width * 0.20f);
float backup_initial_col[4];
memcpy(backup_initial_col, col, components * sizeof(float));
@@ -4783,7 +4800,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
draw_list->PrimVtx(trb, uv_white, hue_color32);
draw_list->PrimVtx(trc, uv_white, col_white);
draw_list->PrimVtx(tra, uv_white, 0);
- draw_list->PrimVtx(trb, uv_white, col_white);
+ draw_list->PrimVtx(trb, uv_white, col_black);
draw_list->PrimVtx(trc, uv_white, 0);
draw_list->AddTriangle(tra, trb, trc, col_midgrey, 1.5f);
sv_cursor_pos = ImLerp(ImLerp(trc, tra, ImSaturate(S)), trb, ImSaturate(1 - V));
@@ -4794,13 +4811,13 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
draw_list->AddRectFilledMultiColor(picker_pos, picker_pos + ImVec2(sv_picker_size, sv_picker_size), col_white, hue_color32, hue_color32, col_white);
draw_list->AddRectFilledMultiColor(picker_pos, picker_pos + ImVec2(sv_picker_size, sv_picker_size), 0, 0, col_black, col_black);
RenderFrameBorder(picker_pos, picker_pos + ImVec2(sv_picker_size, sv_picker_size), 0.0f);
- sv_cursor_pos.x = ImClamp((float)(int)(picker_pos.x + ImSaturate(S) * sv_picker_size + 0.5f), picker_pos.x + 2, picker_pos.x + sv_picker_size - 2); // Sneakily prevent the circle to stick out too much
- sv_cursor_pos.y = ImClamp((float)(int)(picker_pos.y + ImSaturate(1 - V) * sv_picker_size + 0.5f), picker_pos.y + 2, picker_pos.y + sv_picker_size - 2);
+ sv_cursor_pos.x = ImClamp(IM_ROUND(picker_pos.x + ImSaturate(S) * sv_picker_size), picker_pos.x + 2, picker_pos.x + sv_picker_size - 2); // Sneakily prevent the circle to stick out too much
+ sv_cursor_pos.y = ImClamp(IM_ROUND(picker_pos.y + ImSaturate(1 - V) * sv_picker_size), picker_pos.y + 2, picker_pos.y + sv_picker_size - 2);
// Render Hue Bar
for (int i = 0; i < 6; ++i)
draw_list->AddRectFilledMultiColor(ImVec2(bar0_pos_x, picker_pos.y + i * (sv_picker_size / 6)), ImVec2(bar0_pos_x + bars_width, picker_pos.y + (i + 1) * (sv_picker_size / 6)), col_hues[i], col_hues[i], col_hues[i + 1], col_hues[i + 1]);
- float bar0_line_y = (float)(int)(picker_pos.y + H * sv_picker_size + 0.5f);
+ float bar0_line_y = IM_ROUND(picker_pos.y + H * sv_picker_size);
RenderFrameBorder(ImVec2(bar0_pos_x, picker_pos.y), ImVec2(bar0_pos_x + bars_width, picker_pos.y + sv_picker_size), 0.0f);
RenderArrowsForVerticalBar(draw_list, ImVec2(bar0_pos_x - 1, bar0_line_y), ImVec2(bars_triangles_half_sz + 1, bars_triangles_half_sz), bars_width + 2.0f, style.Alpha);
}
@@ -4818,7 +4835,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
ImRect bar1_bb(bar1_pos_x, picker_pos.y, bar1_pos_x + bars_width, picker_pos.y + sv_picker_size);
RenderColorRectWithAlphaCheckerboard(bar1_bb.Min, bar1_bb.Max, 0, bar1_bb.GetWidth() / 2.0f, ImVec2(0.0f, 0.0f));
draw_list->AddRectFilledMultiColor(bar1_bb.Min, bar1_bb.Max, user_col32_striped_of_alpha, user_col32_striped_of_alpha, user_col32_striped_of_alpha & ~IM_COL32_A_MASK, user_col32_striped_of_alpha & ~IM_COL32_A_MASK);
- float bar1_line_y = (float)(int)(picker_pos.y + (1.0f - alpha) * sv_picker_size + 0.5f);
+ float bar1_line_y = IM_ROUND(picker_pos.y + (1.0f - alpha) * sv_picker_size);
RenderFrameBorder(bar1_bb.Min, bar1_bb.Max, 0.0f);
RenderArrowsForVerticalBar(draw_list, ImVec2(bar1_pos_x - 1, bar1_line_y), ImVec2(bars_triangles_half_sz + 1, bars_triangles_half_sz), bars_width + 2.0f, style.Alpha);
}
@@ -4875,7 +4892,7 @@ bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFl
bb_inner.Expand(off);
if ((flags & ImGuiColorEditFlags_AlphaPreviewHalf) && col_rgb.w < 1.0f)
{
- float mid_x = (float)(int)((bb_inner.Min.x + bb_inner.Max.x) * 0.5f + 0.5f);
+ float mid_x = IM_ROUND((bb_inner.Min.x + bb_inner.Max.x) * 0.5f);
RenderColorRectWithAlphaCheckerboard(ImVec2(bb_inner.Min.x + grid_step, bb_inner.Min.y), bb_inner.Max, GetColorU32(col_rgb), grid_step, ImVec2(-grid_step + off, off), rounding, ImDrawCornerFlags_TopRight| ImDrawCornerFlags_BotRight);
window->DrawList->AddRectFilled(bb_inner.Min, ImVec2(mid_x, bb_inner.Max.y), GetColorU32(col_rgb_without_alpha), rounding, ImDrawCornerFlags_TopLeft|ImDrawCornerFlags_BotLeft);
}
@@ -5210,7 +5227,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
ImGuiContext& g = *GImGui;
const ImGuiStyle& style = g.Style;
const bool display_frame = (flags & ImGuiTreeNodeFlags_Framed) != 0;
- const ImVec2 padding = (display_frame || (flags & ImGuiTreeNodeFlags_FramePadding)) ? style.FramePadding : ImVec2(style.FramePadding.x, 0.0f);
+ const ImVec2 padding = (display_frame || (flags & ImGuiTreeNodeFlags_FramePadding)) ? style.FramePadding : ImVec2(style.FramePadding.x, ImMin(window->DC.CurrLineTextBaseOffset, style.FramePadding.y));
if (!label_end)
label_end = FindRenderedTextEnd(label);
@@ -5227,21 +5244,21 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
{
// Framed header expand a little outside the default padding, to the edge of InnerClipRect
// (FIXME: May remove this at some point and make InnerClipRect align with WindowPadding.x instead of WindowPadding.x*0.5f)
- frame_bb.Min.x -= (float)(int)(window->WindowPadding.x * 0.5f - 1.0f);
- frame_bb.Max.x += (float)(int)(window->WindowPadding.x * 0.5f);
+ frame_bb.Min.x -= IM_FLOOR(window->WindowPadding.x * 0.5f - 1.0f);
+ frame_bb.Max.x += IM_FLOOR(window->WindowPadding.x * 0.5f);
}
const float text_offset_x = g.FontSize + (display_frame ? padding.x*3 : padding.x*2); // Collapser arrow width + Spacing
const float text_offset_y = ImMax(padding.y, window->DC.CurrLineTextBaseOffset); // Latch before ItemSize changes it
const float text_width = g.FontSize + (label_size.x > 0.0f ? label_size.x + padding.x*2 : 0.0f); // Include collapser
ImVec2 text_pos(window->DC.CursorPos.x + text_offset_x, window->DC.CursorPos.y + text_offset_y);
- ItemSize(ImVec2(text_width, frame_height), text_offset_y);
+ ItemSize(ImVec2(text_width, frame_height), padding.y);
// For regular tree nodes, we arbitrary allow to click past 2 worth of ItemSpacing
ImRect interact_bb = frame_bb;
if (!display_frame && (flags & (ImGuiTreeNodeFlags_SpanAvailWidth | ImGuiTreeNodeFlags_SpanFullWidth)) == 0)
interact_bb.Max.x = frame_bb.Min.x + text_width + style.ItemSpacing.x * 2.0f;
-
+
// Store a flag for the current depth to tell if we will allow closing this node when navigating one of its child.
// For this purpose we essentially compare if g.NavIdIsAlive went from 0 to 1 between TreeNode() and TreePop().
// This is currently only support 32 level deep and we are fine with (1 << Depth) overflowing into a zero.
@@ -5506,7 +5523,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
ImVec2 pos = window->DC.CursorPos;
pos.y += window->DC.CurrLineTextBaseOffset;
ImRect bb_inner(pos, pos + size);
- ItemSize(size);
+ ItemSize(size, 0.0f);
// Fill horizontal space.
ImVec2 window_padding = window->WindowPadding;
@@ -5520,8 +5537,8 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
// Selectables are tightly packed together so we extend the box to cover spacing between selectable.
const float spacing_x = style.ItemSpacing.x;
const float spacing_y = style.ItemSpacing.y;
- const float spacing_L = (float)(int)(spacing_x * 0.50f);
- const float spacing_U = (float)(int)(spacing_y * 0.50f);
+ const float spacing_L = IM_FLOOR(spacing_x * 0.50f);
+ const float spacing_U = IM_FLOOR(spacing_y * 0.50f);
bb.Min.x -= spacing_L;
bb.Min.y -= spacing_U;
bb.Max.x += (spacing_x - spacing_L);
@@ -5942,10 +5959,10 @@ void ImGui::Value(const char* prefix, float v, const char* float_format)
// [SECTION] MenuItem, BeginMenu, EndMenu, etc.
//-------------------------------------------------------------------------
// - ImGuiMenuColumns [Internal]
-// - BeginMainMenuBar()
-// - EndMainMenuBar()
// - BeginMenuBar()
// - EndMenuBar()
+// - BeginMainMenuBar()
+// - EndMainMenuBar()
// - BeginMenu()
// - EndMenu()
// - MenuItem()
@@ -5971,7 +5988,7 @@ void ImGuiMenuColumns::Update(int count, float spacing, bool clear)
{
if (i > 0 && NextWidths[i] > 0.0f)
Width += Spacing;
- Pos[i] = (float)(int)Width;
+ Pos[i] = IM_FLOOR(Width);
Width += NextWidths[i];
NextWidths[i] = 0.0f;
}
@@ -5988,45 +6005,11 @@ float ImGuiMenuColumns::DeclColumns(float w0, float w1, float w2) // not using v
return ImMax(Width, NextWidth);
}
-float ImGuiMenuColumns::CalcExtraSpace(float avail_w)
+float ImGuiMenuColumns::CalcExtraSpace(float avail_w) const
{
return ImMax(0.0f, avail_w - Width);
}
-// For the main menu bar, which cannot be moved, we honor g.Style.DisplaySafeAreaPadding to ensure text can be visible on a TV set.
-bool ImGui::BeginMainMenuBar()
-{
- ImGuiContext& g = *GImGui;
- g.NextWindowData.MenuBarOffsetMinVal = ImVec2(g.Style.DisplaySafeAreaPadding.x, ImMax(g.Style.DisplaySafeAreaPadding.y - g.Style.FramePadding.y, 0.0f));
- SetNextWindowPos(ImVec2(0.0f, 0.0f));
- SetNextWindowSize(ImVec2(g.IO.DisplaySize.x, g.NextWindowData.MenuBarOffsetMinVal.y + g.FontBaseSize + g.Style.FramePadding.y));
- PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
- PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(0,0));
- ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_MenuBar;
- bool is_open = Begin("##MainMenuBar", NULL, window_flags) && BeginMenuBar();
- PopStyleVar(2);
- g.NextWindowData.MenuBarOffsetMinVal = ImVec2(0.0f, 0.0f);
- if (!is_open)
- {
- End();
- return false;
- }
- return true; //-V1020
-}
-
-void ImGui::EndMainMenuBar()
-{
- EndMenuBar();
-
- // When the user has left the menu layer (typically: closed menus through activation of an item), we restore focus to the previous window
- // FIXME: With this strategy we won't be able to restore a NULL focus.
- ImGuiContext& g = *GImGui;
- if (g.CurrentWindow == g.NavWindow && g.NavLayer == 0 && !g.NavAnyRequest)
- FocusTopMostWindowUnderOne(g.NavWindow, NULL);
-
- End();
-}
-
// FIXME: Provided a rectangle perhaps e.g. a BeginMenuBarEx() could be used anywhere..
// Currently the main responsibility of this function being to setup clip-rect + horizontal layout + menu navigation layer.
// Ideally we also want this to be responsible for claiming space out of the main window scrolling rectangle, in which case ImGuiWindowFlags_MenuBar will become unnecessary.
@@ -6046,7 +6029,7 @@ bool ImGui::BeginMenuBar()
// We don't clip with current window clipping rectangle as it is already set to the area below. However we clip with window full rect.
// We remove 1 worth of rounding to Max.x to that text in long menus and small windows don't tend to display over the lower-right rounded area, which looks particularly glitchy.
ImRect bar_rect = window->MenuBarRect();
- ImRect clip_rect(ImFloor(bar_rect.Min.x + 0.5f), ImFloor(bar_rect.Min.y + window->WindowBorderSize + 0.5f), ImFloor(ImMax(bar_rect.Min.x, bar_rect.Max.x - window->WindowRounding) + 0.5f), ImFloor(bar_rect.Max.y + 0.5f));
+ ImRect clip_rect(IM_ROUND(bar_rect.Min.x), IM_ROUND(bar_rect.Min.y + window->WindowBorderSize), IM_ROUND(ImMax(bar_rect.Min.x, bar_rect.Max.x - window->WindowRounding)), IM_ROUND(bar_rect.Max.y));
clip_rect.ClipWith(window->OuterRectClipped);
PushClipRect(clip_rect.Min, clip_rect.Max, false);
@@ -6100,6 +6083,40 @@ void ImGui::EndMenuBar()
window->DC.MenuBarAppending = false;
}
+// For the main menu bar, which cannot be moved, we honor g.Style.DisplaySafeAreaPadding to ensure text can be visible on a TV set.
+bool ImGui::BeginMainMenuBar()
+{
+ ImGuiContext& g = *GImGui;
+ g.NextWindowData.MenuBarOffsetMinVal = ImVec2(g.Style.DisplaySafeAreaPadding.x, ImMax(g.Style.DisplaySafeAreaPadding.y - g.Style.FramePadding.y, 0.0f));
+ SetNextWindowPos(ImVec2(0.0f, 0.0f));
+ SetNextWindowSize(ImVec2(g.IO.DisplaySize.x, g.NextWindowData.MenuBarOffsetMinVal.y + g.FontBaseSize + g.Style.FramePadding.y));
+ PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
+ PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(0, 0));
+ ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_MenuBar;
+ bool is_open = Begin("##MainMenuBar", NULL, window_flags) && BeginMenuBar();
+ PopStyleVar(2);
+ g.NextWindowData.MenuBarOffsetMinVal = ImVec2(0.0f, 0.0f);
+ if (!is_open)
+ {
+ End();
+ return false;
+ }
+ return true; //-V1020
+}
+
+void ImGui::EndMainMenuBar()
+{
+ EndMenuBar();
+
+ // When the user has left the menu layer (typically: closed menus through activation of an item), we restore focus to the previous window
+ // FIXME: With this strategy we won't be able to restore a NULL focus.
+ ImGuiContext& g = *GImGui;
+ if (g.CurrentWindow == g.NavWindow && g.NavLayer == 0 && !g.NavAnyRequest)
+ FocusTopMostWindowUnderOne(g.NavWindow, NULL);
+
+ End();
+}
+
bool ImGui::BeginMenu(const char* label, bool enabled)
{
ImGuiWindow* window = GetCurrentWindow();
@@ -6128,19 +6145,19 @@ bool ImGui::BeginMenu(const char* label, bool enabled)
// Menu inside an horizontal menu bar
// Selectable extend their highlight by half ItemSpacing in each direction.
// For ChildMenu, the popup position will be overwritten by the call to FindBestWindowPosForPopup() in Begin()
- popup_pos = ImVec2(pos.x - 1.0f - (float)(int)(style.ItemSpacing.x * 0.5f), pos.y - style.FramePadding.y + window->MenuBarHeight());
- window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * 0.5f);
+ popup_pos = ImVec2(pos.x - 1.0f - IM_FLOOR(style.ItemSpacing.x * 0.5f), pos.y - style.FramePadding.y + window->MenuBarHeight());
+ window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * 0.5f);
PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(style.ItemSpacing.x * 2.0f, style.ItemSpacing.y));
float w = label_size.x;
pressed = Selectable(label, menu_is_open, ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_PressedOnClick | ImGuiSelectableFlags_DontClosePopups | (!enabled ? ImGuiSelectableFlags_Disabled : 0), ImVec2(w, 0.0f));
PopStyleVar();
- window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar().
+ window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar().
}
else
{
// Menu inside a menu
popup_pos = ImVec2(pos.x, pos.y - style.WindowPadding.y);
- float w = window->MenuColumns.DeclColumns(label_size.x, 0.0f, (float)(int)(g.FontSize * 1.20f)); // Feedback to next frame
+ float w = window->MenuColumns.DeclColumns(label_size.x, 0.0f, IM_FLOOR(g.FontSize * 1.20f)); // Feedback to next frame
float extra_w = ImMax(0.0f, GetContentRegionAvail().x - w);
pressed = Selectable(label, menu_is_open, ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_PressedOnClick | ImGuiSelectableFlags_DontClosePopups | ImGuiSelectableFlags_DrawFillAvailWidth | (!enabled ? ImGuiSelectableFlags_Disabled : 0), ImVec2(w, 0.0f));
ImU32 text_col = GetColorU32(enabled ? ImGuiCol_Text : ImGuiCol_TextDisabled);
@@ -6279,16 +6296,16 @@ bool ImGui::MenuItem(const char* label, const char* shortcut, bool selected, boo
// Mimic the exact layout spacing of BeginMenu() to allow MenuItem() inside a menu bar, which is a little misleading but may be useful
// Note that in this situation we render neither the shortcut neither the selected tick mark
float w = label_size.x;
- window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * 0.5f);
+ window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * 0.5f);
PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(style.ItemSpacing.x * 2.0f, style.ItemSpacing.y));
pressed = Selectable(label, false, flags, ImVec2(w, 0.0f));
PopStyleVar();
- window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar().
+ window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar().
}
else
{
ImVec2 shortcut_size = shortcut ? CalcTextSize(shortcut, NULL) : ImVec2(0.0f, 0.0f);
- float w = window->MenuColumns.DeclColumns(label_size.x, shortcut_size.x, (float)(int)(g.FontSize * 1.20f)); // Feedback for next frame
+ float w = window->MenuColumns.DeclColumns(label_size.x, shortcut_size.x, IM_FLOOR(g.FontSize * 1.20f)); // Feedback for next frame
float extra_w = ImMax(0.0f, GetContentRegionAvail().x - w);
pressed = Selectable(label, false, flags | ImGuiSelectableFlags_DrawFillAvailWidth, ImVec2(w, 0.0f));
if (shortcut_size.x > 0.0f)
@@ -6437,15 +6454,15 @@ bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImG
tab_bar->FramePadding = g.Style.FramePadding;
// Layout
- ItemSize(ImVec2(tab_bar->OffsetMaxIdeal, tab_bar->BarRect.GetHeight()));
+ ItemSize(ImVec2(tab_bar->OffsetMaxIdeal, tab_bar->BarRect.GetHeight()), tab_bar->FramePadding.y);
window->DC.CursorPos.x = tab_bar->BarRect.Min.x;
// Draw separator
const ImU32 col = GetColorU32((flags & ImGuiTabBarFlags_IsFocused) ? ImGuiCol_TabActive : ImGuiCol_TabUnfocusedActive);
const float y = tab_bar->BarRect.Max.y - 1.0f;
{
- const float separator_min_x = tab_bar->BarRect.Min.x - ImFloor(window->WindowPadding.x * 0.5f);
- const float separator_max_x = tab_bar->BarRect.Max.x + ImFloor(window->WindowPadding.x * 0.5f);
+ const float separator_min_x = tab_bar->BarRect.Min.x - IM_FLOOR(window->WindowPadding.x * 0.5f);
+ const float separator_max_x = tab_bar->BarRect.Max.x + IM_FLOOR(window->WindowPadding.x * 0.5f);
window->DrawList->AddLine(ImVec2(separator_min_x, y), ImVec2(separator_max_x, y), col, 1.0f);
}
return true;
@@ -6564,13 +6581,13 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
// and we cannot wait for the next BeginTabItem() call. We cannot compute this width within TabBarAddTab() because font size depends on the active window.
const char* tab_name = tab_bar->GetTabName(tab);
const bool has_close_button = (tab->Flags & ImGuiTabItemFlags_NoCloseButton) ? false : true;
- tab->WidthContents = TabItemCalcSize(tab_name, has_close_button).x;
+ tab->ContentWidth = TabItemCalcSize(tab_name, has_close_button).x;
- width_total_contents += (tab_n > 0 ? g.Style.ItemInnerSpacing.x : 0.0f) + tab->WidthContents;
+ width_total_contents += (tab_n > 0 ? g.Style.ItemInnerSpacing.x : 0.0f) + tab->ContentWidth;
// Store data so we can build an array sorted by width if we need to shrink tabs down
g.ShrinkWidthBuffer[tab_n].Index = tab_n;
- g.ShrinkWidthBuffer[tab_n].Width = tab->WidthContents;
+ g.ShrinkWidthBuffer[tab_n].Width = tab->ContentWidth;
}
// Compute width
@@ -6582,7 +6599,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
// If we don't have enough room, resize down the largest tabs first
ShrinkWidths(g.ShrinkWidthBuffer.Data, g.ShrinkWidthBuffer.Size, width_excess);
for (int tab_n = 0; tab_n < tab_bar->Tabs.Size; tab_n++)
- tab_bar->Tabs[g.ShrinkWidthBuffer[tab_n].Index].Width = (float)(int)g.ShrinkWidthBuffer[tab_n].Width;
+ tab_bar->Tabs[g.ShrinkWidthBuffer[tab_n].Index].Width = IM_FLOOR(g.ShrinkWidthBuffer[tab_n].Width);
}
else
{
@@ -6590,7 +6607,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
for (int tab_n = 0; tab_n < tab_bar->Tabs.Size; tab_n++)
{
ImGuiTabItem* tab = &tab_bar->Tabs[tab_n];
- tab->Width = ImMin(tab->WidthContents, tab_max_width);
+ tab->Width = ImMin(tab->ContentWidth, tab_max_width);
IM_ASSERT(tab->Width > 0.0f);
}
}
@@ -6606,7 +6623,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
if (scroll_track_selected_tab_id == 0 && g.NavJustMovedToId == tab->ID)
scroll_track_selected_tab_id = tab->ID;
offset_x += tab->Width + g.Style.ItemInnerSpacing.x;
- offset_x_ideal += tab->WidthContents + g.Style.ItemInnerSpacing.x;
+ offset_x_ideal += tab->ContentWidth + g.Style.ItemInnerSpacing.x;
}
tab_bar->OffsetMax = ImMax(offset_x - g.Style.ItemInnerSpacing.x, 0.0f);
tab_bar->OffsetMaxIdeal = ImMax(offset_x_ideal - g.Style.ItemInnerSpacing.x, 0.0f);
@@ -6927,7 +6944,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
tab_is_new = true;
}
tab_bar->LastTabItemIdx = (short)tab_bar->Tabs.index_from_ptr(tab);
- tab->WidthContents = size.x;
+ tab->ContentWidth = size.x;
if (p_open == NULL)
flags |= ImGuiTabItemFlags_NoCloseButton;
@@ -6983,7 +7000,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
// Layout
size.x = tab->Width;
- window->DC.CursorPos = tab_bar->BarRect.Min + ImVec2((float)(int)tab->Offset - tab_bar->ScrollingAnim, 0.0f);
+ window->DC.CursorPos = tab_bar->BarRect.Min + ImVec2(IM_FLOOR(tab->Offset - tab_bar->ScrollingAnim), 0.0f);
ImVec2 pos = window->DC.CursorPos;
ImRect bb(pos, pos + size);
@@ -7038,10 +7055,10 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
}
#if 0
- if (hovered && g.HoveredIdNotActiveTimer > 0.50f && bb.GetWidth() < tab->WidthContents)
+ if (hovered && g.HoveredIdNotActiveTimer > 0.50f && bb.GetWidth() < tab->ContentWidth)
{
// Enlarge tab display when hovering
- bb.Max.x = bb.Min.x + (float)(int)ImLerp(bb.GetWidth(), tab->WidthContents, ImSaturate((g.HoveredIdNotActiveTimer - 0.40f) * 6.0f));
+ bb.Max.x = bb.Min.x + IM_FLOOR(ImLerp(bb.GetWidth(), tab->ContentWidth, ImSaturate((g.HoveredIdNotActiveTimer - 0.40f) * 6.0f)));
display_draw_list = GetForegroundDrawList(window);
TabItemBackground(display_draw_list, bb, flags, GetColorU32(ImGuiCol_TitleBgActive));
}
@@ -7151,7 +7168,7 @@ bool ImGui::TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb,
if (flags & ImGuiTabItemFlags_UnsavedDocument)
{
text_pixel_clip_bb.Max.x -= CalcTextSize(TAB_UNSAVED_MARKER, NULL, false).x;
- ImVec2 unsaved_marker_pos(ImMin(bb.Min.x + frame_padding.x + label_size.x + 2, text_pixel_clip_bb.Max.x), bb.Min.y + frame_padding.y + (float)(int)(-g.FontSize * 0.25f));
+ ImVec2 unsaved_marker_pos(ImMin(bb.Min.x + frame_padding.x + label_size.x + 2, text_pixel_clip_bb.Max.x), bb.Min.y + frame_padding.y + IM_FLOOR(-g.FontSize * 0.25f));
RenderTextClippedEx(draw_list, unsaved_marker_pos, bb.Max - frame_padding, TAB_UNSAVED_MARKER, NULL, NULL);
}
ImRect text_ellipsis_clip_bb = text_pixel_clip_bb;
@@ -7441,8 +7458,8 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiColumnsFlag
{
// Compute clipping rectangle
ImGuiColumnData* column = &columns->Columns[n];
- float clip_x1 = ImFloor(0.5f + window->Pos.x + GetColumnOffset(n));
- float clip_x2 = ImFloor(0.5f + window->Pos.x + GetColumnOffset(n + 1) - 1.0f);
+ float clip_x1 = IM_ROUND(window->Pos.x + GetColumnOffset(n));
+ float clip_x2 = IM_ROUND(window->Pos.x + GetColumnOffset(n + 1) - 1.0f);
column->ClipRect = ImRect(clip_x1, -FLT_MAX, clip_x2, +FLT_MAX);
column->ClipRect.ClipWith(window->ClipRect);
}
@@ -7460,7 +7477,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiColumnsFlag
float width = offset_1 - offset_0;
PushItemWidth(width * 0.65f);
window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f);
- window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
+ window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
window->WorkRect.Max.x = window->Pos.x + offset_1 - column_padding;
}
@@ -7475,7 +7492,7 @@ void ImGui::NextColumn()
if (columns->Count == 1)
{
- window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
+ window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
IM_ASSERT(columns->Current == 0);
return;
}
@@ -7500,7 +7517,7 @@ void ImGui::NextColumn()
columns->Current = 0;
columns->LineMinY = columns->LineMaxY;
}
- window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
+ window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
window->DC.CursorPos.y = columns->LineMinY;
window->DC.CurrLineSize = ImVec2(0.0f, 0.0f);
window->DC.CurrLineTextBaseOffset = 0.0f;
@@ -7567,7 +7584,7 @@ void ImGui::EndColumns()
// Draw column
const ImU32 col = GetColorU32(held ? ImGuiCol_SeparatorActive : hovered ? ImGuiCol_SeparatorHovered : ImGuiCol_Separator);
- const float xi = (float)(int)x;
+ const float xi = IM_FLOOR(x);
window->DrawList->AddLine(ImVec2(xi, y1 + 1.0f), ImVec2(xi, y2), col);
}
@@ -7587,7 +7604,7 @@ void ImGui::EndColumns()
window->WorkRect = columns->HostWorkRect;
window->DC.CurrentColumns = NULL;
window->DC.ColumnsOffset.x = 0.0f;
- window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
+ window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
}
// [2018-03: This is currently the only public API, while we are working on making BeginColumns/EndColumns user-facing]
diff --git a/3rdparty/bgfx/3rdparty/glslang/.appveyor.yml b/3rdparty/bgfx/3rdparty/glslang/.appveyor.yml
index e7c428275b6..32e8f2bde35 100644
--- a/3rdparty/bgfx/3rdparty/glslang/.appveyor.yml
+++ b/3rdparty/bgfx/3rdparty/glslang/.appveyor.yml
@@ -66,7 +66,6 @@ after_test:
bin\glslangValidator.exe
bin\spirv-remap.exe
include\glslang\*
- include\SPIRV\*
lib\glslang%SUFFIX%.lib
lib\HLSL%SUFFIX%.lib
lib\OGLCompiler%SUFFIX%.lib
diff --git a/3rdparty/bgfx/3rdparty/glslang/.travis.yml b/3rdparty/bgfx/3rdparty/glslang/.travis.yml
index 2478912177c..1fa3fc01cda 100644
--- a/3rdparty/bgfx/3rdparty/glslang/.travis.yml
+++ b/3rdparty/bgfx/3rdparty/glslang/.travis.yml
@@ -99,7 +99,6 @@ after_success:
zip ${TARBALL}
bin/glslangValidator
include/glslang/*
- include/SPIRV/*
lib/libglslang${SUFFIX}.a
lib/libHLSL${SUFFIX}.a
lib/libOGLCompiler${SUFFIX}.a
diff --git a/3rdparty/bgfx/3rdparty/glslang/BUILD.bazel b/3rdparty/bgfx/3rdparty/glslang/BUILD.bazel
new file mode 100644
index 00000000000..cc18aa268e0
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/BUILD.bazel
@@ -0,0 +1,245 @@
+package(
+ default_visibility = ["//visibility:public"],
+)
+
+# Description:
+#
+# Khronos reference front-end for GLSL and ESSL, and sample SPIR-V generator.
+
+licenses(["notice"])
+
+exports_files(["LICENSE"])
+
+COMMON_COPTS = select({
+ "@bazel_tools//src/conditions:windows": [""],
+ "//conditions:default": [
+ "-Wall",
+ "-Wuninitialized",
+ "-Wunused",
+ "-Wunused-local-typedefs",
+ "-Wunused-parameter",
+ "-Wunused-value",
+ "-Wunused-variable",
+ "-Wno-reorder",
+ "-std=c++11",
+ "-fvisibility=hidden",
+ "-fvisibility-inlines-hidden",
+ "-fno-exceptions",
+ "-fno-rtti",
+ ],
+})
+
+cc_library(
+ name = "glslang",
+ srcs = glob(
+ [
+ "glslang/GenericCodeGen/*.cpp",
+ "glslang/MachineIndependent/*.cpp",
+ "glslang/MachineIndependent/preprocessor/*.cpp",
+ "hlsl/*.cpp",
+ ],
+ exclude = [
+ "glslang/MachineIndependent/pch.cpp",
+ "glslang/MachineIndependent/pch.h",
+ "hlsl/pch.cpp",
+ "hlsl/pch.h",
+ ],
+ ) + [
+ "OGLCompilersDLL/InitializeDll.cpp",
+ ] + select({
+ "@bazel_tools//src/conditions:windows":
+ ["glslang/OSDependent/Windows/ossource.cpp"],
+ "//conditions:default":
+ ["glslang/OSDependent/Unix/ossource.cpp"],
+ }),
+ hdrs = glob([
+ "glslang/Include/*.h",
+ "glslang/MachineIndependent/*.h",
+ "glslang/MachineIndependent/preprocessor/*.h",
+ "hlsl/*.h",
+ ]) + [
+ "OGLCompilersDLL/InitializeDll.h",
+ "StandAlone/DirStackFileIncluder.h",
+ "glslang/OSDependent/osinclude.h",
+ "glslang/Public/ShaderLang.h",
+ ],
+ copts = COMMON_COPTS,
+ defines = [
+ "AMD_EXTENSIONS",
+ "ENABLE_HLSL=0",
+ "ENABLE_OPT=0",
+ "NV_EXTENSIONS",
+ ],
+ linkopts = select({
+ "@bazel_tools//src/conditions:windows": [""],
+ "//conditions:default": ["-lm", "-lpthread"],
+ }),
+ linkstatic = 1,
+)
+
+genrule(
+ name = "export_spirv_headers",
+ srcs = [
+ "SPIRV/GLSL.ext.AMD.h",
+ "SPIRV/GLSL.ext.EXT.h",
+ "SPIRV/GLSL.ext.KHR.h",
+ "SPIRV/GLSL.ext.NV.h",
+ "SPIRV/GLSL.std.450.h",
+ "SPIRV/spirv.hpp",
+ ],
+ outs = [
+ "include/SPIRV/GLSL.ext.AMD.h",
+ "include/SPIRV/GLSL.ext.EXT.h",
+ "include/SPIRV/GLSL.ext.KHR.h",
+ "include/SPIRV/GLSL.ext.NV.h",
+ "include/SPIRV/GLSL.std.450.h",
+ "include/SPIRV/spirv.hpp",
+ ],
+ cmd = "mkdir -p $(@D)/include/SPIRV && cp $(SRCS) $(@D)/include/SPIRV/",
+)
+
+cc_library(
+ name = "SPIRV_headers",
+ hdrs = [":export_spirv_headers"],
+ copts = COMMON_COPTS,
+ includes = [
+ "include",
+ "include/SPIRV",
+ ],
+ linkstatic = 1,
+)
+
+cc_library(
+ name = "SPIRV",
+ srcs = glob(
+ ["SPIRV/*.cpp"],
+ exclude = [
+ "SPIRV/SpvTools.cpp",
+ ],
+ ),
+ hdrs = [
+ "SPIRV/GlslangToSpv.h",
+ "SPIRV/Logger.h",
+ "SPIRV/SPVRemapper.h",
+ "SPIRV/SpvBuilder.h",
+ "SPIRV/SpvTools.h",
+ "SPIRV/bitutils.h",
+ "SPIRV/disassemble.h",
+ "SPIRV/doc.h",
+ "SPIRV/hex_float.h",
+ "SPIRV/spvIR.h",
+ ],
+ copts = COMMON_COPTS,
+ includes = ["SPIRV"],
+ linkopts = select({
+ "@bazel_tools//src/conditions:windows": [""],
+ "//conditions:default": ["-lm"],
+ }),
+ linkstatic = 1,
+ deps = [
+ ":SPIRV_headers",
+ ":glslang",
+ ],
+)
+
+cc_library(
+ name = "glslang-default-resource-limits",
+ srcs = ["StandAlone/ResourceLimits.cpp"],
+ hdrs = ["StandAlone/ResourceLimits.h"],
+ copts = COMMON_COPTS,
+ linkstatic = 1,
+ deps = [":glslang"],
+)
+
+cc_binary(
+ name = "glslangValidator",
+ srcs = [
+ "StandAlone/StandAlone.cpp",
+ "StandAlone/Worklist.h",
+ ],
+ copts = COMMON_COPTS,
+ deps = [
+ ":SPIRV",
+ ":glslang",
+ ":glslang-default-resource-limits",
+ ],
+)
+
+cc_binary(
+ name = "spirv-remap",
+ srcs = ["StandAlone/spirv-remap.cpp"],
+ copts = COMMON_COPTS,
+ deps = [
+ ":SPIRV",
+ ":glslang",
+ ":glslang-default-resource-limits",
+ ],
+)
+
+filegroup(
+ name = "test_files",
+ srcs = glob(
+ ["Test/**"],
+ exclude = [
+ "Test/bump",
+ "Test/glslangValidator",
+ "Test/runtests",
+ ],
+ ),
+)
+
+cc_library(
+ name = "glslang_test_lib",
+ testonly = 1,
+ srcs = [
+ "gtests/HexFloat.cpp",
+ "gtests/Initializer.h",
+ "gtests/Settings.cpp",
+ "gtests/Settings.h",
+ "gtests/TestFixture.cpp",
+ "gtests/TestFixture.h",
+ "gtests/main.cpp",
+ ],
+ copts = COMMON_COPTS,
+ data = [":test_files"],
+ defines = select({
+ # Unfortunately we can't use $(location) in cc_library at the moment.
+ # See https://github.com/bazelbuild/bazel/issues/1023
+ # So we'll specify the path manually.
+ "@bazel_tools//src/conditions:windows":
+ ["GLSLANG_TEST_DIRECTORY='\"../../../../../Test\"'"],
+ "//conditions:default":
+ ["GLSLANG_TEST_DIRECTORY='\"Test\"'"],
+ }),
+ linkstatic = 1,
+ deps = [
+ ":SPIRV",
+ ":glslang",
+ ":glslang-default-resource-limits",
+ "@com_google_googletest//:gtest",
+ ],
+)
+
+GLSLANG_TESTS = glob(
+ ["gtests/*.FromFile.cpp"],
+ # Since we are not building the SPIRV-Tools dependency, the following tests
+ # cannot be performed.
+ exclude = [
+ "gtests/Hlsl.FromFile.cpp",
+ "gtests/Spv.FromFile.cpp",
+ ],
+)
+
+[cc_test(
+ name = test_file.replace("gtests/", "").replace(".FromFile.cpp", "") + "_test",
+ srcs = [test_file],
+ copts = COMMON_COPTS,
+ data = [
+ ":test_files",
+ ],
+ deps = [
+ ":SPIRV",
+ ":glslang",
+ ":glslang_test_lib",
+ ],
+) for test_file in GLSLANG_TESTS]
diff --git a/3rdparty/bgfx/3rdparty/glslang/BUILD.gn b/3rdparty/bgfx/3rdparty/glslang/BUILD.gn
index 55f21ad01ad..098d7de663b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/BUILD.gn
+++ b/3rdparty/bgfx/3rdparty/glslang/BUILD.gn
@@ -33,6 +33,19 @@
import("//build_overrides/glslang.gni")
+# Both Chromium and Fuchsia use by default a set of warning errors
+# that is far too strict to compile this project. These are also
+# typically appended after |cflags|, overriding target-specific
+# definitions. To work around this, determine which configs to
+# add and remove in order to succesfully build the project.
+if (defined(is_fuchsia_tree) && is_fuchsia_tree) {
+ _configs_to_remove = [ "//build/config:default_warnings" ]
+ _configs_to_add = []
+} else {
+ _configs_to_remove = [ "//build/config/compiler:chromium_code" ]
+ _configs_to_add = [ "//build/config/compiler:no_chromium_code" ]
+}
+
spirv_tools_dir = glslang_spirv_tools_dir
config("glslang_public") {
@@ -47,8 +60,10 @@ source_set("glslang_sources") {
sources = [
"OGLCompilersDLL/InitializeDll.cpp",
"OGLCompilersDLL/InitializeDll.h",
+ "SPIRV/GLSL.ext.AMD.h",
"SPIRV/GLSL.ext.EXT.h",
"SPIRV/GLSL.ext.KHR.h",
+ "SPIRV/GLSL.ext.NV.h",
"SPIRV/GLSL.std.450.h",
"SPIRV/GlslangToSpv.cpp",
"SPIRV/GlslangToSpv.h",
@@ -159,7 +174,7 @@ source_set("glslang_sources") {
}
if (is_clang) {
- cflags_cc = [
+ cflags = [
"-Wno-extra-semi",
"-Wno-ignored-qualifiers",
"-Wno-implicit-fallthrough",
@@ -181,6 +196,9 @@ source_set("glslang_sources") {
"${spirv_tools_dir}:spvtools_opt",
"${spirv_tools_dir}:spvtools_val",
]
+
+ configs -= _configs_to_remove
+ configs += _configs_to_add
}
source_set("glslang_default_resource_limits_sources") {
@@ -192,6 +210,9 @@ source_set("glslang_default_resource_limits_sources") {
":glslang_sources",
]
public_configs = [ ":glslang_public" ]
+
+ configs -= _configs_to_remove
+ configs += _configs_to_add
}
executable("glslang_validator") {
@@ -207,6 +228,9 @@ executable("glslang_validator") {
":glslang_default_resource_limits_sources",
":glslang_sources",
]
+
+ configs -= _configs_to_remove
+ configs += _configs_to_add
}
executable("spirv-remap") {
@@ -217,4 +241,7 @@ executable("spirv-remap") {
deps = [
":glslang_sources",
]
+
+ configs -= _configs_to_remove
+ configs += _configs_to_add
}
diff --git a/3rdparty/bgfx/3rdparty/glslang/CMakeLists.txt b/3rdparty/bgfx/3rdparty/glslang/CMakeLists.txt
index c2adeb033d2..d6fc8d42aa5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/glslang/CMakeLists.txt
@@ -6,6 +6,9 @@ if (POLICY CMP0048)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+# Enable compile commands database
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
# Adhere to GNU filesystem layout conventions
include(GNUInstallDirs)
@@ -13,6 +16,7 @@ include(GNUInstallDirs)
include(CMakeDependentOption)
option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
+option(BUILD_EXTERNAL "Build external dependencies in /External" ON)
set(LIB_TYPE STATIC)
@@ -36,6 +40,8 @@ option(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE "If using Emscripten, builds to run on
CMAKE_DEPENDENT_OPTION(ENABLE_HLSL "Enables HLSL input support" ON "NOT ENABLE_GLSLANG_WEB" OFF)
option(ENABLE_OPT "Enables spirv-opt capability if present" ON)
+option(ENABLE_PCH "Enables Precompiled header" ON)
+option(ENABLE_CTEST "Enables testing" ON)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND WIN32)
set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "..." FORCE)
@@ -51,7 +57,7 @@ endif()
# Precompiled header macro. Parameters are source file list and filename for pch cpp file.
macro(glslang_pch SRCS PCHCPP)
- if(MSVC AND CMAKE_GENERATOR MATCHES "^Visual Studio")
+ if(MSVC AND CMAKE_GENERATOR MATCHES "^Visual Studio" AND ENABLE_PCH)
set(PCH_NAME "$(IntDir)\\pch.pch")
# make source files use/depend on PCH_NAME
set_source_files_properties(${${SRCS}} PROPERTIES COMPILE_FLAGS "/Yupch.h /FIpch.h /Fp${PCH_NAME} /Zm300" OBJECT_DEPENDS "${PCH_NAME}")
@@ -62,8 +68,10 @@ macro(glslang_pch SRCS PCHCPP)
endmacro(glslang_pch)
project(glslang)
-# make testing optional
-include(CTest)
+
+if(ENABLE_CTEST)
+ include(CTest)
+endif()
if(ENABLE_HLSL)
add_definitions(-DENABLE_HLSL)
@@ -148,12 +156,12 @@ endfunction(glslang_set_link_args)
# CMake needs to find the right version of python, right from the beginning,
# otherwise, it will find the wrong version and fail later
-if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External)
+if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External)
find_package(PythonInterp 3 REQUIRED)
-endif()
-# We depend on these for later projects, so they should come first.
-add_subdirectory(External)
+ # We depend on these for later projects, so they should come first.
+ add_subdirectory(External)
+endif()
if(NOT TARGET SPIRV-Tools-opt)
set(ENABLE_OPT OFF)
@@ -178,4 +186,29 @@ add_subdirectory(SPIRV)
if(ENABLE_HLSL)
add_subdirectory(hlsl)
endif(ENABLE_HLSL)
-add_subdirectory(gtests)
+if(ENABLE_CTEST)
+ add_subdirectory(gtests)
+endif()
+
+if(BUILD_TESTING)
+ # glslang-testsuite runs a bash script on Windows.
+ # Make sure to use '-o igncr' flag to ignore carriage returns (\r).
+ set(IGNORE_CR_FLAG "")
+ if(WIN32)
+ set(IGNORE_CR_FLAG -o igncr)
+ endif()
+
+ if (CMAKE_CONFIGURATION_TYPES)
+ set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/localResults)
+ set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIGURATION>/glslangValidator)
+ set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIGURATION>/spirv-remap)
+ else(CMAKE_CONFIGURATION_TYPES)
+ set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/localResults)
+ set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/glslangValidator)
+ set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/spirv-remap)
+ endif(CMAKE_CONFIGURATION_TYPES)
+
+ add_test(NAME glslang-testsuite
+ COMMAND bash ${IGNORE_CR_FLAG} runtests ${RESULTS_PATH} ${VALIDATOR_PATH} ${REMAP_PATH}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Test/)
+endif(BUILD_TESTING)
diff --git a/3rdparty/bgfx/3rdparty/glslang/OGLCompilersDLL/CMakeLists.txt b/3rdparty/bgfx/3rdparty/glslang/OGLCompilersDLL/CMakeLists.txt
index 5bb3f0ee696..af4ab587dcd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/OGLCompilersDLL/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/glslang/OGLCompilersDLL/CMakeLists.txt
@@ -9,6 +9,7 @@ if(WIN32)
endif(WIN32)
if(ENABLE_GLSLANG_INSTALL)
- install(TARGETS OGLCompiler
+ install(TARGETS OGLCompiler EXPORT OGLCompilerTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(EXPORT OGLCompilerTargets DESTINATION lib/cmake)
endif(ENABLE_GLSLANG_INSTALL)
diff --git a/3rdparty/bgfx/3rdparty/glslang/README.md b/3rdparty/bgfx/3rdparty/glslang/README.md
index 67aee9df41d..f5651e1d4bd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/README.md
+++ b/3rdparty/bgfx/3rdparty/glslang/README.md
@@ -307,7 +307,7 @@ See `ShaderLang.h` and the usage of it in `StandAlone/StandAlone.cpp` for more
details. There is a block comment giving more detail above the calls for
`setEnvInput, setEnvClient, and setEnvTarget`.
-### C Functional Interface (orignal)
+### C Functional Interface (original)
This interface is in roughly the first 2/3 of `ShaderLang.h`, and referred to
as the `Sh*()` interface, as all the entry points start `Sh`.
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/CMakeLists.txt b/3rdparty/bgfx/3rdparty/glslang/SPIRV/CMakeLists.txt
index 94d2ebebb3c..e25ec0a13f5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/CMakeLists.txt
@@ -36,7 +36,9 @@ set(SPVREMAP_HEADERS
add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS})
set_property(TARGET SPIRV PROPERTY FOLDER glslang)
set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON)
-target_include_directories(SPIRV PUBLIC ..)
+target_include_directories(SPIRV PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
if (ENABLE_SPVREMAPPER)
add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS})
@@ -57,7 +59,9 @@ if(ENABLE_OPT)
PRIVATE ${spirv-tools_SOURCE_DIR}/source
)
target_link_libraries(SPIRV glslang SPIRV-Tools-opt)
- target_include_directories(SPIRV PUBLIC ../External)
+ target_include_directories(SPIRV PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
else()
target_link_libraries(SPIRV glslang)
endif(ENABLE_OPT)
@@ -70,22 +74,25 @@ endif(WIN32)
if(ENABLE_GLSLANG_INSTALL)
if(BUILD_SHARED_LIBS)
if (ENABLE_SPVREMAPPER)
- install(TARGETS SPVRemapper
+ install(TARGETS SPVRemapper EXPORT SPVRemapperTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
- install(TARGETS SPIRV
+ install(TARGETS SPIRV EXPORT SPIRVTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
else()
if (ENABLE_SPVREMAPPER)
- install(TARGETS SPVRemapper
+ install(TARGETS SPVRemapper EXPORT SPVRemapperTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
- install(TARGETS SPIRV
+ install(TARGETS SPIRV EXPORT SPIRVTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
+
+ install(EXPORT SPVRemapperTargets DESTINATION lib/cmake)
+ install(EXPORT SPIRVTargets DESTINATION lib/cmake)
- install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/)
+ install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/SPIRV/)
endif(ENABLE_GLSLANG_INSTALL)
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h b/3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h
index ac26a054072..e58e836a8d8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h
@@ -40,6 +40,7 @@ static const char* const E_SPV_KHR_8bit_storage = "SPV_KHR_8bit_
static const char* const E_SPV_KHR_storage_buffer_storage_class = "SPV_KHR_storage_buffer_storage_class";
static const char* const E_SPV_KHR_post_depth_coverage = "SPV_KHR_post_depth_coverage";
static const char* const E_SPV_KHR_vulkan_memory_model = "SPV_KHR_vulkan_memory_model";
+static const char* const E_SPV_EXT_physical_storage_buffer = "SPV_EXT_physical_storage_buffer";
static const char* const E_SPV_KHR_physical_storage_buffer = "SPV_KHR_physical_storage_buffer";
static const char* const E_SPV_EXT_fragment_shader_interlock = "SPV_EXT_fragment_shader_interlock";
static const char* const E_SPV_KHR_shader_clock = "SPV_KHR_shader_clock";
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/3rdparty/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp
index afb405e40b7..ad16396fcfa 100644..100755
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp
@@ -100,11 +100,11 @@ struct OpDecorations {
spv::Decoration precision;
#ifdef GLSLANG_WEB
- void addNoContraction(spv::Builder&, spv::Id) const { };
- void addNonUniform(spv::Builder&, spv::Id) const { };
+ void addNoContraction(spv::Builder&, spv::Id) const { }
+ void addNonUniform(spv::Builder&, spv::Id) const { }
#else
- void addNoContraction(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, noContraction); };
- void addNonUniform(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, nonUniform); };
+ void addNoContraction(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, noContraction); }
+ void addNonUniform(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, nonUniform); }
protected:
spv::Decoration noContraction;
spv::Decoration nonUniform;
@@ -292,8 +292,8 @@ spv::ExecutionModel TranslateExecutionModel(EShLanguage stage)
switch (stage) {
case EShLangVertex: return spv::ExecutionModelVertex;
case EShLangFragment: return spv::ExecutionModelFragment;
-#ifndef GLSLANG_WEB
case EShLangCompute: return spv::ExecutionModelGLCompute;
+#ifndef GLSLANG_WEB
case EShLangTessControl: return spv::ExecutionModelTessellationControl;
case EShLangTessEvaluation: return spv::ExecutionModelTessellationEvaluation;
case EShLangGeometry: return spv::ExecutionModelGeometry;
@@ -374,22 +374,20 @@ spv::Decoration TranslateBlockDecoration(const glslang::TType& type, bool useSto
// Translate glslang type to SPIR-V memory decorations.
void TranslateMemoryDecoration(const glslang::TQualifier& qualifier, std::vector<spv::Decoration>& memory, bool useVulkanMemoryModel)
{
-#ifndef GLSLANG_WEB
if (!useVulkanMemoryModel) {
- if (qualifier.coherent)
+ if (qualifier.isCoherent())
memory.push_back(spv::DecorationCoherent);
- if (qualifier.volatil) {
+ if (qualifier.isVolatile()) {
memory.push_back(spv::DecorationVolatile);
memory.push_back(spv::DecorationCoherent);
}
}
- if (qualifier.restrict)
+ if (qualifier.isRestrict())
memory.push_back(spv::DecorationRestrict);
if (qualifier.isReadOnly())
memory.push_back(spv::DecorationNonWritable);
if (qualifier.isWriteOnly())
memory.push_back(spv::DecorationNonReadable);
-#endif
}
// Translate glslang type to SPIR-V layout decorations.
@@ -673,6 +671,13 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
case glslang::EbvFace: return spv::BuiltInFrontFacing;
case glslang::EbvFragDepth: return spv::BuiltInFragDepth;
+ case glslang::EbvNumWorkGroups: return spv::BuiltInNumWorkgroups;
+ case glslang::EbvWorkGroupSize: return spv::BuiltInWorkgroupSize;
+ case glslang::EbvWorkGroupId: return spv::BuiltInWorkgroupId;
+ case glslang::EbvLocalInvocationId: return spv::BuiltInLocalInvocationId;
+ case glslang::EbvLocalInvocationIndex: return spv::BuiltInLocalInvocationIndex;
+ case glslang::EbvGlobalInvocationId: return spv::BuiltInGlobalInvocationId;
+
#ifndef GLSLANG_WEB
// These *Distance capabilities logically belong here, but if the member is declared and
// then never used, consumers of SPIR-V prefer the capability not be declared.
@@ -757,12 +762,6 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
case glslang::EbvTessCoord: return spv::BuiltInTessCoord;
case glslang::EbvPatchVertices: return spv::BuiltInPatchVertices;
case glslang::EbvHelperInvocation: return spv::BuiltInHelperInvocation;
- case glslang::EbvNumWorkGroups: return spv::BuiltInNumWorkgroups;
- case glslang::EbvWorkGroupSize: return spv::BuiltInWorkgroupSize;
- case glslang::EbvWorkGroupId: return spv::BuiltInWorkgroupId;
- case glslang::EbvLocalInvocationId: return spv::BuiltInLocalInvocationId;
- case glslang::EbvLocalInvocationIndex: return spv::BuiltInLocalInvocationIndex;
- case glslang::EbvGlobalInvocationId: return spv::BuiltInGlobalInvocationId;
case glslang::EbvSubGroupSize:
builder.addExtension(spv::E_SPV_KHR_shader_ballot);
@@ -1203,8 +1202,8 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
case glslang::EvqGlobal: return spv::StorageClassPrivate;
case glslang::EvqConstReadOnly: return spv::StorageClassFunction;
case glslang::EvqTemporary: return spv::StorageClassFunction;
-#ifndef GLSLANG_WEB
case glslang::EvqShared: return spv::StorageClassWorkgroup;
+#ifndef GLSLANG_WEB
case glslang::EvqPayloadNV: return spv::StorageClassRayPayloadNV;
case glslang::EvqPayloadInNV: return spv::StorageClassIncomingRayPayloadNV;
case glslang::EvqHitAttrNV: return spv::StorageClassHitAttributeNV;
@@ -1399,7 +1398,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
if (glslangIntermediate->usingPhysicalStorageBuffer()) {
addressingModel = spv::AddressingModelPhysicalStorageBuffer64EXT;
- builder.addIncorporatedExtension(spv::E_SPV_KHR_physical_storage_buffer, spv::Spv_1_5);
+ builder.addIncorporatedExtension(spv::E_SPV_EXT_physical_storage_buffer, spv::Spv_1_5);
builder.addCapability(spv::CapabilityPhysicalStorageBufferAddressesEXT);
};
if (glslangIntermediate->usingVulkanMemoryModel()) {
@@ -1465,13 +1464,20 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
if (mode != spv::ExecutionModeMax)
builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
switch (glslangIntermediate->getInterlockOrdering()) {
- case glslang::EioPixelInterlockOrdered: mode = spv::ExecutionModePixelInterlockOrderedEXT; break;
- case glslang::EioPixelInterlockUnordered: mode = spv::ExecutionModePixelInterlockUnorderedEXT; break;
- case glslang::EioSampleInterlockOrdered: mode = spv::ExecutionModeSampleInterlockOrderedEXT; break;
- case glslang::EioSampleInterlockUnordered: mode = spv::ExecutionModeSampleInterlockUnorderedEXT; break;
- case glslang::EioShadingRateInterlockOrdered: mode = spv::ExecutionModeShadingRateInterlockOrderedEXT; break;
- case glslang::EioShadingRateInterlockUnordered: mode = spv::ExecutionModeShadingRateInterlockUnorderedEXT; break;
- default: mode = spv::ExecutionModeMax; break;
+ case glslang::EioPixelInterlockOrdered: mode = spv::ExecutionModePixelInterlockOrderedEXT;
+ break;
+ case glslang::EioPixelInterlockUnordered: mode = spv::ExecutionModePixelInterlockUnorderedEXT;
+ break;
+ case glslang::EioSampleInterlockOrdered: mode = spv::ExecutionModeSampleInterlockOrderedEXT;
+ break;
+ case glslang::EioSampleInterlockUnordered: mode = spv::ExecutionModeSampleInterlockUnorderedEXT;
+ break;
+ case glslang::EioShadingRateInterlockOrdered: mode = spv::ExecutionModeShadingRateInterlockOrderedEXT;
+ break;
+ case glslang::EioShadingRateInterlockUnordered: mode = spv::ExecutionModeShadingRateInterlockUnorderedEXT;
+ break;
+ default: mode = spv::ExecutionModeMax;
+ break;
}
if (mode != spv::ExecutionModeMax) {
builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
@@ -1489,7 +1495,6 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
#endif
break;
-#ifndef GLSLANG_WEB
case EShLangCompute:
builder.addCapability(spv::CapabilityShader);
builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0),
@@ -1505,6 +1510,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives);
}
break;
+#ifndef GLSLANG_WEB
case EShLangTessEvaluation:
case EShLangTessControl:
builder.addCapability(spv::CapabilityTessellation);
@@ -1624,11 +1630,11 @@ void TGlslangToSpvTraverser::finishSpv()
for (auto it = iOSet.cbegin(); it != iOSet.cend(); ++it)
entryPoint->addIdOperand(*it);
-#ifndef GLSLANG_WEB
- // Add capabilities, extensions, remove unneeded decorations, etc.,
+ // Add capabilities, extensions, remove unneeded decorations, etc.,
// based on the resulting SPIR-V.
+ // Note: WebGPU code generation must have the opportunity to aggressively
+ // prune unreachable merge blocks and continue targets.
builder.postProcess();
-#endif
}
// Write the SPV into 'out'.
@@ -2546,7 +2552,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
binOp = glslang::EOpMod;
break;
-#ifndef GLSLANG_WEB
case glslang::EOpEmitVertex:
case glslang::EOpEndPrimitive:
case glslang::EOpBarrier:
@@ -2570,10 +2575,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
// These all have 0 operands and will naturally finish up in the code below for 0 operands
break;
- case glslang::EOpAtomicStore:
- noReturnValue = true;
- // fallthrough
- case glslang::EOpAtomicLoad:
case glslang::EOpAtomicAdd:
case glslang::EOpAtomicMin:
case glslang::EOpAtomicMax:
@@ -2585,6 +2586,14 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
atomic = true;
break;
+#ifndef GLSLANG_WEB
+ case glslang::EOpAtomicStore:
+ noReturnValue = true;
+ // fallthrough
+ case glslang::EOpAtomicLoad:
+ atomic = true;
+ break;
+
case glslang::EOpAtomicCounterAdd:
case glslang::EOpAtomicCounterSubtract:
case glslang::EOpAtomicCounterMin:
@@ -2667,6 +2676,19 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
if (arg == 1)
lvalue = true;
break;
+
+ case glslang::EOpAtomicAdd:
+ case glslang::EOpAtomicMin:
+ case glslang::EOpAtomicMax:
+ case glslang::EOpAtomicAnd:
+ case glslang::EOpAtomicOr:
+ case glslang::EOpAtomicXor:
+ case glslang::EOpAtomicExchange:
+ case glslang::EOpAtomicCompSwap:
+ if (arg == 0)
+ lvalue = true;
+ break;
+
#ifndef GLSLANG_WEB
case glslang::EOpFrexp:
if (arg == 1)
@@ -2685,14 +2707,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
invertedType = convertGlslangToSpvType(glslangOperands[0]->getAsBinaryNode()->getLeft()->getType());
}
break;
- case glslang::EOpAtomicAdd:
- case glslang::EOpAtomicMin:
- case glslang::EOpAtomicMax:
- case glslang::EOpAtomicAnd:
- case glslang::EOpAtomicOr:
- case glslang::EOpAtomicXor:
- case glslang::EOpAtomicExchange:
- case glslang::EOpAtomicCompSwap:
case glslang::EOpAtomicLoad:
case glslang::EOpAtomicStore:
case glslang::EOpAtomicCounterAdd:
@@ -2818,12 +2832,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
builder.createNoResultOp(spv::OpCooperativeMatrixStoreNV, idImmOps);
result = 0;
- } else if (atomic) {
- // Handle all atomics
- result = createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType(), lvalueCoherentFlags);
} else
#endif
- {
+ if (atomic) {
+ // Handle all atomics
+ result = createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType(), lvalueCoherentFlags);
+ } else {
// Pass through to generic operations.
switch (glslangOperands.size()) {
case 0:
@@ -3535,8 +3549,8 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5);
builder.addCapability(spv::CapabilityRuntimeDescriptorArrayEXT);
}
- spvType = builder.makeRuntimeArray(spvType);
#endif
+ spvType = builder.makeRuntimeArray(spvType);
}
if (stride > 0)
builder.addDecoration(spvType, spv::DecorationArrayStride, stride);
@@ -3701,6 +3715,7 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
for (unsigned int i = 0; i < memory.size(); ++i)
builder.addMemberDecoration(spvType, member, memory[i]);
}
+
#endif
// Location assignment was already completed correctly by the front end,
@@ -4159,9 +4174,11 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF
// memory and use RestrictPointer/AliasedPointer.
if (originalParam(type.getQualifier().storage, type, false) ||
!writableParam(type.getQualifier().storage)) {
- decorations.push_back(type.getQualifier().restrict ? spv::DecorationRestrict : spv::DecorationAliased);
+ decorations.push_back(type.getQualifier().isRestrict() ? spv::DecorationRestrict :
+ spv::DecorationAliased);
} else {
- decorations.push_back(type.getQualifier().restrict ? spv::DecorationRestrictPointerEXT : spv::DecorationAliasedPointerEXT);
+ decorations.push_back(type.getQualifier().isRestrict() ? spv::DecorationRestrictPointerEXT :
+ spv::DecorationAliasedPointerEXT);
}
}
};
@@ -4969,6 +4986,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
}
}
+#ifndef GLSLANG_WEB
// nonprivate
if (imageType.getQualifier().nonprivate) {
params.nonprivate = true;
@@ -4978,6 +4996,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
if (imageType.getQualifier().volatil) {
params.volatil = true;
}
+#endif
std::vector<spv::Id> result( 1,
builder.createTextureCall(precision, resultType(), sparse, cracked.fetch, cracked.proj, cracked.gather,
@@ -6275,6 +6294,9 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecora
break;
case glslang::EOpConvPtrToUvec2:
case glslang::EOpConvUvec2ToPtr:
+ if (builder.isVector(operand))
+ builder.promoteIncorporatedExtension(spv::E_SPV_EXT_physical_storage_buffer,
+ spv::E_SPV_KHR_physical_storage_buffer, spv::Spv_1_5);
convOp = spv::OpBitcast;
break;
#endif
@@ -6398,7 +6420,7 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
scopeId = builder.makeUintConstant(spv::ScopeDevice);
}
// semantics default to relaxed
- spv::Id semanticsId = builder.makeUintConstant(lvalueCoherentFlags.isVolatile() ?
+ spv::Id semanticsId = builder.makeUintConstant(lvalueCoherentFlags.isVolatile() && glslangIntermediate->usingVulkanMemoryModel() ?
spv::MemorySemanticsVolatileMask :
spv::MemorySemanticsMaskNone);
spv::Id semanticsId2 = semanticsId;
@@ -7167,6 +7189,48 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
case glslang::EOpRefract:
libCall = spv::GLSLstd450Refract;
break;
+ case glslang::EOpBarrier:
+ {
+ // This is for the extended controlBarrier function, with four operands.
+ // The unextended barrier() goes through createNoArgOperation.
+ assert(operands.size() == 4);
+ unsigned int executionScope = builder.getConstantScalar(operands[0]);
+ unsigned int memoryScope = builder.getConstantScalar(operands[1]);
+ unsigned int semantics = builder.getConstantScalar(operands[2]) | builder.getConstantScalar(operands[3]);
+ builder.createControlBarrier((spv::Scope)executionScope, (spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics);
+ if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask |
+ spv::MemorySemanticsMakeVisibleKHRMask |
+ spv::MemorySemanticsOutputMemoryKHRMask |
+ spv::MemorySemanticsVolatileMask)) {
+ builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
+ }
+ if (glslangIntermediate->usingVulkanMemoryModel() && (executionScope == spv::ScopeDevice || memoryScope == spv::ScopeDevice)) {
+ builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR);
+ }
+ return 0;
+ }
+ break;
+ case glslang::EOpMemoryBarrier:
+ {
+ // This is for the extended memoryBarrier function, with three operands.
+ // The unextended memoryBarrier() goes through createNoArgOperation.
+ assert(operands.size() == 3);
+ unsigned int memoryScope = builder.getConstantScalar(operands[0]);
+ unsigned int semantics = builder.getConstantScalar(operands[1]) | builder.getConstantScalar(operands[2]);
+ builder.createMemoryBarrier((spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics);
+ if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask |
+ spv::MemorySemanticsMakeVisibleKHRMask |
+ spv::MemorySemanticsOutputMemoryKHRMask |
+ spv::MemorySemanticsVolatileMask)) {
+ builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
+ }
+ if (glslangIntermediate->usingVulkanMemoryModel() && memoryScope == spv::ScopeDevice) {
+ builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR);
+ }
+ return 0;
+ }
+ break;
+
#ifndef GLSLANG_WEB
case glslang::EOpInterpolateAtSample:
if (typeProxy == glslang::EbtFloat16)
@@ -7325,47 +7389,6 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_explicit_vertex_parameter);
libCall = spv::InterpolateAtVertexAMD;
break;
- case glslang::EOpBarrier:
- {
- // This is for the extended controlBarrier function, with four operands.
- // The unextended barrier() goes through createNoArgOperation.
- assert(operands.size() == 4);
- unsigned int executionScope = builder.getConstantScalar(operands[0]);
- unsigned int memoryScope = builder.getConstantScalar(operands[1]);
- unsigned int semantics = builder.getConstantScalar(operands[2]) | builder.getConstantScalar(operands[3]);
- builder.createControlBarrier((spv::Scope)executionScope, (spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics);
- if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask |
- spv::MemorySemanticsMakeVisibleKHRMask |
- spv::MemorySemanticsOutputMemoryKHRMask |
- spv::MemorySemanticsVolatileMask)) {
- builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
- }
- if (glslangIntermediate->usingVulkanMemoryModel() && (executionScope == spv::ScopeDevice || memoryScope == spv::ScopeDevice)) {
- builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR);
- }
- return 0;
- }
- break;
- case glslang::EOpMemoryBarrier:
- {
- // This is for the extended memoryBarrier function, with three operands.
- // The unextended memoryBarrier() goes through createNoArgOperation.
- assert(operands.size() == 3);
- unsigned int memoryScope = builder.getConstantScalar(operands[0]);
- unsigned int semantics = builder.getConstantScalar(operands[1]) | builder.getConstantScalar(operands[2]);
- builder.createMemoryBarrier((spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics);
- if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask |
- spv::MemorySemanticsMakeVisibleKHRMask |
- spv::MemorySemanticsOutputMemoryKHRMask |
- spv::MemorySemanticsVolatileMask)) {
- builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
- }
- if (glslangIntermediate->usingVulkanMemoryModel() && memoryScope == spv::ScopeDevice) {
- builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR);
- }
- return 0;
- }
- break;
case glslang::EOpReportIntersectionNV:
{
@@ -7473,17 +7496,10 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
// Intrinsics with no arguments (or no return value, and no precision).
spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId)
{
-#ifndef GLSLANG_WEB
// GLSL memory barriers use queuefamily scope in new model, device scope in old model
spv::Scope memoryBarrierScope = glslangIntermediate->usingVulkanMemoryModel() ? spv::ScopeQueueFamilyKHR : spv::ScopeDevice;
switch (op) {
- case glslang::EOpEmitVertex:
- builder.createNoResultOp(spv::OpEmitVertex);
- return 0;
- case glslang::EOpEndPrimitive:
- builder.createNoResultOp(spv::OpEndPrimitive);
- return 0;
case glslang::EOpBarrier:
if (glslangIntermediate->getStage() == EShLangTessControl) {
if (glslangIntermediate->usingVulkanMemoryModel()) {
@@ -7504,18 +7520,10 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsAllMemory |
spv::MemorySemanticsAcquireReleaseMask);
return 0;
- case glslang::EOpMemoryBarrierAtomicCounter:
- builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsAtomicCounterMemoryMask |
- spv::MemorySemanticsAcquireReleaseMask);
- return 0;
case glslang::EOpMemoryBarrierBuffer:
builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsUniformMemoryMask |
spv::MemorySemanticsAcquireReleaseMask);
return 0;
- case glslang::EOpMemoryBarrierImage:
- builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsImageMemoryMask |
- spv::MemorySemanticsAcquireReleaseMask);
- return 0;
case glslang::EOpMemoryBarrierShared:
builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsWorkgroupMemoryMask |
spv::MemorySemanticsAcquireReleaseMask);
@@ -7524,6 +7532,15 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
builder.createMemoryBarrier(spv::ScopeWorkgroup, spv::MemorySemanticsAllMemory |
spv::MemorySemanticsAcquireReleaseMask);
return 0;
+#ifndef GLSLANG_WEB
+ case glslang::EOpMemoryBarrierAtomicCounter:
+ builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsAtomicCounterMemoryMask |
+ spv::MemorySemanticsAcquireReleaseMask);
+ return 0;
+ case glslang::EOpMemoryBarrierImage:
+ builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsImageMemoryMask |
+ spv::MemorySemanticsAcquireReleaseMask);
+ return 0;
case glslang::EOpAllMemoryBarrierWithGroupSync:
builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeDevice,
spv::MemorySemanticsAllMemory |
@@ -7568,6 +7585,14 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
builder.createMemoryBarrier(spv::ScopeSubgroup, spv::MemorySemanticsWorkgroupMemoryMask |
spv::MemorySemanticsAcquireReleaseMask);
return spv::NoResult;
+
+ case glslang::EOpEmitVertex:
+ builder.createNoResultOp(spv::OpEmitVertex);
+ return 0;
+ case glslang::EOpEndPrimitive:
+ builder.createNoResultOp(spv::OpEndPrimitive);
+ return 0;
+
case glslang::EOpSubgroupElect: {
std::vector<spv::Id> operands;
return createSubgroupOperation(op, typeId, operands, glslang::EbtVoid);
@@ -7615,10 +7640,10 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
builder.addCapability(spv::CapabilityShaderClockKHR);
return builder.createOp(spv::OpReadClockKHR, typeId, args);
}
+#endif
default:
break;
}
-#endif
logger->missingFunctionality("unknown operation with no arguments");
@@ -7823,7 +7848,6 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n
// We now know we have a specialization constant to build
-#ifndef GLSLANG_WEB
// gl_WorkGroupSize is a special case until the front-end handles hierarchical specialization constants,
// even then, it's specialization ids are handled by special case syntax in GLSL: layout(local_size_x = ...
if (node.getType().getQualifier().builtIn == glslang::EbvWorkGroupSize) {
@@ -7838,7 +7862,6 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n
}
return builder.makeCompositeConstant(builder.makeVectorType(builder.makeUintType(32), 3), dimConstId, true);
}
-#endif
// An AST node labelled as specialization constant should be a symbol node.
// Its initializer should either be a sub tree with constant nodes, or a constant union array.
@@ -8174,7 +8197,8 @@ int GetSpirvGeneratorVersion()
// return 5; // make OpArrayLength result type be an int with signedness of 0
// return 6; // revert version 5 change, which makes a different (new) kind of incorrect code,
// versions 4 and 6 each generate OpArrayLength as it has long been done
- return 7; // GLSL volatile keyword maps to both SPIR-V decorations Volatile and Coherent
+ // return 7; // GLSL volatile keyword maps to both SPIR-V decorations Volatile and Coherent
+ return 8; // switch to new dead block eliminator; use OpUnreachable
}
// Write SPIR-V out to a binary file
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/InReadableOrder.cpp b/3rdparty/bgfx/3rdparty/glslang/SPIRV/InReadableOrder.cpp
index 52b29613a45..9d9410be93c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/InReadableOrder.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/InReadableOrder.cpp
@@ -61,17 +61,22 @@ namespace {
// Use by calling visit() on the root block.
class ReadableOrderTraverser {
public:
- explicit ReadableOrderTraverser(std::function<void(Block*)> callback) : callback_(callback) {}
+ ReadableOrderTraverser(std::function<void(Block*, spv::ReachReason, Block*)> callback)
+ : callback_(callback) {}
// Visits the block if it hasn't been visited already and isn't currently
- // being delayed. Invokes callback(block), then descends into its
+ // being delayed. Invokes callback(block, why, header), then descends into its
// successors. Delays merge-block and continue-block processing until all
- // the branches have been completed.
- void visit(Block* block)
+ // the branches have been completed. If |block| is an unreachable merge block or
+ // an unreachable continue target, then |header| is the corresponding header block.
+ void visit(Block* block, spv::ReachReason why, Block* header)
{
assert(block);
+ if (why == spv::ReachViaControlFlow) {
+ reachableViaControlFlow_.insert(block);
+ }
if (visited_.count(block) || delayed_.count(block))
return;
- callback_(block);
+ callback_(block, why, header);
visited_.insert(block);
Block* mergeBlock = nullptr;
Block* continueBlock = nullptr;
@@ -87,27 +92,40 @@ public:
delayed_.insert(continueBlock);
}
}
- const auto successors = block->getSuccessors();
- for (auto it = successors.cbegin(); it != successors.cend(); ++it)
- visit(*it);
+ if (why == spv::ReachViaControlFlow) {
+ const auto& successors = block->getSuccessors();
+ for (auto it = successors.cbegin(); it != successors.cend(); ++it)
+ visit(*it, why, nullptr);
+ }
if (continueBlock) {
+ const spv::ReachReason continueWhy =
+ (reachableViaControlFlow_.count(continueBlock) > 0)
+ ? spv::ReachViaControlFlow
+ : spv::ReachDeadContinue;
delayed_.erase(continueBlock);
- visit(continueBlock);
+ visit(continueBlock, continueWhy, block);
}
if (mergeBlock) {
+ const spv::ReachReason mergeWhy =
+ (reachableViaControlFlow_.count(mergeBlock) > 0)
+ ? spv::ReachViaControlFlow
+ : spv::ReachDeadMerge;
delayed_.erase(mergeBlock);
- visit(mergeBlock);
+ visit(mergeBlock, mergeWhy, block);
}
}
private:
- std::function<void(Block*)> callback_;
+ std::function<void(Block*, spv::ReachReason, Block*)> callback_;
// Whether a block has already been visited or is being delayed.
std::unordered_set<Block *> visited_, delayed_;
+
+ // The set of blocks that actually are reached via control flow.
+ std::unordered_set<Block *> reachableViaControlFlow_;
};
}
-void spv::inReadableOrder(Block* root, std::function<void(Block*)> callback)
+void spv::inReadableOrder(Block* root, std::function<void(Block*, spv::ReachReason, Block*)> callback)
{
- ReadableOrderTraverser(callback).visit(root);
+ ReadableOrderTraverser(callback).visit(root, spv::ReachViaControlFlow, nullptr);
}
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h
index bef7d3db1d3..8d8f34baaa8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h
@@ -106,11 +106,20 @@ public:
void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); }
void setEmitOpLines() { emitOpLines = true; }
void addExtension(const char* ext) { extensions.insert(ext); }
+ void removeExtension(const char* ext)
+ {
+ extensions.erase(ext);
+ }
void addIncorporatedExtension(const char* ext, SpvVersion incorporatedVersion)
{
if (getSpvVersion() < static_cast<unsigned>(incorporatedVersion))
addExtension(ext);
}
+ void promoteIncorporatedExtension(const char* baseExt, const char* promoExt, SpvVersion incorporatedVersion)
+ {
+ removeExtension(baseExt);
+ addIncorporatedExtension(promoExt, incorporatedVersion);
+ }
void addInclude(const std::string& name, const std::string& text)
{
spv::Id incId = getStringId(name);
@@ -674,14 +683,12 @@ public:
// based on the type of the base and the chain of dereferences.
Id accessChainGetInferredType();
- // Add capabilities, extensions, remove unneeded decorations, etc.,
+ // Add capabilities, extensions, remove unneeded decorations, etc.,
// based on the resulting SPIR-V.
void postProcess();
// Hook to visit each instruction in a block in a function
void postProcess(Instruction&);
- // Hook to visit each instruction in a reachable block in a function.
- void postProcessReachable(const Instruction&);
// Hook to visit each non-32-bit sized float/int operation in a block.
void postProcessType(const Instruction&, spv::Id typeId);
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp
index 832ee3ef73c..86fad580a2a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp
@@ -39,6 +39,7 @@
#include <cassert>
#include <cstdlib>
+#include <unordered_map>
#include <unordered_set>
#include <algorithm>
@@ -319,16 +320,14 @@ void Builder::postProcess(Instruction& inst)
}
}
-// Called for each instruction in a reachable block.
-void Builder::postProcessReachable(const Instruction&)
-{
- // did have code here, but questionable to do so without deleting the instructions
-}
-
// comment in header
void Builder::postProcess()
{
+ // reachableBlocks is the set of blockss reached via control flow, or which are
+ // unreachable continue targert or unreachable merge.
std::unordered_set<const Block*> reachableBlocks;
+ std::unordered_map<Block*, Block*> headerForUnreachableContinue;
+ std::unordered_set<Block*> unreachableMerges;
std::unordered_set<Id> unreachableDefinitions;
// Collect IDs defined in unreachable blocks. For each function, label the
// reachable blocks first. Then for each unreachable block, collect the
@@ -336,16 +335,41 @@ void Builder::postProcess()
for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) {
Function* f = *fi;
Block* entry = f->getEntryBlock();
- inReadableOrder(entry, [&reachableBlocks](const Block* b) { reachableBlocks.insert(b); });
+ inReadableOrder(entry,
+ [&reachableBlocks, &unreachableMerges, &headerForUnreachableContinue]
+ (Block* b, ReachReason why, Block* header) {
+ reachableBlocks.insert(b);
+ if (why == ReachDeadContinue) headerForUnreachableContinue[b] = header;
+ if (why == ReachDeadMerge) unreachableMerges.insert(b);
+ });
for (auto bi = f->getBlocks().cbegin(); bi != f->getBlocks().cend(); bi++) {
Block* b = *bi;
- if (reachableBlocks.count(b) == 0) {
- for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ii++)
+ if (unreachableMerges.count(b) != 0 || headerForUnreachableContinue.count(b) != 0) {
+ auto ii = b->getInstructions().cbegin();
+ ++ii; // Keep potential decorations on the label.
+ for (; ii != b->getInstructions().cend(); ++ii)
+ unreachableDefinitions.insert(ii->get()->getResultId());
+ } else if (reachableBlocks.count(b) == 0) {
+ // The normal case for unreachable code. All definitions are considered dead.
+ for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ++ii)
unreachableDefinitions.insert(ii->get()->getResultId());
}
}
}
+ // Modify unreachable merge blocks and unreachable continue targets.
+ // Delete their contents.
+ for (auto mergeIter = unreachableMerges.begin(); mergeIter != unreachableMerges.end(); ++mergeIter) {
+ (*mergeIter)->rewriteAsCanonicalUnreachableMerge();
+ }
+ for (auto continueIter = headerForUnreachableContinue.begin();
+ continueIter != headerForUnreachableContinue.end();
+ ++continueIter) {
+ Block* continue_target = continueIter->first;
+ Block* header = continueIter->second;
+ continue_target->rewriteAsCanonicalUnreachableContinue(header);
+ }
+
// Remove unneeded decorations, for unreachable instructions
decorations.erase(std::remove_if(decorations.begin(), decorations.end(),
[&unreachableDefinitions](std::unique_ptr<Instruction>& I) -> bool {
@@ -374,13 +398,6 @@ void Builder::postProcess()
}
}
- // process all reachable instructions...
- for (auto bi = reachableBlocks.cbegin(); bi != reachableBlocks.cend(); ++bi) {
- const Block* block = *bi;
- const auto function = [this](const std::unique_ptr<Instruction>& inst) { postProcessReachable(*inst.get()); };
- std::for_each(block->getInstructions().begin(), block->getInstructions().end(), function);
- }
-
// process all block-contained instructions
for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) {
Function* f = *fi;
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp
index 698f154a39f..7c3b0391927 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp
@@ -173,6 +173,7 @@ void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector<unsigned int>
if (options->generateDebugInfo) {
optimizer.RegisterPass(spvtools::CreatePropagateLineInfoPass());
}
+ optimizer.RegisterPass(spvtools::CreateWrapOpKillPass());
optimizer.RegisterPass(spvtools::CreateDeadBranchElimPass());
optimizer.RegisterPass(spvtools::CreateMergeReturnPass());
optimizer.RegisterPass(spvtools::CreateInlineExhaustivePass());
@@ -196,8 +197,6 @@ void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector<unsigned int>
optimizer.RegisterPass(spvtools::CreateDeadInsertElimPass());
if (options->optimizeSize) {
optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass());
- // TODO(greg-lunarg): Add this when AMD driver issues are resolved
- // optimizer.RegisterPass(CreateCommonUniformElimPass());
}
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/spvIR.h b/3rdparty/bgfx/3rdparty/glslang/SPIRV/spvIR.h
index 7e2d4bc1452..994224d1fbe 100755
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/spvIR.h
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/spvIR.h
@@ -226,6 +226,36 @@ public:
return nullptr;
}
+ // Change this block into a canonical dead merge block. Delete instructions
+ // as necessary. A canonical dead merge block has only an OpLabel and an
+ // OpUnreachable.
+ void rewriteAsCanonicalUnreachableMerge() {
+ assert(localVariables.empty());
+ // Delete all instructions except for the label.
+ assert(instructions.size() > 0);
+ instructions.resize(1);
+ successors.clear();
+ Instruction* unreachable = new Instruction(OpUnreachable);
+ addInstruction(std::unique_ptr<Instruction>(unreachable));
+ }
+ // Change this block into a canonical dead continue target branching to the
+ // given header ID. Delete instructions as necessary. A canonical dead continue
+ // target has only an OpLabel and an unconditional branch back to the corresponding
+ // header.
+ void rewriteAsCanonicalUnreachableContinue(Block* header) {
+ assert(localVariables.empty());
+ // Delete all instructions except for the label.
+ assert(instructions.size() > 0);
+ instructions.resize(1);
+ successors.clear();
+ // Add OpBranch back to the header.
+ assert(header != nullptr);
+ Instruction* branch = new Instruction(OpBranch);
+ branch->addIdOperand(header->getId());
+ addInstruction(std::move(std::unique_ptr<Instruction>(branch)));
+ successors.push_back(header);
+ }
+
bool isTerminated() const
{
switch (instructions.back()->getOpCode()) {
@@ -235,6 +265,7 @@ public:
case OpKill:
case OpReturn:
case OpReturnValue:
+ case OpUnreachable:
return true;
default:
return false;
@@ -268,10 +299,24 @@ protected:
bool unreachable;
};
+// The different reasons for reaching a block in the inReadableOrder traversal.
+enum ReachReason {
+ // Reachable from the entry block via transfers of control, i.e. branches.
+ ReachViaControlFlow = 0,
+ // A continue target that is not reachable via control flow.
+ ReachDeadContinue,
+ // A merge block that is not reachable via control flow.
+ ReachDeadMerge
+};
+
// Traverses the control-flow graph rooted at root in an order suited for
// readable code generation. Invokes callback at every node in the traversal
-// order.
-void inReadableOrder(Block* root, std::function<void(Block*)> callback);
+// order. The callback arguments are:
+// - the block,
+// - the reason we reached the block,
+// - if the reason was that block is an unreachable continue or unreachable merge block
+// then the last parameter is the corresponding header block.
+void inReadableOrder(Block* root, std::function<void(Block*, ReachReason, Block* header)> callback);
//
// SPIR-V IR Function.
@@ -321,7 +366,7 @@ public:
parameterInstructions[p]->dump(out);
// Blocks
- inReadableOrder(blocks[0], [&out](const Block* b) { b->dump(out); });
+ inReadableOrder(blocks[0], [&out](const Block* b, ReachReason, Block*) { b->dump(out); });
Instruction end(0, 0, OpFunctionEnd);
end.dump(out);
}
diff --git a/3rdparty/bgfx/3rdparty/glslang/StandAlone/CMakeLists.txt b/3rdparty/bgfx/3rdparty/glslang/StandAlone/CMakeLists.txt
index 5cea53d9f64..0878965c1f1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/StandAlone/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/glslang/StandAlone/CMakeLists.txt
@@ -4,8 +4,9 @@ set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang)
set_property(TARGET glslang-default-resource-limits PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(glslang-default-resource-limits
- PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
- PUBLIC ${PROJECT_SOURCE_DIR})
+ PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>)
+
set(SOURCES StandAlone.cpp DirStackFileIncluder.h)
set(REMAPPER_SOURCES spirv-remap.cpp)
@@ -33,21 +34,27 @@ endif(WIN32)
target_link_libraries(glslangValidator ${LIBRARIES})
target_link_libraries(spirv-remap ${LIBRARIES})
-target_include_directories(glslangValidator PUBLIC ../External)
+target_include_directories(glslangValidator PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
if(WIN32)
source_group("Source" FILES ${SOURCES})
endif(WIN32)
if(ENABLE_GLSLANG_INSTALL)
- install(TARGETS glslangValidator
+ install(TARGETS glslangValidator EXPORT glslangValidatorTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
- install(TARGETS spirv-remap
+ install(TARGETS spirv-remap EXPORT spirv-remapTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+ install(EXPORT glslangValidatorTargets DESTINATION lib/cmake)
+ install(EXPORT spirv-remapTargets DESTINATION lib/cmake)
if(BUILD_SHARED_LIBS)
- install(TARGETS glslang-default-resource-limits
+ install(TARGETS glslang-default-resource-limits EXPORT glslang-default-resource-limitsTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(EXPORT glslang-default-resource-limitsTargets DESTINATION lib/cmake)
endif()
endif(ENABLE_GLSLANG_INSTALL)
diff --git a/3rdparty/bgfx/3rdparty/glslang/StandAlone/StandAlone.cpp b/3rdparty/bgfx/3rdparty/glslang/StandAlone/StandAlone.cpp
index 4be3a4f4785..07479321967 100644
--- a/3rdparty/bgfx/3rdparty/glslang/StandAlone/StandAlone.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/StandAlone/StandAlone.cpp
@@ -988,7 +988,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
// Set base bindings
shader->setShiftBinding(res, baseBinding[res][compUnit.stage]);
-
+
// Set bindings for particular resource sets
// TODO: use a range based for loop here, when available in all environments.
for (auto i = baseBindingForSet[res][compUnit.stage].begin();
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/130.frag b/3rdparty/bgfx/3rdparty/glslang/Test/130.frag
index 3e394110b55..8a5bfd522c7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/130.frag
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/130.frag
@@ -167,3 +167,12 @@ void qux2()
}
layout(early_fragment_tests) out; // ERROR
+
+#extension GL_ARB_explicit_uniform_location : enable
+
+layout(location = 3) uniform vec4 ucolor0; // ERROR: explicit attrib location is also required for version < 330
+
+#extension GL_ARB_explicit_attrib_location : enable
+
+layout(location = 4) uniform vec4 ucolor1;
+
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/330.frag b/3rdparty/bgfx/3rdparty/glslang/Test/330.frag
index 9afa8f82697..a7ca87cdbfc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/330.frag
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/330.frag
@@ -149,4 +149,17 @@ void fooKeyMem()
KeyMem.precise;
}
-layout(location=28, index=2) out vec4 outIndex2; // ERROR index out of range \ No newline at end of file
+layout(location=28, index=2) out vec4 outIndex2; // ERROR index out of range
+
+layout(location=4) uniform vec4 ucolor0; // ERROR: extension is not enabled
+
+#extension GL_ARB_explicit_uniform_location : enable
+
+layout(location=5) uniform vec4 ucolor1;
+
+layout(location=6) uniform ColorsBuffer // ERROR: location cannot be applied in uniform buffer block
+{
+ vec4 colors[128];
+} colorsBuffer;
+
+
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out
index 2e58bdd0755..887e4acd0f8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out
@@ -1,6 +1,6 @@
hlsl.aliasOpaque.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 87
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out
index d334b7e6e1c..ad9e6c10c93 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out
@@ -1,6 +1,6 @@
hlsl.flattenOpaque.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 185
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out
index 921cb96a95e..6ed8da216b6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out
@@ -1,6 +1,6 @@
hlsl.flattenOpaqueInit.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 134
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out
index 39770f45977..81ab5e60245 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out
@@ -1,6 +1,6 @@
hlsl.flattenOpaqueInitMix.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 97
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out
index 4628479ad60..562070d6b01 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out
@@ -1,6 +1,6 @@
hlsl.flattenSubset.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 66
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out
index 0d7ab5603f5..5cc280bff54 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out
@@ -1,6 +1,6 @@
hlsl.flattenSubset2.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 53
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out
index 27482b34d84..f4c9c5abe8a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out
@@ -1,6 +1,6 @@
hlsl.partialFlattenLocal.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 158
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out
index e54fb7efa35..7be570bd5a5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out
@@ -1,6 +1,6 @@
hlsl.partialFlattenMixed.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 36
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/130.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/130.frag.out
index 81d055befea..0af9ab9f694 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/130.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/130.frag.out
@@ -29,10 +29,13 @@ ERROR: 0:153: 'early_fragment_tests' : not supported for this version or the ena
ERROR: 0:154: 'image load store' : not supported for this version or the enabled extensions
ERROR: 0:154: 'iimage2D' : Reserved word.
ERROR: 0:169: 'early_fragment_tests' : can only apply to 'in'
-ERROR: 28 compilation errors. No code generated.
+ERROR: 0:173: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions
+ERROR: 29 compilation errors. No code generated.
Shader version: 130
+Requested GL_ARB_explicit_attrib_location
+Requested GL_ARB_explicit_uniform_location
Requested GL_ARB_gpu_shader5
Requested GL_ARB_separate_shader_objects
Requested GL_ARB_shader_image_load_store
@@ -402,12 +405,16 @@ ERROR: node is still EOpNull!
0:? 'gl_FogFragCoord' ( smooth in float)
0:? 'iimg2Dbad' (layout( r32i) uniform iimage2D)
0:? 'iimg2D' (layout( r32i) uniform iimage2D)
+0:? 'ucolor0' (layout( location=3) uniform 4-component vector of float)
+0:? 'ucolor1' (layout( location=4) uniform 4-component vector of float)
Linked fragment stage:
Shader version: 130
+Requested GL_ARB_explicit_attrib_location
+Requested GL_ARB_explicit_uniform_location
Requested GL_ARB_gpu_shader5
Requested GL_ARB_separate_shader_objects
Requested GL_ARB_shader_image_load_store
@@ -457,4 +464,6 @@ ERROR: node is still EOpNull!
0:? 'gl_FogFragCoord' ( smooth in float)
0:? 'iimg2Dbad' (layout( r32i) uniform iimage2D)
0:? 'iimg2D' (layout( r32i) uniform iimage2D)
+0:? 'ucolor0' (layout( location=3) uniform 4-component vector of float)
+0:? 'ucolor1' (layout( location=4) uniform 4-component vector of float)
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/330.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/330.frag.out
index 36ba7a2b3c6..bb2770f569e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/330.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/330.frag.out
@@ -40,11 +40,14 @@ ERROR: 0:140: 'assign' : cannot convert from ' const float' to ' temp 2-compone
ERROR: 0:141: 'textureQueryLod' : no matching overloaded function found
ERROR: 0:141: 'assign' : cannot convert from ' const float' to ' temp 2-component vector of float'
ERROR: 0:152: 'index' : value must be 0 or 1
-ERROR: 41 compilation errors. No code generated.
+ERROR: 0:154: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions
+ERROR: 0:160: 'location' : cannot apply to uniform or buffer block
+ERROR: 43 compilation errors. No code generated.
Shader version: 330
Requested GL_ARB_enhanced_layouts
+Requested GL_ARB_explicit_uniform_location
Requested GL_ARB_separate_shader_objects
ERROR: node is still EOpNull!
0:8 Function Definition: main( ( global void)
@@ -126,6 +129,9 @@ ERROR: node is still EOpNull!
0:? 'precise' ( global int)
0:? 'KeyMem' ( global structure{ global int precise})
0:? 'outIndex2' (layout( location=28 index=0) out 4-component vector of float)
+0:? 'ucolor0' (layout( location=4) uniform 4-component vector of float)
+0:? 'ucolor1' (layout( location=5) uniform 4-component vector of float)
+0:? 'colorsBuffer' (layout( location=6 column_major shared) uniform block{layout( column_major shared) uniform 128-element array of 4-component vector of float colors})
Linked fragment stage:
@@ -135,6 +141,7 @@ ERROR: Linking fragment stage: Cannot use both gl_FragColor and gl_FragData
Shader version: 330
Requested GL_ARB_enhanced_layouts
+Requested GL_ARB_explicit_uniform_location
Requested GL_ARB_separate_shader_objects
ERROR: node is still EOpNull!
0:8 Function Definition: main( ( global void)
@@ -191,4 +198,7 @@ ERROR: node is still EOpNull!
0:? 'precise' ( global int)
0:? 'KeyMem' ( global structure{ global int precise})
0:? 'outIndex2' (layout( location=28 index=0) out 4-component vector of float)
+0:? 'ucolor0' (layout( location=4) uniform 4-component vector of float)
+0:? 'ucolor1' (layout( location=5) uniform 4-component vector of float)
+0:? 'colorsBuffer' (layout( location=6 column_major shared) uniform block{layout( column_major shared) uniform 128-element array of 4-component vector of float colors})
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/compoundsuffix.frag.hlsl b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/compoundsuffix.frag.hlsl
index f47c97dc8e6..650d1d0b8fd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/compoundsuffix.frag.hlsl
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/compoundsuffix.frag.hlsl
@@ -1,6 +1,6 @@
compoundsuffix.frag.hlsl
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 22
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.450.subgroup.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.450.subgroup.frag.out
index e61523e9027..817abb244cf 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.450.subgroup.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.450.subgroup.frag.out
@@ -85,11 +85,13 @@ ERROR: 0:95: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
ERROR: 0:96: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
ERROR: 0:97: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
ERROR: 0:98: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
-ERROR: 0:232: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
-ERROR: 0:233: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
-ERROR: 0:234: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
-ERROR: 0:235: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
-ERROR: 90 compilation errors. No code generated.
+ERROR: 0:124: 'id' : argument must be compile-time constant
+ERROR: 0:199: 'id' : argument must be compile-time constant
+ERROR: 0:236: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:237: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:238: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 0:239: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
+ERROR: 92 compilation errors. No code generated.
Shader version: 450
@@ -352,270 +354,278 @@ ERROR: node is still EOpNull!
0:116 Function Definition: ballot_works(vf4; ( global void)
0:116 Function Parameters:
0:116 'f4' ( in 4-component vector of float)
-0:117 Sequence
-0:117 'gl_SubgroupEqMask' ( flat in 4-component vector of uint SubgroupEqMask)
-0:118 'gl_SubgroupGeMask' ( flat in 4-component vector of uint SubgroupGeMask)
-0:119 'gl_SubgroupGtMask' ( flat in 4-component vector of uint SubgroupGtMask)
-0:120 'gl_SubgroupLeMask' ( flat in 4-component vector of uint SubgroupLeMask)
-0:121 'gl_SubgroupLtMask' ( flat in 4-component vector of uint SubgroupLtMask)
-0:122 subgroupBroadcast ( global 4-component vector of float)
-0:122 'f4' ( in 4-component vector of float)
-0:122 Constant:
-0:122 0 (const uint)
-0:123 subgroupBroadcastFirst ( global 4-component vector of float)
+0:? Sequence
+0:118 'gl_SubgroupEqMask' ( flat in 4-component vector of uint SubgroupEqMask)
+0:119 'gl_SubgroupGeMask' ( flat in 4-component vector of uint SubgroupGeMask)
+0:120 'gl_SubgroupGtMask' ( flat in 4-component vector of uint SubgroupGtMask)
+0:121 'gl_SubgroupLeMask' ( flat in 4-component vector of uint SubgroupLeMask)
+0:122 'gl_SubgroupLtMask' ( flat in 4-component vector of uint SubgroupLtMask)
+0:123 subgroupBroadcast ( global 4-component vector of float)
0:123 'f4' ( in 4-component vector of float)
-0:124 Sequence
-0:124 move second child to first child ( temp 4-component vector of uint)
-0:124 'ballot' ( temp 4-component vector of uint)
-0:124 subgroupBallot ( global 4-component vector of uint)
-0:124 Constant:
-0:124 false (const bool)
-0:125 subgroupInverseBallot ( global bool)
-0:125 Constant:
-0:125 1 (const uint)
-0:125 1 (const uint)
-0:125 1 (const uint)
-0:125 1 (const uint)
-0:126 subgroupBallotBitExtract ( global bool)
-0:126 'ballot' ( temp 4-component vector of uint)
-0:126 Constant:
-0:126 0 (const uint)
-0:127 subgroupBallotBitCount ( global uint)
-0:127 'ballot' ( temp 4-component vector of uint)
-0:128 subgroupBallotInclusiveBitCount ( global uint)
+0:123 Constant:
+0:123 0 (const uint)
+0:124 subgroupBroadcast ( global 4-component vector of float)
+0:124 'f4' ( in 4-component vector of float)
+0:124 Convert int to uint ( temp uint)
+0:124 'i' ( temp int)
+0:125 subgroupBroadcastFirst ( global 4-component vector of float)
+0:125 'f4' ( in 4-component vector of float)
+0:126 Sequence
+0:126 move second child to first child ( temp 4-component vector of uint)
+0:126 'ballot' ( temp 4-component vector of uint)
+0:126 subgroupBallot ( global 4-component vector of uint)
+0:126 Constant:
+0:126 false (const bool)
+0:127 subgroupInverseBallot ( global bool)
+0:127 Constant:
+0:127 1 (const uint)
+0:127 1 (const uint)
+0:127 1 (const uint)
+0:127 1 (const uint)
+0:128 subgroupBallotBitExtract ( global bool)
0:128 'ballot' ( temp 4-component vector of uint)
-0:129 subgroupBallotExclusiveBitCount ( global uint)
+0:128 Constant:
+0:128 0 (const uint)
+0:129 subgroupBallotBitCount ( global uint)
0:129 'ballot' ( temp 4-component vector of uint)
-0:130 subgroupBallotFindLSB ( global uint)
+0:130 subgroupBallotInclusiveBitCount ( global uint)
0:130 'ballot' ( temp 4-component vector of uint)
-0:131 subgroupBallotFindMSB ( global uint)
+0:131 subgroupBallotExclusiveBitCount ( global uint)
0:131 'ballot' ( temp 4-component vector of uint)
-0:135 Function Definition: vote_works(vf4; ( global void)
-0:135 Function Parameters:
-0:135 'f4' ( in 4-component vector of float)
-0:137 Sequence
-0:137 subgroupAll ( global bool)
-0:137 Constant:
-0:137 true (const bool)
-0:138 subgroupAny ( global bool)
-0:138 Constant:
-0:138 false (const bool)
-0:139 subgroupAllEqual ( global bool)
-0:139 'f4' ( in 4-component vector of float)
-0:144 Function Definition: shuffle_works(vf4; ( global void)
-0:144 Function Parameters:
-0:144 'f4' ( in 4-component vector of float)
-0:146 Sequence
-0:146 subgroupShuffle ( global 4-component vector of float)
-0:146 'f4' ( in 4-component vector of float)
-0:146 Constant:
-0:146 0 (const uint)
-0:147 subgroupShuffleXor ( global 4-component vector of float)
-0:147 'f4' ( in 4-component vector of float)
-0:147 Constant:
-0:147 1 (const uint)
-0:148 subgroupShuffleUp ( global 4-component vector of float)
+0:132 subgroupBallotFindLSB ( global uint)
+0:132 'ballot' ( temp 4-component vector of uint)
+0:133 subgroupBallotFindMSB ( global uint)
+0:133 'ballot' ( temp 4-component vector of uint)
+0:137 Function Definition: vote_works(vf4; ( global void)
+0:137 Function Parameters:
+0:137 'f4' ( in 4-component vector of float)
+0:139 Sequence
+0:139 subgroupAll ( global bool)
+0:139 Constant:
+0:139 true (const bool)
+0:140 subgroupAny ( global bool)
+0:140 Constant:
+0:140 false (const bool)
+0:141 subgroupAllEqual ( global bool)
+0:141 'f4' ( in 4-component vector of float)
+0:146 Function Definition: shuffle_works(vf4; ( global void)
+0:146 Function Parameters:
+0:146 'f4' ( in 4-component vector of float)
+0:148 Sequence
+0:148 subgroupShuffle ( global 4-component vector of float)
0:148 'f4' ( in 4-component vector of float)
0:148 Constant:
-0:148 1 (const uint)
-0:149 subgroupShuffleDown ( global 4-component vector of float)
+0:148 0 (const uint)
+0:149 subgroupShuffleXor ( global 4-component vector of float)
0:149 'f4' ( in 4-component vector of float)
0:149 Constant:
0:149 1 (const uint)
-0:153 Function Definition: arith_works(vf4; ( global void)
-0:153 Function Parameters:
-0:153 'f4' ( in 4-component vector of float)
+0:150 subgroupShuffleUp ( global 4-component vector of float)
+0:150 'f4' ( in 4-component vector of float)
+0:150 Constant:
+0:150 1 (const uint)
+0:151 subgroupShuffleDown ( global 4-component vector of float)
+0:151 'f4' ( in 4-component vector of float)
+0:151 Constant:
+0:151 1 (const uint)
+0:155 Function Definition: arith_works(vf4; ( global void)
+0:155 Function Parameters:
+0:155 'f4' ( in 4-component vector of float)
0:? Sequence
-0:156 subgroupAdd ( global 4-component vector of float)
-0:156 'f4' ( in 4-component vector of float)
-0:157 subgroupMul ( global 4-component vector of float)
-0:157 'f4' ( in 4-component vector of float)
-0:158 subgroupMin ( global 4-component vector of float)
+0:158 subgroupAdd ( global 4-component vector of float)
0:158 'f4' ( in 4-component vector of float)
-0:159 subgroupMax ( global 4-component vector of float)
+0:159 subgroupMul ( global 4-component vector of float)
0:159 'f4' ( in 4-component vector of float)
-0:160 subgroupAnd ( global 4-component vector of uint)
-0:160 'ballot' ( temp 4-component vector of uint)
-0:161 subgroupOr ( global 4-component vector of uint)
-0:161 'ballot' ( temp 4-component vector of uint)
-0:162 subgroupXor ( global 4-component vector of uint)
+0:160 subgroupMin ( global 4-component vector of float)
+0:160 'f4' ( in 4-component vector of float)
+0:161 subgroupMax ( global 4-component vector of float)
+0:161 'f4' ( in 4-component vector of float)
+0:162 subgroupAnd ( global 4-component vector of uint)
0:162 'ballot' ( temp 4-component vector of uint)
-0:163 subgroupInclusiveAdd ( global 4-component vector of float)
-0:163 'f4' ( in 4-component vector of float)
-0:164 subgroupInclusiveMul ( global 4-component vector of float)
-0:164 'f4' ( in 4-component vector of float)
-0:165 subgroupInclusiveMin ( global 4-component vector of float)
+0:163 subgroupOr ( global 4-component vector of uint)
+0:163 'ballot' ( temp 4-component vector of uint)
+0:164 subgroupXor ( global 4-component vector of uint)
+0:164 'ballot' ( temp 4-component vector of uint)
+0:165 subgroupInclusiveAdd ( global 4-component vector of float)
0:165 'f4' ( in 4-component vector of float)
-0:166 subgroupInclusiveMax ( global 4-component vector of float)
+0:166 subgroupInclusiveMul ( global 4-component vector of float)
0:166 'f4' ( in 4-component vector of float)
-0:167 subgroupInclusiveAnd ( global 4-component vector of uint)
-0:167 'ballot' ( temp 4-component vector of uint)
-0:168 subgroupInclusiveOr ( global 4-component vector of uint)
-0:168 'ballot' ( temp 4-component vector of uint)
-0:169 subgroupInclusiveXor ( global 4-component vector of uint)
+0:167 subgroupInclusiveMin ( global 4-component vector of float)
+0:167 'f4' ( in 4-component vector of float)
+0:168 subgroupInclusiveMax ( global 4-component vector of float)
+0:168 'f4' ( in 4-component vector of float)
+0:169 subgroupInclusiveAnd ( global 4-component vector of uint)
0:169 'ballot' ( temp 4-component vector of uint)
-0:170 subgroupExclusiveAdd ( global 4-component vector of float)
-0:170 'f4' ( in 4-component vector of float)
-0:171 subgroupExclusiveMul ( global 4-component vector of float)
-0:171 'f4' ( in 4-component vector of float)
-0:172 subgroupExclusiveMin ( global 4-component vector of float)
+0:170 subgroupInclusiveOr ( global 4-component vector of uint)
+0:170 'ballot' ( temp 4-component vector of uint)
+0:171 subgroupInclusiveXor ( global 4-component vector of uint)
+0:171 'ballot' ( temp 4-component vector of uint)
+0:172 subgroupExclusiveAdd ( global 4-component vector of float)
0:172 'f4' ( in 4-component vector of float)
-0:173 subgroupExclusiveMax ( global 4-component vector of float)
+0:173 subgroupExclusiveMul ( global 4-component vector of float)
0:173 'f4' ( in 4-component vector of float)
-0:174 subgroupExclusiveAnd ( global 4-component vector of uint)
-0:174 'ballot' ( temp 4-component vector of uint)
-0:175 subgroupExclusiveOr ( global 4-component vector of uint)
-0:175 'ballot' ( temp 4-component vector of uint)
-0:176 subgroupExclusiveXor ( global 4-component vector of uint)
+0:174 subgroupExclusiveMin ( global 4-component vector of float)
+0:174 'f4' ( in 4-component vector of float)
+0:175 subgroupExclusiveMax ( global 4-component vector of float)
+0:175 'f4' ( in 4-component vector of float)
+0:176 subgroupExclusiveAnd ( global 4-component vector of uint)
0:176 'ballot' ( temp 4-component vector of uint)
-0:180 Function Definition: clustered_works(vf4; ( global void)
-0:180 Function Parameters:
-0:180 'f4' ( in 4-component vector of float)
-0:182 Sequence
-0:182 Sequence
-0:182 move second child to first child ( temp 4-component vector of uint)
-0:182 'ballot' ( temp 4-component vector of uint)
-0:182 Constant:
-0:182 85 (const uint)
-0:182 0 (const uint)
-0:182 0 (const uint)
-0:182 0 (const uint)
-0:183 subgroupClusteredAdd ( global 4-component vector of float)
-0:183 'f4' ( in 4-component vector of float)
-0:183 Constant:
-0:183 2 (const uint)
-0:184 subgroupClusteredMul ( global 4-component vector of float)
-0:184 'f4' ( in 4-component vector of float)
-0:184 Constant:
-0:184 2 (const uint)
-0:185 subgroupClusteredMin ( global 4-component vector of float)
+0:177 subgroupExclusiveOr ( global 4-component vector of uint)
+0:177 'ballot' ( temp 4-component vector of uint)
+0:178 subgroupExclusiveXor ( global 4-component vector of uint)
+0:178 'ballot' ( temp 4-component vector of uint)
+0:182 Function Definition: clustered_works(vf4; ( global void)
+0:182 Function Parameters:
+0:182 'f4' ( in 4-component vector of float)
+0:184 Sequence
+0:184 Sequence
+0:184 move second child to first child ( temp 4-component vector of uint)
+0:184 'ballot' ( temp 4-component vector of uint)
+0:184 Constant:
+0:184 85 (const uint)
+0:184 0 (const uint)
+0:184 0 (const uint)
+0:184 0 (const uint)
+0:185 subgroupClusteredAdd ( global 4-component vector of float)
0:185 'f4' ( in 4-component vector of float)
0:185 Constant:
0:185 2 (const uint)
-0:186 subgroupClusteredMax ( global 4-component vector of float)
+0:186 subgroupClusteredMul ( global 4-component vector of float)
0:186 'f4' ( in 4-component vector of float)
0:186 Constant:
0:186 2 (const uint)
-0:187 subgroupClusteredAnd ( global 4-component vector of uint)
-0:187 'ballot' ( temp 4-component vector of uint)
+0:187 subgroupClusteredMin ( global 4-component vector of float)
+0:187 'f4' ( in 4-component vector of float)
0:187 Constant:
0:187 2 (const uint)
-0:188 subgroupClusteredOr ( global 4-component vector of uint)
-0:188 'ballot' ( temp 4-component vector of uint)
+0:188 subgroupClusteredMax ( global 4-component vector of float)
+0:188 'f4' ( in 4-component vector of float)
0:188 Constant:
0:188 2 (const uint)
-0:189 subgroupClusteredXor ( global 4-component vector of uint)
+0:189 subgroupClusteredAnd ( global 4-component vector of uint)
0:189 'ballot' ( temp 4-component vector of uint)
0:189 Constant:
0:189 2 (const uint)
-0:193 Function Definition: quad_works(vf4; ( global void)
-0:193 Function Parameters:
-0:193 'f4' ( in 4-component vector of float)
-0:195 Sequence
-0:195 subgroupQuadBroadcast ( global 4-component vector of float)
-0:195 'f4' ( in 4-component vector of float)
-0:195 Constant:
-0:195 0 (const uint)
-0:196 subgroupQuadSwapHorizontal ( global 4-component vector of float)
-0:196 'f4' ( in 4-component vector of float)
-0:197 subgroupQuadSwapVertical ( global 4-component vector of float)
-0:197 'f4' ( in 4-component vector of float)
-0:198 subgroupQuadSwapDiagonal ( global 4-component vector of float)
+0:190 subgroupClusteredOr ( global 4-component vector of uint)
+0:190 'ballot' ( temp 4-component vector of uint)
+0:190 Constant:
+0:190 2 (const uint)
+0:191 subgroupClusteredXor ( global 4-component vector of uint)
+0:191 'ballot' ( temp 4-component vector of uint)
+0:191 Constant:
+0:191 2 (const uint)
+0:195 Function Definition: quad_works(vf4; ( global void)
+0:195 Function Parameters:
+0:195 'f4' ( in 4-component vector of float)
+0:? Sequence
+0:198 subgroupQuadBroadcast ( global 4-component vector of float)
0:198 'f4' ( in 4-component vector of float)
-0:202 Function Definition: partitioned_works(vf4; ( global void)
-0:202 Function Parameters:
-0:202 'f4' ( in 4-component vector of float)
-0:204 Sequence
-0:204 Sequence
-0:204 move second child to first child ( temp 4-component vector of uint)
-0:204 'parti' ( temp 4-component vector of uint)
-0:204 subgroupPartitionNV ( global 4-component vector of uint)
-0:204 'f4' ( in 4-component vector of float)
-0:205 Sequence
-0:205 move second child to first child ( temp 4-component vector of uint)
-0:205 'ballot' ( temp 4-component vector of uint)
-0:205 Constant:
-0:205 85 (const uint)
-0:205 0 (const uint)
-0:205 0 (const uint)
-0:205 0 (const uint)
-0:206 subgroupPartitionedAddNV ( global 4-component vector of float)
-0:206 'f4' ( in 4-component vector of float)
-0:206 'parti' ( temp 4-component vector of uint)
-0:207 subgroupPartitionedMulNV ( global 4-component vector of float)
-0:207 'f4' ( in 4-component vector of float)
-0:207 'parti' ( temp 4-component vector of uint)
-0:208 subgroupPartitionedMinNV ( global 4-component vector of float)
-0:208 'f4' ( in 4-component vector of float)
-0:208 'parti' ( temp 4-component vector of uint)
-0:209 subgroupPartitionedMaxNV ( global 4-component vector of float)
-0:209 'f4' ( in 4-component vector of float)
-0:209 'parti' ( temp 4-component vector of uint)
-0:210 subgroupPartitionedAndNV ( global 4-component vector of uint)
-0:210 'ballot' ( temp 4-component vector of uint)
+0:198 Constant:
+0:198 0 (const uint)
+0:199 subgroupQuadBroadcast ( global 4-component vector of float)
+0:199 'f4' ( in 4-component vector of float)
+0:199 Convert int to uint ( temp uint)
+0:199 'i' ( temp int)
+0:200 subgroupQuadSwapHorizontal ( global 4-component vector of float)
+0:200 'f4' ( in 4-component vector of float)
+0:201 subgroupQuadSwapVertical ( global 4-component vector of float)
+0:201 'f4' ( in 4-component vector of float)
+0:202 subgroupQuadSwapDiagonal ( global 4-component vector of float)
+0:202 'f4' ( in 4-component vector of float)
+0:206 Function Definition: partitioned_works(vf4; ( global void)
+0:206 Function Parameters:
+0:206 'f4' ( in 4-component vector of float)
+0:208 Sequence
+0:208 Sequence
+0:208 move second child to first child ( temp 4-component vector of uint)
+0:208 'parti' ( temp 4-component vector of uint)
+0:208 subgroupPartitionNV ( global 4-component vector of uint)
+0:208 'f4' ( in 4-component vector of float)
+0:209 Sequence
+0:209 move second child to first child ( temp 4-component vector of uint)
+0:209 'ballot' ( temp 4-component vector of uint)
+0:209 Constant:
+0:209 85 (const uint)
+0:209 0 (const uint)
+0:209 0 (const uint)
+0:209 0 (const uint)
+0:210 subgroupPartitionedAddNV ( global 4-component vector of float)
+0:210 'f4' ( in 4-component vector of float)
0:210 'parti' ( temp 4-component vector of uint)
-0:211 subgroupPartitionedOrNV ( global 4-component vector of uint)
-0:211 'ballot' ( temp 4-component vector of uint)
+0:211 subgroupPartitionedMulNV ( global 4-component vector of float)
+0:211 'f4' ( in 4-component vector of float)
0:211 'parti' ( temp 4-component vector of uint)
-0:212 subgroupPartitionedXorNV ( global 4-component vector of uint)
-0:212 'ballot' ( temp 4-component vector of uint)
+0:212 subgroupPartitionedMinNV ( global 4-component vector of float)
+0:212 'f4' ( in 4-component vector of float)
0:212 'parti' ( temp 4-component vector of uint)
-0:213 subgroupPartitionedInclusiveAddNV ( global 4-component vector of float)
+0:213 subgroupPartitionedMaxNV ( global 4-component vector of float)
0:213 'f4' ( in 4-component vector of float)
0:213 'parti' ( temp 4-component vector of uint)
-0:214 subgroupPartitionedInclusiveMulNV ( global 4-component vector of float)
-0:214 'f4' ( in 4-component vector of float)
+0:214 subgroupPartitionedAndNV ( global 4-component vector of uint)
+0:214 'ballot' ( temp 4-component vector of uint)
0:214 'parti' ( temp 4-component vector of uint)
-0:215 subgroupPartitionedInclusiveMinNV ( global 4-component vector of float)
-0:215 'f4' ( in 4-component vector of float)
+0:215 subgroupPartitionedOrNV ( global 4-component vector of uint)
+0:215 'ballot' ( temp 4-component vector of uint)
0:215 'parti' ( temp 4-component vector of uint)
-0:216 subgroupPartitionedInclusiveMaxNV ( global 4-component vector of float)
-0:216 'f4' ( in 4-component vector of float)
+0:216 subgroupPartitionedXorNV ( global 4-component vector of uint)
+0:216 'ballot' ( temp 4-component vector of uint)
0:216 'parti' ( temp 4-component vector of uint)
-0:217 subgroupPartitionedInclusiveAndNV ( global 4-component vector of uint)
-0:217 'ballot' ( temp 4-component vector of uint)
+0:217 subgroupPartitionedInclusiveAddNV ( global 4-component vector of float)
+0:217 'f4' ( in 4-component vector of float)
0:217 'parti' ( temp 4-component vector of uint)
-0:218 subgroupPartitionedInclusiveOrNV ( global 4-component vector of uint)
-0:218 'ballot' ( temp 4-component vector of uint)
+0:218 subgroupPartitionedInclusiveMulNV ( global 4-component vector of float)
+0:218 'f4' ( in 4-component vector of float)
0:218 'parti' ( temp 4-component vector of uint)
-0:219 subgroupPartitionedInclusiveXorNV ( global 4-component vector of uint)
-0:219 'ballot' ( temp 4-component vector of uint)
+0:219 subgroupPartitionedInclusiveMinNV ( global 4-component vector of float)
+0:219 'f4' ( in 4-component vector of float)
0:219 'parti' ( temp 4-component vector of uint)
-0:220 subgroupPartitionedExclusiveAddNV ( global 4-component vector of float)
+0:220 subgroupPartitionedInclusiveMaxNV ( global 4-component vector of float)
0:220 'f4' ( in 4-component vector of float)
0:220 'parti' ( temp 4-component vector of uint)
-0:221 subgroupPartitionedExclusiveMulNV ( global 4-component vector of float)
-0:221 'f4' ( in 4-component vector of float)
+0:221 subgroupPartitionedInclusiveAndNV ( global 4-component vector of uint)
+0:221 'ballot' ( temp 4-component vector of uint)
0:221 'parti' ( temp 4-component vector of uint)
-0:222 subgroupPartitionedExclusiveMinNV ( global 4-component vector of float)
-0:222 'f4' ( in 4-component vector of float)
+0:222 subgroupPartitionedInclusiveOrNV ( global 4-component vector of uint)
+0:222 'ballot' ( temp 4-component vector of uint)
0:222 'parti' ( temp 4-component vector of uint)
-0:223 subgroupPartitionedExclusiveMaxNV ( global 4-component vector of float)
-0:223 'f4' ( in 4-component vector of float)
+0:223 subgroupPartitionedInclusiveXorNV ( global 4-component vector of uint)
+0:223 'ballot' ( temp 4-component vector of uint)
0:223 'parti' ( temp 4-component vector of uint)
-0:224 subgroupPartitionedExclusiveAndNV ( global 4-component vector of uint)
-0:224 'ballot' ( temp 4-component vector of uint)
+0:224 subgroupPartitionedExclusiveAddNV ( global 4-component vector of float)
+0:224 'f4' ( in 4-component vector of float)
0:224 'parti' ( temp 4-component vector of uint)
-0:225 subgroupPartitionedExclusiveOrNV ( global 4-component vector of uint)
-0:225 'ballot' ( temp 4-component vector of uint)
+0:225 subgroupPartitionedExclusiveMulNV ( global 4-component vector of float)
+0:225 'f4' ( in 4-component vector of float)
0:225 'parti' ( temp 4-component vector of uint)
-0:226 subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
-0:226 'ballot' ( temp 4-component vector of uint)
+0:226 subgroupPartitionedExclusiveMinNV ( global 4-component vector of float)
+0:226 'f4' ( in 4-component vector of float)
0:226 'parti' ( temp 4-component vector of uint)
-0:230 Function Definition: sm_builtins_err( ( global void)
-0:230 Function Parameters:
-0:232 Sequence
-0:232 'gl_WarpsPerSMNV' ( flat in uint WarpsPerSMNV)
-0:233 'gl_SMCountNV' ( flat in uint SMCountNV)
-0:234 'gl_WarpIDNV' ( flat in uint WarpIDNV)
-0:235 'gl_SMIDNV' ( flat in uint SMIDNV)
-0:242 Function Definition: sm_builtins( ( global void)
-0:242 Function Parameters:
-0:244 Sequence
-0:244 'gl_WarpsPerSMNV' ( flat in uint WarpsPerSMNV)
-0:245 'gl_SMCountNV' ( flat in uint SMCountNV)
-0:246 'gl_WarpIDNV' ( flat in uint WarpIDNV)
-0:247 'gl_SMIDNV' ( flat in uint SMIDNV)
+0:227 subgroupPartitionedExclusiveMaxNV ( global 4-component vector of float)
+0:227 'f4' ( in 4-component vector of float)
+0:227 'parti' ( temp 4-component vector of uint)
+0:228 subgroupPartitionedExclusiveAndNV ( global 4-component vector of uint)
+0:228 'ballot' ( temp 4-component vector of uint)
+0:228 'parti' ( temp 4-component vector of uint)
+0:229 subgroupPartitionedExclusiveOrNV ( global 4-component vector of uint)
+0:229 'ballot' ( temp 4-component vector of uint)
+0:229 'parti' ( temp 4-component vector of uint)
+0:230 subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
+0:230 'ballot' ( temp 4-component vector of uint)
+0:230 'parti' ( temp 4-component vector of uint)
+0:234 Function Definition: sm_builtins_err( ( global void)
+0:234 Function Parameters:
+0:236 Sequence
+0:236 'gl_WarpsPerSMNV' ( flat in uint WarpsPerSMNV)
+0:237 'gl_SMCountNV' ( flat in uint SMCountNV)
+0:238 'gl_WarpIDNV' ( flat in uint WarpIDNV)
+0:239 'gl_SMIDNV' ( flat in uint SMIDNV)
+0:246 Function Definition: sm_builtins( ( global void)
+0:246 Function Parameters:
+0:248 Sequence
+0:248 'gl_WarpsPerSMNV' ( flat in uint WarpsPerSMNV)
+0:249 'gl_SMCountNV' ( flat in uint SMCountNV)
+0:250 'gl_WarpIDNV' ( flat in uint WarpIDNV)
+0:251 'gl_SMIDNV' ( flat in uint SMIDNV)
0:? Linker Objects
0:? 'data' (layout( location=0) out 4-component vector of uint)
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.entryPointRename.vert.bad.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.entryPointRename.vert.bad.out
index c7ea97e043a..7b99bbe8bdc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.entryPointRename.vert.bad.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.entryPointRename.vert.bad.out
@@ -2,7 +2,7 @@ glsl.entryPointRename.vert
ERROR: Source entry point must be "main"
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 20
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.entryPointRename.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.entryPointRename.vert.out
index 3dbe13bae9d..3044deec327 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.entryPointRename.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glsl.entryPointRename.vert.out
@@ -1,6 +1,6 @@
glsl.entryPointRename.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 20
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glspv.esversion.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glspv.esversion.vert.out
index 395d7f37b23..9f92513362a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glspv.esversion.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glspv.esversion.vert.out
@@ -1,6 +1,6 @@
glspv.esversion.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 10
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glspv.version.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glspv.version.frag.out
index 4a45b5bfd1f..42c73ddb670 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glspv.version.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/glspv.version.frag.out
@@ -2,7 +2,7 @@ glspv.version.frag
ERROR: #version: compilation for SPIR-V does not support the compatibility profile
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 6
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.PointSize.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.PointSize.geom.out
index 77cdc7db712..80fee613c38 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.PointSize.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.PointSize.geom.out
@@ -71,7 +71,7 @@ output primitive = line_strip
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 36
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.PointSize.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.PointSize.vert.out
index bda0030e1c4..2390a5af9de 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.PointSize.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.PointSize.vert.out
@@ -38,7 +38,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out float PointSize)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 16
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out
index 63d29fa4c2b..d22bac6b819 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.aliasOpaque.frag.out
@@ -143,7 +143,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 64
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.amend.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.amend.frag.out
index e273abeb2f2..7fd07270d4e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.amend.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.amend.frag.out
@@ -160,7 +160,7 @@ gl_FragCoord origin is upper left
0:? 'm' ( global 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 57
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.flatten.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.flatten.frag.out
index 80d51539d19..4c2a8c1130d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.flatten.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.flatten.frag.out
@@ -345,7 +345,7 @@ gl_FragCoord origin is upper left
0:? 'ps_output.color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 143
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.frag.out
index 2e706d76c94..7178102761a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.frag.out
@@ -290,7 +290,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 126
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.implicit-size.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.implicit-size.frag.out
index 9af6fed287d..402807e956e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.implicit-size.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.implicit-size.frag.out
@@ -163,7 +163,7 @@ gl_FragCoord origin is upper left
0:? 'g_mystruct' ( global 2-element array of structure{ temp int i, temp float f})
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 72
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.multidim.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.multidim.frag.out
index 94629996f0c..6c852c37af6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.multidim.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.array.multidim.frag.out
@@ -134,7 +134,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 57
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.assoc.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.assoc.frag.out
index 562a8633432..2002b0df29e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.assoc.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.assoc.frag.out
@@ -132,7 +132,7 @@ gl_FragCoord origin is upper left
0:? 'a5' (layout( location=4) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 58
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attribute.expression.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attribute.expression.comp.out
index 1b3ffdbc4ba..1ff212381b1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attribute.expression.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attribute.expression.comp.out
@@ -82,7 +82,7 @@ local_size = (4, 6, 8)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 39
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attribute.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attribute.frag.out
index 44e963e0fd6..2290cd80776 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attribute.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attribute.frag.out
@@ -50,7 +50,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 24
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attributeC11.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attributeC11.frag.out
index 47dd96a7c76..14bdcdddeeb 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attributeC11.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attributeC11.frag.out
@@ -95,7 +95,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 51
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attributeGlobalBuffer.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attributeGlobalBuffer.frag.out
index e3784473f86..a486d1e904f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attributeGlobalBuffer.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.attributeGlobalBuffer.frag.out
@@ -56,7 +56,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 28
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.basic.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.basic.comp.out
index d84642e9a4e..fb26bc312a6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.basic.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.basic.comp.out
@@ -64,7 +64,7 @@ local_size = (1, 1, 1)
0:? 'gti' ( in 3-component vector of int LocalInvocationID)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 38
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.basic.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.basic.geom.out
index f4116d4e81f..ee123d44c26 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.basic.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.basic.geom.out
@@ -188,7 +188,7 @@ output primitive = line_strip
0:? 'OutputStream.something' (layout( location=1) out int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 68
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.boolConv.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.boolConv.vert.out
index d88955fae23..8762faf43fd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.boolConv.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.boolConv.vert.out
@@ -204,7 +204,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out 4-component vector of float Position)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 99
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.buffer.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.buffer.frag.out
index 25a7963004c..e41c02d962e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.buffer.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.buffer.frag.out
@@ -147,7 +147,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 73
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out
index f3278834923..698350cbc08 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.calculatelod.dx10.frag.out
@@ -358,7 +358,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 148
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out
index 85dafcc7000..e4bcb61d7d8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.calculatelodunclamped.dx10.frag.out
@@ -358,7 +358,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 148
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.cast.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.cast.frag.out
index 0aa11bead63..aa657f376a7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.cast.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.cast.frag.out
@@ -70,7 +70,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 34
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.cbuffer-identifier.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.cbuffer-identifier.vert.out
index f7225f844b1..5cec136e84f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.cbuffer-identifier.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.cbuffer-identifier.vert.out
@@ -250,7 +250,7 @@ Shader version: 500
0:? 'input.Norm' (layout( location=1) in 3-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 93
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.charLit.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.charLit.vert.out
index b09fc81f405..4846f8f22c0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.charLit.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.charLit.vert.out
@@ -146,7 +146,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out 4-component vector of float Position)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 58
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clip.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clip.frag.out
index dbf99bf5a01..a0ebb745cc7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clip.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clip.frag.out
@@ -74,7 +74,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 30
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out
index f223ddc4f75..4382505250b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out
@@ -98,7 +98,7 @@ gl_FragCoord origin is upper left
0:? 'cull' ( in 1-element array of float CullDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 53
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out
index 144b8775e25..5348359812d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out
@@ -550,7 +550,7 @@ output primitive = line_strip
0:? 'OutputStream.clip' ( out 2-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 118
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.vert.out
index d1d1370a9f4..7d8b49f8d97 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.vert.out
@@ -108,7 +108,7 @@ Shader version: 500
0:? 'cull' ( out 1-element array of float CullDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 46
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out
index 64604ebb99c..d1da7bc2bbc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out
@@ -290,7 +290,7 @@ gl_FragCoord origin is upper left
0:? 'cull' ( in 4-element array of float CullDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 84
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out
index a8abd02f215..bdee84f8f50 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out
@@ -724,7 +724,7 @@ output primitive = line_strip
0:? 'OutputStream.clip' ( out 4-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 128
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.vert.out
index 397a25d7cf8..77bd23d48ec 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.vert.out
@@ -420,7 +420,7 @@ Shader version: 500
0:? 'cull' ( out 4-element array of float CullDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 89
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out
index 3b5082e8705..c7eda56f481 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out
@@ -98,7 +98,7 @@ gl_FragCoord origin is upper left
0:? 'cull' ( in 2-element array of float CullDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 53
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.geom.out
index f8ba5c6d503..2e6b5f64a3c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.geom.out
@@ -630,7 +630,7 @@ output primitive = line_strip
0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 127
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.vert.out
index 01afd1797ea..c9289a53d3d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.vert.out
@@ -136,7 +136,7 @@ Shader version: 500
0:? 'cull' ( out 2-element array of float CullDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 51
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out
index 95f81c9560b..8a46b157d13 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out
@@ -174,7 +174,7 @@ gl_FragCoord origin is upper left
0:? 'v.ClipRect' ( in 4-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 57
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.geom.out
index 1096e02c25e..31d32051d1d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.geom.out
@@ -612,7 +612,7 @@ output primitive = line_strip
0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 130
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.vert.out
index d05fae41d73..7fca9d4e36e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.vert.out
@@ -270,7 +270,7 @@ Shader version: 500
0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 72
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out
index afdd4c4d7d5..f0adb05bc23 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out
@@ -232,7 +232,7 @@ gl_FragCoord origin is upper left
0:? 'v.ClipRect' ( in 4-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 62
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-5.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-5.vert.out
index 3e8f1fe771c..264c22c2ed1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-5.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-5.vert.out
@@ -318,7 +318,7 @@ Shader version: 500
0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 73
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out
index 3ee8065aad3..49c225a20b9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out
@@ -282,7 +282,7 @@ gl_FragCoord origin is upper left
0:? 'v.clip1' ( in 8-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 79
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-6.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-6.vert.out
index a386d0ac584..024d0285bd9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-6.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-6.vert.out
@@ -428,7 +428,7 @@ Shader version: 500
0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 86
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out
index 94b6a791fc3..5ff568e708a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out
@@ -270,7 +270,7 @@ gl_FragCoord origin is upper left
0:? 'v.clip1' ( in 8-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 78
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-7.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-7.vert.out
index 87e34bd8ac3..24eced891b3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-7.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-7.vert.out
@@ -384,7 +384,7 @@ Shader version: 500
0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 81
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out
index 98c9505c86f..f4e55acb3a2 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out
@@ -186,7 +186,7 @@ gl_FragCoord origin is upper left
0:? 'v.clip1' ( in 4-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 65
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-8.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-8.vert.out
index 88800e3c4e4..456e11f5e46 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-8.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-8.vert.out
@@ -240,7 +240,7 @@ Shader version: 500
0:? '@entryPointOutput.clip1' ( out 4-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 62
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out
index ff7f261902f..0a17eafa94d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out
@@ -144,7 +144,7 @@ gl_FragCoord origin is upper left
0:? 'clip0' ( in 4-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 68
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-9.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-9.vert.out
index 2d0c9b02e22..61b996fb4ec 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-9.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-9.vert.out
@@ -194,7 +194,7 @@ Shader version: 500
0:? 'clip0' ( out 4-element array of float ClipDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 67
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.color.hull.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.color.hull.tesc.out
index 72e0b7e7633..c5be8e401ed 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.color.hull.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.color.hull.tesc.out
@@ -356,7 +356,7 @@ triangle order = cw
0:? '@patchConstantOutput.inside' ( patch out 2-element array of float TessLevelInner)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 127
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.comparison.vec.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.comparison.vec.frag.out
index ff73e17831a..5936c9a9e9d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.comparison.vec.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.comparison.vec.frag.out
@@ -262,7 +262,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 96
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.conditional.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.conditional.frag.out
index 7df88e7fc3e..e23d49c99b7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.conditional.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.conditional.frag.out
@@ -522,7 +522,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 206
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constantbuffer.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constantbuffer.frag.out
index fa8881db54e..48d849b4802 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constantbuffer.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constantbuffer.frag.out
@@ -133,7 +133,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 66
Capability Shader
@@ -240,6 +240,5 @@ Validation failed
60: 7(fvec4) CompositeConstruct 59 59 59 59
ReturnValue 60
30: Label
- 62: 7(fvec4) Undef
- ReturnValue 62
+ Unreachable
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructArray.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructArray.vert.out
index 6e18ad9713b..8ba41bc92ae 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructArray.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructArray.vert.out
@@ -268,7 +268,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out 4-component vector of float Position)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 89
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructexpr.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructexpr.frag.out
index 227c7e17389..085821abfc5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructexpr.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructexpr.frag.out
@@ -104,7 +104,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 40
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructimat.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructimat.frag.out
index 075dabb58bb..a5014db4358 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructimat.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.constructimat.frag.out
@@ -545,7 +545,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 98
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.coverage.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.coverage.frag.out
index 691d64368c9..a14807350c1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.coverage.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.coverage.frag.out
@@ -119,7 +119,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 52
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.dashI.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.dashI.vert.out
index eb9406b274e..d5e7e20901a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.dashI.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.dashI.vert.out
@@ -1,6 +1,6 @@
hlsl.dashI.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 40
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.deadFunctionMissingBody.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.deadFunctionMissingBody.vert.out
index 2bc08dabb89..559708d1237 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.deadFunctionMissingBody.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.deadFunctionMissingBody.vert.out
@@ -1,6 +1,6 @@
hlsl.deadFunctionMissingBody.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 18
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.depthGreater.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.depthGreater.frag.out
index df6311f6642..70928024a0d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.depthGreater.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.depthGreater.frag.out
@@ -50,7 +50,7 @@ using depth_greater
0:? 'depth' ( out float FragDepth)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 20
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.depthLess.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.depthLess.frag.out
index d2b9d8edb46..275eaf13d8d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.depthLess.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.depthLess.frag.out
@@ -42,7 +42,7 @@ using depth_less
0:? '@entryPointOutput' ( out float FragDepth)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 16
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.discard.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.discard.frag.out
index cc7c8666092..23ed871b2e0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.discard.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.discard.frag.out
@@ -108,7 +108,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 50
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.doLoop.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.doLoop.frag.out
index bb564658a28..2b65a76b039 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.doLoop.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.doLoop.frag.out
@@ -2,68 +2,95 @@ hlsl.doLoop.frag
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
-0:2 Function Definition: @PixelShaderFunction(f1; ( temp 4-component vector of float)
-0:2 Function Parameters:
-0:2 'input' ( in float)
+0:1 Function Definition: f0( ( temp void)
+0:1 Function Parameters:
0:? Sequence
-0:3 Loop with condition not tested first: Unroll
-0:3 Loop Condition
-0:3 Constant:
-0:3 false (const bool)
-0:3 No loop body
-0:4 Loop with condition not tested first: Unroll
-0:4 Loop Condition
-0:4 Constant:
-0:4 false (const bool)
-0:4 No loop body
-0:5 Loop with condition not tested first
-0:5 Loop Condition
-0:5 Compare Greater Than ( temp bool)
-0:5 'input' ( in float)
-0:5 Constant:
-0:5 2.000000
-0:5 Loop Body
-0:? Sequence
-0:5 Branch: Return with expression
-0:5 Construct vec4 ( temp 4-component vector of float)
-0:5 'input' ( in float)
-0:6 Loop with condition not tested first
+0:2 Loop with condition not tested first: Unroll
+0:2 Loop Condition
+0:2 Constant:
+0:2 false (const bool)
+0:2 No loop body
+0:5 Function Definition: f1( ( temp void)
+0:5 Function Parameters:
+0:? Sequence
+0:6 Loop with condition not tested first: Unroll
0:6 Loop Condition
-0:6 Compare Less Than ( temp bool)
-0:6 'input' ( in float)
-0:6 Constant:
-0:6 10.000000
-0:6 Loop Body
-0:6 Pre-Increment ( temp float)
-0:6 'input' ( in float)
-0:7 Loop with condition not tested first
-0:7 Loop Condition
-0:7 Compare Less Than ( temp bool)
-0:7 Pre-Increment ( temp float)
-0:7 'input' ( in float)
-0:7 Constant:
-0:7 10.000000
-0:7 Loop Body
-0:7 Loop with condition tested first
-0:7 Loop Condition
-0:7 Compare Less Than ( temp bool)
-0:7 Pre-Increment ( temp float)
-0:7 'input' ( in float)
-0:7 Constant:
-0:7 10.000000
-0:7 No loop body
-0:8 Branch: Return with expression
-0:8 Construct vec4 ( temp 4-component vector of float)
-0:8 'input' ( in float)
-0:2 Function Definition: PixelShaderFunction( ( temp void)
-0:2 Function Parameters:
+0:6 Constant:
+0:6 false (const bool)
+0:6 No loop body
+0:9 Function Definition: f2(f1; ( temp float)
+0:9 Function Parameters:
+0:9 'input' ( in float)
+0:? Sequence
+0:10 Loop with condition not tested first
+0:10 Loop Condition
+0:10 Compare Greater Than ( temp bool)
+0:10 'input' ( in float)
+0:10 Constant:
+0:10 2.000000
+0:10 Loop Body
+0:? Sequence
+0:10 Branch: Return with expression
+0:10 Construct float ( temp float)
+0:10 Construct vec4 ( temp 4-component vector of float)
+0:10 'input' ( in float)
+0:13 Function Definition: f3(f1; ( temp void)
+0:13 Function Parameters:
+0:13 'input' ( in float)
0:? Sequence
-0:2 move second child to first child ( temp float)
+0:14 Loop with condition not tested first
+0:14 Loop Condition
+0:14 Compare Less Than ( temp bool)
+0:14 'input' ( in float)
+0:14 Constant:
+0:14 10.000000
+0:14 Loop Body
+0:14 Pre-Increment ( temp float)
+0:14 'input' ( in float)
+0:17 Function Definition: f4(f1; ( temp void)
+0:17 Function Parameters:
+0:17 'input' ( in float)
+0:? Sequence
+0:18 Loop with condition not tested first
+0:18 Loop Condition
+0:18 Compare Less Than ( temp bool)
+0:18 Pre-Increment ( temp float)
+0:18 'input' ( in float)
+0:18 Constant:
+0:18 10.000000
+0:18 Loop Body
+0:18 Loop with condition tested first
+0:18 Loop Condition
+0:18 Compare Less Than ( temp bool)
+0:18 Pre-Increment ( temp float)
+0:18 'input' ( in float)
+0:18 Constant:
+0:18 10.000000
+0:18 No loop body
+0:22 Function Definition: @PixelShaderFunction(f1; ( temp 4-component vector of float)
+0:22 Function Parameters:
+0:22 'input' ( in float)
+0:? Sequence
+0:23 Function Call: f0( ( temp void)
+0:24 Function Call: f1( ( temp void)
+0:25 Function Call: f2(f1; ( temp float)
+0:25 'input' ( in float)
+0:26 Function Call: f3(f1; ( temp void)
+0:26 'input' ( in float)
+0:27 Function Call: f4(f1; ( temp void)
+0:27 'input' ( in float)
+0:28 Branch: Return with expression
+0:28 Construct vec4 ( temp 4-component vector of float)
+0:28 'input' ( in float)
+0:22 Function Definition: PixelShaderFunction( ( temp void)
+0:22 Function Parameters:
+0:? Sequence
+0:22 move second child to first child ( temp float)
0:? 'input' ( temp float)
0:? 'input' (layout( location=0) in float)
-0:2 move second child to first child ( temp 4-component vector of float)
+0:22 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:2 Function Call: @PixelShaderFunction(f1; ( temp 4-component vector of float)
+0:22 Function Call: @PixelShaderFunction(f1; ( temp 4-component vector of float)
0:? 'input' ( temp float)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
@@ -76,196 +103,272 @@ Linked fragment stage:
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
-0:2 Function Definition: @PixelShaderFunction(f1; ( temp 4-component vector of float)
-0:2 Function Parameters:
-0:2 'input' ( in float)
+0:1 Function Definition: f0( ( temp void)
+0:1 Function Parameters:
0:? Sequence
-0:3 Loop with condition not tested first: Unroll
-0:3 Loop Condition
-0:3 Constant:
-0:3 false (const bool)
-0:3 No loop body
-0:4 Loop with condition not tested first: Unroll
-0:4 Loop Condition
-0:4 Constant:
-0:4 false (const bool)
-0:4 No loop body
-0:5 Loop with condition not tested first
-0:5 Loop Condition
-0:5 Compare Greater Than ( temp bool)
-0:5 'input' ( in float)
-0:5 Constant:
-0:5 2.000000
-0:5 Loop Body
-0:? Sequence
-0:5 Branch: Return with expression
-0:5 Construct vec4 ( temp 4-component vector of float)
-0:5 'input' ( in float)
-0:6 Loop with condition not tested first
+0:2 Loop with condition not tested first: Unroll
+0:2 Loop Condition
+0:2 Constant:
+0:2 false (const bool)
+0:2 No loop body
+0:5 Function Definition: f1( ( temp void)
+0:5 Function Parameters:
+0:? Sequence
+0:6 Loop with condition not tested first: Unroll
0:6 Loop Condition
-0:6 Compare Less Than ( temp bool)
-0:6 'input' ( in float)
-0:6 Constant:
-0:6 10.000000
-0:6 Loop Body
-0:6 Pre-Increment ( temp float)
-0:6 'input' ( in float)
-0:7 Loop with condition not tested first
-0:7 Loop Condition
-0:7 Compare Less Than ( temp bool)
-0:7 Pre-Increment ( temp float)
-0:7 'input' ( in float)
-0:7 Constant:
-0:7 10.000000
-0:7 Loop Body
-0:7 Loop with condition tested first
-0:7 Loop Condition
-0:7 Compare Less Than ( temp bool)
-0:7 Pre-Increment ( temp float)
-0:7 'input' ( in float)
-0:7 Constant:
-0:7 10.000000
-0:7 No loop body
-0:8 Branch: Return with expression
-0:8 Construct vec4 ( temp 4-component vector of float)
-0:8 'input' ( in float)
-0:2 Function Definition: PixelShaderFunction( ( temp void)
-0:2 Function Parameters:
+0:6 Constant:
+0:6 false (const bool)
+0:6 No loop body
+0:9 Function Definition: f2(f1; ( temp float)
+0:9 Function Parameters:
+0:9 'input' ( in float)
+0:? Sequence
+0:10 Loop with condition not tested first
+0:10 Loop Condition
+0:10 Compare Greater Than ( temp bool)
+0:10 'input' ( in float)
+0:10 Constant:
+0:10 2.000000
+0:10 Loop Body
+0:? Sequence
+0:10 Branch: Return with expression
+0:10 Construct float ( temp float)
+0:10 Construct vec4 ( temp 4-component vector of float)
+0:10 'input' ( in float)
+0:13 Function Definition: f3(f1; ( temp void)
+0:13 Function Parameters:
+0:13 'input' ( in float)
+0:? Sequence
+0:14 Loop with condition not tested first
+0:14 Loop Condition
+0:14 Compare Less Than ( temp bool)
+0:14 'input' ( in float)
+0:14 Constant:
+0:14 10.000000
+0:14 Loop Body
+0:14 Pre-Increment ( temp float)
+0:14 'input' ( in float)
+0:17 Function Definition: f4(f1; ( temp void)
+0:17 Function Parameters:
+0:17 'input' ( in float)
0:? Sequence
-0:2 move second child to first child ( temp float)
+0:18 Loop with condition not tested first
+0:18 Loop Condition
+0:18 Compare Less Than ( temp bool)
+0:18 Pre-Increment ( temp float)
+0:18 'input' ( in float)
+0:18 Constant:
+0:18 10.000000
+0:18 Loop Body
+0:18 Loop with condition tested first
+0:18 Loop Condition
+0:18 Compare Less Than ( temp bool)
+0:18 Pre-Increment ( temp float)
+0:18 'input' ( in float)
+0:18 Constant:
+0:18 10.000000
+0:18 No loop body
+0:22 Function Definition: @PixelShaderFunction(f1; ( temp 4-component vector of float)
+0:22 Function Parameters:
+0:22 'input' ( in float)
+0:? Sequence
+0:23 Function Call: f0( ( temp void)
+0:24 Function Call: f1( ( temp void)
+0:25 Function Call: f2(f1; ( temp float)
+0:25 'input' ( in float)
+0:26 Function Call: f3(f1; ( temp void)
+0:26 'input' ( in float)
+0:27 Function Call: f4(f1; ( temp void)
+0:27 'input' ( in float)
+0:28 Branch: Return with expression
+0:28 Construct vec4 ( temp 4-component vector of float)
+0:28 'input' ( in float)
+0:22 Function Definition: PixelShaderFunction( ( temp void)
+0:22 Function Parameters:
+0:? Sequence
+0:22 move second child to first child ( temp float)
0:? 'input' ( temp float)
0:? 'input' (layout( location=0) in float)
-0:2 move second child to first child ( temp 4-component vector of float)
+0:22 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:2 Function Call: @PixelShaderFunction(f1; ( temp 4-component vector of float)
+0:22 Function Call: @PixelShaderFunction(f1; ( temp 4-component vector of float)
0:? 'input' ( temp float)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'input' (layout( location=0) in float)
// Module Version 10000
-// Generated by (magic number): 80007
-// Id's are bound by 71
+// Generated by (magic number): 80008
+// Id's are bound by 99
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
- EntryPoint Fragment 4 "PixelShaderFunction" 64 67
+ EntryPoint Fragment 4 "PixelShaderFunction" 92 95
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "PixelShaderFunction"
- Name 11 "@PixelShaderFunction(f1;"
- Name 10 "input"
- Name 62 "input"
- Name 64 "input"
- Name 67 "@entryPointOutput"
- Name 68 "param"
- Decorate 64(input) Location 0
- Decorate 67(@entryPointOutput) Location 0
+ Name 6 "f0("
+ Name 8 "f1("
+ Name 14 "f2(f1;"
+ Name 13 "input"
+ Name 18 "f3(f1;"
+ Name 17 "input"
+ Name 21 "f4(f1;"
+ Name 20 "input"
+ Name 26 "@PixelShaderFunction(f1;"
+ Name 25 "input"
+ Name 77 "param"
+ Name 80 "param"
+ Name 83 "param"
+ Name 90 "input"
+ Name 92 "input"
+ Name 95 "@entryPointOutput"
+ Name 96 "param"
+ Decorate 92(input) Location 0
+ Decorate 95(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
- 6: TypeFloat 32
- 7: TypePointer Function 6(float)
- 8: TypeVector 6(float) 4
- 9: TypeFunction 8(fvec4) 7(ptr)
- 17: TypeBool
- 18: 17(bool) ConstantFalse
- 31: 6(float) Constant 1073741824
- 38: 6(float) Constant 1065353216
- 41: 6(float) Constant 1092616192
- 63: TypePointer Input 6(float)
- 64(input): 63(ptr) Variable Input
- 66: TypePointer Output 8(fvec4)
-67(@entryPointOutput): 66(ptr) Variable Output
+ 10: TypeFloat 32
+ 11: TypePointer Function 10(float)
+ 12: TypeFunction 10(float) 11(ptr)
+ 16: TypeFunction 2 11(ptr)
+ 23: TypeVector 10(float) 4
+ 24: TypeFunction 23(fvec4) 11(ptr)
+ 32: TypeBool
+ 33: 32(bool) ConstantFalse
+ 47: 10(float) Constant 1073741824
+ 55: 10(float) Constant 1065353216
+ 58: 10(float) Constant 1092616192
+ 91: TypePointer Input 10(float)
+ 92(input): 91(ptr) Variable Input
+ 94: TypePointer Output 23(fvec4)
+95(@entryPointOutput): 94(ptr) Variable Output
4(PixelShaderFunction): 2 Function None 3
5: Label
- 62(input): 7(ptr) Variable Function
- 68(param): 7(ptr) Variable Function
- 65: 6(float) Load 64(input)
- Store 62(input) 65
- 69: 6(float) Load 62(input)
- Store 68(param) 69
- 70: 8(fvec4) FunctionCall 11(@PixelShaderFunction(f1;) 68(param)
- Store 67(@entryPointOutput) 70
+ 90(input): 11(ptr) Variable Function
+ 96(param): 11(ptr) Variable Function
+ 93: 10(float) Load 92(input)
+ Store 90(input) 93
+ 97: 10(float) Load 90(input)
+ Store 96(param) 97
+ 98: 23(fvec4) FunctionCall 26(@PixelShaderFunction(f1;) 96(param)
+ Store 95(@entryPointOutput) 98
Return
FunctionEnd
-11(@PixelShaderFunction(f1;): 8(fvec4) Function None 9
- 10(input): 7(ptr) FunctionParameter
- 12: Label
- Branch 13
- 13: Label
- LoopMerge 15 16 Unroll
- Branch 14
- 14: Label
- Branch 16
- 16: Label
- BranchConditional 18 13 15
- 15: Label
- Branch 19
- 19: Label
- LoopMerge 21 22 Unroll
- Branch 20
- 20: Label
- Branch 22
- 22: Label
- BranchConditional 18 19 21
- 21: Label
- Branch 23
- 23: Label
- LoopMerge 25 26 None
- Branch 24
- 24: Label
- 27: 6(float) Load 10(input)
- 28: 8(fvec4) CompositeConstruct 27 27 27 27
- ReturnValue 28
- 26: Label
- 30: 6(float) Load 10(input)
- 32: 17(bool) FOrdGreaterThan 30 31
- BranchConditional 32 23 25
- 25: Label
- Branch 33
- 33: Label
- LoopMerge 35 36 None
+ 6(f0(): 2 Function None 3
+ 7: Label
+ Branch 28
+ 28: Label
+ LoopMerge 30 31 Unroll
+ Branch 29
+ 29: Label
+ Branch 31
+ 31: Label
+ BranchConditional 33 28 30
+ 30: Label
+ Return
+ FunctionEnd
+ 8(f1(): 2 Function None 3
+ 9: Label
Branch 34
34: Label
- 37: 6(float) Load 10(input)
- 39: 6(float) FAdd 37 38
- Store 10(input) 39
- Branch 36
- 36: Label
- 40: 6(float) Load 10(input)
- 42: 17(bool) FOrdLessThan 40 41
- BranchConditional 42 33 35
+ LoopMerge 36 37 Unroll
+ Branch 35
35: Label
- Branch 43
- 43: Label
- LoopMerge 45 46 None
- Branch 44
- 44: Label
- Branch 47
- 47: Label
- LoopMerge 49 50 None
+ Branch 37
+ 37: Label
+ BranchConditional 33 34 36
+ 36: Label
+ Return
+ FunctionEnd
+ 14(f2(f1;): 10(float) Function None 12
+ 13(input): 11(ptr) FunctionParameter
+ 15: Label
+ Branch 38
+ 38: Label
+ LoopMerge 40 41 None
+ Branch 39
+ 39: Label
+ 42: 10(float) Load 13(input)
+ 43: 23(fvec4) CompositeConstruct 42 42 42 42
+ 44: 10(float) CompositeExtract 43 0
+ ReturnValue 44
+ 41: Label
+ Branch 38
+ 40: Label
+ Unreachable
+ FunctionEnd
+ 18(f3(f1;): 2 Function None 16
+ 17(input): 11(ptr) FunctionParameter
+ 19: Label
+ Branch 50
+ 50: Label
+ LoopMerge 52 53 None
Branch 51
51: Label
- 52: 6(float) Load 10(input)
- 53: 6(float) FAdd 52 38
- Store 10(input) 53
- 54: 17(bool) FOrdLessThan 53 41
- BranchConditional 54 48 49
- 48: Label
- Branch 50
- 50: Label
- Branch 47
- 49: Label
- Branch 46
- 46: Label
- 55: 6(float) Load 10(input)
- 56: 6(float) FAdd 55 38
- Store 10(input) 56
- 57: 17(bool) FOrdLessThan 56 41
- BranchConditional 57 43 45
- 45: Label
- 58: 6(float) Load 10(input)
- 59: 8(fvec4) CompositeConstruct 58 58 58 58
- ReturnValue 59
+ 54: 10(float) Load 17(input)
+ 56: 10(float) FAdd 54 55
+ Store 17(input) 56
+ Branch 53
+ 53: Label
+ 57: 10(float) Load 17(input)
+ 59: 32(bool) FOrdLessThan 57 58
+ BranchConditional 59 50 52
+ 52: Label
+ Return
+ FunctionEnd
+ 21(f4(f1;): 2 Function None 16
+ 20(input): 11(ptr) FunctionParameter
+ 22: Label
+ Branch 60
+ 60: Label
+ LoopMerge 62 63 None
+ Branch 61
+ 61: Label
+ Branch 64
+ 64: Label
+ LoopMerge 66 67 None
+ Branch 68
+ 68: Label
+ 69: 10(float) Load 20(input)
+ 70: 10(float) FAdd 69 55
+ Store 20(input) 70
+ 71: 32(bool) FOrdLessThan 70 58
+ BranchConditional 71 65 66
+ 65: Label
+ Branch 67
+ 67: Label
+ Branch 64
+ 66: Label
+ Branch 63
+ 63: Label
+ 72: 10(float) Load 20(input)
+ 73: 10(float) FAdd 72 55
+ Store 20(input) 73
+ 74: 32(bool) FOrdLessThan 73 58
+ BranchConditional 74 60 62
+ 62: Label
+ Return
+ FunctionEnd
+26(@PixelShaderFunction(f1;): 23(fvec4) Function None 24
+ 25(input): 11(ptr) FunctionParameter
+ 27: Label
+ 77(param): 11(ptr) Variable Function
+ 80(param): 11(ptr) Variable Function
+ 83(param): 11(ptr) Variable Function
+ 75: 2 FunctionCall 6(f0()
+ 76: 2 FunctionCall 8(f1()
+ 78: 10(float) Load 25(input)
+ Store 77(param) 78
+ 79: 10(float) FunctionCall 14(f2(f1;) 77(param)
+ 81: 10(float) Load 25(input)
+ Store 80(param) 81
+ 82: 2 FunctionCall 18(f3(f1;) 80(param)
+ 84: 10(float) Load 25(input)
+ Store 83(param) 84
+ 85: 2 FunctionCall 21(f4(f1;) 83(param)
+ 86: 10(float) Load 25(input)
+ 87: 23(fvec4) CompositeConstruct 86 86 86 86
+ ReturnValue 87
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.1.tese.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.1.tese.out
index 4bc8bac5e93..0b7b27564c9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.1.tese.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.1.tese.out
@@ -286,7 +286,7 @@ triangle order = none
0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 103
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.2.tese.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.2.tese.out
index 827f80f7337..e6ec924af8b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.2.tese.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.2.tese.out
@@ -284,7 +284,7 @@ triangle order = none
0:? 'pcf_data.foo' (layout( location=2) patch in float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 98
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.3.tese.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.3.tese.out
index dd3d502af89..4b8584c9d64 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.3.tese.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.domain.3.tese.out
@@ -264,7 +264,7 @@ triangle order = none
0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 100
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.earlydepthstencil.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.earlydepthstencil.frag.out
index e598a5190ff..f30b89ad2f1 100755
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.earlydepthstencil.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.earlydepthstencil.frag.out
@@ -108,7 +108,7 @@ using early_fragment_tests
0:? 'input.Position' ( in 4-component vector of float FragCoord)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 50
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out
index 410915cfe80..c3c3aef8a8e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out
@@ -60,7 +60,7 @@ Shader version: 500
0:? 'vertexIndex' (layout( location=0) in uint)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 29
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out
index 1c9953b5f27..bb9c26c3b8b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystructreturn.frag.out
@@ -51,7 +51,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 27
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out
index 65d326d45c6..22027bfd7b7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.emptystructreturn.vert.out
@@ -49,7 +49,7 @@ Shader version: 500
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 27
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry-in.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry-in.frag.out
index dc9eea4af90..d65532df973 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry-in.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry-in.frag.out
@@ -166,7 +166,7 @@ gl_FragCoord origin is upper left
0:? 'i.i2' (layout( location=1) flat in 2-component vector of int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 74
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry-out.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry-out.frag.out
index 6ca3011bba5..e1af2846d1e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry-out.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry-out.frag.out
@@ -244,7 +244,7 @@ gl_FragCoord origin is upper left
0:? 'out3.i' (layout( location=5) out 2-component vector of int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 89
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry.rename.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry.rename.frag.out
index 9e23396a421..b0e958b3bc3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry.rename.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.entry.rename.frag.out
@@ -72,7 +72,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 32
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out
index 61367d6cb88..c4e6baf09e9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.explicitDescriptorSet-2.frag.out
@@ -1,6 +1,6 @@
hlsl.explicitDescriptorSet.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 31
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out
index 9bc2f019812..9665ad2511d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.explicitDescriptorSet.frag.out
@@ -1,6 +1,6 @@
hlsl.explicitDescriptorSet.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 31
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flatten.return.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flatten.return.frag.out
index e47fe3ebf0e..bc388f85da0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flatten.return.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flatten.return.frag.out
@@ -118,7 +118,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.other_struct_member3' (layout( location=3) out float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 49
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out
index 94d02f4933d..688656c1a5d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaque.frag.out
@@ -295,7 +295,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 122
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out
index a5a59442cb2..6d16858719a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out
@@ -165,7 +165,7 @@ Shader version: 500
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 82
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out
index 5a2aa2a1fb3..62a2e8e7a27 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out
@@ -107,7 +107,7 @@ Shader version: 500
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 59
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenSubset.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenSubset.frag.out
index 262a29d6137..f6da1a9efea 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenSubset.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenSubset.frag.out
@@ -115,7 +115,7 @@ gl_FragCoord origin is upper left
0:? 'vpos' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 54
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out
index 77dc4cd51d5..40d92a95641 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.flattenSubset2.frag.out
@@ -149,7 +149,7 @@ gl_FragCoord origin is upper left
0:? 'vpos' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 56
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.float1.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.float1.frag.out
index 49827dcf8d9..0f7600e0eb3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.float1.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.float1.frag.out
@@ -65,7 +65,7 @@ gl_FragCoord origin is upper left
0:? 'scalar' ( global float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 27
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.float4.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.float4.frag.out
index 8dc3307846b..8e8c821f454 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.float4.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.float4.frag.out
@@ -42,7 +42,7 @@ gl_FragCoord origin is upper left
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float AmbientColor, uniform bool ff1, layout( offset=20) uniform float ff2, layout( binding=0 offset=32) uniform 4-component vector of float ff3, layout( binding=1 offset=48) uniform 4-component vector of float ff4})
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 26
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.forLoop.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.forLoop.frag.out
index 3e835f80d4d..b6c271018af 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.forLoop.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.forLoop.frag.out
@@ -2,197 +2,251 @@ hlsl.forLoop.frag
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
-0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
-0:2 Function Parameters:
-0:2 'input' ( in 4-component vector of float)
+0:1 Function Definition: f0( ( temp void)
+0:1 Function Parameters:
0:? Sequence
0:? Sequence
-0:3 Loop with condition tested first
-0:3 No loop condition
-0:3 No loop body
-0:4 Sequence
-0:4 Pre-Increment ( temp 4-component vector of float)
-0:4 'input' ( in 4-component vector of float)
-0:4 Loop with condition tested first
-0:4 No loop condition
-0:4 No loop body
+0:2 Loop with condition tested first
+0:2 No loop condition
+0:2 No loop body
+0:5 Function Definition: f1(vf4; ( temp void)
+0:5 Function Parameters:
+0:5 'input' ( in 4-component vector of float)
+0:? Sequence
+0:6 Sequence
+0:6 Pre-Increment ( temp 4-component vector of float)
+0:6 'input' ( in 4-component vector of float)
+0:6 Loop with condition tested first
+0:6 No loop condition
+0:6 No loop body
+0:9 Function Definition: f2(vf4; ( temp void)
+0:9 Function Parameters:
+0:9 'input' ( in 4-component vector of float)
+0:? Sequence
0:? Sequence
-0:5 Loop with condition tested first: Unroll
-0:5 Loop Condition
-0:5 any ( temp bool)
-0:5 NotEqual ( temp 4-component vector of bool)
-0:5 'input' ( in 4-component vector of float)
-0:5 'input' ( in 4-component vector of float)
-0:5 No loop body
+0:10 Loop with condition tested first: Unroll
+0:10 Loop Condition
+0:10 any ( temp bool)
+0:10 NotEqual ( temp 4-component vector of bool)
+0:10 'input' ( in 4-component vector of float)
+0:10 'input' ( in 4-component vector of float)
+0:10 No loop body
+0:13 Function Definition: f3(vf4; ( temp float)
+0:13 Function Parameters:
+0:13 'input' ( in 4-component vector of float)
+0:? Sequence
0:? Sequence
-0:6 Loop with condition tested first
-0:6 Loop Condition
-0:6 any ( temp bool)
-0:6 NotEqual ( temp 4-component vector of bool)
-0:6 'input' ( in 4-component vector of float)
-0:6 'input' ( in 4-component vector of float)
-0:6 Loop Body
+0:14 Loop with condition tested first
+0:14 Loop Condition
+0:14 any ( temp bool)
+0:14 NotEqual ( temp 4-component vector of bool)
+0:14 'input' ( in 4-component vector of float)
+0:14 'input' ( in 4-component vector of float)
+0:14 Loop Body
0:? Sequence
-0:6 Branch: Return with expression
-0:6 Negate value ( temp 4-component vector of float)
-0:6 'input' ( in 4-component vector of float)
-0:7 Sequence
-0:7 Pre-Decrement ( temp 4-component vector of float)
-0:7 'input' ( in 4-component vector of float)
-0:7 Loop with condition tested first
-0:7 Loop Condition
-0:7 any ( temp bool)
-0:7 NotEqual ( temp 4-component vector of bool)
-0:7 'input' ( in 4-component vector of float)
-0:7 'input' ( in 4-component vector of float)
-0:7 Loop Body
+0:14 Branch: Return with expression
+0:14 Construct float ( temp float)
+0:14 Negate value ( temp 4-component vector of float)
+0:14 'input' ( in 4-component vector of float)
+0:17 Function Definition: f4(vf4; ( temp float)
+0:17 Function Parameters:
+0:17 'input' ( in 4-component vector of float)
+0:? Sequence
+0:18 Sequence
+0:18 Pre-Decrement ( temp 4-component vector of float)
+0:18 'input' ( in 4-component vector of float)
+0:18 Loop with condition tested first
+0:18 Loop Condition
+0:18 any ( temp bool)
+0:18 NotEqual ( temp 4-component vector of bool)
+0:18 'input' ( in 4-component vector of float)
+0:18 'input' ( in 4-component vector of float)
+0:18 Loop Body
0:? Sequence
-0:7 Branch: Return with expression
-0:7 Negate value ( temp 4-component vector of float)
-0:7 'input' ( in 4-component vector of float)
-0:7 Loop Terminal Expression
-0:7 add second child into first child ( temp 4-component vector of float)
-0:7 'input' ( in 4-component vector of float)
-0:7 Constant:
-0:7 2.000000
+0:18 Branch: Return with expression
+0:18 Construct float ( temp float)
+0:18 Negate value ( temp 4-component vector of float)
+0:18 'input' ( in 4-component vector of float)
+0:18 Loop Terminal Expression
+0:18 add second child into first child ( temp 4-component vector of float)
+0:18 'input' ( in 4-component vector of float)
+0:18 Constant:
+0:18 2.000000
+0:21 Function Definition: f5(vf4; ( temp void)
+0:21 Function Parameters:
+0:21 'input' ( in 4-component vector of float)
+0:? Sequence
0:? Sequence
-0:8 Loop with condition tested first
-0:8 No loop condition
-0:8 Loop Body
-0:8 Test condition and select ( temp void)
-0:8 Condition
-0:8 Compare Greater Than ( temp bool)
-0:8 direct index ( temp float)
-0:8 'input' ( in 4-component vector of float)
-0:8 Constant:
-0:8 0 (const int)
-0:8 Constant:
-0:8 2.000000
-0:8 true case
-0:8 Branch: Break
+0:22 Loop with condition tested first
+0:22 No loop condition
+0:22 Loop Body
+0:22 Test condition and select ( temp void)
+0:22 Condition
+0:22 Compare Greater Than ( temp bool)
+0:22 direct index ( temp float)
+0:22 'input' ( in 4-component vector of float)
+0:22 Constant:
+0:22 0 (const int)
+0:22 Constant:
+0:22 2.000000
+0:22 true case
+0:22 Branch: Break
+0:25 Function Definition: f6(vf4; ( temp void)
+0:25 Function Parameters:
+0:25 'input' ( in 4-component vector of float)
+0:? Sequence
0:? Sequence
-0:9 Loop with condition tested first
-0:9 No loop condition
-0:9 Loop Body
-0:9 Test condition and select ( temp void)
-0:9 Condition
-0:9 Compare Greater Than ( temp bool)
-0:9 direct index ( temp float)
-0:9 'input' ( in 4-component vector of float)
-0:9 Constant:
-0:9 0 (const int)
-0:9 Constant:
-0:9 2.000000
-0:9 true case
-0:9 Branch: Continue
-0:11 Sequence
-0:11 move second child to first child ( temp int)
-0:11 'ii' ( temp int)
-0:11 Constant:
-0:11 -1 (const int)
-0:11 Loop with condition tested first
-0:11 Loop Condition
-0:11 Compare Less Than ( temp bool)
-0:11 'ii' ( temp int)
-0:11 Constant:
-0:11 3 (const int)
-0:11 Loop Body
-0:11 Test condition and select ( temp void)
-0:11 Condition
-0:11 Compare Equal ( temp bool)
-0:11 'ii' ( temp int)
-0:11 Constant:
-0:11 2 (const int)
-0:11 true case
-0:11 Branch: Continue
-0:11 Loop Terminal Expression
-0:11 Pre-Increment ( temp int)
-0:11 'ii' ( temp int)
-0:12 Pre-Decrement ( temp float)
-0:12 'ii' ( temp float)
-0:13 Sequence
-0:13 move second child to first child ( temp int)
-0:13 'first' ( temp int)
-0:13 Constant:
-0:13 0 (const int)
-0:13 move second child to first child ( temp int)
-0:13 'second' ( temp int)
-0:13 Constant:
-0:13 1 (const int)
-0:13 Loop with condition tested first
-0:13 No loop condition
-0:13 Loop Body
-0:13 add ( temp int)
-0:13 'first' ( temp int)
-0:13 'second' ( temp int)
-0:14 Sequence
-0:14 move second child to first child ( temp int)
-0:14 'i' ( temp int)
-0:14 Constant:
-0:14 0 (const int)
-0:14 move second child to first child ( temp int)
-0:14 'count' ( temp int)
-0:14 Convert float to int ( temp int)
-0:14 'ii' ( temp float)
-0:14 Loop with condition tested first
-0:14 Loop Condition
-0:14 Compare Less Than ( temp bool)
-0:14 'i' ( temp int)
-0:14 'count' ( temp int)
-0:14 No loop body
-0:14 Loop Terminal Expression
-0:14 Post-Increment ( temp int)
-0:14 'i' ( temp int)
-0:15 Sequence
-0:15 move second child to first child ( temp float)
-0:15 'first' ( temp float)
-0:15 Constant:
-0:15 0.000000
-0:15 Loop with condition tested first
-0:15 Loop Condition
-0:15 Compare Less Than ( temp bool)
-0:15 'first' ( temp float)
-0:15 direct index ( temp float)
-0:15 'second' ( temp 2-element array of float)
-0:15 Constant:
-0:15 0 (const int)
-0:15 Loop Body
-0:15 add ( temp float)
-0:15 add ( temp float)
-0:15 'first' ( temp float)
-0:15 direct index ( temp float)
-0:15 'second' ( temp 2-element array of float)
-0:15 Constant:
-0:15 1 (const int)
-0:15 'third' ( temp float)
-0:15 Loop Terminal Expression
-0:15 Pre-Increment ( temp float)
-0:15 direct index ( temp float)
-0:15 'second' ( temp 2-element array of float)
-0:15 Constant:
-0:15 1 (const int)
+0:26 Loop with condition tested first
+0:26 No loop condition
+0:26 Loop Body
+0:26 Test condition and select ( temp void)
+0:26 Condition
+0:26 Compare Greater Than ( temp bool)
+0:26 direct index ( temp float)
+0:26 'input' ( in 4-component vector of float)
+0:26 Constant:
+0:26 0 (const int)
+0:26 Constant:
+0:26 2.000000
+0:26 true case
+0:26 Branch: Continue
+0:29 Function Definition: f99( ( temp void)
+0:29 Function Parameters:
+0:? Sequence
+0:30 Sequence
+0:30 move second child to first child ( temp int)
+0:30 'first' ( temp int)
+0:30 Constant:
+0:30 0 (const int)
+0:30 move second child to first child ( temp int)
+0:30 'second' ( temp int)
+0:30 Constant:
+0:30 1 (const int)
+0:30 Loop with condition tested first
+0:30 No loop condition
+0:30 Loop Body
+0:30 add ( temp int)
+0:30 'first' ( temp int)
+0:30 'second' ( temp int)
+0:33 Function Definition: f100(f1; ( temp void)
+0:33 Function Parameters:
+0:33 'ii' ( in float)
+0:? Sequence
0:? Sequence
-0:16 Comma ( temp float)
-0:16 Comma ( temp float)
-0:16 Pre-Decrement ( temp float)
-0:16 'ii' ( temp float)
-0:16 Pre-Decrement ( temp float)
-0:16 'ii' ( temp float)
-0:16 Pre-Decrement ( temp float)
-0:16 'ii' ( temp float)
-0:16 Loop with condition tested first
-0:16 No loop condition
-0:16 Loop Body
-0:16 'ii' ( temp float)
-0:2 Function Definition: PixelShaderFunction( ( temp void)
-0:2 Function Parameters:
+0:34 Comma ( temp float)
+0:34 Comma ( temp float)
+0:34 Pre-Decrement ( temp float)
+0:34 'ii' ( in float)
+0:34 Pre-Decrement ( temp float)
+0:34 'ii' ( in float)
+0:34 Pre-Decrement ( temp float)
+0:34 'ii' ( in float)
+0:34 Loop with condition tested first
+0:34 No loop condition
+0:34 Loop Body
+0:34 'ii' ( in float)
+0:38 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:38 Function Parameters:
+0:38 'input' ( in 4-component vector of float)
+0:? Sequence
+0:39 Function Call: f0( ( temp void)
+0:40 Function Call: f1(vf4; ( temp void)
+0:40 'input' ( in 4-component vector of float)
+0:41 Function Call: f2(vf4; ( temp void)
+0:41 'input' ( in 4-component vector of float)
+0:42 Function Call: f3(vf4; ( temp float)
+0:42 'input' ( in 4-component vector of float)
+0:43 Function Call: f4(vf4; ( temp float)
+0:43 'input' ( in 4-component vector of float)
+0:44 Function Call: f5(vf4; ( temp void)
+0:44 'input' ( in 4-component vector of float)
+0:45 Function Call: f6(vf4; ( temp void)
+0:45 'input' ( in 4-component vector of float)
+0:48 Sequence
+0:48 move second child to first child ( temp int)
+0:48 'ii' ( temp int)
+0:48 Constant:
+0:48 -1 (const int)
+0:48 Loop with condition tested first
+0:48 Loop Condition
+0:48 Compare Less Than ( temp bool)
+0:48 'ii' ( temp int)
+0:48 Constant:
+0:48 3 (const int)
+0:48 Loop Body
+0:48 Test condition and select ( temp void)
+0:48 Condition
+0:48 Compare Equal ( temp bool)
+0:48 'ii' ( temp int)
+0:48 Constant:
+0:48 2 (const int)
+0:48 true case
+0:48 Branch: Continue
+0:48 Loop Terminal Expression
+0:48 Pre-Increment ( temp int)
+0:48 'ii' ( temp int)
+0:49 Pre-Decrement ( temp float)
+0:49 'ii' ( temp float)
+0:51 Function Call: f99( ( temp void)
+0:53 Sequence
+0:53 move second child to first child ( temp int)
+0:53 'i' ( temp int)
+0:53 Constant:
+0:53 0 (const int)
+0:53 move second child to first child ( temp int)
+0:53 'count' ( temp int)
+0:53 Convert float to int ( temp int)
+0:53 'ii' ( temp float)
+0:53 Loop with condition tested first
+0:53 Loop Condition
+0:53 Compare Less Than ( temp bool)
+0:53 'i' ( temp int)
+0:53 'count' ( temp int)
+0:53 No loop body
+0:53 Loop Terminal Expression
+0:53 Post-Increment ( temp int)
+0:53 'i' ( temp int)
+0:54 Sequence
+0:54 move second child to first child ( temp float)
+0:54 'first' ( temp float)
+0:54 Constant:
+0:54 0.000000
+0:54 Loop with condition tested first
+0:54 Loop Condition
+0:54 Compare Less Than ( temp bool)
+0:54 'first' ( temp float)
+0:54 direct index ( temp float)
+0:54 'second' ( temp 2-element array of float)
+0:54 Constant:
+0:54 0 (const int)
+0:54 Loop Body
+0:54 add ( temp float)
+0:54 add ( temp float)
+0:54 'first' ( temp float)
+0:54 direct index ( temp float)
+0:54 'second' ( temp 2-element array of float)
+0:54 Constant:
+0:54 1 (const int)
+0:54 'third' ( temp float)
+0:54 Loop Terminal Expression
+0:54 Pre-Increment ( temp float)
+0:54 direct index ( temp float)
+0:54 'second' ( temp 2-element array of float)
+0:54 Constant:
+0:54 1 (const int)
+0:56 Function Call: f100(f1; ( temp void)
+0:56 'ii' ( temp float)
+0:58 Branch: Return with expression
+0:58 'input' ( in 4-component vector of float)
+0:38 Function Definition: PixelShaderFunction( ( temp void)
+0:38 Function Parameters:
0:? Sequence
-0:2 move second child to first child ( temp 4-component vector of float)
+0:38 move second child to first child ( temp 4-component vector of float)
0:? 'input' ( temp 4-component vector of float)
0:? 'input' (layout( location=0) in 4-component vector of float)
-0:2 move second child to first child ( temp 4-component vector of float)
+0:38 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:38 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
0:? 'input' ( temp 4-component vector of float)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
@@ -205,501 +259,654 @@ Linked fragment stage:
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
-0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
-0:2 Function Parameters:
-0:2 'input' ( in 4-component vector of float)
+0:1 Function Definition: f0( ( temp void)
+0:1 Function Parameters:
0:? Sequence
0:? Sequence
-0:3 Loop with condition tested first
-0:3 No loop condition
-0:3 No loop body
-0:4 Sequence
-0:4 Pre-Increment ( temp 4-component vector of float)
-0:4 'input' ( in 4-component vector of float)
-0:4 Loop with condition tested first
-0:4 No loop condition
-0:4 No loop body
+0:2 Loop with condition tested first
+0:2 No loop condition
+0:2 No loop body
+0:5 Function Definition: f1(vf4; ( temp void)
+0:5 Function Parameters:
+0:5 'input' ( in 4-component vector of float)
+0:? Sequence
+0:6 Sequence
+0:6 Pre-Increment ( temp 4-component vector of float)
+0:6 'input' ( in 4-component vector of float)
+0:6 Loop with condition tested first
+0:6 No loop condition
+0:6 No loop body
+0:9 Function Definition: f2(vf4; ( temp void)
+0:9 Function Parameters:
+0:9 'input' ( in 4-component vector of float)
+0:? Sequence
0:? Sequence
-0:5 Loop with condition tested first: Unroll
-0:5 Loop Condition
-0:5 any ( temp bool)
-0:5 NotEqual ( temp 4-component vector of bool)
-0:5 'input' ( in 4-component vector of float)
-0:5 'input' ( in 4-component vector of float)
-0:5 No loop body
+0:10 Loop with condition tested first: Unroll
+0:10 Loop Condition
+0:10 any ( temp bool)
+0:10 NotEqual ( temp 4-component vector of bool)
+0:10 'input' ( in 4-component vector of float)
+0:10 'input' ( in 4-component vector of float)
+0:10 No loop body
+0:13 Function Definition: f3(vf4; ( temp float)
+0:13 Function Parameters:
+0:13 'input' ( in 4-component vector of float)
+0:? Sequence
0:? Sequence
-0:6 Loop with condition tested first
-0:6 Loop Condition
-0:6 any ( temp bool)
-0:6 NotEqual ( temp 4-component vector of bool)
-0:6 'input' ( in 4-component vector of float)
-0:6 'input' ( in 4-component vector of float)
-0:6 Loop Body
+0:14 Loop with condition tested first
+0:14 Loop Condition
+0:14 any ( temp bool)
+0:14 NotEqual ( temp 4-component vector of bool)
+0:14 'input' ( in 4-component vector of float)
+0:14 'input' ( in 4-component vector of float)
+0:14 Loop Body
0:? Sequence
-0:6 Branch: Return with expression
-0:6 Negate value ( temp 4-component vector of float)
-0:6 'input' ( in 4-component vector of float)
-0:7 Sequence
-0:7 Pre-Decrement ( temp 4-component vector of float)
-0:7 'input' ( in 4-component vector of float)
-0:7 Loop with condition tested first
-0:7 Loop Condition
-0:7 any ( temp bool)
-0:7 NotEqual ( temp 4-component vector of bool)
-0:7 'input' ( in 4-component vector of float)
-0:7 'input' ( in 4-component vector of float)
-0:7 Loop Body
+0:14 Branch: Return with expression
+0:14 Construct float ( temp float)
+0:14 Negate value ( temp 4-component vector of float)
+0:14 'input' ( in 4-component vector of float)
+0:17 Function Definition: f4(vf4; ( temp float)
+0:17 Function Parameters:
+0:17 'input' ( in 4-component vector of float)
+0:? Sequence
+0:18 Sequence
+0:18 Pre-Decrement ( temp 4-component vector of float)
+0:18 'input' ( in 4-component vector of float)
+0:18 Loop with condition tested first
+0:18 Loop Condition
+0:18 any ( temp bool)
+0:18 NotEqual ( temp 4-component vector of bool)
+0:18 'input' ( in 4-component vector of float)
+0:18 'input' ( in 4-component vector of float)
+0:18 Loop Body
0:? Sequence
-0:7 Branch: Return with expression
-0:7 Negate value ( temp 4-component vector of float)
-0:7 'input' ( in 4-component vector of float)
-0:7 Loop Terminal Expression
-0:7 add second child into first child ( temp 4-component vector of float)
-0:7 'input' ( in 4-component vector of float)
-0:7 Constant:
-0:7 2.000000
+0:18 Branch: Return with expression
+0:18 Construct float ( temp float)
+0:18 Negate value ( temp 4-component vector of float)
+0:18 'input' ( in 4-component vector of float)
+0:18 Loop Terminal Expression
+0:18 add second child into first child ( temp 4-component vector of float)
+0:18 'input' ( in 4-component vector of float)
+0:18 Constant:
+0:18 2.000000
+0:21 Function Definition: f5(vf4; ( temp void)
+0:21 Function Parameters:
+0:21 'input' ( in 4-component vector of float)
+0:? Sequence
0:? Sequence
-0:8 Loop with condition tested first
-0:8 No loop condition
-0:8 Loop Body
-0:8 Test condition and select ( temp void)
-0:8 Condition
-0:8 Compare Greater Than ( temp bool)
-0:8 direct index ( temp float)
-0:8 'input' ( in 4-component vector of float)
-0:8 Constant:
-0:8 0 (const int)
-0:8 Constant:
-0:8 2.000000
-0:8 true case
-0:8 Branch: Break
+0:22 Loop with condition tested first
+0:22 No loop condition
+0:22 Loop Body
+0:22 Test condition and select ( temp void)
+0:22 Condition
+0:22 Compare Greater Than ( temp bool)
+0:22 direct index ( temp float)
+0:22 'input' ( in 4-component vector of float)
+0:22 Constant:
+0:22 0 (const int)
+0:22 Constant:
+0:22 2.000000
+0:22 true case
+0:22 Branch: Break
+0:25 Function Definition: f6(vf4; ( temp void)
+0:25 Function Parameters:
+0:25 'input' ( in 4-component vector of float)
+0:? Sequence
0:? Sequence
-0:9 Loop with condition tested first
-0:9 No loop condition
-0:9 Loop Body
-0:9 Test condition and select ( temp void)
-0:9 Condition
-0:9 Compare Greater Than ( temp bool)
-0:9 direct index ( temp float)
-0:9 'input' ( in 4-component vector of float)
-0:9 Constant:
-0:9 0 (const int)
-0:9 Constant:
-0:9 2.000000
-0:9 true case
-0:9 Branch: Continue
-0:11 Sequence
-0:11 move second child to first child ( temp int)
-0:11 'ii' ( temp int)
-0:11 Constant:
-0:11 -1 (const int)
-0:11 Loop with condition tested first
-0:11 Loop Condition
-0:11 Compare Less Than ( temp bool)
-0:11 'ii' ( temp int)
-0:11 Constant:
-0:11 3 (const int)
-0:11 Loop Body
-0:11 Test condition and select ( temp void)
-0:11 Condition
-0:11 Compare Equal ( temp bool)
-0:11 'ii' ( temp int)
-0:11 Constant:
-0:11 2 (const int)
-0:11 true case
-0:11 Branch: Continue
-0:11 Loop Terminal Expression
-0:11 Pre-Increment ( temp int)
-0:11 'ii' ( temp int)
-0:12 Pre-Decrement ( temp float)
-0:12 'ii' ( temp float)
-0:13 Sequence
-0:13 move second child to first child ( temp int)
-0:13 'first' ( temp int)
-0:13 Constant:
-0:13 0 (const int)
-0:13 move second child to first child ( temp int)
-0:13 'second' ( temp int)
-0:13 Constant:
-0:13 1 (const int)
-0:13 Loop with condition tested first
-0:13 No loop condition
-0:13 Loop Body
-0:13 add ( temp int)
-0:13 'first' ( temp int)
-0:13 'second' ( temp int)
-0:14 Sequence
-0:14 move second child to first child ( temp int)
-0:14 'i' ( temp int)
-0:14 Constant:
-0:14 0 (const int)
-0:14 move second child to first child ( temp int)
-0:14 'count' ( temp int)
-0:14 Convert float to int ( temp int)
-0:14 'ii' ( temp float)
-0:14 Loop with condition tested first
-0:14 Loop Condition
-0:14 Compare Less Than ( temp bool)
-0:14 'i' ( temp int)
-0:14 'count' ( temp int)
-0:14 No loop body
-0:14 Loop Terminal Expression
-0:14 Post-Increment ( temp int)
-0:14 'i' ( temp int)
-0:15 Sequence
-0:15 move second child to first child ( temp float)
-0:15 'first' ( temp float)
-0:15 Constant:
-0:15 0.000000
-0:15 Loop with condition tested first
-0:15 Loop Condition
-0:15 Compare Less Than ( temp bool)
-0:15 'first' ( temp float)
-0:15 direct index ( temp float)
-0:15 'second' ( temp 2-element array of float)
-0:15 Constant:
-0:15 0 (const int)
-0:15 Loop Body
-0:15 add ( temp float)
-0:15 add ( temp float)
-0:15 'first' ( temp float)
-0:15 direct index ( temp float)
-0:15 'second' ( temp 2-element array of float)
-0:15 Constant:
-0:15 1 (const int)
-0:15 'third' ( temp float)
-0:15 Loop Terminal Expression
-0:15 Pre-Increment ( temp float)
-0:15 direct index ( temp float)
-0:15 'second' ( temp 2-element array of float)
-0:15 Constant:
-0:15 1 (const int)
+0:26 Loop with condition tested first
+0:26 No loop condition
+0:26 Loop Body
+0:26 Test condition and select ( temp void)
+0:26 Condition
+0:26 Compare Greater Than ( temp bool)
+0:26 direct index ( temp float)
+0:26 'input' ( in 4-component vector of float)
+0:26 Constant:
+0:26 0 (const int)
+0:26 Constant:
+0:26 2.000000
+0:26 true case
+0:26 Branch: Continue
+0:29 Function Definition: f99( ( temp void)
+0:29 Function Parameters:
+0:? Sequence
+0:30 Sequence
+0:30 move second child to first child ( temp int)
+0:30 'first' ( temp int)
+0:30 Constant:
+0:30 0 (const int)
+0:30 move second child to first child ( temp int)
+0:30 'second' ( temp int)
+0:30 Constant:
+0:30 1 (const int)
+0:30 Loop with condition tested first
+0:30 No loop condition
+0:30 Loop Body
+0:30 add ( temp int)
+0:30 'first' ( temp int)
+0:30 'second' ( temp int)
+0:33 Function Definition: f100(f1; ( temp void)
+0:33 Function Parameters:
+0:33 'ii' ( in float)
+0:? Sequence
0:? Sequence
-0:16 Comma ( temp float)
-0:16 Comma ( temp float)
-0:16 Pre-Decrement ( temp float)
-0:16 'ii' ( temp float)
-0:16 Pre-Decrement ( temp float)
-0:16 'ii' ( temp float)
-0:16 Pre-Decrement ( temp float)
-0:16 'ii' ( temp float)
-0:16 Loop with condition tested first
-0:16 No loop condition
-0:16 Loop Body
-0:16 'ii' ( temp float)
-0:2 Function Definition: PixelShaderFunction( ( temp void)
-0:2 Function Parameters:
+0:34 Comma ( temp float)
+0:34 Comma ( temp float)
+0:34 Pre-Decrement ( temp float)
+0:34 'ii' ( in float)
+0:34 Pre-Decrement ( temp float)
+0:34 'ii' ( in float)
+0:34 Pre-Decrement ( temp float)
+0:34 'ii' ( in float)
+0:34 Loop with condition tested first
+0:34 No loop condition
+0:34 Loop Body
+0:34 'ii' ( in float)
+0:38 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:38 Function Parameters:
+0:38 'input' ( in 4-component vector of float)
+0:? Sequence
+0:39 Function Call: f0( ( temp void)
+0:40 Function Call: f1(vf4; ( temp void)
+0:40 'input' ( in 4-component vector of float)
+0:41 Function Call: f2(vf4; ( temp void)
+0:41 'input' ( in 4-component vector of float)
+0:42 Function Call: f3(vf4; ( temp float)
+0:42 'input' ( in 4-component vector of float)
+0:43 Function Call: f4(vf4; ( temp float)
+0:43 'input' ( in 4-component vector of float)
+0:44 Function Call: f5(vf4; ( temp void)
+0:44 'input' ( in 4-component vector of float)
+0:45 Function Call: f6(vf4; ( temp void)
+0:45 'input' ( in 4-component vector of float)
+0:48 Sequence
+0:48 move second child to first child ( temp int)
+0:48 'ii' ( temp int)
+0:48 Constant:
+0:48 -1 (const int)
+0:48 Loop with condition tested first
+0:48 Loop Condition
+0:48 Compare Less Than ( temp bool)
+0:48 'ii' ( temp int)
+0:48 Constant:
+0:48 3 (const int)
+0:48 Loop Body
+0:48 Test condition and select ( temp void)
+0:48 Condition
+0:48 Compare Equal ( temp bool)
+0:48 'ii' ( temp int)
+0:48 Constant:
+0:48 2 (const int)
+0:48 true case
+0:48 Branch: Continue
+0:48 Loop Terminal Expression
+0:48 Pre-Increment ( temp int)
+0:48 'ii' ( temp int)
+0:49 Pre-Decrement ( temp float)
+0:49 'ii' ( temp float)
+0:51 Function Call: f99( ( temp void)
+0:53 Sequence
+0:53 move second child to first child ( temp int)
+0:53 'i' ( temp int)
+0:53 Constant:
+0:53 0 (const int)
+0:53 move second child to first child ( temp int)
+0:53 'count' ( temp int)
+0:53 Convert float to int ( temp int)
+0:53 'ii' ( temp float)
+0:53 Loop with condition tested first
+0:53 Loop Condition
+0:53 Compare Less Than ( temp bool)
+0:53 'i' ( temp int)
+0:53 'count' ( temp int)
+0:53 No loop body
+0:53 Loop Terminal Expression
+0:53 Post-Increment ( temp int)
+0:53 'i' ( temp int)
+0:54 Sequence
+0:54 move second child to first child ( temp float)
+0:54 'first' ( temp float)
+0:54 Constant:
+0:54 0.000000
+0:54 Loop with condition tested first
+0:54 Loop Condition
+0:54 Compare Less Than ( temp bool)
+0:54 'first' ( temp float)
+0:54 direct index ( temp float)
+0:54 'second' ( temp 2-element array of float)
+0:54 Constant:
+0:54 0 (const int)
+0:54 Loop Body
+0:54 add ( temp float)
+0:54 add ( temp float)
+0:54 'first' ( temp float)
+0:54 direct index ( temp float)
+0:54 'second' ( temp 2-element array of float)
+0:54 Constant:
+0:54 1 (const int)
+0:54 'third' ( temp float)
+0:54 Loop Terminal Expression
+0:54 Pre-Increment ( temp float)
+0:54 direct index ( temp float)
+0:54 'second' ( temp 2-element array of float)
+0:54 Constant:
+0:54 1 (const int)
+0:56 Function Call: f100(f1; ( temp void)
+0:56 'ii' ( temp float)
+0:58 Branch: Return with expression
+0:58 'input' ( in 4-component vector of float)
+0:38 Function Definition: PixelShaderFunction( ( temp void)
+0:38 Function Parameters:
0:? Sequence
-0:2 move second child to first child ( temp 4-component vector of float)
+0:38 move second child to first child ( temp 4-component vector of float)
0:? 'input' ( temp 4-component vector of float)
0:? 'input' (layout( location=0) in 4-component vector of float)
-0:2 move second child to first child ( temp 4-component vector of float)
+0:38 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:38 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
0:? 'input' ( temp 4-component vector of float)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
-// Id's are bound by 183
+// Generated by (magic number): 80008
+// Id's are bound by 240
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
- EntryPoint Fragment 4 "PixelShaderFunction" 176 179
+ EntryPoint Fragment 4 "PixelShaderFunction" 233 236
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "PixelShaderFunction"
- Name 11 "@PixelShaderFunction(vf4;"
- Name 10 "input"
- Name 92 "ii"
- Name 111 "ii"
- Name 114 "first"
- Name 116 "second"
- Name 124 "i"
- Name 125 "count"
- Name 138 "first"
- Name 149 "second"
- Name 157 "third"
- Name 174 "input"
- Name 176 "input"
- Name 179 "@entryPointOutput"
- Name 180 "param"
- Decorate 176(input) Location 0
- Decorate 179(@entryPointOutput) Location 0
+ Name 6 "f0("
+ Name 13 "f1(vf4;"
+ Name 12 "input"
+ Name 16 "f2(vf4;"
+ Name 15 "input"
+ Name 20 "f3(vf4;"
+ Name 19 "input"
+ Name 23 "f4(vf4;"
+ Name 22 "input"
+ Name 26 "f5(vf4;"
+ Name 25 "input"
+ Name 29 "f6(vf4;"
+ Name 28 "input"
+ Name 31 "f99("
+ Name 36 "f100(f1;"
+ Name 35 "ii"
+ Name 40 "@PixelShaderFunction(vf4;"
+ Name 39 "input"
+ Name 124 "first"
+ Name 126 "second"
+ Name 146 "param"
+ Name 149 "param"
+ Name 152 "param"
+ Name 155 "param"
+ Name 158 "param"
+ Name 161 "param"
+ Name 164 "ii"
+ Name 182 "ii"
+ Name 186 "i"
+ Name 187 "count"
+ Name 200 "first"
+ Name 211 "second"
+ Name 219 "third"
+ Name 225 "param"
+ Name 231 "input"
+ Name 233 "input"
+ Name 236 "@entryPointOutput"
+ Name 237 "param"
+ Decorate 233(input) Location 0
+ Decorate 236(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
- 6: TypeFloat 32
- 7: TypeVector 6(float) 4
- 8: TypePointer Function 7(fvec4)
- 9: TypeFunction 7(fvec4) 8(ptr)
- 18: 6(float) Constant 1065353216
- 32: TypeBool
- 33: TypeVector 32(bool) 4
- 63: 6(float) Constant 1073741824
- 71: TypeInt 32 0
- 72: 71(int) Constant 0
- 73: TypePointer Function 6(float)
- 90: TypeInt 32 1
- 91: TypePointer Function 90(int)
- 93: 90(int) Constant 4294967295
- 100: 90(int) Constant 3
- 103: 90(int) Constant 2
- 109: 90(int) Constant 1
- 115: 90(int) Constant 0
- 139: 6(float) Constant 0
- 146: 71(int) Constant 2
- 147: TypeArray 6(float) 146
- 148: TypePointer Function 147
- 175: TypePointer Input 7(fvec4)
- 176(input): 175(ptr) Variable Input
- 178: TypePointer Output 7(fvec4)
-179(@entryPointOutput): 178(ptr) Variable Output
+ 8: TypeFloat 32
+ 9: TypeVector 8(float) 4
+ 10: TypePointer Function 9(fvec4)
+ 11: TypeFunction 2 10(ptr)
+ 18: TypeFunction 8(float) 10(ptr)
+ 33: TypePointer Function 8(float)
+ 34: TypeFunction 2 33(ptr)
+ 38: TypeFunction 9(fvec4) 10(ptr)
+ 47: 8(float) Constant 1065353216
+ 61: TypeBool
+ 62: TypeVector 61(bool) 4
+ 95: 8(float) Constant 1073741824
+ 104: TypeInt 32 0
+ 105: 104(int) Constant 0
+ 122: TypeInt 32 1
+ 123: TypePointer Function 122(int)
+ 125: 122(int) Constant 0
+ 127: 122(int) Constant 1
+ 165: 122(int) Constant 4294967295
+ 172: 122(int) Constant 3
+ 175: 122(int) Constant 2
+ 201: 8(float) Constant 0
+ 208: 104(int) Constant 2
+ 209: TypeArray 8(float) 208
+ 210: TypePointer Function 209
+ 232: TypePointer Input 9(fvec4)
+ 233(input): 232(ptr) Variable Input
+ 235: TypePointer Output 9(fvec4)
+236(@entryPointOutput): 235(ptr) Variable Output
4(PixelShaderFunction): 2 Function None 3
5: Label
- 174(input): 8(ptr) Variable Function
- 180(param): 8(ptr) Variable Function
- 177: 7(fvec4) Load 176(input)
- Store 174(input) 177
- 181: 7(fvec4) Load 174(input)
- Store 180(param) 181
- 182: 7(fvec4) FunctionCall 11(@PixelShaderFunction(vf4;) 180(param)
- Store 179(@entryPointOutput) 182
+ 231(input): 10(ptr) Variable Function
+ 237(param): 10(ptr) Variable Function
+ 234: 9(fvec4) Load 233(input)
+ Store 231(input) 234
+ 238: 9(fvec4) Load 231(input)
+ Store 237(param) 238
+ 239: 9(fvec4) FunctionCall 40(@PixelShaderFunction(vf4;) 237(param)
+ Store 236(@entryPointOutput) 239
Return
FunctionEnd
-11(@PixelShaderFunction(vf4;): 7(fvec4) Function None 9
- 10(input): 8(ptr) FunctionParameter
- 12: Label
- 92(ii): 91(ptr) Variable Function
- 111(ii): 73(ptr) Variable Function
- 114(first): 91(ptr) Variable Function
- 116(second): 91(ptr) Variable Function
- 124(i): 91(ptr) Variable Function
- 125(count): 91(ptr) Variable Function
- 138(first): 73(ptr) Variable Function
- 149(second): 148(ptr) Variable Function
- 157(third): 73(ptr) Variable Function
- Branch 13
- 13: Label
- LoopMerge 15 16 None
- Branch 14
+ 6(f0(): 2 Function None 3
+ 7: Label
+ Branch 42
+ 42: Label
+ LoopMerge 44 45 None
+ Branch 43
+ 43: Label
+ Branch 45
+ 45: Label
+ Branch 42
+ 44: Label
+ Unreachable
+ FunctionEnd
+ 13(f1(vf4;): 2 Function None 11
+ 12(input): 10(ptr) FunctionParameter
14: Label
- Branch 16
- 16: Label
- Branch 13
- 15: Label
- 17: 7(fvec4) Load 10(input)
- 19: 7(fvec4) CompositeConstruct 18 18 18 18
- 20: 7(fvec4) FAdd 17 19
- Store 10(input) 20
- Branch 21
- 21: Label
- LoopMerge 23 24 None
- Branch 22
- 22: Label
- Branch 24
- 24: Label
- Branch 21
- 23: Label
- Branch 25
- 25: Label
- LoopMerge 27 28 Unroll
- Branch 29
- 29: Label
- 30: 7(fvec4) Load 10(input)
- 31: 7(fvec4) Load 10(input)
- 34: 33(bvec4) FOrdNotEqual 30 31
- 35: 32(bool) Any 34
- BranchConditional 35 26 27
- 26: Label
- Branch 28
- 28: Label
- Branch 25
- 27: Label
- Branch 36
- 36: Label
- LoopMerge 38 39 None
- Branch 40
- 40: Label
- 41: 7(fvec4) Load 10(input)
- 42: 7(fvec4) Load 10(input)
- 43: 33(bvec4) FOrdNotEqual 41 42
- 44: 32(bool) Any 43
- BranchConditional 44 37 38
- 37: Label
- 45: 7(fvec4) Load 10(input)
- 46: 7(fvec4) FNegate 45
- ReturnValue 46
- 39: Label
- Branch 36
- 38: Label
- 48: 7(fvec4) Load 10(input)
- 49: 7(fvec4) CompositeConstruct 18 18 18 18
- 50: 7(fvec4) FSub 48 49
- Store 10(input) 50
+ 46: 9(fvec4) Load 12(input)
+ 48: 9(fvec4) CompositeConstruct 47 47 47 47
+ 49: 9(fvec4) FAdd 46 48
+ Store 12(input) 49
+ Branch 50
+ 50: Label
+ LoopMerge 52 53 None
Branch 51
51: Label
- LoopMerge 53 54 None
- Branch 55
- 55: Label
- 56: 7(fvec4) Load 10(input)
- 57: 7(fvec4) Load 10(input)
- 58: 33(bvec4) FOrdNotEqual 56 57
- 59: 32(bool) Any 58
- BranchConditional 59 52 53
- 52: Label
- 60: 7(fvec4) Load 10(input)
- 61: 7(fvec4) FNegate 60
- ReturnValue 61
- 54: Label
- 64: 7(fvec4) Load 10(input)
- 65: 7(fvec4) CompositeConstruct 63 63 63 63
- 66: 7(fvec4) FAdd 64 65
- Store 10(input) 66
- Branch 51
+ Branch 53
53: Label
- Branch 67
- 67: Label
- LoopMerge 69 70 None
- Branch 68
- 68: Label
- 74: 73(ptr) AccessChain 10(input) 72
- 75: 6(float) Load 74
- 76: 32(bool) FOrdGreaterThan 75 63
- SelectionMerge 78 None
- BranchConditional 76 77 78
- 77: Label
- Branch 69
- 78: Label
- Branch 70
- 70: Label
- Branch 67
+ Branch 50
+ 52: Label
+ Unreachable
+ FunctionEnd
+ 16(f2(vf4;): 2 Function None 11
+ 15(input): 10(ptr) FunctionParameter
+ 17: Label
+ Branch 54
+ 54: Label
+ LoopMerge 56 57 Unroll
+ Branch 58
+ 58: Label
+ 59: 9(fvec4) Load 15(input)
+ 60: 9(fvec4) Load 15(input)
+ 63: 62(bvec4) FOrdNotEqual 59 60
+ 64: 61(bool) Any 63
+ BranchConditional 64 55 56
+ 55: Label
+ Branch 57
+ 57: Label
+ Branch 54
+ 56: Label
+ Return
+ FunctionEnd
+ 20(f3(vf4;): 8(float) Function None 18
+ 19(input): 10(ptr) FunctionParameter
+ 21: Label
+ Branch 65
+ 65: Label
+ LoopMerge 67 68 None
+ Branch 69
69: Label
- Branch 80
- 80: Label
- LoopMerge 82 83 None
- Branch 81
- 81: Label
- 84: 73(ptr) AccessChain 10(input) 72
- 85: 6(float) Load 84
- 86: 32(bool) FOrdGreaterThan 85 63
- SelectionMerge 88 None
- BranchConditional 86 87 88
- 87: Label
- Branch 83
- 88: Label
- Branch 83
- 83: Label
- Branch 80
+ 70: 9(fvec4) Load 19(input)
+ 71: 9(fvec4) Load 19(input)
+ 72: 62(bvec4) FOrdNotEqual 70 71
+ 73: 61(bool) Any 72
+ BranchConditional 73 66 67
+ 66: Label
+ 74: 9(fvec4) Load 19(input)
+ 75: 9(fvec4) FNegate 74
+ 76: 8(float) CompositeExtract 75 0
+ ReturnValue 76
+ 68: Label
+ Branch 65
+ 67: Label
+ 78: 8(float) Undef
+ ReturnValue 78
+ FunctionEnd
+ 23(f4(vf4;): 8(float) Function None 18
+ 22(input): 10(ptr) FunctionParameter
+ 24: Label
+ 79: 9(fvec4) Load 22(input)
+ 80: 9(fvec4) CompositeConstruct 47 47 47 47
+ 81: 9(fvec4) FSub 79 80
+ Store 22(input) 81
+ Branch 82
82: Label
- Store 92(ii) 93
- Branch 94
- 94: Label
- LoopMerge 96 97 None
- Branch 98
- 98: Label
- 99: 90(int) Load 92(ii)
- 101: 32(bool) SLessThan 99 100
- BranchConditional 101 95 96
- 95: Label
- 102: 90(int) Load 92(ii)
- 104: 32(bool) IEqual 102 103
- SelectionMerge 106 None
- BranchConditional 104 105 106
- 105: Label
- Branch 97
- 106: Label
- Branch 97
- 97: Label
- 108: 90(int) Load 92(ii)
- 110: 90(int) IAdd 108 109
- Store 92(ii) 110
- Branch 94
- 96: Label
- 112: 6(float) Load 111(ii)
- 113: 6(float) FSub 112 18
- Store 111(ii) 113
- Store 114(first) 115
- Store 116(second) 109
- Branch 117
- 117: Label
- LoopMerge 119 120 None
- Branch 118
- 118: Label
- 121: 90(int) Load 114(first)
- 122: 90(int) Load 116(second)
- 123: 90(int) IAdd 121 122
- Branch 120
+ LoopMerge 84 85 None
+ Branch 86
+ 86: Label
+ 87: 9(fvec4) Load 22(input)
+ 88: 9(fvec4) Load 22(input)
+ 89: 62(bvec4) FOrdNotEqual 87 88
+ 90: 61(bool) Any 89
+ BranchConditional 90 83 84
+ 83: Label
+ 91: 9(fvec4) Load 22(input)
+ 92: 9(fvec4) FNegate 91
+ 93: 8(float) CompositeExtract 92 0
+ ReturnValue 93
+ 85: Label
+ Branch 82
+ 84: Label
+ 99: 8(float) Undef
+ ReturnValue 99
+ FunctionEnd
+ 26(f5(vf4;): 2 Function None 11
+ 25(input): 10(ptr) FunctionParameter
+ 27: Label
+ Branch 100
+ 100: Label
+ LoopMerge 102 103 None
+ Branch 101
+ 101: Label
+ 106: 33(ptr) AccessChain 25(input) 105
+ 107: 8(float) Load 106
+ 108: 61(bool) FOrdGreaterThan 107 95
+ SelectionMerge 110 None
+ BranchConditional 108 109 110
+ 109: Label
+ Branch 102
+ 110: Label
+ Branch 103
+ 103: Label
+ Branch 100
+ 102: Label
+ Return
+ FunctionEnd
+ 29(f6(vf4;): 2 Function None 11
+ 28(input): 10(ptr) FunctionParameter
+ 30: Label
+ Branch 112
+ 112: Label
+ LoopMerge 114 115 None
+ Branch 113
+ 113: Label
+ 116: 33(ptr) AccessChain 28(input) 105
+ 117: 8(float) Load 116
+ 118: 61(bool) FOrdGreaterThan 117 95
+ SelectionMerge 120 None
+ BranchConditional 118 119 120
+ 119: Label
+ Branch 115
120: Label
- Branch 117
- 119: Label
- Store 124(i) 115
- 126: 6(float) Load 111(ii)
- 127: 90(int) ConvertFToS 126
- Store 125(count) 127
+ Branch 115
+ 115: Label
+ Branch 112
+ 114: Label
+ Unreachable
+ FunctionEnd
+ 31(f99(): 2 Function None 3
+ 32: Label
+ 124(first): 123(ptr) Variable Function
+ 126(second): 123(ptr) Variable Function
+ Store 124(first) 125
+ Store 126(second) 127
Branch 128
128: Label
LoopMerge 130 131 None
- Branch 132
- 132: Label
- 133: 90(int) Load 124(i)
- 134: 90(int) Load 125(count)
- 135: 32(bool) SLessThan 133 134
- BranchConditional 135 129 130
- 129: Label
- Branch 131
- 131: Label
- 136: 90(int) Load 124(i)
- 137: 90(int) IAdd 136 109
- Store 124(i) 137
- Branch 128
+ Branch 129
+ 129: Label
+ 132: 122(int) Load 124(first)
+ 133: 122(int) Load 126(second)
+ 134: 122(int) IAdd 132 133
+ Branch 131
+ 131: Label
+ Branch 128
130: Label
- Store 138(first) 139
- Branch 140
- 140: Label
- LoopMerge 142 143 None
+ Unreachable
+ FunctionEnd
+ 36(f100(f1;): 2 Function None 34
+ 35(ii): 33(ptr) FunctionParameter
+ 37: Label
+ 135: 8(float) Load 35(ii)
+ 136: 8(float) FSub 135 47
+ Store 35(ii) 136
+ 137: 8(float) Load 35(ii)
+ 138: 8(float) FSub 137 47
+ Store 35(ii) 138
+ 139: 8(float) Load 35(ii)
+ 140: 8(float) FSub 139 47
+ Store 35(ii) 140
+ Branch 141
+ 141: Label
+ LoopMerge 143 144 None
+ Branch 142
+ 142: Label
Branch 144
144: Label
- 145: 6(float) Load 138(first)
- 150: 73(ptr) AccessChain 149(second) 115
- 151: 6(float) Load 150
- 152: 32(bool) FOrdLessThan 145 151
- BranchConditional 152 141 142
- 141: Label
- 153: 6(float) Load 138(first)
- 154: 73(ptr) AccessChain 149(second) 109
- 155: 6(float) Load 154
- 156: 6(float) FAdd 153 155
- 158: 6(float) Load 157(third)
- 159: 6(float) FAdd 156 158
- Branch 143
- 143: Label
- 160: 73(ptr) AccessChain 149(second) 109
- 161: 6(float) Load 160
- 162: 6(float) FAdd 161 18
- Store 160 162
- Branch 140
- 142: Label
- 163: 6(float) Load 111(ii)
- 164: 6(float) FSub 163 18
- Store 111(ii) 164
- 165: 6(float) Load 111(ii)
- 166: 6(float) FSub 165 18
- Store 111(ii) 166
- 167: 6(float) Load 111(ii)
- 168: 6(float) FSub 167 18
- Store 111(ii) 168
- Branch 169
- 169: Label
- LoopMerge 171 172 None
+ Branch 141
+ 143: Label
+ Unreachable
+ FunctionEnd
+40(@PixelShaderFunction(vf4;): 9(fvec4) Function None 38
+ 39(input): 10(ptr) FunctionParameter
+ 41: Label
+ 146(param): 10(ptr) Variable Function
+ 149(param): 10(ptr) Variable Function
+ 152(param): 10(ptr) Variable Function
+ 155(param): 10(ptr) Variable Function
+ 158(param): 10(ptr) Variable Function
+ 161(param): 10(ptr) Variable Function
+ 164(ii): 123(ptr) Variable Function
+ 182(ii): 33(ptr) Variable Function
+ 186(i): 123(ptr) Variable Function
+ 187(count): 123(ptr) Variable Function
+ 200(first): 33(ptr) Variable Function
+ 211(second): 210(ptr) Variable Function
+ 219(third): 33(ptr) Variable Function
+ 225(param): 33(ptr) Variable Function
+ 145: 2 FunctionCall 6(f0()
+ 147: 9(fvec4) Load 39(input)
+ Store 146(param) 147
+ 148: 2 FunctionCall 13(f1(vf4;) 146(param)
+ 150: 9(fvec4) Load 39(input)
+ Store 149(param) 150
+ 151: 2 FunctionCall 16(f2(vf4;) 149(param)
+ 153: 9(fvec4) Load 39(input)
+ Store 152(param) 153
+ 154: 8(float) FunctionCall 20(f3(vf4;) 152(param)
+ 156: 9(fvec4) Load 39(input)
+ Store 155(param) 156
+ 157: 8(float) FunctionCall 23(f4(vf4;) 155(param)
+ 159: 9(fvec4) Load 39(input)
+ Store 158(param) 159
+ 160: 2 FunctionCall 26(f5(vf4;) 158(param)
+ 162: 9(fvec4) Load 39(input)
+ Store 161(param) 162
+ 163: 2 FunctionCall 29(f6(vf4;) 161(param)
+ Store 164(ii) 165
+ Branch 166
+ 166: Label
+ LoopMerge 168 169 None
Branch 170
170: Label
- Branch 172
- 172: Label
- Branch 169
- 171: Label
- 173: 7(fvec4) Undef
- ReturnValue 173
+ 171: 122(int) Load 164(ii)
+ 173: 61(bool) SLessThan 171 172
+ BranchConditional 173 167 168
+ 167: Label
+ 174: 122(int) Load 164(ii)
+ 176: 61(bool) IEqual 174 175
+ SelectionMerge 178 None
+ BranchConditional 176 177 178
+ 177: Label
+ Branch 169
+ 178: Label
+ Branch 169
+ 169: Label
+ 180: 122(int) Load 164(ii)
+ 181: 122(int) IAdd 180 127
+ Store 164(ii) 181
+ Branch 166
+ 168: Label
+ 183: 8(float) Load 182(ii)
+ 184: 8(float) FSub 183 47
+ Store 182(ii) 184
+ 185: 2 FunctionCall 31(f99()
+ Store 186(i) 125
+ 188: 8(float) Load 182(ii)
+ 189: 122(int) ConvertFToS 188
+ Store 187(count) 189
+ Branch 190
+ 190: Label
+ LoopMerge 192 193 None
+ Branch 194
+ 194: Label
+ 195: 122(int) Load 186(i)
+ 196: 122(int) Load 187(count)
+ 197: 61(bool) SLessThan 195 196
+ BranchConditional 197 191 192
+ 191: Label
+ Branch 193
+ 193: Label
+ 198: 122(int) Load 186(i)
+ 199: 122(int) IAdd 198 127
+ Store 186(i) 199
+ Branch 190
+ 192: Label
+ Store 200(first) 201
+ Branch 202
+ 202: Label
+ LoopMerge 204 205 None
+ Branch 206
+ 206: Label
+ 207: 8(float) Load 200(first)
+ 212: 33(ptr) AccessChain 211(second) 125
+ 213: 8(float) Load 212
+ 214: 61(bool) FOrdLessThan 207 213
+ BranchConditional 214 203 204
+ 203: Label
+ 215: 8(float) Load 200(first)
+ 216: 33(ptr) AccessChain 211(second) 127
+ 217: 8(float) Load 216
+ 218: 8(float) FAdd 215 217
+ 220: 8(float) Load 219(third)
+ 221: 8(float) FAdd 218 220
+ Branch 205
+ 205: Label
+ 222: 33(ptr) AccessChain 211(second) 127
+ 223: 8(float) Load 222
+ 224: 8(float) FAdd 223 47
+ Store 222 224
+ Branch 202
+ 204: Label
+ 226: 8(float) Load 182(ii)
+ Store 225(param) 226
+ 227: 2 FunctionCall 36(f100(f1;) 225(param)
+ 228: 9(fvec4) Load 39(input)
+ ReturnValue 228
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.format.rwtexture.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.format.rwtexture.frag.out
index 7ab53299be4..699dafeb6df 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.format.rwtexture.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.format.rwtexture.frag.out
@@ -184,7 +184,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 160
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.fraggeom.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.fraggeom.frag.out
index af3564d1964..7509ddc81f2 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.fraggeom.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.fraggeom.frag.out
@@ -64,7 +64,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 25
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out
index 32d27ab0c66..b954c2b6247 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.array.dx10.frag.out
@@ -262,7 +262,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 124
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out
index 57e4499dd8c..530bccd85fd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.basic.dx10.frag.out
@@ -258,7 +258,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 135
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out
index a0c8d159417..de745d1b5b1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out
@@ -220,7 +220,7 @@ Shader version: 500
0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 126
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out
index 85ba2945e91..3a897121da4 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.offset.dx10.frag.out
@@ -208,7 +208,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 114
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out
index c73547e321b..36011878a9a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gather.offsetarray.dx10.frag.out
@@ -202,7 +202,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 97
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out
index ac6c81741e5..c2a49018b61 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out
@@ -750,7 +750,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 255
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out
index 8617d701caf..8bb01d53962 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out
@@ -758,7 +758,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 265
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out
index 4a0d77a09ca..a77767804e0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out
@@ -1263,7 +1263,7 @@ using depth_any
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 399
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out
index c9740b05944..2acc97530b6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out
@@ -1255,7 +1255,7 @@ using depth_any
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 389
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out
index 5e2d42212bd..8ad84cd746a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out
@@ -456,7 +456,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 164
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out
index eb92fbb0c81..cf406ed4a09 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out
@@ -2318,7 +2318,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 550
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out
index cccdfeb247a..51368b6dfa1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out
@@ -116,7 +116,7 @@ Shader version: 500
0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 48
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out
index d8675a20bad..d096c381f8a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out
@@ -718,7 +718,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 232
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out
index d1e28447f77..7c46c8e192f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out
@@ -580,7 +580,7 @@ using depth_any
0:? 'sample' (layout( location=0) flat in int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 198
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.global-const-init.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.global-const-init.frag.out
index a1aa55b5741..828c0c5945c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.global-const-init.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.global-const-init.frag.out
@@ -102,7 +102,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 50
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.groupid.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.groupid.comp.out
index a76db505f51..65804b73013 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.groupid.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.groupid.comp.out
@@ -82,7 +82,7 @@ local_size = (8, 8, 1)
0:? 'vGroupId' ( in 3-component vector of uint WorkGroupID)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 37
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out
index 4971371a39f..fabc1109155 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out
@@ -798,7 +798,7 @@ triangle order = ccw
0:? '@patchConstantOutput' (layout( location=1) patch out structure{ temp 3-element array of 3-component vector of float NormalWS})
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 216
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hlslOffset.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hlslOffset.vert.out
index b0c04672250..099318cb9c3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hlslOffset.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hlslOffset.vert.out
@@ -26,7 +26,7 @@ Shader version: 500
0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform float m0, layout( row_major std140) uniform 3-component vector of float m4, layout( row_major std140) uniform float m16, layout( row_major std140 offset=20) uniform 3-component vector of float m20, layout( row_major std140 offset=36) uniform 3-component vector of float m36, layout( row_major std140 offset=56) uniform 2-component vector of float m56, layout( row_major std140) uniform float m64, layout( row_major std140) uniform 2-component vector of float m68, layout( row_major std140) uniform float m76, layout( row_major std140) uniform float m80, layout( row_major std140) uniform 1-element array of 2-component vector of float m96})
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 18
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.1.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.1.tesc.out
index 1be149872fc..ca4417d7cd7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.1.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.1.tesc.out
@@ -224,7 +224,7 @@ vertex spacing = equal_spacing
0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 89
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.2.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.2.tesc.out
index c8218d23725..70fc4f1ea80 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.2.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.2.tesc.out
@@ -220,7 +220,7 @@ vertex spacing = equal_spacing
0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 91
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.3.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.3.tesc.out
index 4ff01985dcf..fba7fac812d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.3.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.3.tesc.out
@@ -220,7 +220,7 @@ vertex spacing = equal_spacing
0:? '@patchConstantOutput.edges' ( patch out 4-element array of float TessLevelOuter)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 91
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.4.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.4.tesc.out
index a99730d0938..253bdc6453e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.4.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.4.tesc.out
@@ -476,7 +476,7 @@ triangle order = cw
0:? '@patchConstantOutput.fInsideTessFactor' ( patch out 2-element array of float TessLevelInner)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 127
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out
index 41f3c0a44de..2bf3c7c7d1d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out
@@ -396,7 +396,7 @@ triangle order = cw
0:? '@patchConstantOutput.flInFactor' ( patch out 2-element array of float TessLevelInner)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 124
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out
index 986e1102111..62e48f74205 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out
@@ -414,7 +414,7 @@ triangle order = cw
0:? '@patchConstantOutput.flInFactor' ( patch out 2-element array of float TessLevelInner)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 126
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.void.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.void.tesc.out
index c44c7e4dd73..7c006db323e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.void.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.hull.void.tesc.out
@@ -108,7 +108,7 @@ triangle order = ccw
0:? 'InvocationId' ( in uint InvocationID)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 55
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.identifier.sample.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.identifier.sample.frag.out
index a23451ec196..ddc4c51de76 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.identifier.sample.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.identifier.sample.frag.out
@@ -86,7 +86,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 33
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.if.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.if.frag.out
index 056b672e308..6b6de9c5f4c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.if.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.if.frag.out
@@ -2,104 +2,116 @@ hlsl.if.frag
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
-0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
-0:2 Function Parameters:
-0:2 'input' ( in 4-component vector of float)
+0:1 Function Definition: f0(vf4; ( temp 4-component vector of float)
+0:1 Function Parameters:
+0:1 'input' ( in 4-component vector of float)
0:? Sequence
-0:3 Test condition and select ( temp void)
-0:3 Condition
-0:3 all ( temp bool)
-0:3 Equal ( temp 4-component vector of bool)
-0:3 'input' ( in 4-component vector of float)
-0:3 'input' ( in 4-component vector of float)
-0:3 true case
-0:4 Branch: Return with expression
-0:4 'input' ( in 4-component vector of float)
-0:6 Test condition and select ( temp void)
-0:6 Condition
-0:6 all ( temp bool)
-0:6 Equal ( temp 4-component vector of bool)
-0:6 'input' ( in 4-component vector of float)
-0:6 'input' ( in 4-component vector of float)
-0:6 true case
-0:7 Branch: Return with expression
-0:7 'input' ( in 4-component vector of float)
-0:6 false case
-0:9 Branch: Return with expression
-0:9 Negate value ( temp 4-component vector of float)
+0:2 Test condition and select ( temp void)
+0:2 Condition
+0:2 all ( temp bool)
+0:2 Equal ( temp 4-component vector of bool)
+0:2 'input' ( in 4-component vector of float)
+0:2 'input' ( in 4-component vector of float)
+0:2 true case
+0:3 Branch: Return with expression
+0:3 'input' ( in 4-component vector of float)
+0:2 false case
+0:5 Branch: Return with expression
+0:5 Negate value ( temp 4-component vector of float)
+0:5 'input' ( in 4-component vector of float)
+0:8 Function Definition: f1(vf4; ( temp 4-component vector of float)
+0:8 Function Parameters:
+0:8 'input' ( in 4-component vector of float)
+0:? Sequence
+0:9 Test condition and select ( temp void)
+0:9 Condition
+0:9 all ( temp bool)
+0:9 Equal ( temp 4-component vector of bool)
+0:9 'input' ( in 4-component vector of float)
0:9 'input' ( in 4-component vector of float)
-0:11 Test condition and select ( temp void)
-0:11 Condition
-0:11 all ( temp bool)
-0:11 Equal ( temp 4-component vector of bool)
-0:11 'input' ( in 4-component vector of float)
-0:11 'input' ( in 4-component vector of float)
-0:11 true case is null
-0:14 Test condition and select ( temp void)
-0:14 Condition
-0:14 all ( temp bool)
-0:14 Equal ( temp 4-component vector of bool)
-0:14 'input' ( in 4-component vector of float)
-0:14 'input' ( in 4-component vector of float)
-0:14 true case is null
-0:19 Test condition and select ( temp void): Flatten
-0:19 Condition
-0:19 all ( temp bool)
-0:19 Equal ( temp 4-component vector of bool)
-0:19 'input' ( in 4-component vector of float)
-0:19 'input' ( in 4-component vector of float)
-0:19 true case
+0:9 true case
+0:? Sequence
+0:10 Branch: Return with expression
+0:10 'input' ( in 4-component vector of float)
+0:9 false case
0:? Sequence
-0:20 Branch: Return with expression
-0:20 'input' ( in 4-component vector of float)
+0:12 Branch: Return with expression
+0:12 Negate value ( temp 4-component vector of float)
+0:12 'input' ( in 4-component vector of float)
+0:17 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:17 Function Parameters:
+0:17 'input' ( in 4-component vector of float)
+0:? Sequence
+0:18 Test condition and select ( temp void)
+0:18 Condition
+0:18 all ( temp bool)
+0:18 Equal ( temp 4-component vector of bool)
+0:18 'input' ( in 4-component vector of float)
+0:18 'input' ( in 4-component vector of float)
+0:18 true case
+0:19 Branch: Return with expression
+0:19 'input' ( in 4-component vector of float)
+0:21 Function Call: f0(vf4; ( temp 4-component vector of float)
+0:21 'input' ( in 4-component vector of float)
0:23 Test condition and select ( temp void)
0:23 Condition
0:23 all ( temp bool)
0:23 Equal ( temp 4-component vector of bool)
0:23 'input' ( in 4-component vector of float)
0:23 'input' ( in 4-component vector of float)
-0:23 true case
-0:? Sequence
-0:24 Branch: Return with expression
-0:24 'input' ( in 4-component vector of float)
-0:23 false case
+0:23 true case is null
+0:26 Test condition and select ( temp void)
+0:26 Condition
+0:26 all ( temp bool)
+0:26 Equal ( temp 4-component vector of bool)
+0:26 'input' ( in 4-component vector of float)
+0:26 'input' ( in 4-component vector of float)
+0:26 true case is null
+0:31 Test condition and select ( temp void): Flatten
+0:31 Condition
+0:31 all ( temp bool)
+0:31 Equal ( temp 4-component vector of bool)
+0:31 'input' ( in 4-component vector of float)
+0:31 'input' ( in 4-component vector of float)
+0:31 true case
0:? Sequence
-0:26 Branch: Return with expression
-0:26 Negate value ( temp 4-component vector of float)
-0:26 'input' ( in 4-component vector of float)
-0:30 Test condition and select ( temp void)
-0:30 Condition
-0:30 Convert float to bool ( temp bool)
-0:30 move second child to first child ( temp float)
-0:30 'ii' ( temp float)
-0:30 direct index ( temp float)
-0:30 'input' ( in 4-component vector of float)
-0:30 Constant:
-0:30 2 (const int)
-0:30 true case
-0:31 Pre-Increment ( temp float)
-0:31 'ii' ( temp float)
-0:32 Pre-Increment ( temp int)
-0:32 'ii' ( temp int)
-0:33 Test condition and select ( temp void)
-0:33 Condition
-0:33 Compare Equal ( temp bool)
-0:33 Convert int to float ( temp float)
-0:33 'ii' ( temp int)
-0:33 Constant:
-0:33 1.000000
-0:33 true case
-0:34 Pre-Increment ( temp int)
-0:34 'ii' ( temp int)
-0:2 Function Definition: PixelShaderFunction( ( temp void)
-0:2 Function Parameters:
+0:32 Branch: Return with expression
+0:32 'input' ( in 4-component vector of float)
+0:35 Function Call: f1(vf4; ( temp 4-component vector of float)
+0:35 'input' ( in 4-component vector of float)
+0:38 Test condition and select ( temp void)
+0:38 Condition
+0:38 Convert float to bool ( temp bool)
+0:38 move second child to first child ( temp float)
+0:38 'ii' ( temp float)
+0:38 direct index ( temp float)
+0:38 'input' ( in 4-component vector of float)
+0:38 Constant:
+0:38 2 (const int)
+0:38 true case
+0:39 Pre-Increment ( temp float)
+0:39 'ii' ( temp float)
+0:40 Pre-Increment ( temp int)
+0:40 'ii' ( temp int)
+0:41 Test condition and select ( temp void)
+0:41 Condition
+0:41 Compare Equal ( temp bool)
+0:41 Convert int to float ( temp float)
+0:41 'ii' ( temp int)
+0:41 Constant:
+0:41 1.000000
+0:41 true case
+0:42 Pre-Increment ( temp int)
+0:42 'ii' ( temp int)
+0:17 Function Definition: PixelShaderFunction( ( temp void)
+0:17 Function Parameters:
0:? Sequence
-0:2 move second child to first child ( temp 4-component vector of float)
+0:17 move second child to first child ( temp 4-component vector of float)
0:? 'input' ( temp 4-component vector of float)
0:? 'input' (layout( location=0) in 4-component vector of float)
-0:2 move second child to first child ( temp 4-component vector of float)
+0:17 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:17 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
0:? 'input' ( temp 4-component vector of float)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
@@ -112,259 +124,295 @@ Linked fragment stage:
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
-0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
-0:2 Function Parameters:
-0:2 'input' ( in 4-component vector of float)
+0:1 Function Definition: f0(vf4; ( temp 4-component vector of float)
+0:1 Function Parameters:
+0:1 'input' ( in 4-component vector of float)
+0:? Sequence
+0:2 Test condition and select ( temp void)
+0:2 Condition
+0:2 all ( temp bool)
+0:2 Equal ( temp 4-component vector of bool)
+0:2 'input' ( in 4-component vector of float)
+0:2 'input' ( in 4-component vector of float)
+0:2 true case
+0:3 Branch: Return with expression
+0:3 'input' ( in 4-component vector of float)
+0:2 false case
+0:5 Branch: Return with expression
+0:5 Negate value ( temp 4-component vector of float)
+0:5 'input' ( in 4-component vector of float)
+0:8 Function Definition: f1(vf4; ( temp 4-component vector of float)
+0:8 Function Parameters:
+0:8 'input' ( in 4-component vector of float)
0:? Sequence
-0:3 Test condition and select ( temp void)
-0:3 Condition
-0:3 all ( temp bool)
-0:3 Equal ( temp 4-component vector of bool)
-0:3 'input' ( in 4-component vector of float)
-0:3 'input' ( in 4-component vector of float)
-0:3 true case
-0:4 Branch: Return with expression
-0:4 'input' ( in 4-component vector of float)
-0:6 Test condition and select ( temp void)
-0:6 Condition
-0:6 all ( temp bool)
-0:6 Equal ( temp 4-component vector of bool)
-0:6 'input' ( in 4-component vector of float)
-0:6 'input' ( in 4-component vector of float)
-0:6 true case
-0:7 Branch: Return with expression
-0:7 'input' ( in 4-component vector of float)
-0:6 false case
-0:9 Branch: Return with expression
-0:9 Negate value ( temp 4-component vector of float)
+0:9 Test condition and select ( temp void)
+0:9 Condition
+0:9 all ( temp bool)
+0:9 Equal ( temp 4-component vector of bool)
0:9 'input' ( in 4-component vector of float)
-0:11 Test condition and select ( temp void)
-0:11 Condition
-0:11 all ( temp bool)
-0:11 Equal ( temp 4-component vector of bool)
-0:11 'input' ( in 4-component vector of float)
-0:11 'input' ( in 4-component vector of float)
-0:11 true case is null
-0:14 Test condition and select ( temp void)
-0:14 Condition
-0:14 all ( temp bool)
-0:14 Equal ( temp 4-component vector of bool)
-0:14 'input' ( in 4-component vector of float)
-0:14 'input' ( in 4-component vector of float)
-0:14 true case is null
-0:19 Test condition and select ( temp void): Flatten
-0:19 Condition
-0:19 all ( temp bool)
-0:19 Equal ( temp 4-component vector of bool)
-0:19 'input' ( in 4-component vector of float)
-0:19 'input' ( in 4-component vector of float)
-0:19 true case
+0:9 'input' ( in 4-component vector of float)
+0:9 true case
+0:? Sequence
+0:10 Branch: Return with expression
+0:10 'input' ( in 4-component vector of float)
+0:9 false case
0:? Sequence
-0:20 Branch: Return with expression
-0:20 'input' ( in 4-component vector of float)
+0:12 Branch: Return with expression
+0:12 Negate value ( temp 4-component vector of float)
+0:12 'input' ( in 4-component vector of float)
+0:17 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:17 Function Parameters:
+0:17 'input' ( in 4-component vector of float)
+0:? Sequence
+0:18 Test condition and select ( temp void)
+0:18 Condition
+0:18 all ( temp bool)
+0:18 Equal ( temp 4-component vector of bool)
+0:18 'input' ( in 4-component vector of float)
+0:18 'input' ( in 4-component vector of float)
+0:18 true case
+0:19 Branch: Return with expression
+0:19 'input' ( in 4-component vector of float)
+0:21 Function Call: f0(vf4; ( temp 4-component vector of float)
+0:21 'input' ( in 4-component vector of float)
0:23 Test condition and select ( temp void)
0:23 Condition
0:23 all ( temp bool)
0:23 Equal ( temp 4-component vector of bool)
0:23 'input' ( in 4-component vector of float)
0:23 'input' ( in 4-component vector of float)
-0:23 true case
+0:23 true case is null
+0:26 Test condition and select ( temp void)
+0:26 Condition
+0:26 all ( temp bool)
+0:26 Equal ( temp 4-component vector of bool)
+0:26 'input' ( in 4-component vector of float)
+0:26 'input' ( in 4-component vector of float)
+0:26 true case is null
+0:31 Test condition and select ( temp void): Flatten
+0:31 Condition
+0:31 all ( temp bool)
+0:31 Equal ( temp 4-component vector of bool)
+0:31 'input' ( in 4-component vector of float)
+0:31 'input' ( in 4-component vector of float)
+0:31 true case
0:? Sequence
-0:24 Branch: Return with expression
-0:24 'input' ( in 4-component vector of float)
-0:23 false case
-0:? Sequence
-0:26 Branch: Return with expression
-0:26 Negate value ( temp 4-component vector of float)
-0:26 'input' ( in 4-component vector of float)
-0:30 Test condition and select ( temp void)
-0:30 Condition
-0:30 Convert float to bool ( temp bool)
-0:30 move second child to first child ( temp float)
-0:30 'ii' ( temp float)
-0:30 direct index ( temp float)
-0:30 'input' ( in 4-component vector of float)
-0:30 Constant:
-0:30 2 (const int)
-0:30 true case
-0:31 Pre-Increment ( temp float)
-0:31 'ii' ( temp float)
-0:32 Pre-Increment ( temp int)
-0:32 'ii' ( temp int)
-0:33 Test condition and select ( temp void)
-0:33 Condition
-0:33 Compare Equal ( temp bool)
-0:33 Convert int to float ( temp float)
-0:33 'ii' ( temp int)
-0:33 Constant:
-0:33 1.000000
-0:33 true case
-0:34 Pre-Increment ( temp int)
-0:34 'ii' ( temp int)
-0:2 Function Definition: PixelShaderFunction( ( temp void)
-0:2 Function Parameters:
+0:32 Branch: Return with expression
+0:32 'input' ( in 4-component vector of float)
+0:35 Function Call: f1(vf4; ( temp 4-component vector of float)
+0:35 'input' ( in 4-component vector of float)
+0:38 Test condition and select ( temp void)
+0:38 Condition
+0:38 Convert float to bool ( temp bool)
+0:38 move second child to first child ( temp float)
+0:38 'ii' ( temp float)
+0:38 direct index ( temp float)
+0:38 'input' ( in 4-component vector of float)
+0:38 Constant:
+0:38 2 (const int)
+0:38 true case
+0:39 Pre-Increment ( temp float)
+0:39 'ii' ( temp float)
+0:40 Pre-Increment ( temp int)
+0:40 'ii' ( temp int)
+0:41 Test condition and select ( temp void)
+0:41 Condition
+0:41 Compare Equal ( temp bool)
+0:41 Convert int to float ( temp float)
+0:41 'ii' ( temp int)
+0:41 Constant:
+0:41 1.000000
+0:41 true case
+0:42 Pre-Increment ( temp int)
+0:42 'ii' ( temp int)
+0:17 Function Definition: PixelShaderFunction( ( temp void)
+0:17 Function Parameters:
0:? Sequence
-0:2 move second child to first child ( temp 4-component vector of float)
+0:17 move second child to first child ( temp 4-component vector of float)
0:? 'input' ( temp 4-component vector of float)
0:? 'input' (layout( location=0) in 4-component vector of float)
-0:2 move second child to first child ( temp 4-component vector of float)
+0:17 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:17 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
0:? 'input' ( temp 4-component vector of float)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
-// Id's are bound by 103
+// Generated by (magic number): 80008
+// Id's are bound by 117
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
- EntryPoint Fragment 4 "PixelShaderFunction" 96 99
+ EntryPoint Fragment 4 "PixelShaderFunction" 110 113
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "PixelShaderFunction"
- Name 11 "@PixelShaderFunction(vf4;"
+ Name 11 "f0(vf4;"
Name 10 "input"
- Name 68 "ii"
+ Name 14 "f1(vf4;"
+ Name 13 "input"
+ Name 17 "@PixelShaderFunction(vf4;"
+ Name 16 "input"
+ Name 55 "param"
+ Name 78 "param"
Name 82 "ii"
- Name 94 "input"
- Name 96 "input"
- Name 99 "@entryPointOutput"
- Name 100 "param"
- Decorate 96(input) Location 0
- Decorate 99(@entryPointOutput) Location 0
+ Name 96 "ii"
+ Name 108 "input"
+ Name 110 "input"
+ Name 113 "@entryPointOutput"
+ Name 114 "param"
+ Decorate 110(input) Location 0
+ Decorate 113(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
9: TypeFunction 7(fvec4) 8(ptr)
- 15: TypeBool
- 16: TypeVector 15(bool) 4
- 67: TypePointer Function 6(float)
- 69: TypeInt 32 0
- 70: 69(int) Constant 2
- 73: 6(float) Constant 0
- 78: 6(float) Constant 1065353216
- 80: TypeInt 32 1
- 81: TypePointer Function 80(int)
- 84: 80(int) Constant 1
- 95: TypePointer Input 7(fvec4)
- 96(input): 95(ptr) Variable Input
- 98: TypePointer Output 7(fvec4)
-99(@entryPointOutput): 98(ptr) Variable Output
+ 21: TypeBool
+ 22: TypeVector 21(bool) 4
+ 81: TypePointer Function 6(float)
+ 83: TypeInt 32 0
+ 84: 83(int) Constant 2
+ 87: 6(float) Constant 0
+ 92: 6(float) Constant 1065353216
+ 94: TypeInt 32 1
+ 95: TypePointer Function 94(int)
+ 98: 94(int) Constant 1
+ 109: TypePointer Input 7(fvec4)
+ 110(input): 109(ptr) Variable Input
+ 112: TypePointer Output 7(fvec4)
+113(@entryPointOutput): 112(ptr) Variable Output
4(PixelShaderFunction): 2 Function None 3
5: Label
- 94(input): 8(ptr) Variable Function
- 100(param): 8(ptr) Variable Function
- 97: 7(fvec4) Load 96(input)
- Store 94(input) 97
- 101: 7(fvec4) Load 94(input)
- Store 100(param) 101
- 102: 7(fvec4) FunctionCall 11(@PixelShaderFunction(vf4;) 100(param)
- Store 99(@entryPointOutput) 102
+ 108(input): 8(ptr) Variable Function
+ 114(param): 8(ptr) Variable Function
+ 111: 7(fvec4) Load 110(input)
+ Store 108(input) 111
+ 115: 7(fvec4) Load 108(input)
+ Store 114(param) 115
+ 116: 7(fvec4) FunctionCall 17(@PixelShaderFunction(vf4;) 114(param)
+ Store 113(@entryPointOutput) 116
Return
FunctionEnd
-11(@PixelShaderFunction(vf4;): 7(fvec4) Function None 9
+ 11(f0(vf4;): 7(fvec4) Function None 9
10(input): 8(ptr) FunctionParameter
12: Label
- 68(ii): 67(ptr) Variable Function
+ 19: 7(fvec4) Load 10(input)
+ 20: 7(fvec4) Load 10(input)
+ 23: 22(bvec4) FOrdEqual 19 20
+ 24: 21(bool) All 23
+ SelectionMerge 26 None
+ BranchConditional 24 25 29
+ 25: Label
+ 27: 7(fvec4) Load 10(input)
+ ReturnValue 27
+ 29: Label
+ 30: 7(fvec4) Load 10(input)
+ 31: 7(fvec4) FNegate 30
+ ReturnValue 31
+ 26: Label
+ Unreachable
+ FunctionEnd
+ 14(f1(vf4;): 7(fvec4) Function None 9
+ 13(input): 8(ptr) FunctionParameter
+ 15: Label
+ 34: 7(fvec4) Load 13(input)
+ 35: 7(fvec4) Load 13(input)
+ 36: 22(bvec4) FOrdEqual 34 35
+ 37: 21(bool) All 36
+ SelectionMerge 39 None
+ BranchConditional 37 38 42
+ 38: Label
+ 40: 7(fvec4) Load 13(input)
+ ReturnValue 40
+ 42: Label
+ 43: 7(fvec4) Load 13(input)
+ 44: 7(fvec4) FNegate 43
+ ReturnValue 44
+ 39: Label
+ Unreachable
+ FunctionEnd
+17(@PixelShaderFunction(vf4;): 7(fvec4) Function None 9
+ 16(input): 8(ptr) FunctionParameter
+ 18: Label
+ 55(param): 8(ptr) Variable Function
+ 78(param): 8(ptr) Variable Function
82(ii): 81(ptr) Variable Function
- 13: 7(fvec4) Load 10(input)
- 14: 7(fvec4) Load 10(input)
- 17: 16(bvec4) FOrdEqual 13 14
- 18: 15(bool) All 17
- SelectionMerge 20 None
- BranchConditional 18 19 20
- 19: Label
- 21: 7(fvec4) Load 10(input)
- ReturnValue 21
- 20: Label
- 23: 7(fvec4) Load 10(input)
- 24: 7(fvec4) Load 10(input)
- 25: 16(bvec4) FOrdEqual 23 24
- 26: 15(bool) All 25
- SelectionMerge 28 None
- BranchConditional 26 27 31
- 27: Label
- 29: 7(fvec4) Load 10(input)
- ReturnValue 29
- 31: Label
- 32: 7(fvec4) Load 10(input)
- 33: 7(fvec4) FNegate 32
- ReturnValue 33
- 28: Label
- 35: 7(fvec4) Load 10(input)
- 36: 7(fvec4) Load 10(input)
- 37: 16(bvec4) FOrdEqual 35 36
- 38: 15(bool) All 37
- SelectionMerge 40 None
- BranchConditional 38 39 40
- 39: Label
- Branch 40
- 40: Label
- 41: 7(fvec4) Load 10(input)
- 42: 7(fvec4) Load 10(input)
- 43: 16(bvec4) FOrdEqual 41 42
- 44: 15(bool) All 43
- SelectionMerge 46 None
- BranchConditional 44 45 46
- 45: Label
- Branch 46
- 46: Label
- 47: 7(fvec4) Load 10(input)
- 48: 7(fvec4) Load 10(input)
- 49: 16(bvec4) FOrdEqual 47 48
- 50: 15(bool) All 49
- SelectionMerge 52 Flatten
+ 96(ii): 95(ptr) Variable Function
+ 47: 7(fvec4) Load 16(input)
+ 48: 7(fvec4) Load 16(input)
+ 49: 22(bvec4) FOrdEqual 47 48
+ 50: 21(bool) All 49
+ SelectionMerge 52 None
BranchConditional 50 51 52
51: Label
- 53: 7(fvec4) Load 10(input)
+ 53: 7(fvec4) Load 16(input)
ReturnValue 53
52: Label
- 55: 7(fvec4) Load 10(input)
- 56: 7(fvec4) Load 10(input)
- 57: 16(bvec4) FOrdEqual 55 56
- 58: 15(bool) All 57
- SelectionMerge 60 None
- BranchConditional 58 59 63
- 59: Label
- 61: 7(fvec4) Load 10(input)
- ReturnValue 61
- 63: Label
- 64: 7(fvec4) Load 10(input)
- 65: 7(fvec4) FNegate 64
- ReturnValue 65
- 60: Label
- 71: 67(ptr) AccessChain 10(input) 70
- 72: 6(float) Load 71
- Store 68(ii) 72
- 74: 15(bool) FOrdNotEqual 72 73
- SelectionMerge 76 None
- BranchConditional 74 75 76
- 75: Label
- 77: 6(float) Load 68(ii)
- 79: 6(float) FAdd 77 78
- Store 68(ii) 79
- Branch 76
- 76: Label
- 83: 80(int) Load 82(ii)
- 85: 80(int) IAdd 83 84
- Store 82(ii) 85
- 86: 80(int) Load 82(ii)
- 87: 6(float) ConvertSToF 86
- 88: 15(bool) FOrdEqual 87 78
+ 56: 7(fvec4) Load 16(input)
+ Store 55(param) 56
+ 57: 7(fvec4) FunctionCall 11(f0(vf4;) 55(param)
+ 58: 7(fvec4) Load 16(input)
+ 59: 7(fvec4) Load 16(input)
+ 60: 22(bvec4) FOrdEqual 58 59
+ 61: 21(bool) All 60
+ SelectionMerge 63 None
+ BranchConditional 61 62 63
+ 62: Label
+ Branch 63
+ 63: Label
+ 64: 7(fvec4) Load 16(input)
+ 65: 7(fvec4) Load 16(input)
+ 66: 22(bvec4) FOrdEqual 64 65
+ 67: 21(bool) All 66
+ SelectionMerge 69 None
+ BranchConditional 67 68 69
+ 68: Label
+ Branch 69
+ 69: Label
+ 70: 7(fvec4) Load 16(input)
+ 71: 7(fvec4) Load 16(input)
+ 72: 22(bvec4) FOrdEqual 70 71
+ 73: 21(bool) All 72
+ SelectionMerge 75 Flatten
+ BranchConditional 73 74 75
+ 74: Label
+ 76: 7(fvec4) Load 16(input)
+ ReturnValue 76
+ 75: Label
+ 79: 7(fvec4) Load 16(input)
+ Store 78(param) 79
+ 80: 7(fvec4) FunctionCall 14(f1(vf4;) 78(param)
+ 85: 81(ptr) AccessChain 16(input) 84
+ 86: 6(float) Load 85
+ Store 82(ii) 86
+ 88: 21(bool) FOrdNotEqual 86 87
SelectionMerge 90 None
BranchConditional 88 89 90
89: Label
- 91: 80(int) Load 82(ii)
- 92: 80(int) IAdd 91 84
- Store 82(ii) 92
+ 91: 6(float) Load 82(ii)
+ 93: 6(float) FAdd 91 92
+ Store 82(ii) 93
Branch 90
90: Label
- 93: 7(fvec4) Undef
- ReturnValue 93
+ 97: 94(int) Load 96(ii)
+ 99: 94(int) IAdd 97 98
+ Store 96(ii) 99
+ 100: 94(int) Load 96(ii)
+ 101: 6(float) ConvertSToF 100
+ 102: 21(bool) FOrdEqual 101 92
+ SelectionMerge 104 None
+ BranchConditional 102 103 104
+ 103: Label
+ 105: 94(int) Load 96(ii)
+ 106: 94(int) IAdd 105 98
+ Store 96(ii) 106
+ Branch 104
+ 104: Label
+ 107: 7(fvec4) Undef
+ ReturnValue 107
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.imagefetch-subvec4.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.imagefetch-subvec4.comp.out
index 721aeead005..304f24b6ad7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.imagefetch-subvec4.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.imagefetch-subvec4.comp.out
@@ -72,7 +72,7 @@ local_size = (8, 8, 8)
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 39
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.implicitBool.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.implicitBool.frag.out
index c6161258110..8b5dcde7a63 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.implicitBool.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.implicitBool.frag.out
@@ -332,7 +332,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 139
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.include.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.include.vert.out
index 88ee8e784f5..4a814ae9803 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.include.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.include.vert.out
@@ -1,6 +1,6 @@
../Test/hlsl.include.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 44
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.inf.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.inf.vert.out
index 1cedc55f511..02326b3b2ee 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.inf.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.inf.vert.out
@@ -112,7 +112,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out 4-component vector of float Position)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 37
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.init.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.init.frag.out
index 1d9a5efa337..2139adb46e5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.init.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.init.frag.out
@@ -331,7 +331,7 @@ gl_FragCoord origin is upper left
0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform float a, layout( row_major std140) uniform float b, layout( row_major std140) uniform float c})
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 110
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.init2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.init2.frag.out
index 9e03de3a9c9..0ba8bd274dc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.init2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.init2.frag.out
@@ -358,7 +358,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 112
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.inoutquals.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.inoutquals.frag.out
index 42adb1a81a5..2ffa3c56d2a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.inoutquals.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.inoutquals.frag.out
@@ -214,7 +214,7 @@ using depth_any
0:? 'sampleMask' ( out 1-element array of int SampleMaskIn)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 92
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.int.dot.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.int.dot.frag.out
index afe44c85edb..a691836f028 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.int.dot.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.int.dot.frag.out
@@ -224,7 +224,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 84
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsic.frexp.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsic.frexp.frag.out
index 3a9d6fd51f8..9fb9cc55ca6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsic.frexp.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsic.frexp.frag.out
@@ -190,7 +190,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 98
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsic.frexp.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsic.frexp.vert.out
index 92bd7ef0aa9..7069ececba8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsic.frexp.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsic.frexp.vert.out
@@ -113,7 +113,7 @@ Shader version: 500
0:? Linker Objects
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 78
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.barriers.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.barriers.comp.out
index 13fe578073f..a078978e402 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.barriers.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.barriers.comp.out
@@ -52,7 +52,7 @@ local_size = (1, 1, 1)
0:? '@entryPointOutput' (layout( location=0) out float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 22
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.comp.out
index 3329c5cb75a..761a3b3dadc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.comp.out
@@ -717,7 +717,7 @@ local_size = (1, 1, 1)
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 265
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out
index f2216defb4d..483224163da 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.d3dcolortoubyte4.frag.out
@@ -74,7 +74,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 29
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.double.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.double.frag.out
index 55a102f551b..472f31b2fd6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.double.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.double.frag.out
@@ -164,7 +164,7 @@ gl_FragCoord origin is upper left
0:? 'inU1b' (layout( location=9) flat in uint)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 90
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out
index 3f69827daac..0260b937743 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.evalfns.frag.out
@@ -155,7 +155,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 80
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out
index c5619efa559..785b083df83 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out
@@ -260,7 +260,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 103
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.f3216.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.f3216.frag.out
index c447efc4205..77826b3b1d1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.f3216.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.f3216.frag.out
@@ -270,7 +270,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 106
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.frag.out
index b8add071b1a..42563828608 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.frag.out
@@ -5645,7 +5645,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 1836
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.lit.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.lit.frag.out
index 8b1454b872d..9a8cb29293b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.lit.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.lit.frag.out
@@ -118,7 +118,7 @@ gl_FragCoord origin is upper left
0:? 'm' (layout( location=2) in float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 48
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.negative.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.negative.comp.out
index 97d67198ea0..920038f2bb8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.negative.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.negative.comp.out
@@ -180,7 +180,7 @@ local_size = (1, 1, 1)
0:? 'inI0' (layout( location=3) in 4-component vector of int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 99
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.negative.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.negative.vert.out
index c2711c657e7..3b1bac8dbfb 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.negative.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.negative.vert.out
@@ -308,7 +308,7 @@ Shader version: 500
0:? 'inI0' (layout( location=3) in 4-component vector of int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 155
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out
index 84ea6f4912f..21716984305 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.down.frag.out
@@ -104,7 +104,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 50
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out
index 988432e8ff8..41b1c68c780 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out
@@ -888,7 +888,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 322
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out
index 9f8ecf2715a..143fa72845b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out
@@ -204,7 +204,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 80
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.vert.out
index 460785e7f42..28e8e41d44b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.intrinsics.vert.out
@@ -2780,7 +2780,7 @@ Shader version: 500
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 1225
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.isfinite.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.isfinite.frag.out
index 7b8287fc102..a68bd1b9328 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.isfinite.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.isfinite.frag.out
@@ -172,7 +172,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 85
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.layout.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.layout.frag.out
index 6a3eb04f591..1e4f171dab2 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.layout.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.layout.frag.out
@@ -88,7 +88,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 44
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.layoutOverride.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.layoutOverride.vert.out
index 31593aa937d..cc09653be1d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.layoutOverride.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.layoutOverride.vert.out
@@ -52,7 +52,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out 4-component vector of float Position)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 32
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out
index 8d7f70f30ed..9597762114d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out
@@ -358,7 +358,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 130
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out
index e5c0f6e17bb..f26d7dfb1ea 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out
@@ -388,7 +388,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 159
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out
index b47e037caa0..895a1096794 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out
@@ -490,7 +490,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 179
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out
index 99f36673a49..99a57a74a03 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out
@@ -452,7 +452,7 @@ Shader version: 500
0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 171
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out
index 969a99f6075..2255cf566b3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out
@@ -166,7 +166,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 72
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out
index d404b27ec49..08a1c564ccc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out
@@ -172,7 +172,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 75
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out
index 089329e091d..ebf1bd3b499 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out
@@ -562,7 +562,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 201
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out
index 7df846be0c6..297c7377239 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out
@@ -436,7 +436,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 174
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out
index 62009e175be..7ad197c8f9a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out
@@ -110,7 +110,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 57
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out
index f05b335f9c2..77344ac29c3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out
@@ -208,7 +208,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 119
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out
index c6e00ffd462..bf9ea2de097 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out
@@ -244,7 +244,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 132
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.binary.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.binary.frag.out
index 5b23a625407..1df39664326 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.binary.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.binary.frag.out
@@ -124,7 +124,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 56
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out
index 0e4f852acb8..bc469dc5b35 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.binary.vec.frag.out
@@ -254,7 +254,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 115
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.unary.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.unary.frag.out
index b342c349b4b..57247c60b57 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.unary.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logical.unary.frag.out
@@ -184,7 +184,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 84
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logicalConvert.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logicalConvert.frag.out
index 6c595f8ef12..4757f331e75 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logicalConvert.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.logicalConvert.frag.out
@@ -254,7 +254,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 50
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.loopattr.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.loopattr.frag.out
index cc0073ac43d..c6130f716c7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.loopattr.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.loopattr.frag.out
@@ -136,7 +136,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 54
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matNx1.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matNx1.frag.out
index e8e0a7b3d5f..1d92d5f323b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matNx1.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matNx1.frag.out
@@ -153,7 +153,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 77
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.bool.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.bool.frag.out
index b5543d8f25b..1362ee75945 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.bool.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.bool.frag.out
@@ -233,7 +233,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 130
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.frag.out
index 80bb2167818..ed08983353e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.frag.out
@@ -32,7 +32,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 30
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.int.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.int.frag.out
index a1854aa2100..ad0c314271b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.int.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matType.int.frag.out
@@ -399,7 +399,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 232
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matpack-1.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matpack-1.frag.out
index c02258752db..829d0b118e6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matpack-1.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matpack-1.frag.out
@@ -100,7 +100,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 39
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out
index 86e945ec28c..a5e351e1d30 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matpack-pragma.frag.out
@@ -170,7 +170,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 44
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out
index 237ce5d4ec1..7bc0c1782f6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matrixSwizzle.vert.out
@@ -677,7 +677,7 @@ Shader version: 500
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 118
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matrixindex.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matrixindex.frag.out
index 63ddc4df806..1e5fbb96c06 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matrixindex.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.matrixindex.frag.out
@@ -272,7 +272,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 83
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.max.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.max.frag.out
index db215a2c006..14cd8bf0959 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.max.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.max.frag.out
@@ -66,7 +66,7 @@ gl_FragCoord origin is upper left
0:? 'input2' (layout( location=1) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 33
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.memberFunCall.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.memberFunCall.frag.out
index 01cb99adb8e..83dc86f5311 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.memberFunCall.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.memberFunCall.frag.out
@@ -152,7 +152,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 73
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mintypes.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mintypes.frag.out
index 4824bcbed2a..2ce899ba46b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mintypes.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mintypes.frag.out
@@ -98,7 +98,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 70
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mip.operator.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mip.operator.frag.out
index 478e808f45a..4123d238af3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mip.operator.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mip.operator.frag.out
@@ -128,7 +128,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 61
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mul-truncate.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mul-truncate.frag.out
index a7de28c75c6..c337ed4bfeb 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mul-truncate.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.mul-truncate.frag.out
@@ -383,7 +383,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 190
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out
index 8bd1ad855ea..fa480922dca 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out
@@ -1,6 +1,6 @@
hlsl.multiDescriptorSet.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 92
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiEntry.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiEntry.vert.out
index c051591cc13..d6415122a58 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiEntry.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiEntry.vert.out
@@ -70,7 +70,7 @@ Shader version: 500
0:? 'Index' ( in uint VertexIndex)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 41
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiReturn.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiReturn.frag.out
index 6c41c77bed7..54b5107b17b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiReturn.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.multiReturn.frag.out
@@ -48,7 +48,7 @@ gl_FragCoord origin is upper left
0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform structure{ temp float f, temp 3-component vector of float v, temp 3X3 matrix of float m} s})
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 42
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.namespace.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.namespace.frag.out
index 8df43ad759d..9431f66d7be 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.namespace.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.namespace.frag.out
@@ -103,7 +103,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 54
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out
index 3ede90e6400..fc51e9c3d1c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.noSemantic.functionality1.comp.out
@@ -1,6 +1,6 @@
hlsl.noSemantic.functionality1.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 30
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.nonint-index.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.nonint-index.frag.out
index 131c1ec03cc..0b6bdbcd314 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.nonint-index.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.nonint-index.frag.out
@@ -88,7 +88,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 39
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.nonstaticMemberFunction.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.nonstaticMemberFunction.frag.out
index 1927a4cf26d..268e56373d9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.nonstaticMemberFunction.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.nonstaticMemberFunction.frag.out
@@ -268,7 +268,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 111
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.numericsuffixes.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.numericsuffixes.frag.out
index b1fa856faa3..b4332667e9c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.numericsuffixes.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.numericsuffixes.frag.out
@@ -192,7 +192,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 54
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.numthreads.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.numthreads.comp.out
index fd7de34b172..95cf29fdb82 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.numthreads.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.numthreads.comp.out
@@ -44,7 +44,7 @@ local_size = (1, 4, 8)
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 23
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.opaque-type-bug.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.opaque-type-bug.frag.out
index 918b462fb94..4ac7a91fafd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.opaque-type-bug.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.opaque-type-bug.frag.out
@@ -58,7 +58,7 @@ gl_FragCoord origin is upper left
0:? 'MyTexture' (layout( binding=0) uniform texture2D)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 27
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.overload.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.overload.frag.out
index 5960d3d5892..d93c305351f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.overload.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.overload.frag.out
@@ -734,7 +734,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 520
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.params.default.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.params.default.frag.out
index d1ecfa61c95..5d054bf281a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.params.default.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.params.default.frag.out
@@ -376,7 +376,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 178
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out
index 46df206164b..c3ed3a23212 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialFlattenLocal.vert.out
@@ -237,7 +237,7 @@ Shader version: 500
0:? 'pos' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 90
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out
index da832b4b01f..520a0fb23d9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialFlattenMixed.vert.out
@@ -91,7 +91,7 @@ Shader version: 500
0:? 'pos' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 43
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialInit.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialInit.frag.out
index 6881671e9bd..551c579e423 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialInit.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.partialInit.frag.out
@@ -400,7 +400,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 104
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line.frag.out
index 2c06fe91f87..0416cf4003a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line.frag.out
@@ -120,7 +120,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 42
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line2.frag.out
index 10bbf6ad8ce..338884a5405 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line2.frag.out
@@ -1,6 +1,6 @@
hlsl.pp.line2.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 80
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line3.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line3.frag.out
index 33e5d55aace..e94547cc699 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line3.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line3.frag.out
@@ -1,6 +1,6 @@
hlsl.pp.line3.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 78
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line4.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line4.frag.out
index ff92b5200d4..1ddb98bc8b8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line4.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.line4.frag.out
@@ -1,6 +1,6 @@
hlsl.pp.line4.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 115
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.vert.out
index 24ddfd1d2a6..5d4e943409d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.pp.vert.out
@@ -26,7 +26,7 @@ Shader version: 500
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int goodGlobal1, uniform int goodGlobal2})
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 13
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precedence.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precedence.frag.out
index f4c53389d79..b51be0dd346 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precedence.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precedence.frag.out
@@ -148,7 +148,7 @@ gl_FragCoord origin is upper left
0:? 'a4' (layout( location=3) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 65
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precedence2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precedence2.frag.out
index 9ce674d6b94..7dd21a62f31 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precedence2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precedence2.frag.out
@@ -114,7 +114,7 @@ gl_FragCoord origin is upper left
0:? 'a4' (layout( location=3) flat in int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 56
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precise.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precise.frag.out
index dd450690a0a..84b26481514 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precise.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.precise.frag.out
@@ -76,7 +76,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.color' (layout( location=0) noContraction out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 37
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.preprocessor.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.preprocessor.frag.out
index 3c36530e885..11ec1ad2454 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.preprocessor.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.preprocessor.frag.out
@@ -94,7 +94,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 40
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.atomic.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.atomic.frag.out
index bd781bdb200..4d56fbab431 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.atomic.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.atomic.frag.out
@@ -64,7 +64,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 36
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.binary.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.binary.frag.out
index 624a5062b3f..f63fc3eb264 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.binary.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.binary.frag.out
@@ -172,7 +172,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 83
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.vec1.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.vec1.frag.out
index b92d7409048..a6ad7ca9450 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.vec1.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promote.vec1.frag.out
@@ -80,7 +80,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 31
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promotions.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promotions.frag.out
index cb7998311dd..0a17395fe80 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promotions.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.promotions.frag.out
@@ -1582,7 +1582,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 596
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.atomics.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.atomics.frag.out
index 02aa00ca2ec..77b140b4c58 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.atomics.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.atomics.frag.out
@@ -3946,7 +3946,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 1147
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.bracket.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.bracket.frag.out
index dc60a2974b8..70f8bbe48e1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.bracket.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.bracket.frag.out
@@ -1744,7 +1744,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 607
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.register.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.register.frag.out
index 01f6c89c45a..6004512b3bd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.register.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.register.frag.out
@@ -98,7 +98,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 42
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out
index aabee5934d0..a8e33ddcc23 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out
@@ -1690,7 +1690,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 571
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out
index 089c603702e..267d7339183 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out
@@ -202,7 +202,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 63
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out
index a3b523797fe..06c24e7537c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out
@@ -1708,7 +1708,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 605
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out
index 9066a1d7752..2d0053106ed 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.array.dx10.frag.out
@@ -322,7 +322,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 146
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out
index 0940e101396..17609029df5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.basic.dx10.frag.out
@@ -550,7 +550,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 198
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.dx9.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.dx9.frag.out
index 7b3432af2ba..ce6d5464d7f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.dx9.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.dx9.frag.out
@@ -378,7 +378,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 135
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.dx9.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.dx9.vert.out
index 732b0439880..2b29c0c4f52 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.dx9.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.dx9.vert.out
@@ -154,7 +154,7 @@ Shader version: 500
0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 64
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out
index 5eadb4a638a..b641ad24736 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.offset.dx10.frag.out
@@ -364,7 +364,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 161
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out
index edc5d3143d9..54dc4679187 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.offsetarray.dx10.frag.out
@@ -274,7 +274,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 118
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out
index cc44567aa1e..8aa0e7fe62f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sample.sub-vec4.dx10.frag.out
@@ -154,7 +154,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 72
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out
index c229502d69d..aec493db5c6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.array.dx10.frag.out
@@ -358,7 +358,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 146
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out
index c840fa4e9b4..9a29c6d852e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.basic.dx10.frag.out
@@ -424,7 +424,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 170
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out
index be4b4f828a4..fb78b6c0b2e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out
@@ -401,7 +401,7 @@ using depth_any
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 161
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out
index ae33f407c22..8b7bd37393c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out
@@ -299,7 +299,7 @@ using depth_any
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 118
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out
index 54cbc0478da..8d0ff463d98 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.array.dx10.frag.out
@@ -399,7 +399,7 @@ using depth_any
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 209
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out
index 90e117312c4..c44f16bfa53 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.basic.dx10.frag.out
@@ -381,7 +381,7 @@ using depth_any
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 198
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.dualmode.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.dualmode.frag.out
index 7bcf0852993..fd5dd3e1dfd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.dualmode.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.dualmode.frag.out
@@ -85,7 +85,7 @@ gl_FragCoord origin is upper left
0:? 'g_tTex' (layout( binding=3) uniform texture1D)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 43
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out
index 29d02daba94..ca0fb8cacb5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.offset.dx10.frag.out
@@ -327,7 +327,7 @@ using depth_any
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 167
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out
index bf7b6f020eb..3d0b8fd6692 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmp.offsetarray.dx10.frag.out
@@ -339,7 +339,7 @@ using depth_any
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 178
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out
index 5b21f702d70..ce13388e066 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.array.dx10.frag.out
@@ -435,7 +435,7 @@ using depth_any
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 210
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out
index fae6899e856..4bf15ece698 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.basic.dx10.frag.out
@@ -417,7 +417,7 @@ using depth_any
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 199
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out
index 0987ea833da..b85daf03e0c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.offset.dx10.frag.out
@@ -351,7 +351,7 @@ using depth_any
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 168
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out
index 74345146831..6f460d0c4a7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplecmplevelzero.offsetarray.dx10.frag.out
@@ -363,7 +363,7 @@ using depth_any
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 179
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out
index 67b5692d4dd..b2922a1a2f8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.array.dx10.frag.out
@@ -430,7 +430,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 140
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out
index 7edb8dad842..161821eead5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.frag.out
@@ -532,7 +532,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 175
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out
index 979d48f583a..b683d98eaaf 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out
@@ -494,7 +494,7 @@ Shader version: 500
0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 166
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out
index 2620a67cd28..81fbc0bd7de 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.offset.dx10.frag.out
@@ -472,7 +472,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 166
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out
index 87ad78bedc0..01ca547f1e9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplegrad.offsetarray.dx10.frag.out
@@ -340,7 +340,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 120
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out
index 4f079507f8c..a5ff45a8e48 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.array.dx10.frag.out
@@ -358,7 +358,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 147
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out
index ee982cc2c79..6b91c173d40 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.frag.out
@@ -426,7 +426,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 172
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out
index 0a8ae49ad03..8f395ed5300 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out
@@ -386,7 +386,7 @@ Shader version: 500
0:? '@entryPointOutput.Pos' ( out 4-component vector of float Position)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 162
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out
index b007ee10bb2..10b48ecc5f1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.offset.dx10.frag.out
@@ -400,7 +400,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 162
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out
index 302bc81e6ea..5fb25a00428 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.samplelevel.offsetarray.dx10.frag.out
@@ -298,7 +298,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 119
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalar-length.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalar-length.frag.out
index aa11af554a5..ec808973244 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalar-length.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalar-length.frag.out
@@ -64,7 +64,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 30
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalar2matrix.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalar2matrix.frag.out
index 57d250eba2a..cb996f6ab9a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalar2matrix.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalar2matrix.frag.out
@@ -374,7 +374,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 96
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalarCast.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalarCast.vert.out
index 0e07c9f6621..40f0f2049ab 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalarCast.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scalarCast.vert.out
@@ -322,7 +322,7 @@ Shader version: 500
0:? '@entryPointOutput.texCoord' (layout( location=0) out 2-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 120
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scope.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scope.frag.out
index b563380e176..882158e05ce 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scope.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.scope.frag.out
@@ -102,7 +102,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 49
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.self_cast.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.self_cast.frag.out
index 9d398ed9c10..6f0e1dd687f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.self_cast.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.self_cast.frag.out
@@ -68,7 +68,7 @@ gl_FragCoord origin is upper left
0:? Linker Objects
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 32
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic-1.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic-1.vert.out
index b5e40913867..96c14a98e2d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic-1.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic-1.vert.out
@@ -242,7 +242,7 @@ Shader version: 500
0:? 'v' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 84
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic.geom.out
index 773c8aa37ad..daf4eed22f1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic.geom.out
@@ -157,7 +157,7 @@ output primitive = line_strip
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 65
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic.vert.out
index 2dbcd57ff14..144df05e178 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semantic.vert.out
@@ -210,7 +210,7 @@ Shader version: 500
0:? '@entryPointOutput.cull1' ( out 2-element array of float CullDistance)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 70
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semicolons.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semicolons.frag.out
index 94307a6a614..b45f59de2d8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semicolons.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.semicolons.frag.out
@@ -74,7 +74,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 31
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.shapeConv.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.shapeConv.frag.out
index d2838099257..8da8d48a86f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.shapeConv.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.shapeConv.frag.out
@@ -319,7 +319,7 @@ gl_FragCoord origin is upper left
0:? Linker Objects
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 127
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.shapeConvRet.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.shapeConvRet.frag.out
index fc12f7f0763..efcbe04d242 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.shapeConvRet.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.shapeConvRet.frag.out
@@ -68,7 +68,7 @@ gl_FragCoord origin is upper left
0:? 'f' (layout( location=0) in float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 35
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sin.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sin.frag.out
index b92085e41db..3128cec75b5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sin.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.sin.frag.out
@@ -52,7 +52,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 26
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.snorm.uav.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.snorm.uav.comp.out
index 4c5e6039a58..739d77d8563 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.snorm.uav.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.snorm.uav.comp.out
@@ -112,7 +112,7 @@ local_size = (16, 16, 1)
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 54
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.specConstant.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.specConstant.frag.out
index c2942e34173..fdcc2a01b2f 100755
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.specConstant.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.specConstant.frag.out
@@ -136,7 +136,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 61
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.staticFuncInit.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.staticFuncInit.frag.out
index d468cec39f9..04924ed4291 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.staticFuncInit.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.staticFuncInit.frag.out
@@ -130,7 +130,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 57
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out
index 2c7e4180054..5ae189d72cb 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out
@@ -118,7 +118,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 54
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out
index 29a14c48bd0..f5e004d2d16 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out
@@ -96,7 +96,7 @@ local_size = (64, 1, 1)
0:? 'dispatchThreadID' ( in 3-component vector of uint GlobalInvocationID)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 42
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.string.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.string.frag.out
index 9181b933aa9..6ee1945a0c5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.string.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.string.frag.out
@@ -50,7 +50,7 @@ gl_FragCoord origin is upper left
0:? 'f' (layout( location=0) in float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 24
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.stringtoken.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.stringtoken.frag.out
index 15263c58d6a..1b6e0a8c198 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.stringtoken.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.stringtoken.frag.out
@@ -70,7 +70,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 34
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.frag.out
index 192041fa3ff..a255b3673b6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.frag.out
@@ -213,7 +213,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 102
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split-1.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split-1.vert.out
index d7d6e92b120..8c25ca265fc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split-1.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split-1.vert.out
@@ -196,7 +196,7 @@ Shader version: 500
0:? 'Pos_loose' (layout( location=3) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 70
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.array.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.array.geom.out
index 081b05cbb6e..c489ffb19b3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.array.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.array.geom.out
@@ -160,7 +160,7 @@ output primitive = triangle_strip
0:? 'OutputStream.VertexID' (layout( location=2) out uint)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 82
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out
index 24c88795251..3209ab76711 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out
@@ -209,7 +209,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 66
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.call.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.call.vert.out
index 50d1d2b13fc..7c65c065ac5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.call.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.call.vert.out
@@ -214,7 +214,7 @@ Shader version: 500
0:? 'vsin.x1_in' (layout( location=2) in int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 77
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out
index 7a72a3f880d..75b5003d8fb 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out
@@ -448,7 +448,7 @@ output primitive = triangle_strip
0:? 'ts.contains_no_builtin_io.m1' (layout( location=3) out int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 100
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out
index 477fbd20049..ecb929e3be1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out
@@ -192,7 +192,7 @@ output primitive = triangle_strip
0:? 'ts.pos' ( out 4-component vector of float Position)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 67
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out
index 8bf477e691b..f516ea09f3b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out
@@ -98,7 +98,7 @@ Shader version: 500
0:? 'Pos_loose' (layout( location=1) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 45
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out
index 9938be8bda2..ae470376f1f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structIoFourWay.frag.out
@@ -162,7 +162,7 @@ using depth_greater
0:? 't.normal' (layout( location=3) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 65
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structStructName.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structStructName.frag.out
index 183dcf63976..6e767e48f2d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structStructName.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structStructName.frag.out
@@ -44,7 +44,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 22
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out
index 5d34aecee05..b654c32eed4 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structarray.flatten.frag.out
@@ -157,7 +157,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 80
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out
index f88118d6246..426214bec1a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out
@@ -170,7 +170,7 @@ output primitive = triangle_strip
0:? 'outStream.uv' (layout( location=1) out 2-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 58
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out
index 36050fb35d4..c61b1d85b62 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.append.fn.frag.out
@@ -151,7 +151,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 70
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out
index 2e5c5641bba..e213b4b4d16 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out
@@ -124,7 +124,7 @@ gl_FragCoord origin is upper left
0:? 'pos' (layout( location=0) flat in uint)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 56
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out
index e242cf6f411..d038fbd8b0d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out
@@ -475,7 +475,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 87
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out
index 26c7a06011b..e0f11319d92 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out
@@ -324,7 +324,7 @@ gl_FragCoord origin is upper left
0:? 'pos' (layout( location=0) flat in uint)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 114
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out
index b33b44d247e..34b029b846e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out
@@ -176,7 +176,7 @@ gl_FragCoord origin is upper left
0:? 'pos' (layout( location=0) flat in uint)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 78
Capability Shader
@@ -305,6 +305,5 @@ gl_FragCoord origin is upper left
66: 9(fvec4) CompositeConstruct 65 65 65 65
ReturnValue 66
45: Label
- 68: 9(fvec4) Undef
- ReturnValue 68
+ Unreachable
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out
index fbb07c29784..e1c5466a544 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out
@@ -180,7 +180,7 @@ local_size = (1, 1, 1)
0:? 'nThreadId' ( in 3-component vector of uint GlobalInvocationID)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 85
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out
index 085d9dd0600..1df588027cc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out
@@ -139,7 +139,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 78
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out
index 517b48c8db4..d25446b3aa0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out
@@ -136,7 +136,7 @@ local_size = (256, 1, 1)
0:? 'dispatchId' ( in 3-component vector of uint GlobalInvocationID)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 63
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.frag.out
index 9a67fd76a8d..38e915d95ee 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.frag.out
@@ -188,7 +188,7 @@ gl_FragCoord origin is upper left
0:? 'pos' (layout( location=0) flat in uint)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 96
Capability Shader
@@ -344,6 +344,5 @@ gl_FragCoord origin is upper left
84: 9(fvec4) CompositeConstruct 83 83 83 83
ReturnValue 84
53: Label
- 86: 9(fvec4) Undef
- ReturnValue 86
+ Unreachable
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out
index 5c73619f2cc..57f387c37d8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.hlslfun1.out
@@ -1,6 +1,6 @@
hlsl.structbuffer.incdec.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 70
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out
index 452e9eebf92..b9c1630406c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out
@@ -204,7 +204,7 @@ gl_FragCoord origin is upper left
0:? 'pos' (layout( location=0) flat in uint)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 70
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out
index ceccd5bbca5..fbd48a27ce8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out
@@ -176,7 +176,7 @@ gl_FragCoord origin is upper left
0:? 'pos' (layout( location=0) flat in uint)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 78
Capability Shader
@@ -303,6 +303,5 @@ gl_FragCoord origin is upper left
66: 9(fvec4) CompositeConstruct 65 65 65 65
ReturnValue 66
45: Label
- 68: 9(fvec4) Undef
- ReturnValue 68
+ Unreachable
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out
index 00a055e0277..a061eaced92 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out
@@ -1004,7 +1004,7 @@ gl_FragCoord origin is upper left
0:? 'pos' (layout( location=0) flat in uint)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 239
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structin.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structin.vert.out
index d7f539d0c43..ad9c0d4241c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structin.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.structin.vert.out
@@ -340,7 +340,7 @@ Shader version: 500
0:? 'e' (layout( location=5) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 94
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.subpass.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.subpass.frag.out
index ad5a013290c..8d4802815bc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.subpass.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.subpass.frag.out
@@ -430,7 +430,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 204
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.switch.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.switch.frag.out
index b72891ea5ad..b94187d7e2a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.switch.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.switch.frag.out
@@ -296,7 +296,7 @@ gl_FragCoord origin is upper left
0:? 'd' (layout( location=2) flat in int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 106
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.swizzle.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.swizzle.frag.out
index c734d509835..87ccdc7bebb 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.swizzle.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.swizzle.frag.out
@@ -77,7 +77,7 @@ gl_FragCoord origin is upper left
0:? 'AmbientColor' ( global 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 30
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.synthesizeInput.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.synthesizeInput.frag.out
index bbe97434eee..31f7b7a042b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.synthesizeInput.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.synthesizeInput.frag.out
@@ -98,7 +98,7 @@ gl_FragCoord origin is upper left
0:? 'input.no_interp' (layout( location=1) flat in uint)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 44
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.target.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.target.frag.out
index 00017968160..0ab23e8ee77 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.target.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.target.frag.out
@@ -114,7 +114,7 @@ gl_FragCoord origin is upper left
0:? 'out2' (layout( location=3) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 50
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.targetStruct1.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.targetStruct1.frag.out
index 371ce2a10be..93d787c148f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.targetStruct1.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.targetStruct1.frag.out
@@ -184,7 +184,7 @@ gl_FragCoord origin is upper left
0:? 'po' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 65
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.targetStruct2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.targetStruct2.frag.out
index e6099c9eba3..0fae66fa5bd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.targetStruct2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.targetStruct2.frag.out
@@ -184,7 +184,7 @@ gl_FragCoord origin is upper left
0:? 'po' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 65
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.templatetypes.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.templatetypes.frag.out
index 3fc5846aeb8..1dcfc46f093 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.templatetypes.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.templatetypes.frag.out
@@ -508,7 +508,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 153
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texture.struct.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texture.struct.frag.out
index 6fc542855ac..7835d322694 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texture.struct.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texture.struct.frag.out
@@ -839,7 +839,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 240
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out
index 1beb027d8c7..01f32da62f7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texture.subvec4.frag.out
@@ -356,7 +356,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 130
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texturebuffer.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texturebuffer.frag.out
index 0f761af0d00..1aa9dbc38ca 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texturebuffer.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.texturebuffer.frag.out
@@ -70,7 +70,7 @@ gl_FragCoord origin is upper left
0:? 'pos' ( in 4-component vector of float FragCoord)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 39
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.this.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.this.frag.out
index ac5fde8b95b..f32f109e7bd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.this.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.this.frag.out
@@ -240,7 +240,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 98
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tristream-append.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tristream-append.geom.out
index 94344cddfcb..514ce168788 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tristream-append.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tristream-append.geom.out
@@ -107,7 +107,7 @@ output primitive = triangle_strip
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 57
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tx.bracket.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tx.bracket.frag.out
index f5c828806b5..0e8fb5c3563 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tx.bracket.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tx.bracket.frag.out
@@ -422,7 +422,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 188
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tx.overload.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tx.overload.frag.out
index 3277954412f..8556b9e6042 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tx.overload.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.tx.overload.frag.out
@@ -134,7 +134,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 73
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.half.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.half.frag.out
index 6b5a945b9d9..719b1396392 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.half.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.half.frag.out
@@ -164,7 +164,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 60
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.identifier.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.identifier.frag.out
index 2eaa2ae461d..adec4a3f794 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.identifier.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.identifier.frag.out
@@ -266,7 +266,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 105
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.type.conversion.valid.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.type.conversion.valid.frag.out
index fc67200146d..3e511ff418b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.type.conversion.valid.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.type.type.conversion.valid.frag.out
@@ -1364,7 +1364,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 122
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out
index 8509cc4b6e0..1ca93bbe78f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.typeGraphCopy.vert.out
@@ -62,7 +62,7 @@ Shader version: 500
0:? '@entryPointOutput' (layout( location=0) out float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 28
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.typedef.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.typedef.frag.out
index 11fd10741a8..d4ab66e5910 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.typedef.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.typedef.frag.out
@@ -79,7 +79,7 @@ gl_FragCoord origin is upper left
0:? Linker Objects
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 34
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.void.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.void.frag.out
index 30edd633c8f..99de9d9e72d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.void.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.void.frag.out
@@ -54,7 +54,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 27
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out
index f1c9679b9a7..a9fc9b4ca17 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavebroadcast.comp.out
@@ -2298,7 +2298,7 @@ local_size = (32, 16, 1)
0:? 'dti' ( in 3-component vector of uint GlobalInvocationID)
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 359
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.waveprefix.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.waveprefix.comp.out
index a9a4b759198..3fc84973085 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.waveprefix.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.waveprefix.comp.out
@@ -2322,7 +2322,7 @@ local_size = (32, 16, 1)
0:? 'dti' ( in 3-component vector of uint GlobalInvocationID)
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 369
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequad.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequad.comp.out
index e7e10f198a5..e237e15a3d3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequad.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequad.comp.out
@@ -8026,7 +8026,7 @@ local_size = (32, 16, 1)
0:? 'dti' ( in 3-component vector of uint GlobalInvocationID)
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 1120
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequery.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequery.comp.out
index 67da71d6b10..09cba4d2369 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequery.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequery.comp.out
@@ -60,7 +60,7 @@ local_size = (32, 16, 1)
0:? 'data' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 28
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequery.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequery.frag.out
index 52304a6c637..8848a159644 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequery.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavequery.frag.out
@@ -72,7 +72,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 30
Capability Shader
@@ -118,6 +118,5 @@ gl_FragCoord origin is upper left
23: Label
ReturnValue 24
16: Label
- 26: 7(fvec4) Undef
- ReturnValue 26
+ Unreachable
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavereduction.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavereduction.comp.out
index 3e0d3fb5714..c31f7f5fd3f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavereduction.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavereduction.comp.out
@@ -6186,7 +6186,7 @@ local_size = (32, 16, 1)
0:? 'dti' ( in 3-component vector of uint GlobalInvocationID)
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 901
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavevote.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavevote.comp.out
index 7b671bf908b..b5c095dbfea 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavevote.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.wavevote.comp.out
@@ -204,7 +204,7 @@ local_size = (32, 16, 1)
0:? 'dti' ( in 3-component vector of uint GlobalInvocationID)
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 75
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.whileLoop.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.whileLoop.frag.out
index babc77dfd77..a63d006e353 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.whileLoop.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.whileLoop.frag.out
@@ -96,7 +96,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 52
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-1.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-1.vert.out
index c086cc07f69..08413d223cc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-1.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-1.vert.out
@@ -72,7 +72,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out 4-component vector of float Position)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 34
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-2.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-2.vert.out
index 4e6f189a56c..9e90d3b4f80 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-2.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-2.vert.out
@@ -80,7 +80,7 @@ Shader version: 500
0:? 'position' ( out 4-component vector of float Position)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 37
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-3.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-3.vert.out
index 6374551905d..29f63f12029 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-3.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/hlsl.y-negate-3.vert.out
@@ -126,7 +126,7 @@ Shader version: 500
0:? '@entryPointOutput.somethingelse' (layout( location=0) out int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 50
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/link1.vk.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/link1.vk.frag.out
index 094a50d8a28..94debe1404b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/link1.vk.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/link1.vk.frag.out
@@ -197,7 +197,7 @@ gl_FragCoord origin is upper left
0:? 's2D' (layout( binding=1) uniform highp sampler2D)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 70
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.dcefunc.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.dcefunc.frag.out
index 33ec069dbe9..e985def6d65 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.dcefunc.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.dcefunc.frag.out
@@ -1,6 +1,6 @@
remap.basic.dcefunc.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 22
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.everything.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.everything.frag.out
index 858d629e466..0f7034a88c8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.everything.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.everything.frag.out
@@ -1,6 +1,6 @@
remap.basic.everything.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 24969
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.none.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.none.frag.out
index 1ad1d74c785..44790dd4098 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.none.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.none.frag.out
@@ -1,6 +1,6 @@
remap.basic.none.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 22
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.strip.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.strip.frag.out
index 3d876d0d68b..05f16badbaa 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.strip.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.basic.strip.frag.out
@@ -1,6 +1,6 @@
remap.basic.strip.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 22
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out
index 7f180a9f5e0..b9ce55e4f4f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.everything.frag.out
@@ -2,7 +2,7 @@ remap.hlsl.sample.basic.everything.frag
WARNING: 0:4: 'immediate sampler state' : unimplemented
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 24878
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out
index 577a13501c0..71b7de010a8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.none.frag.out
@@ -2,7 +2,7 @@ remap.hlsl.sample.basic.none.frag
WARNING: 0:4: 'immediate sampler state' : unimplemented
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 198
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out
index d7aea9f9416..c65d237eaa6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.sample.basic.strip.frag.out
@@ -2,7 +2,7 @@ remap.hlsl.sample.basic.strip.frag
WARNING: 0:4: 'immediate sampler state' : unimplemented
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 198
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.templatetypes.everything.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.templatetypes.everything.frag.out
index aff0998cd05..ea390b50072 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.templatetypes.everything.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.templatetypes.everything.frag.out
@@ -1,6 +1,6 @@
remap.hlsl.templatetypes.everything.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 24954
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.templatetypes.none.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.templatetypes.none.frag.out
index 282fd2a24a0..32b4e7ba421 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.templatetypes.none.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.hlsl.templatetypes.none.frag.out
@@ -1,6 +1,6 @@
remap.hlsl.templatetypes.none.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 160
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.if.everything.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.if.everything.frag.out
index cdb007b317b..26cc3dcaa0a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.if.everything.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.if.everything.frag.out
@@ -1,6 +1,6 @@
remap.if.everything.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 22855
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.if.none.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.if.none.frag.out
index 0c8d27836d2..48e85874e79 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.if.none.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.if.none.frag.out
@@ -1,6 +1,6 @@
remap.if.none.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 25
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1a.everything.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1a.everything.frag.out
index 2f8f1c737dd..6d5ce1c0ac5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1a.everything.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1a.everything.frag.out
@@ -1,6 +1,6 @@
remap.similar_1a.everything.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 24916
Capability Shader
@@ -88,7 +88,7 @@ remap.similar_1a.everything.frag
22102: 649(ptr) Variable Function
24151: 12(int) Load 4408
13868: 9(bool) SGreaterThan 24151 2577
- SelectionMerge 22309 None
+ SelectionMerge 14966 None
BranchConditional 13868 9492 17416
9492: Label
15624: 12(int) Load 4408
@@ -109,7 +109,6 @@ remap.similar_1a.everything.frag
10505: 12(int) IAdd 11462 21176
14626: 13(float) ConvertSToF 10505
ReturnValue 14626
- 22309: Label
- 6429: 13(float) Undef
- ReturnValue 6429
+ 14966: Label
+ Unreachable
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1a.none.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1a.none.frag.out
index 80d35c3fa1e..457f1bef23f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1a.none.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1a.none.frag.out
@@ -1,6 +1,6 @@
remap.similar_1a.none.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 86
Capability Shader
@@ -124,6 +124,5 @@ remap.similar_1a.none.frag
68: 8(float) ConvertSToF 67
ReturnValue 68
43: Label
- 70: 8(float) Undef
- ReturnValue 70
+ Unreachable
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1b.everything.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1b.everything.frag.out
index c76c4bfa06a..67425c67a98 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1b.everything.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1b.everything.frag.out
@@ -1,6 +1,6 @@
remap.similar_1b.everything.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 24916
Capability Shader
@@ -93,7 +93,7 @@ remap.similar_1b.everything.frag
22102: 649(ptr) Variable Function
24151: 12(int) Load 4408
13868: 9(bool) SGreaterThan 24151 2577
- SelectionMerge 22309 None
+ SelectionMerge 14966 None
BranchConditional 13868 10822 17416
10822: Label
22680: 12(int) Load 4408
@@ -115,7 +115,6 @@ remap.similar_1b.everything.frag
10505: 12(int) IAdd 11462 21176
14626: 13(float) ConvertSToF 10505
ReturnValue 14626
- 22309: Label
- 6429: 13(float) Undef
- ReturnValue 6429
+ 14966: Label
+ Unreachable
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1b.none.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1b.none.frag.out
index 0a854d6ea25..fe021e02091 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1b.none.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.similar_1b.none.frag.out
@@ -1,6 +1,6 @@
remap.similar_1b.none.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 91
Capability Shader
@@ -130,6 +130,5 @@ remap.similar_1b.none.frag
73: 8(float) ConvertSToF 72
ReturnValue 73
46: Label
- 75: 8(float) Undef
- ReturnValue 75
+ Unreachable
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.specconst.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.specconst.comp.out
index ee049f43099..80d13b29c22 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.specconst.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.specconst.comp.out
@@ -1,6 +1,6 @@
remap.specconst.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 16104
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.switch.everything.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.switch.everything.frag.out
index ffd64d4f6ae..2362f671334 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.switch.everything.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.switch.everything.frag.out
@@ -3,7 +3,7 @@ WARNING: 0:5: '' : all default precisions are highp; use precision statements to
"precision mediump int; precision highp float;"
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 23990
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.switch.none.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.switch.none.frag.out
index 4dd78977a47..f8737b947e9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.switch.none.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.switch.none.frag.out
@@ -3,7 +3,7 @@ WARNING: 0:5: '' : all default precisions are highp; use precision statements to
"precision mediump int; precision highp float;"
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 48
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.uniformarray.everything.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.uniformarray.everything.frag.out
index c1f306e1090..40429f24a5a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.uniformarray.everything.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.uniformarray.everything.frag.out
@@ -1,6 +1,6 @@
remap.uniformarray.everything.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 25030
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.uniformarray.none.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.uniformarray.none.frag.out
index 1087e5e7a7f..42d55b97b55 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.uniformarray.none.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/remap.uniformarray.none.frag.out
@@ -1,6 +1,6 @@
remap.uniformarray.none.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 53
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/size b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/size
index 48487765434..47364a5804d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/size
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/size
@@ -1 +1 @@
-388096 ../build/install/bin/glslangValidator.exe
+396288 ../build/install/bin/glslangValidator.exe
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ssbo.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ssbo.vert.out
index cffc3a4feea..105bbdb8d65 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ssbo.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ssbo.vert.out
@@ -1,6 +1,6 @@
spv.1.3.8bitstorage-ssbo.vert
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 28
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ubo.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ubo.vert.out
index 7bdda4afd5e..77c156583e5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ubo.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ubo.vert.out
@@ -1,6 +1,6 @@
spv.1.3.8bitstorage-ubo.vert
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 29
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.coopmat.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.coopmat.comp.out
index c1838479787..29d914ff0d0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.coopmat.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.3.coopmat.comp.out
@@ -1,6 +1,6 @@
spv.1.3.coopmat.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 52
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.LoopControl.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.LoopControl.frag.out
index c9a605b950a..008ef4706ef 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.LoopControl.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.LoopControl.frag.out
@@ -3,7 +3,7 @@ WARNING: 0:15: 'min_iterations' : expected a single integer argument
WARNING: 0:15: 'max_iterations' : expected a single integer argument
// Module Version 10400
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 54
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.NonWritable.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.NonWritable.frag.out
index 3f54661d3b2..0207ed2294f 100755
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.NonWritable.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.NonWritable.frag.out
@@ -1,6 +1,6 @@
spv.1.4.NonWritable.frag
// Module Version 10400
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 38
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogical.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogical.comp.out
index d80bfee7cab..53e672fad15 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogical.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogical.comp.out
@@ -1,6 +1,6 @@
spv.1.4.OpCopyLogical.comp
// Module Version 10400
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 65
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogical.funcall.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogical.funcall.frag.out
index 85bfdb26869..d7509b1584a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogical.funcall.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogical.funcall.frag.out
@@ -1,6 +1,6 @@
spv.1.4.OpCopyLogical.funcall.frag
// Module Version 10400
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 60
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogicalBool.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogicalBool.comp.out
index f2f85c10b74..2b60625f4b6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogicalBool.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpCopyLogicalBool.comp.out
@@ -1,6 +1,6 @@
spv.1.4.OpCopyLogicalBool.comp
// Module Version 10400
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 135
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpEntryPoint.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpEntryPoint.frag.out
index 694cff046f9..f06960c8a09 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpEntryPoint.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpEntryPoint.frag.out
@@ -1,6 +1,6 @@
spv.1.4.OpEntryPoint.frag
// Module Version 10400
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 64
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpSelect.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpSelect.frag.out
index 31797170d98..6ba00a4af8d 100755
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpSelect.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.OpSelect.frag.out
@@ -1,6 +1,6 @@
spv.1.4.OpSelect.frag
// Module Version 10400
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 98
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.constructComposite.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.constructComposite.comp.out
index 5c0f5cfa9b0..e514286957f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.constructComposite.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.constructComposite.comp.out
@@ -1,6 +1,6 @@
spv.1.4.constructComposite.comp
// Module Version 10400
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 27
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.image.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.image.frag.out
index 4adfd4bdd31..98ffdcbcc49 100755
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.image.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.image.frag.out
@@ -1,6 +1,6 @@
spv.1.4.image.frag
// Module Version 10400
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 104
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.sparseTexture.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.sparseTexture.frag.out
index 292335ed780..3b566c7cf4f 100755
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.sparseTexture.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.sparseTexture.frag.out
@@ -1,6 +1,6 @@
spv.1.4.sparseTexture.frag
// Module Version 10400
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 213
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.texture.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.texture.frag.out
index 7c2de0bb1b1..da3a24f51f0 100755
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.texture.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.1.4.texture.frag.out
@@ -1,6 +1,6 @@
spv.1.4.texture.frag
// Module Version 10400
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 79
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.100ops.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.100ops.frag.out
index 8f656ebb5c9..d2b8f3e8042 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.100ops.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.100ops.frag.out
@@ -1,6 +1,6 @@
spv.100ops.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 49
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.130.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.130.frag.out
index 67e2b824619..ca1f9e380e8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.130.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.130.frag.out
@@ -3,7 +3,7 @@ WARNING: 0:31: '#extension' : extension is only partially supported: GL_ARB_gpu_
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 205
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.140.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.140.frag.out
index abfd13a9167..45b7510680f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.140.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.140.frag.out
@@ -1,7 +1,7 @@
spv.140.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 96
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.150.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.150.geom.out
index 19bd72530fa..ab0584621c4 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.150.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.150.geom.out
@@ -1,6 +1,6 @@
spv.150.geom
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 71
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.150.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.150.vert.out
index db058fa348b..9e1c9f4972b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.150.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.150.vert.out
@@ -1,6 +1,6 @@
spv.150.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 63
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage-int.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage-int.frag.out
index c1aacb8e7a8..80733cec665 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage-int.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage-int.frag.out
@@ -1,6 +1,6 @@
spv.16bitstorage-int.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 171
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage-uint.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage-uint.frag.out
index ba2e0c6eba7..d4b1b7597ad 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage-uint.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage-uint.frag.out
@@ -1,6 +1,6 @@
spv.16bitstorage-uint.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 173
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage.frag.out
index 5530cf464dc..c73eb599747 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitstorage.frag.out
@@ -1,6 +1,6 @@
spv.16bitstorage.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 173
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitxfb.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitxfb.vert.out
index 7d989c57e72..96cff799c73 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitxfb.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.16bitxfb.vert.out
@@ -1,6 +1,6 @@
spv.16bitxfb.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 59
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300BuiltIns.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300BuiltIns.vert.out
index ee2c236e783..2633645cbd3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300BuiltIns.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300BuiltIns.vert.out
@@ -1,6 +1,6 @@
spv.300BuiltIns.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 42
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layout.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layout.frag.out
index 10a6d00eb1d..db069558dd3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layout.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layout.frag.out
@@ -1,6 +1,6 @@
spv.300layout.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 37
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layout.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layout.vert.out
index 4d4d7ea4371..c97d217a07a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layout.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layout.vert.out
@@ -1,6 +1,6 @@
spv.300layout.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 163
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layoutp.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layoutp.vert.out
index e12041fc356..2b1ef83eefe 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layoutp.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.300layoutp.vert.out
@@ -1,6 +1,6 @@
spv.300layoutp.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 115
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.310.bitcast.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.310.bitcast.frag.out
index d7a244f8628..e4f62b49f82 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.310.bitcast.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.310.bitcast.frag.out
@@ -1,6 +1,6 @@
spv.310.bitcast.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 153
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.310.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.310.comp.out
index bb8e6a7b1d2..3b90d419471 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.310.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.310.comp.out
@@ -1,6 +1,6 @@
spv.310.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 72
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.320.meshShaderUserDefined.mesh.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.320.meshShaderUserDefined.mesh.out
index 20b6fa24226..6881084ae7c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.320.meshShaderUserDefined.mesh.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.320.meshShaderUserDefined.mesh.out
@@ -1,6 +1,6 @@
spv.320.meshShaderUserDefined.mesh
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 140
Capability MeshShadingNV
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.330.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.330.geom.out
index 1ccbfb6c4c6..79e03b6fa24 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.330.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.330.geom.out
@@ -1,6 +1,6 @@
spv.330.geom
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 32
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.frag.nanclamp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.frag.nanclamp.out
index 5305ee4c3a8..448aa5efaee 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.frag.nanclamp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.frag.nanclamp.out
@@ -1,6 +1,6 @@
spv.400.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 1118
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.frag.out
index 5433e4d385d..b2f4a167ee3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.frag.out
@@ -1,7 +1,7 @@
spv.400.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 1118
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.tesc.out
index ce7c3afa4b8..e84b420ed2d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.tesc.out
@@ -1,6 +1,6 @@
spv.400.tesc
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 92
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.tese.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.tese.out
index 43b6a9159a4..5705fbd3de3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.tese.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.400.tese.out
@@ -1,6 +1,6 @@
spv.400.tese
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 96
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.420.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.420.geom.out
index fa91dd81d81..c75ae5d6194 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.420.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.420.geom.out
@@ -1,6 +1,6 @@
spv.420.geom
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 72
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.430.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.430.frag.out
index 330489f2df6..96ab1e960e4 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.430.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.430.frag.out
@@ -1,6 +1,6 @@
spv.430.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 24
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.430.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.430.vert.out
index 1cd9e619e73..89e5b16e269 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.430.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.430.vert.out
@@ -1,6 +1,6 @@
spv.430.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 66
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.geom.out
index 7713e54e0fc..1e7e8c50f08 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.geom.out
@@ -1,6 +1,6 @@
spv.450.geom
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 31
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.noRedecl.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.noRedecl.tesc.out
index b23061da4d4..31c7b4da90f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.noRedecl.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.noRedecl.tesc.out
@@ -1,6 +1,6 @@
spv.450.noRedecl.tesc
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 21
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.tesc.out
index 35653fdef77..0c22d9a756a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.450.tesc.out
@@ -1,6 +1,6 @@
spv.450.tesc
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 45
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.comp.out
index 6ebf49fa931..09256746260 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.comp.out
@@ -1,6 +1,6 @@
spv.460.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 15
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.frag.out
index 04393fbef2c..067bd43cd61 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.frag.out
@@ -1,6 +1,6 @@
spv.460.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 32
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.vert.out
index c2ef3024155..a73b7e1dc3b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.460.vert.out
@@ -1,6 +1,6 @@
spv.460.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 20
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-int.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-int.frag.out
index 47e854f2d90..54a47afa1f7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-int.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-int.frag.out
@@ -1,6 +1,6 @@
spv.8bitstorage-int.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 171
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-ssbo.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-ssbo.vert.out
index d0379fa53ac..274639b1419 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-ssbo.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-ssbo.vert.out
@@ -1,6 +1,6 @@
spv.8bitstorage-ssbo.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 28
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-ubo.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-ubo.vert.out
index c5ec89d4d48..af95a7633b4 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-ubo.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-ubo.vert.out
@@ -1,6 +1,6 @@
spv.8bitstorage-ubo.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 29
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out
index a66c6a3bec0..65658825f3f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out
@@ -1,6 +1,6 @@
spv.8bitstorage-uint.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 173
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.AnyHitShader.rahit.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.AnyHitShader.rahit.out
index 92b31d08496..d044b97307a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.AnyHitShader.rahit.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.AnyHitShader.rahit.out
@@ -1,6 +1,6 @@
spv.AnyHitShader.rahit
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 81
Capability RayTracingNV
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.AofA.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.AofA.frag.out
index 7433f177ab4..c9f8b469efc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.AofA.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.AofA.frag.out
@@ -3,7 +3,7 @@ WARNING: 0:6: '[][]' : Generating SPIR-V array-of-arrays, but Vulkan only suppor
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 104
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ClosestHitShader.rchit.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ClosestHitShader.rchit.out
index b461462ee49..482008dc84d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ClosestHitShader.rchit.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ClosestHitShader.rchit.out
@@ -1,6 +1,6 @@
spv.ClosestHitShader.rchit
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 88
Capability RayTracingNV
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.GeometryShaderPassthrough.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.GeometryShaderPassthrough.geom.out
index 5db845e591e..7e62c575772 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.GeometryShaderPassthrough.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.GeometryShaderPassthrough.geom.out
@@ -1,6 +1,6 @@
spv.GeometryShaderPassthrough.geom
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 15
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.IntersectShader.rint.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.IntersectShader.rint.out
index cbb70cd68d5..4fe4edf0413 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.IntersectShader.rint.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.IntersectShader.rint.out
@@ -1,6 +1,6 @@
spv.IntersectShader.rint
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 71
Capability RayTracingNV
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.MissShader.rmiss.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.MissShader.rmiss.out
index 0ad3341a418..37fd3bda0dc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.MissShader.rmiss.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.MissShader.rmiss.out
@@ -1,6 +1,6 @@
spv.MissShader.rmiss
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 60
Capability RayTracingNV
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.OVR_multiview.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.OVR_multiview.vert.out
index 7013cedd75b..66168dce511 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.OVR_multiview.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.OVR_multiview.vert.out
@@ -1,6 +1,6 @@
spv.OVR_multiview.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 27
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.Operations.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.Operations.frag.out
index 4113ddf1199..22aeecd9c4c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.Operations.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.Operations.frag.out
@@ -1,6 +1,6 @@
spv.Operations.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 532
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayCallable.rcall.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayCallable.rcall.out
index e399e634263..31df5d1b1b3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayCallable.rcall.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayCallable.rcall.out
@@ -1,6 +1,6 @@
spv.RayCallable.rcall
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 30
Capability RayTracingNV
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayConstants.rgen.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayConstants.rgen.out
index d939acfbc61..033e545515f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayConstants.rgen.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayConstants.rgen.out
@@ -1,6 +1,6 @@
spv.RayConstants.rgen
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 27
Capability RayTracingNV
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShader.rgen.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShader.rgen.out
index 91f37e5c8c4..59eabd0dc7a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShader.rgen.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShader.rgen.out
@@ -1,6 +1,6 @@
spv.RayGenShader.rgen
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 54
Capability RayTracingNV
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShader11.rgen.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShader11.rgen.out
index 8f2c52b05ed..2d49b0fc757 100755
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShader11.rgen.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShader11.rgen.out
@@ -1,6 +1,6 @@
spv.RayGenShader11.rgen
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 53
Capability RayTracingNV
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShaderArray.rgen.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShaderArray.rgen.out
index 7430756928f..e9143049d8a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShaderArray.rgen.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.RayGenShaderArray.rgen.out
@@ -1,6 +1,6 @@
spv.RayGenShaderArray.rgen
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 89
Capability ShaderNonUniformEXT
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.accessChain.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.accessChain.frag.out
index bf878292fa7..c5c71a5cfc4 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.accessChain.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.accessChain.frag.out
@@ -1,6 +1,6 @@
spv.accessChain.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 222
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.aggOps.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.aggOps.frag.out
index f388e8ea2de..976c747aa79 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.aggOps.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.aggOps.frag.out
@@ -3,7 +3,7 @@ WARNING: 0:4: '' : all default precisions are highp; use precision statements to
"precision mediump int; precision highp float;"
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 215
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.always-discard.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.always-discard.frag.out
index 8074cf82643..fb4529e68e2 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.always-discard.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.always-discard.frag.out
@@ -1,6 +1,6 @@
spv.always-discard.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 84
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.always-discard2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.always-discard2.frag.out
index e3fa43a394d..2d8f66eff85 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.always-discard2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.always-discard2.frag.out
@@ -1,6 +1,6 @@
spv.always-discard2.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 40
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.arbPostDepthCoverage.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.arbPostDepthCoverage.frag.out
index f41c0121233..d62c677511c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.arbPostDepthCoverage.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.arbPostDepthCoverage.frag.out
@@ -1,6 +1,6 @@
spv.arbPostDepthCoverage.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 18
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.atomic.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.atomic.comp.out
index 3dd88f398a4..08bd83023e9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.atomic.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.atomic.comp.out
@@ -1,6 +1,6 @@
spv.atomic.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 74
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.atomicInt64.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.atomicInt64.comp.out
index 9c66aecc85f..5ac910e3e54 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.atomicInt64.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.atomicInt64.comp.out
@@ -1,6 +1,6 @@
spv.atomicInt64.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 149
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.barrier.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.barrier.vert.out
index b9369f27913..ffc2eaac2c2 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.barrier.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.barrier.vert.out
@@ -1,6 +1,6 @@
spv.barrier.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 24
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bitCast.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bitCast.frag.out
index a687b8da2e4..f590ec7d721 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bitCast.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bitCast.frag.out
@@ -1,6 +1,6 @@
spv.bitCast.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 172
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bool.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bool.vert.out
index 31eb54cf821..3e5a1905619 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bool.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bool.vert.out
@@ -1,6 +1,6 @@
spv.bool.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 46
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.boolInBlock.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.boolInBlock.frag.out
index e86ca6b3f78..b0a4023a361 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.boolInBlock.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.boolInBlock.frag.out
@@ -1,6 +1,6 @@
spv.boolInBlock.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 102
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.branch-return.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.branch-return.vert.out
index ca44724587b..3aacca7ef0d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.branch-return.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.branch-return.vert.out
@@ -1,6 +1,6 @@
spv.branch-return.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 38
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.buffer.autoassign.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.buffer.autoassign.frag.out
index 507318f7a6b..e526adafba1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.buffer.autoassign.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.buffer.autoassign.frag.out
@@ -1,6 +1,6 @@
spv.buffer.autoassign.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 50
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle1.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle1.frag.out
index 8457eaca810..9d1818825b9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle1.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle1.frag.out
@@ -1,12 +1,12 @@
spv.bufferhandle1.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 52
Capability Shader
Capability VulkanMemoryModelKHR
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
Extension "SPV_KHR_vulkan_memory_model"
1: ExtInstImport "GLSL.std.450"
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle10.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle10.frag.out
index 871b0177b89..5064c7e7f70 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle10.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle10.frag.out
@@ -1,12 +1,12 @@
spv.bufferhandle10.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 40
Capability Shader
Capability VulkanMemoryModelKHR
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
Extension "SPV_KHR_vulkan_memory_model"
1: ExtInstImport "GLSL.std.450"
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle11.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle11.frag.out
index 6f3cbe158d8..783577c96b5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle11.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle11.frag.out
@@ -3,14 +3,14 @@ WARNING: 0:6: '' : all default precisions are highp; use precision statements to
"precision mediump int; precision highp float;"
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 61
Capability Shader
Capability StorageBuffer8BitAccess
Capability PhysicalStorageBufferAddressesEXT
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_8bit_storage"
- Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle12.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle12.frag.out
index 1808c5fad80..9f0f4fb7947 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle12.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle12.frag.out
@@ -3,14 +3,14 @@ WARNING: 0:6: '' : all default precisions are highp; use precision statements to
"precision mediump int; precision highp float;"
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 183
Capability Shader
Capability StorageUniformBufferBlock16
Capability PhysicalStorageBufferAddressesEXT
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_16bit_storage"
- Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle13.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle13.frag.out
index 7b83210a2db..516b9fc4829 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle13.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle13.frag.out
@@ -1,11 +1,11 @@
spv.bufferhandle13.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 58
Capability Shader
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle14.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle14.frag.out
index b44391a3e6e..440a0329371 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle14.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle14.frag.out
@@ -1,11 +1,11 @@
spv.bufferhandle14.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 46
Capability Shader
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main"
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle15.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle15.frag.out
index 2eae28b2962..f018e21c075 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle15.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle15.frag.out
@@ -3,12 +3,12 @@ WARNING: 0:16: '' : all default precisions are highp; use precision statements t
"precision mediump int; precision highp float;"
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 60
Capability Shader
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle16.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle16.frag.out
index 2355591837a..cfc6f051e24 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle16.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle16.frag.out
@@ -1,12 +1,12 @@
spv.bufferhandle16.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 48
Capability Shader
Capability Int64
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main"
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle18.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle18.frag.out
index 6d2178df700..0a5f6fb518e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle18.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle18.frag.out
@@ -1,12 +1,12 @@
spv.bufferhandle18.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 196
Capability Shader
Capability Int64
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main"
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle2.frag.out
index 728bee38358..6c43fbe7552 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle2.frag.out
@@ -1,11 +1,11 @@
spv.bufferhandle2.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 45
Capability Shader
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle3.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle3.frag.out
index b888fe422a6..ba50eb1a26b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle3.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle3.frag.out
@@ -1,11 +1,11 @@
spv.bufferhandle3.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 50
Capability Shader
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle4.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle4.frag.out
index e5a4f5d3ce3..7dff09cb4b9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle4.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle4.frag.out
@@ -1,11 +1,11 @@
spv.bufferhandle4.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 61
Capability Shader
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle5.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle5.frag.out
index c663c42d7f6..209459b9cea 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle5.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle5.frag.out
@@ -1,11 +1,11 @@
spv.bufferhandle5.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 22
Capability Shader
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main"
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle6.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle6.frag.out
index 2a9b484cb77..b373a2f1876 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle6.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle6.frag.out
@@ -1,11 +1,11 @@
spv.bufferhandle6.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 165
Capability Shader
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle7.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle7.frag.out
index c5bbc5d4761..9beaee18030 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle7.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle7.frag.out
@@ -1,11 +1,11 @@
spv.bufferhandle7.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 24
Capability Shader
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle8.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle8.frag.out
index 3219734af71..95abfd94cb5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle8.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle8.frag.out
@@ -1,11 +1,11 @@
spv.bufferhandle8.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 27
Capability Shader
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle9.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle9.frag.out
index df2b677c700..b452acc28ed 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle9.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandle9.frag.out
@@ -1,12 +1,12 @@
spv.bufferhandle9.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 56
Capability Shader
Capability Int64
Capability PhysicalStorageBufferAddressesEXT
- Extension "SPV_KHR_physical_storage_buffer"
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandleUvec2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandleUvec2.frag.out
index 1e0cbcd305c..b1944cf0623 100755
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandleUvec2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.bufferhandleUvec2.frag.out
@@ -1,6 +1,6 @@
spv.bufferhandleUvec2.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 71
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.builtInXFB.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.builtInXFB.vert.out
index 556a698ca15..7a8b17ae63c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.builtInXFB.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.builtInXFB.vert.out
@@ -1,6 +1,6 @@
spv.builtInXFB.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 21
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.computeShaderDerivatives.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.computeShaderDerivatives.comp.out
index d332f352509..052ac06cea8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.computeShaderDerivatives.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.computeShaderDerivatives.comp.out
@@ -1,6 +1,6 @@
spv.computeShaderDerivatives.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 212
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.computeShaderDerivatives2.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.computeShaderDerivatives2.comp.out
index be1919bd200..3ef5ee48157 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.computeShaderDerivatives2.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.computeShaderDerivatives2.comp.out
@@ -1,6 +1,6 @@
spv.computeShaderDerivatives2.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 212
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conditionalDemote.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conditionalDemote.frag.out
index 10f2c23e6b1..f25517605a5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conditionalDemote.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conditionalDemote.frag.out
@@ -1,6 +1,6 @@
spv.conditionalDemote.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 38
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conditionalDiscard.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conditionalDiscard.frag.out
index 2f2dcf266c3..a05afb9394e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conditionalDiscard.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conditionalDiscard.frag.out
@@ -1,6 +1,6 @@
spv.conditionalDiscard.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 36
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constConstruct.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constConstruct.vert.out
index 5922b34abfd..d3250a1a4d3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constConstruct.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constConstruct.vert.out
@@ -1,7 +1,7 @@
spv.constConstruct.vert
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 150
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constStruct.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constStruct.vert.out
index d04f33d1b29..1fce72897af 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constStruct.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constStruct.vert.out
@@ -1,6 +1,6 @@
spv.constStruct.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 23
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constructComposite.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constructComposite.comp.out
index 6a23ecb2be6..f1179d47cff 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constructComposite.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.constructComposite.comp.out
@@ -1,6 +1,6 @@
spv.constructComposite.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 29
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out
index c7082326a8a..c222f25c21f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.controlFlowAttributes.frag.out
@@ -1,16 +1,16 @@
spv.controlFlowAttributes.frag
-WARNING: 0:20: 'unroll' : expected no arguments
-WARNING: 0:21: 'dont_unroll' : expected no arguments
-WARNING: 0:22: 'dependency_infinite' : expected no arguments
-WARNING: 0:23: 'dependency_length' : expected a single integer argument
-WARNING: 0:24: '' : attribute with arguments not recognized, skipping
-WARNING: 0:25: '' : attribute with arguments not recognized, skipping
-WARNING: 0:26: '' : attribute with arguments not recognized, skipping
+WARNING: 0:27: 'unroll' : expected no arguments
+WARNING: 0:28: 'dont_unroll' : expected no arguments
+WARNING: 0:29: 'dependency_infinite' : expected no arguments
+WARNING: 0:30: 'dependency_length' : expected a single integer argument
+WARNING: 0:31: '' : attribute with arguments not recognized, skipping
+WARNING: 0:32: '' : attribute with arguments not recognized, skipping
+WARNING: 0:33: '' : attribute with arguments not recognized, skipping
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
-// Id's are bound by 118
+// Generated by (magic number): 80008
+// Id's are bound by 123
Capability Shader
1: ExtInstImport "GLSL.std.450"
@@ -20,220 +20,231 @@ Validation failed
Source GLSL 450
SourceExtension "GL_EXT_control_flow_attributes"
Name 4 "main"
- Name 8 "i"
- Name 36 "i"
- Name 47 "cond"
- Name 60 "i"
- Name 79 "i"
+ Name 6 "f0("
+ Name 8 "f1("
+ Name 23 "i"
+ Name 41 "i"
+ Name 52 "cond"
+ Name 65 "i"
+ Name 84 "i"
2: TypeVoid
3: TypeFunction 2
- 6: TypeInt 32 1
- 7: TypePointer Function 6(int)
- 9: 6(int) Constant 0
- 16: 6(int) Constant 8
- 17: TypeBool
- 20: 6(int) Constant 1
- 31: 17(bool) ConstantTrue
- 46: TypePointer Private 17(bool)
- 47(cond): 46(ptr) Variable Private
- 54: 17(bool) ConstantFalse
- 55: 6(int) Constant 3
+ 19: TypeBool
+ 20: 19(bool) ConstantTrue
+ 21: TypeInt 32 1
+ 22: TypePointer Function 21(int)
+ 24: 21(int) Constant 0
+ 31: 21(int) Constant 8
+ 34: 21(int) Constant 1
+ 51: TypePointer Private 19(bool)
+ 52(cond): 51(ptr) Variable Private
+ 59: 19(bool) ConstantFalse
+ 60: 21(int) Constant 3
4(main): 2 Function None 3
5: Label
- 8(i): 7(ptr) Variable Function
- 36(i): 7(ptr) Variable Function
- 60(i): 7(ptr) Variable Function
- 79(i): 7(ptr) Variable Function
- Store 8(i) 9
- Branch 10
- 10: Label
- LoopMerge 12 13 Unroll
- Branch 14
- 14: Label
- 15: 6(int) Load 8(i)
- 18: 17(bool) SLessThan 15 16
- BranchConditional 18 11 12
- 11: Label
- Branch 13
- 13: Label
- 19: 6(int) Load 8(i)
- 21: 6(int) IAdd 19 20
- Store 8(i) 21
- Branch 10
- 12: Label
- Branch 22
- 22: Label
- LoopMerge 24 25 DontUnroll
- Branch 23
- 23: Label
+ 23(i): 22(ptr) Variable Function
+ 41(i): 22(ptr) Variable Function
+ 65(i): 22(ptr) Variable Function
+ 84(i): 22(ptr) Variable Function
+ Store 23(i) 24
Branch 25
25: Label
- Branch 22
- 24: Label
- Branch 26
- 26: Label
- LoopMerge 28 29 DontUnroll
- Branch 30
- 30: Label
- BranchConditional 31 27 28
- 27: Label
- Branch 29
- 29: Label
- Branch 26
- 28: Label
- Branch 32
- 32: Label
- LoopMerge 34 35 DependencyInfinite
- Branch 33
- 33: Label
- Branch 35
- 35: Label
- BranchConditional 31 32 34
- 34: Label
- Store 36(i) 9
+ LoopMerge 27 28 Unroll
+ Branch 29
+ 29: Label
+ 30: 21(int) Load 23(i)
+ 32: 19(bool) SLessThan 30 31
+ BranchConditional 32 26 27
+ 26: Label
+ Branch 28
+ 28: Label
+ 33: 21(int) Load 23(i)
+ 35: 21(int) IAdd 33 34
+ Store 23(i) 35
+ Branch 25
+ 27: Label
+ 36: 2 FunctionCall 6(f0()
Branch 37
37: Label
- LoopMerge 39 40 DependencyLength 4
- Branch 41
- 41: Label
- 42: 6(int) Load 36(i)
- 43: 17(bool) SLessThan 42 16
- BranchConditional 43 38 39
- 38: Label
- Branch 40
- 40: Label
- 44: 6(int) Load 36(i)
- 45: 6(int) IAdd 44 20
- Store 36(i) 45
- Branch 37
+ LoopMerge 39 40 DependencyInfinite
+ Branch 38
+ 38: Label
+ Branch 40
+ 40: Label
+ BranchConditional 20 37 39
39: Label
- 48: 17(bool) Load 47(cond)
- SelectionMerge 50 Flatten
- BranchConditional 48 49 50
- 49: Label
- Branch 50
- 50: Label
- 51: 17(bool) Load 47(cond)
- SelectionMerge 53 DontFlatten
- BranchConditional 51 52 53
- 52: Label
- Store 47(cond) 54
- Branch 53
- 53: Label
- SelectionMerge 57 DontFlatten
- Switch 55 57
- case 3: 56
- 56: Label
- Branch 57
- 57: Label
- Store 60(i) 9
- Branch 61
- 61: Label
- LoopMerge 63 64 None
- Branch 65
- 65: Label
- 66: 6(int) Load 60(i)
- 67: 17(bool) SLessThan 66 16
- BranchConditional 67 62 63
- 62: Label
- Branch 64
- 64: Label
- 68: 6(int) Load 60(i)
- 69: 6(int) IAdd 68 20
- Store 60(i) 69
- Branch 61
- 63: Label
+ Store 41(i) 24
+ Branch 42
+ 42: Label
+ LoopMerge 44 45 DependencyLength 4
+ Branch 46
+ 46: Label
+ 47: 21(int) Load 41(i)
+ 48: 19(bool) SLessThan 47 31
+ BranchConditional 48 43 44
+ 43: Label
+ Branch 45
+ 45: Label
+ 49: 21(int) Load 41(i)
+ 50: 21(int) IAdd 49 34
+ Store 41(i) 50
+ Branch 42
+ 44: Label
+ 53: 19(bool) Load 52(cond)
+ SelectionMerge 55 Flatten
+ BranchConditional 53 54 55
+ 54: Label
+ Branch 55
+ 55: Label
+ 56: 19(bool) Load 52(cond)
+ SelectionMerge 58 DontFlatten
+ BranchConditional 56 57 58
+ 57: Label
+ Store 52(cond) 59
+ Branch 58
+ 58: Label
+ SelectionMerge 62 DontFlatten
+ Switch 60 62
+ case 3: 61
+ 61: Label
+ Branch 62
+ 62: Label
+ Store 65(i) 24
+ Branch 66
+ 66: Label
+ LoopMerge 68 69 None
Branch 70
70: Label
- LoopMerge 72 73 None
- Branch 74
- 74: Label
- BranchConditional 31 71 72
- 71: Label
- Branch 73
- 73: Label
- Branch 70
- 72: Label
+ 71: 21(int) Load 65(i)
+ 72: 19(bool) SLessThan 71 31
+ BranchConditional 72 67 68
+ 67: Label
+ Branch 69
+ 69: Label
+ 73: 21(int) Load 65(i)
+ 74: 21(int) IAdd 73 34
+ Store 65(i) 74
+ Branch 66
+ 68: Label
Branch 75
75: Label
LoopMerge 77 78 None
- Branch 76
- 76: Label
- Branch 78
- 78: Label
- BranchConditional 31 75 77
+ Branch 79
+ 79: Label
+ BranchConditional 20 76 77
+ 76: Label
+ Branch 78
+ 78: Label
+ Branch 75
77: Label
- Store 79(i) 9
Branch 80
80: Label
LoopMerge 82 83 None
- Branch 84
- 84: Label
- 85: 6(int) Load 79(i)
- 86: 17(bool) SLessThan 85 16
- BranchConditional 86 81 82
- 81: Label
- Branch 83
- 83: Label
- 87: 6(int) Load 79(i)
- 88: 6(int) IAdd 87 20
- Store 79(i) 88
- Branch 80
+ Branch 81
+ 81: Label
+ Branch 83
+ 83: Label
+ BranchConditional 20 80 82
82: Label
- 89: 17(bool) Load 47(cond)
- SelectionMerge 91 None
- BranchConditional 89 90 91
- 90: Label
- Branch 91
- 91: Label
- 92: 17(bool) Load 47(cond)
- SelectionMerge 94 None
- BranchConditional 92 93 94
- 93: Label
- Store 47(cond) 54
- Branch 94
- 94: Label
+ Store 84(i) 24
+ Branch 85
+ 85: Label
+ LoopMerge 87 88 None
+ Branch 89
+ 89: Label
+ 90: 21(int) Load 84(i)
+ 91: 19(bool) SLessThan 90 31
+ BranchConditional 91 86 87
+ 86: Label
+ Branch 88
+ 88: Label
+ 92: 21(int) Load 84(i)
+ 93: 21(int) IAdd 92 34
+ Store 84(i) 93
+ Branch 85
+ 87: Label
+ 94: 19(bool) Load 52(cond)
SelectionMerge 96 None
- Switch 55 96
- case 3: 95
+ BranchConditional 94 95 96
95: Label
Branch 96
96: Label
- Branch 99
+ 97: 19(bool) Load 52(cond)
+ SelectionMerge 99 None
+ BranchConditional 97 98 99
+ 98: Label
+ Store 52(cond) 59
+ Branch 99
99: Label
- LoopMerge 101 102 Unroll DontUnroll DependencyLength 2
- Branch 103
- 103: Label
- 104: 17(bool) Load 47(cond)
- BranchConditional 104 100 101
+ SelectionMerge 101 None
+ Switch 60 101
+ case 3: 100
100: Label
- Branch 102
- 102: Label
- Branch 99
+ Branch 101
101: Label
- SelectionMerge 106 DontFlatten
- Switch 55 106
- case 3: 105
+ Branch 104
+ 104: Label
+ LoopMerge 106 107 Unroll DontUnroll DependencyLength 2
+ Branch 108
+ 108: Label
+ 109: 19(bool) Load 52(cond)
+ BranchConditional 109 105 106
105: Label
- Branch 106
+ Branch 107
+ 107: Label
+ Branch 104
106: Label
- 109: 17(bool) Load 47(cond)
- SelectionMerge 111 Flatten
- BranchConditional 109 110 111
+ SelectionMerge 111 DontFlatten
+ Switch 60 111
+ case 3: 110
110: Label
Branch 111
111: Label
- Branch 112
- 112: Label
- LoopMerge 114 115 DependencyInfinite
- Branch 116
- 116: Label
- 117: 17(bool) Load 47(cond)
- BranchConditional 117 113 114
- 113: Label
- Branch 115
+ 114: 19(bool) Load 52(cond)
+ SelectionMerge 116 Flatten
+ BranchConditional 114 115 116
115: Label
- Branch 112
- 114: Label
+ Branch 116
+ 116: Label
+ Branch 117
+ 117: Label
+ LoopMerge 119 120 DependencyInfinite
+ Branch 121
+ 121: Label
+ 122: 19(bool) Load 52(cond)
+ BranchConditional 122 118 119
+ 118: Label
+ Branch 120
+ 120: Label
+ Branch 117
+ 119: Label
+ Return
+ FunctionEnd
+ 6(f0(): 2 Function None 3
+ 7: Label
+ Branch 10
+ 10: Label
+ LoopMerge 12 13 DontUnroll
+ Branch 11
+ 11: Label
+ Branch 13
+ 13: Label
+ Branch 10
+ 12: Label
+ Unreachable
+ FunctionEnd
+ 8(f1(): 2 Function None 3
+ 9: Label
+ Branch 14
+ 14: Label
+ LoopMerge 16 17 DontUnroll
+ Branch 18
+ 18: Label
+ BranchConditional 20 15 16
+ 15: Label
+ Branch 17
+ 17: Label
+ Branch 14
+ 16: Label
Return
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conversion.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conversion.frag.out
index a3215324bac..60129dd290c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conversion.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.conversion.frag.out
@@ -1,6 +1,6 @@
spv.conversion.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 455
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.coopmat.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.coopmat.comp.out
index 976c59f4725..4ef702809d9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.coopmat.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.coopmat.comp.out
@@ -1,6 +1,6 @@
spv.coopmat.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 228
Capability Shader
@@ -9,8 +9,8 @@ spv.coopmat.comp
Capability VulkanMemoryModelKHR
Capability PhysicalStorageBufferAddressesEXT
Capability CooperativeMatrixNV
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_16bit_storage"
- Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
Extension "SPV_KHR_vulkan_memory_model"
Extension "SPV_NV_cooperative_matrix"
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOut.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOut.frag.out
index f3847213f2a..5dc14cebe44 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOut.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOut.frag.out
@@ -1,6 +1,6 @@
spv.dataOut.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 20
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOutIndirect.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOutIndirect.frag.out
index f37160107a8..fa6a0daa015 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOutIndirect.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOutIndirect.frag.out
@@ -1,6 +1,6 @@
spv.dataOutIndirect.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 26
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOutIndirect.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOutIndirect.vert.out
index 9ba988c653a..fab5e586ab3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOutIndirect.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dataOutIndirect.vert.out
@@ -2,7 +2,7 @@ spv.dataOutIndirect.vert
WARNING: 0:3: attribute deprecated in version 130; may be removed in future release
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 38
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-continue.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-continue.vert.out
new file mode 100644
index 00000000000..f3b8792a17a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-continue.vert.out
@@ -0,0 +1,54 @@
+spv.dead-after-continue.vert
+// Module Version 10000
+// Generated by (magic number): 80008
+// Id's are bound by 29
+
+ Capability Shader
+ 1: ExtInstImport "GLSL.std.450"
+ MemoryModel Logical GLSL450
+ EntryPoint Vertex 4 "main" 20 28
+ Source GLSL 450
+ Name 4 "main"
+ Name 8 "i"
+ Name 20 "o"
+ Name 28 "c"
+ Decorate 20(o) Location 0
+ Decorate 28(c) Location 0
+ 2: TypeVoid
+ 3: TypeFunction 2
+ 6: TypeInt 32 1
+ 7: TypePointer Function 6(int)
+ 9: 6(int) Constant 0
+ 16: 6(int) Constant 5
+ 17: TypeBool
+ 19: TypePointer Output 6(int)
+ 20(o): 19(ptr) Variable Output
+ 21: 6(int) Constant 1
+ 23: 6(int) Constant 2
+ 26: 6(int) Constant 3
+ 27: TypePointer Input 6(int)
+ 28(c): 27(ptr) Variable Input
+ 4(main): 2 Function None 3
+ 5: Label
+ 8(i): 7(ptr) Variable Function
+ Store 8(i) 9
+ Branch 10
+ 10: Label
+ LoopMerge 12 13 None
+ Branch 14
+ 14: Label
+ 15: 6(int) Load 8(i)
+ 18: 17(bool) SLessThan 15 16
+ BranchConditional 18 11 12
+ 11: Label
+ Store 20(o) 21
+ Branch 13
+ 13: Label
+ 24: 6(int) Load 8(i)
+ 25: 6(int) IAdd 24 21
+ Store 8(i) 25
+ Branch 10
+ 12: Label
+ Store 20(o) 26
+ Return
+ FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-discard.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-discard.frag.out
new file mode 100644
index 00000000000..f378d04d83a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-discard.frag.out
@@ -0,0 +1,31 @@
+spv.dead-after-discard.frag
+// Module Version 10000
+// Generated by (magic number): 80008
+// Id's are bound by 15
+
+ Capability Shader
+ 1: ExtInstImport "GLSL.std.450"
+ MemoryModel Logical GLSL450
+ EntryPoint Fragment 4 "main" 8 14
+ ExecutionMode 4 OriginUpperLeft
+ Source GLSL 450
+ Name 4 "main"
+ Name 8 "o"
+ Name 14 "c"
+ Decorate 8(o) Location 0
+ Decorate 14(c) Location 0
+ 2: TypeVoid
+ 3: TypeFunction 2
+ 6: TypeInt 32 1
+ 7: TypePointer Output 6(int)
+ 8(o): 7(ptr) Variable Output
+ 9: 6(int) Constant 1
+ 11: 6(int) Constant 3
+ 12: TypeFloat 32
+ 13: TypePointer Input 12(float)
+ 14(c): 13(ptr) Variable Input
+ 4(main): 2 Function None 3
+ 5: Label
+ Store 8(o) 9
+ Kill
+ FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-loop-break.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-loop-break.vert.out
new file mode 100644
index 00000000000..b653e3998b0
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-loop-break.vert.out
@@ -0,0 +1,67 @@
+spv.dead-after-loop-break.vert
+// Module Version 10000
+// Generated by (magic number): 80008
+// Id's are bound by 36
+
+ Capability Shader
+ 1: ExtInstImport "GLSL.std.450"
+ MemoryModel Logical GLSL450
+ EntryPoint Vertex 4 "main" 8 25
+ Source GLSL 450
+ Name 4 "main"
+ Name 8 "o"
+ Name 11 "i"
+ Name 25 "c"
+ Decorate 8(o) Location 0
+ Decorate 25(c) Location 0
+ 2: TypeVoid
+ 3: TypeFunction 2
+ 6: TypeInt 32 1
+ 7: TypePointer Output 6(int)
+ 8(o): 7(ptr) Variable Output
+ 9: 6(int) Constant 1
+ 10: TypePointer Function 6(int)
+ 12: 6(int) Constant 0
+ 19: 6(int) Constant 5
+ 20: TypeBool
+ 22: 6(int) Constant 2
+ 24: TypePointer Input 6(int)
+ 25(c): 24(ptr) Variable Input
+ 30: 6(int) Constant 3
+ 32: 6(int) Constant 4
+ 35: 6(int) Constant 6
+ 4(main): 2 Function None 3
+ 5: Label
+ 11(i): 10(ptr) Variable Function
+ Store 8(o) 9
+ Store 11(i) 12
+ Branch 13
+ 13: Label
+ LoopMerge 15 16 None
+ Branch 17
+ 17: Label
+ 18: 6(int) Load 11(i)
+ 21: 20(bool) SLessThan 18 19
+ BranchConditional 21 14 15
+ 14: Label
+ Store 8(o) 22
+ 23: 6(int) Load 11(i)
+ 26: 6(int) Load 25(c)
+ 27: 20(bool) IEqual 23 26
+ SelectionMerge 29 None
+ BranchConditional 27 28 29
+ 28: Label
+ Store 8(o) 30
+ Branch 15
+ 29: Label
+ Store 8(o) 19
+ Branch 16
+ 16: Label
+ 33: 6(int) Load 11(i)
+ 34: 6(int) IAdd 33 9
+ Store 11(i) 34
+ Branch 13
+ 15: Label
+ Store 8(o) 35
+ Return
+ FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-return.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-return.vert.out
new file mode 100644
index 00000000000..d963f9ffb8d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-return.vert.out
@@ -0,0 +1,29 @@
+spv.dead-after-return.vert
+// Module Version 10000
+// Generated by (magic number): 80008
+// Id's are bound by 14
+
+ Capability Shader
+ 1: ExtInstImport "GLSL.std.450"
+ MemoryModel Logical GLSL450
+ EntryPoint Vertex 4 "main" 8 13
+ Source GLSL 450
+ Name 4 "main"
+ Name 8 "o"
+ Name 13 "c"
+ Decorate 8(o) Location 0
+ Decorate 13(c) Location 0
+ 2: TypeVoid
+ 3: TypeFunction 2
+ 6: TypeInt 32 1
+ 7: TypePointer Output 6(int)
+ 8(o): 7(ptr) Variable Output
+ 9: 6(int) Constant 1
+ 11: 6(int) Constant 3
+ 12: TypePointer Input 6(int)
+ 13(c): 12(ptr) Variable Input
+ 4(main): 2 Function None 3
+ 5: Label
+ Store 8(o) 9
+ Return
+ FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-switch-break.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-switch-break.vert.out
new file mode 100644
index 00000000000..a50601289b2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-after-switch-break.vert.out
@@ -0,0 +1,40 @@
+spv.dead-after-switch-break.vert
+// Module Version 10000
+// Generated by (magic number): 80008
+// Id's are bound by 21
+
+ Capability Shader
+ 1: ExtInstImport "GLSL.std.450"
+ MemoryModel Logical GLSL450
+ EntryPoint Vertex 4 "main" 8 14
+ Source GLSL 450
+ Name 4 "main"
+ Name 8 "c"
+ Name 14 "o"
+ Decorate 8(c) Location 0
+ Decorate 14(o) Location 0
+ 2: TypeVoid
+ 3: TypeFunction 2
+ 6: TypeInt 32 1
+ 7: TypePointer Input 6(int)
+ 8(c): 7(ptr) Variable Input
+ 13: TypePointer Output 6(int)
+ 14(o): 13(ptr) Variable Output
+ 15: 6(int) Constant 1
+ 17: 6(int) Constant 2
+ 20: 6(int) Constant 3
+ 4(main): 2 Function None 3
+ 5: Label
+ 9: 6(int) Load 8(c)
+ SelectionMerge 12 None
+ Switch 9 11
+ case 0: 10
+ 11: Label
+ Branch 12
+ 10: Label
+ Store 14(o) 15
+ Branch 12
+ 12: Label
+ Store 14(o) 20
+ Return
+ FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-complex-continue-after-return.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-complex-continue-after-return.vert.out
new file mode 100644
index 00000000000..60e81bd6270
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-complex-continue-after-return.vert.out
@@ -0,0 +1,55 @@
+spv.dead-complex-continue-after-return.vert
+// Module Version 10000
+// Generated by (magic number): 80008
+// Id's are bound by 31
+
+ Capability Shader
+ 1: ExtInstImport "GLSL.std.450"
+ MemoryModel Logical GLSL450
+ EntryPoint Vertex 4 "main" 11 30
+ Source GLSL 450
+ Name 4 "main"
+ Name 8 "i"
+ Name 11 "o"
+ Name 30 "c"
+ Decorate 11(o) Location 0
+ Decorate 30(c) Location 0
+ 2: TypeVoid
+ 3: TypeFunction 2
+ 6: TypeInt 32 1
+ 7: TypePointer Function 6(int)
+ 9: 6(int) Constant 0
+ 10: TypePointer Output 6(int)
+ 11(o): 10(ptr) Variable Output
+ 12: 6(int) Constant 1
+ 19: 6(int) Constant 5
+ 20: TypeBool
+ 22: 6(int) Constant 2
+ 24: 6(int) Constant 3
+ 27: 6(int) Constant 99
+ 28: 6(int) Constant 4
+ 29: TypePointer Input 6(int)
+ 30(c): 29(ptr) Variable Input
+ 4(main): 2 Function None 3
+ 5: Label
+ 8(i): 7(ptr) Variable Function
+ Store 8(i) 9
+ Store 11(o) 12
+ Store 8(i) 9
+ Branch 13
+ 13: Label
+ LoopMerge 15 16 None
+ Branch 17
+ 17: Label
+ 18: 6(int) Load 8(i)
+ 21: 20(bool) SLessThan 18 19
+ BranchConditional 21 14 15
+ 14: Label
+ Store 11(o) 22
+ Return
+ 16: Label
+ Branch 13
+ 15: Label
+ Store 11(o) 28
+ Return
+ FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-complex-merge-after-return.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-complex-merge-after-return.vert.out
new file mode 100644
index 00000000000..609a3ceb6d2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.dead-complex-merge-after-return.vert.out
@@ -0,0 +1,51 @@
+spv.dead-complex-merge-after-return.vert
+// Module Version 10000
+// Generated by (magic number): 80008
+// Id's are bound by 36
+
+ Capability Shader
+ 1: ExtInstImport "GLSL.std.450"
+ MemoryModel Logical GLSL450
+ EntryPoint Vertex 4 "main" 11 27
+ Source GLSL 450
+ Name 4 "main"
+ Name 8 "i"
+ Name 11 "o"
+ Name 27 "c"
+ Decorate 11(o) Location 0
+ Decorate 27(c) Location 0
+ 2: TypeVoid
+ 3: TypeFunction 2
+ 6: TypeInt 32 1
+ 7: TypePointer Function 6(int)
+ 9: 6(int) Constant 0
+ 10: TypePointer Output 6(int)
+ 11(o): 10(ptr) Variable Output
+ 12: 6(int) Constant 1
+ 17: 6(int) Constant 2
+ 19: 6(int) Constant 3
+ 22: 6(int) Constant 5
+ 23: TypeBool
+ 25: 6(int) Constant 4
+ 26: TypePointer Input 6(int)
+ 27(c): 26(ptr) Variable Input
+ 32: 6(int) Constant 100
+ 34: 6(int) Constant 200
+ 35: 6(int) Constant 300
+ 4(main): 2 Function None 3
+ 5: Label
+ 8(i): 7(ptr) Variable Function
+ Store 8(i) 9
+ Store 11(o) 12
+ Branch 13
+ 13: Label
+ LoopMerge 15 16 None
+ Branch 14
+ 14: Label
+ Store 11(o) 17
+ Return
+ 16: Label
+ Branch 13
+ 15: Label
+ Unreachable
+ FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out
index e212089230a..b68de49ec8a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out
@@ -2,7 +2,7 @@ spv.debugInfo.frag
error: SPIRV-Tools Validation Errors
error: Invalid SPIR-V binary version 1.3 for target environment SPIR-V 1.0 (under OpenGL 4.5 semantics).
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 124
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.debugInfo.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.debugInfo.frag.out
index aaa988d4a73..f27aac01012 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.debugInfo.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.debugInfo.frag.out
@@ -1,6 +1,6 @@
spv.debugInfo.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 124
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.deepRvalue.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.deepRvalue.frag.out
index 1869d76e30b..776fdf8dfd1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.deepRvalue.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.deepRvalue.frag.out
@@ -1,6 +1,6 @@
spv.deepRvalue.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 152
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.depthOut.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.depthOut.frag.out
index 59afd3e1e15..d212c897271 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.depthOut.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.depthOut.frag.out
@@ -1,6 +1,6 @@
spv.depthOut.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 15
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.deviceGroup.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.deviceGroup.frag.out
index 6710b77f79d..2d16272cfba 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.deviceGroup.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.deviceGroup.frag.out
@@ -1,6 +1,6 @@
spv.deviceGroup.frag
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 17
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.discard-dce.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.discard-dce.frag.out
index 9d138f294bc..c4a5cb21824 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.discard-dce.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.discard-dce.frag.out
@@ -1,6 +1,6 @@
spv.discard-dce.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 84
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.do-simple.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.do-simple.vert.out
index 6014dfec80c..826cc1ca3a5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.do-simple.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.do-simple.vert.out
@@ -1,6 +1,6 @@
spv.do-simple.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 21
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.do-while-continue-break.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.do-while-continue-break.vert.out
index 28388800157..36315a2f4ad 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.do-while-continue-break.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.do-while-continue-break.vert.out
@@ -1,6 +1,6 @@
spv.do-while-continue-break.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 43
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.doWhileLoop.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.doWhileLoop.frag.out
index 808466eb008..945f0d7c082 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.doWhileLoop.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.doWhileLoop.frag.out
@@ -1,6 +1,6 @@
spv.doWhileLoop.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 34
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.double.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.double.comp.out
index e9470ac6ec9..7961fc62d87 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.double.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.double.comp.out
@@ -1,6 +1,6 @@
spv.double.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 60
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.drawParams.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.drawParams.vert.out
index 8f3e2c0aa4d..e9d497031ed 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.drawParams.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.drawParams.vert.out
@@ -1,6 +1,6 @@
spv.drawParams.vert
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 29
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.earlyReturnDiscard.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.earlyReturnDiscard.frag.out
index c44b722f0f6..a4eb8cab64b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.earlyReturnDiscard.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.earlyReturnDiscard.frag.out
@@ -1,6 +1,6 @@
spv.earlyReturnDiscard.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 110
Capability Shader
@@ -160,7 +160,7 @@ spv.earlyReturnDiscard.frag
102: Label
Return
100: Label
- Branch 67
+ Unreachable
67: Label
106: 7(fvec4) Load 9(color)
107: 7(fvec4) Load 13(color2)
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.explicittypes.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.explicittypes.frag.out
index c07f66d543a..93189135b45 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.explicittypes.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.explicittypes.frag.out
@@ -1,6 +1,6 @@
spv.explicittypes.frag
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 576
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.extPostDepthCoverage.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.extPostDepthCoverage.frag.out
index 85a23593684..28d207b7d80 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.extPostDepthCoverage.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.extPostDepthCoverage.frag.out
@@ -1,6 +1,6 @@
spv.extPostDepthCoverage.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 6
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16.frag.out
index 1f955c222e2..ca1bca156dd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16.frag.out
@@ -1,7 +1,7 @@
spv.float16.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 534
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16Fetch.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16Fetch.frag.out
index 45c80fec331..92ff63131d5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16Fetch.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16Fetch.frag.out
@@ -1,7 +1,7 @@
spv.float16Fetch.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 5923
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16convertonlyarith.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16convertonlyarith.comp.out
index 6abf0d4a5be..5c8c29284cc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16convertonlyarith.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16convertonlyarith.comp.out
@@ -1,6 +1,6 @@
spv.float16convertonlyarith.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 22
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16convertonlystorage.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16convertonlystorage.comp.out
index a2ff1d09c5b..b37bb6b4679 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16convertonlystorage.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float16convertonlystorage.comp.out
@@ -1,6 +1,6 @@
spv.float16convertonlystorage.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 22
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float32.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float32.frag.out
index f1b0d029e2f..db413c43027 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float32.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float32.frag.out
@@ -1,6 +1,6 @@
spv.float32.frag
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 533
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float64.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float64.frag.out
index 231f0707854..b98c8704861 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float64.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.float64.frag.out
@@ -1,7 +1,7 @@
spv.float64.frag
Validation failed
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 524
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.flowControl.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.flowControl.frag.out
index 30c2a4b6ecd..fc68306de7c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.flowControl.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.flowControl.frag.out
@@ -1,6 +1,6 @@
spv.flowControl.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 39
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-complex-condition.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-complex-condition.vert.out
index 41275a45cec..78252ee99e1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-complex-condition.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-complex-condition.vert.out
@@ -1,6 +1,6 @@
spv.for-complex-condition.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 31
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-continue-break.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-continue-break.vert.out
index ff94a931367..50c034e67d0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-continue-break.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-continue-break.vert.out
@@ -1,6 +1,6 @@
spv.for-continue-break.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 45
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-nobody.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-nobody.vert.out
index 2a3bcf40ee9..26844c2fc0f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-nobody.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-nobody.vert.out
@@ -1,6 +1,6 @@
spv.for-nobody.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 25
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-notest.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-notest.vert.out
index 36c4a96a3ad..ff85cb42a77 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-notest.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-notest.vert.out
@@ -1,6 +1,6 @@
spv.for-notest.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 20
Capability Shader
@@ -38,5 +38,5 @@ spv.for-notest.vert
Store 8(i) 19
Branch 10
12: Label
- Return
+ Unreachable
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-simple.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-simple.vert.out
index ecb539f902a..a3e5d86798a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-simple.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.for-simple.vert.out
@@ -1,6 +1,6 @@
spv.for-simple.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 24
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.forLoop.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.forLoop.frag.out
index a07921ce775..b4b0f5d4581 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.forLoop.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.forLoop.frag.out
@@ -1,6 +1,6 @@
spv.forLoop.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 131
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.forwardFun.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.forwardFun.frag.out
index 32875b2ce34..26140aff13d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.forwardFun.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.forwardFun.frag.out
@@ -1,6 +1,6 @@
spv.forwardFun.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 60
Capability Shader
@@ -99,8 +99,7 @@ spv.forwardFun.frag
45: Label
ReturnValue 46
42: Label
- 48: 8(float) Undef
- ReturnValue 48
+ Unreachable
FunctionEnd
16(foo(vf4;): 8(float) Function None 14
15(bar): 13(ptr) FunctionParameter
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentDensity-es.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentDensity-es.frag.out
index 01ac38336af..69f92c8ac90 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentDensity-es.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentDensity-es.frag.out
@@ -1,6 +1,6 @@
spv.fragmentDensity-es.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 18
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentDensity.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentDensity.frag.out
index 8bbc37cc5b2..5bdb43a793c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentDensity.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentDensity.frag.out
@@ -1,6 +1,6 @@
spv.fragmentDensity.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 21
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentShaderBarycentric.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentShaderBarycentric.frag.out
index ffb3527c0bd..fbded6e4203 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentShaderBarycentric.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentShaderBarycentric.frag.out
@@ -1,6 +1,6 @@
spv.fragmentShaderBarycentric.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 43
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentShaderBarycentric2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentShaderBarycentric2.frag.out
index 05dce7a7dfa..22b84ba83e8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentShaderBarycentric2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fragmentShaderBarycentric2.frag.out
@@ -1,6 +1,6 @@
spv.fragmentShaderBarycentric2.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 42
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fsi.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fsi.frag.out
index 51fb06882e6..b0c97134855 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fsi.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fsi.frag.out
@@ -1,6 +1,6 @@
spv.fsi.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 24
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fullyCovered.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fullyCovered.frag.out
index 76c8e44d330..4dbea15f91c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fullyCovered.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.fullyCovered.frag.out
@@ -1,6 +1,6 @@
spv.fullyCovered.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 18
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionCall.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionCall.frag.out
index 269b74e64eb..4fa7863b6a6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionCall.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionCall.frag.out
@@ -4,7 +4,7 @@ WARNING: 0:4: varying deprecated in version 130; may be removed in future releas
WARNING: 0:5: varying deprecated in version 130; may be removed in future release
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 76
Capability Shader
@@ -105,8 +105,7 @@ WARNING: 0:5: varying deprecated in version 130; may be removed in future releas
44: Label
ReturnValue 45
41: Label
- 47: 6(float) Undef
- ReturnValue 47
+ Unreachable
FunctionEnd
18(missingReturn(): 6(float) Function None 15
19: Label
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out
index df590c197cd..4543895e61b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out
@@ -1,7 +1,7 @@
spv.functionNestedOpaque.vert
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 39
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionParameterTypes.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionParameterTypes.frag.out
index 24e780e211b..decc1904e41 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionParameterTypes.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionParameterTypes.frag.out
@@ -1,6 +1,6 @@
spv.functionParameterTypes.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 34
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionSemantics.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionSemantics.frag.out
index 49bdf7cdb7d..000a7bc9c30 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionSemantics.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.functionSemantics.frag.out
@@ -1,6 +1,6 @@
spv.functionSemantics.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 156
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glFragColor.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glFragColor.frag.out
index 55fb24f125e..af25280456c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glFragColor.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glFragColor.frag.out
@@ -1,6 +1,6 @@
spv.glFragColor.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 12
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out
index 9c8ccb50ca8..9872f4a4756 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glsl.register.autoassign.frag.out
@@ -1,6 +1,6 @@
spv.glsl.register.autoassign.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 142
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glsl.register.noautoassign.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glsl.register.noautoassign.frag.out
index 44d63ed1d78..b52e220171d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glsl.register.noautoassign.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.glsl.register.noautoassign.frag.out
@@ -1,6 +1,6 @@
spv.glsl.register.noautoassign.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 142
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out
index 35a6a4d9cd7..1d2e6b49f18 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out
@@ -1,6 +1,6 @@
spv.hlslDebugInfo.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 19
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.hlslOffsets.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.hlslOffsets.vert.out
index 723675469b8..b1cdb6b519e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.hlslOffsets.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.hlslOffsets.vert.out
@@ -18,7 +18,7 @@ Shader version: 450
0:? 'anon@0' (layout( binding=0 column_major std430) buffer block{layout( column_major std430) buffer highp float m0, layout( column_major std430) buffer highp 3-component vector of float m4, layout( column_major std430) buffer highp float m16, layout( column_major std430 offset=20) buffer highp 3-component vector of float m20, layout( column_major std430) buffer highp 3-component vector of float m32, layout( column_major std430) buffer highp 2-component vector of float m48, layout( column_major std430) buffer highp 2-component vector of float m56, layout( column_major std430) buffer highp float m64, layout( column_major std430) buffer highp 2-component vector of float m68, layout( column_major std430) buffer highp float m76, layout( column_major std430) buffer highp float m80, layout( column_major std430 offset=88) buffer highp 2-component vector of float m88, layout( column_major std430) buffer highp 2-component vector of float m96, layout( column_major std430) buffer 2-component vector of double m112})
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 14
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.image.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.image.frag.out
index 0fefd01ac4d..63d26d8d450 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.image.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.image.frag.out
@@ -1,7 +1,7 @@
spv.image.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 395
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out
index 28cd4f9643a..526d739243b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out
@@ -1,7 +1,7 @@
spv.imageLoadStoreLod.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 82
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int16.amd.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int16.amd.frag.out
index 26c701db6d5..3f6179b93b7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int16.amd.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int16.amd.frag.out
@@ -1,6 +1,6 @@
spv.int16.amd.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 560
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int16.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int16.frag.out
index a7b9bfe675a..ff8a44620d2 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int16.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int16.frag.out
@@ -1,6 +1,6 @@
spv.int16.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 523
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int32.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int32.frag.out
index e5c788944d3..1e8cd7028ce 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int32.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int32.frag.out
@@ -1,6 +1,6 @@
spv.int32.frag
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 493
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int64.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int64.frag.out
index b1375a66661..4510134d408 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int64.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int64.frag.out
@@ -1,7 +1,7 @@
spv.int64.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 489
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int8.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int8.frag.out
index 0a4740d3863..c84ca7e008e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int8.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.int8.frag.out
@@ -1,6 +1,6 @@
spv.int8.frag
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 518
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.intOps.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.intOps.vert.out
index 2a637832077..272233eccb3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.intOps.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.intOps.vert.out
@@ -1,6 +1,6 @@
spv.intOps.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 268
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.intcoopmat.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.intcoopmat.comp.out
index a854ed5539a..940ba3312c3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.intcoopmat.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.intcoopmat.comp.out
@@ -1,6 +1,6 @@
spv.intcoopmat.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 262
Capability Shader
@@ -10,8 +10,8 @@ spv.intcoopmat.comp
Capability VulkanMemoryModelKHR
Capability PhysicalStorageBufferAddressesEXT
Capability CooperativeMatrixNV
+ Extension "SPV_EXT_physical_storage_buffer"
Extension "SPV_KHR_8bit_storage"
- Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
Extension "SPV_KHR_vulkan_memory_model"
Extension "SPV_NV_cooperative_matrix"
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.interpOps.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.interpOps.frag.out
index 699524dd954..7ec4f9f4527 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.interpOps.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.interpOps.frag.out
@@ -1,6 +1,6 @@
spv.interpOps.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 100
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.layoutNested.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.layoutNested.vert.out
index b5ef8834546..44d58abf9d7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.layoutNested.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.layoutNested.vert.out
@@ -1,6 +1,6 @@
spv.layoutNested.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 66
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.length.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.length.frag.out
index 8e799fbb42a..de391bc544f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.length.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.length.frag.out
@@ -1,6 +1,6 @@
spv.length.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 33
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.localAggregates.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.localAggregates.frag.out
index f5fad547dc3..adfa0fd17a0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.localAggregates.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.localAggregates.frag.out
@@ -1,6 +1,6 @@
spv.localAggregates.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 136
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.loops.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.loops.frag.out
index 046360f609e..a3a3423881d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.loops.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.loops.frag.out
@@ -1,6 +1,6 @@
spv.loops.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 725
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.loopsArtificial.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.loopsArtificial.frag.out
index d0d60542f86..65329d4c25c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.loopsArtificial.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.loopsArtificial.frag.out
@@ -1,6 +1,6 @@
spv.loopsArtificial.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 158
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matFun.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matFun.vert.out
index 8ed378f869a..d39160d0899 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matFun.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matFun.vert.out
@@ -1,6 +1,6 @@
spv.matFun.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 103
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matrix.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matrix.frag.out
index c2b4a1f6c88..f7b6ce305fb 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matrix.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matrix.frag.out
@@ -1,6 +1,6 @@
spv.matrix.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 286
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matrix2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matrix2.frag.out
index dc574a40d80..77a098a8b94 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matrix2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.matrix2.frag.out
@@ -1,6 +1,6 @@
spv.matrix2.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 221
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.memoryQualifier.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.memoryQualifier.frag.out
index 93c6b2dbc57..737e862a588 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.memoryQualifier.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.memoryQualifier.frag.out
@@ -1,7 +1,7 @@
spv.memoryQualifier.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 97
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out
index 8c4e5763f75..29675915c6a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out
@@ -1,6 +1,6 @@
spv.memoryScopeSemantics.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 163
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.merge-unreachable.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.merge-unreachable.frag.out
index 7ec0f33dfc4..3eab4ec9230 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.merge-unreachable.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.merge-unreachable.frag.out
@@ -1,6 +1,6 @@
spv.merge-unreachable.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 25
Capability Shader
@@ -37,5 +37,5 @@ spv.merge-unreachable.frag
23: Label
Return
21: Label
- Return
+ Unreachable
FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderBuiltins.mesh.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderBuiltins.mesh.out
index 38d363bb374..cea7e4d7702 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderBuiltins.mesh.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderBuiltins.mesh.out
@@ -1,6 +1,6 @@
spv.meshShaderBuiltins.mesh
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 148
Capability ClipDistance
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderPerViewBuiltins.mesh.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderPerViewBuiltins.mesh.out
index b912acafcf5..75f8c63a4cb 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderPerViewBuiltins.mesh.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderPerViewBuiltins.mesh.out
@@ -1,6 +1,6 @@
spv.meshShaderPerViewBuiltins.mesh
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 126
Capability MultiViewport
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderPerViewUserDefined.mesh.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderPerViewUserDefined.mesh.out
index 266f662df16..de019a2b839 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderPerViewUserDefined.mesh.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderPerViewUserDefined.mesh.out
@@ -1,6 +1,6 @@
spv.meshShaderPerViewUserDefined.mesh
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 108
Capability MeshShadingNV
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderRedeclBuiltins.mesh.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderRedeclBuiltins.mesh.out
index 4afbef9f4f5..e9ebd44cfb5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderRedeclBuiltins.mesh.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderRedeclBuiltins.mesh.out
@@ -1,6 +1,6 @@
spv.meshShaderRedeclBuiltins.mesh
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 129
Capability ClipDistance
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderRedeclPerViewBuiltins.mesh.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderRedeclPerViewBuiltins.mesh.out
index 6672dc24344..38542d5c77c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderRedeclPerViewBuiltins.mesh.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderRedeclPerViewBuiltins.mesh.out
@@ -1,6 +1,6 @@
spv.meshShaderRedeclPerViewBuiltins.mesh
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 120
Capability PerViewAttributesNV
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderSharedMem.mesh.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderSharedMem.mesh.out
index dd0003dd25e..adac07ffabc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderSharedMem.mesh.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderSharedMem.mesh.out
@@ -1,6 +1,6 @@
spv.meshShaderSharedMem.mesh
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 77
Capability StorageImageWriteWithoutFormat
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderTaskMem.mesh.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderTaskMem.mesh.out
index e14f7a856e7..057e0fdd95e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderTaskMem.mesh.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderTaskMem.mesh.out
@@ -1,6 +1,6 @@
spv.meshShaderTaskMem.mesh
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 58
Capability MeshShadingNV
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderUserDefined.mesh.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderUserDefined.mesh.out
index c3ec91507fa..43579bb4380 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderUserDefined.mesh.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshShaderUserDefined.mesh.out
@@ -1,6 +1,6 @@
spv.meshShaderUserDefined.mesh
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 138
Capability MeshShadingNV
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshTaskShader.task.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshTaskShader.task.out
index a835d7feb50..96d37c4a6e7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshTaskShader.task.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.meshTaskShader.task.out
@@ -1,6 +1,6 @@
spv.meshTaskShader.task
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 116
Capability StorageImageWriteWithoutFormat
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiStruct.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiStruct.comp.out
index 7e88a59065b..679a4bd7eb7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiStruct.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiStruct.comp.out
@@ -1,6 +1,6 @@
spv.multiStruct.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 161
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiStructFuncall.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiStructFuncall.frag.out
index a3a4480a981..9312fe928e7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiStructFuncall.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiStructFuncall.frag.out
@@ -1,6 +1,6 @@
spv.multiStructFuncall.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 66
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiView.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiView.frag.out
index 9dbd36b992b..5363352566e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiView.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiView.frag.out
@@ -1,6 +1,6 @@
spv.multiView.frag
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 17
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out
index c06a890bc36..16e81a1e11f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiviewPerViewAttributes.tesc.out
@@ -1,6 +1,6 @@
spv.multiviewPerViewAttributes.tesc
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 41
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiviewPerViewAttributes.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiviewPerViewAttributes.vert.out
index c8377cfae73..acca44eef76 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiviewPerViewAttributes.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.multiviewPerViewAttributes.vert.out
@@ -1,6 +1,6 @@
spv.multiviewPerViewAttributes.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 29
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.newTexture.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.newTexture.frag.out
index 1bad3fa70d6..6bbb0328054 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.newTexture.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.newTexture.frag.out
@@ -1,7 +1,7 @@
spv.newTexture.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 284
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noBuiltInLoc.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noBuiltInLoc.vert.out
index 066f81f78fa..7a45e7277ed 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noBuiltInLoc.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noBuiltInLoc.vert.out
@@ -1,6 +1,6 @@
spv.noBuiltInLoc.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 35
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noDeadDecorations.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noDeadDecorations.vert.out
index d7e37027184..a555ba2567f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noDeadDecorations.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noDeadDecorations.vert.out
@@ -1,6 +1,6 @@
spv.noDeadDecorations.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 32
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noWorkgroup.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noWorkgroup.comp.out
index 2624fdcdbd9..92ae670617a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noWorkgroup.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.noWorkgroup.comp.out
@@ -1,6 +1,6 @@
spv.noWorkgroup.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 12
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonSquare.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonSquare.vert.out
index 679a5f0f96b..9746fe01c86 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonSquare.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonSquare.vert.out
@@ -1,6 +1,6 @@
spv.nonSquare.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 90
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonuniform.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonuniform.frag.out
index 3aaa8733ce0..32b64662a84 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonuniform.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonuniform.frag.out
@@ -1,6 +1,6 @@
spv.nonuniform.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 212
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonuniform2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonuniform2.frag.out
index 3f101fe124e..db24f4177ff 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonuniform2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.nonuniform2.frag.out
@@ -1,6 +1,6 @@
spv.nonuniform2.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 24
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.offsets.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.offsets.frag.out
index 17d7b86e11f..08a75e94f02 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.offsets.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.offsets.frag.out
@@ -1,6 +1,6 @@
spv.offsets.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 15
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.paramMemory.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.paramMemory.frag.out
index cba2fbd0488..df13c65f963 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.paramMemory.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.paramMemory.frag.out
@@ -1,7 +1,7 @@
spv.paramMemory.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 64
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.perprimitiveNV.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.perprimitiveNV.frag.out
index eaff400c091..9943ee9eaa6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.perprimitiveNV.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.perprimitiveNV.frag.out
@@ -1,6 +1,6 @@
spv.perprimitiveNV.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 23
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pp.line.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pp.line.frag.out
index 5794177f095..12c5fa5f553 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pp.line.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pp.line.frag.out
@@ -3,7 +3,7 @@ WARNING: spv.pp.line.frag:6: varying deprecated in version 130; may be removed i
WARNING: spv.pp.line.frag:7: varying deprecated in version 130; may be removed in future release
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 65
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precise.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precise.tesc.out
index 95a048fc75f..840e7b3b3b8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precise.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precise.tesc.out
@@ -1,6 +1,6 @@
spv.precise.tesc
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 72
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precise.tese.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precise.tese.out
index a73cbd8327e..b59ac0ecce9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precise.tese.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precise.tese.out
@@ -1,6 +1,6 @@
spv.precise.tese
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 119
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precision.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precision.frag.out
index 5ddb4927248..ac4c0aa5317 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precision.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precision.frag.out
@@ -1,6 +1,6 @@
spv.precision.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 127
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out
index 0620c41ef0d..97681f363e7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.precisionNonESSamp.frag.out
@@ -1,6 +1,6 @@
spv.precisionNonESSamp.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 47
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.prepost.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.prepost.frag.out
index 3b4bfd8acad..a0dbbd46e72 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.prepost.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.prepost.frag.out
@@ -1,6 +1,6 @@
spv.prepost.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 94
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.privateVariableTypes.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.privateVariableTypes.frag.out
index 9b4063ed5b6..1b8e1a5c7d0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.privateVariableTypes.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.privateVariableTypes.frag.out
@@ -1,6 +1,6 @@
spv.privateVariableTypes.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 27
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pushConstant.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pushConstant.vert.out
index 40ee328461c..5348edb4ad9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pushConstant.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pushConstant.vert.out
@@ -1,6 +1,6 @@
spv.pushConstant.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 35
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pushConstantAnon.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pushConstantAnon.vert.out
index b03855da573..3932b42ed1a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pushConstantAnon.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.pushConstantAnon.vert.out
@@ -1,6 +1,6 @@
spv.pushConstantAnon.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 38
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.qualifiers.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.qualifiers.vert.out
index ffdc6f8056a..47f73a0abce 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.qualifiers.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.qualifiers.vert.out
@@ -1,6 +1,6 @@
spv.qualifiers.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 21
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.queryL.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.queryL.frag.out
index 87dbb8c145e..97d845a198f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.queryL.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.queryL.frag.out
@@ -1,7 +1,7 @@
spv.queryL.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 224
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.rankShift.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.rankShift.comp.out
index 3ca7514599f..e0fba776a4e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.rankShift.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.rankShift.comp.out
@@ -1,6 +1,6 @@
spv.rankShift.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 33
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.autoassign-2.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.autoassign-2.frag.out
index 533e3880361..9fd317ef449 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.autoassign-2.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.autoassign-2.frag.out
@@ -1,6 +1,6 @@
spv.register.autoassign-2.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 47
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.autoassign.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.autoassign.frag.out
index 123ea356dd5..74118efc1f1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.autoassign.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.autoassign.frag.out
@@ -1,6 +1,6 @@
spv.register.autoassign.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 155
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.noautoassign.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.noautoassign.frag.out
index 3259f41f4b0..1292b0b2209 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.noautoassign.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.noautoassign.frag.out
@@ -1,6 +1,6 @@
spv.register.noautoassign.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 155
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.subpass.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.subpass.frag.out
index c42832a9730..21f79558f91 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.subpass.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.register.subpass.frag.out
@@ -1,6 +1,6 @@
spv.register.subpass.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 40
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.rw.autoassign.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.rw.autoassign.frag.out
index 2ee30bc5cb0..a575e786a15 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.rw.autoassign.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.rw.autoassign.frag.out
@@ -1,6 +1,6 @@
spv.rw.autoassign.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 42
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sample.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sample.frag.out
index e4d38f35a6b..57fbf31dd97 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sample.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sample.frag.out
@@ -1,6 +1,6 @@
spv.sample.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 13
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sampleId.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sampleId.frag.out
index 894d8db880d..1412da26118 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sampleId.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sampleId.frag.out
@@ -1,6 +1,6 @@
spv.sampleId.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 26
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out
index 3a9872e31dd..28923255781 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sampleMaskOverrideCoverage.frag.out
@@ -1,6 +1,6 @@
spv.sampleMaskOverrideCoverage.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 20
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.samplePosition.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.samplePosition.frag.out
index 882423ee8d4..b06c7685726 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.samplePosition.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.samplePosition.frag.out
@@ -1,6 +1,6 @@
spv.samplePosition.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 30
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.samplerlessTextureFunctions.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.samplerlessTextureFunctions.frag.out
index 0f09b43e765..c12201e3088 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.samplerlessTextureFunctions.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.samplerlessTextureFunctions.frag.out
@@ -1,6 +1,6 @@
spv.samplerlessTextureFunctions.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 51
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.scalarlayout.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.scalarlayout.frag.out
index 0168bc3eb0e..1b26242daa3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.scalarlayout.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.scalarlayout.frag.out
@@ -1,7 +1,7 @@
spv.scalarlayout.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 20
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.scalarlayoutfloat16.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.scalarlayoutfloat16.frag.out
index dac7e3a365a..c88fa7f2c39 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.scalarlayoutfloat16.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.scalarlayoutfloat16.frag.out
@@ -1,7 +1,7 @@
spv.scalarlayoutfloat16.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 18
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.separate.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.separate.frag.out
index 27cd3be0c48..690ab2f655b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.separate.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.separate.frag.out
@@ -1,7 +1,7 @@
spv.separate.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 319
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.set.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.set.vert.out
index 16d771fce6c..fe4326f273f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.set.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.set.vert.out
@@ -1,6 +1,6 @@
spv.set.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 22
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderBallot.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderBallot.comp.out
index 1c616ee5197..3ddee0f24ba 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderBallot.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderBallot.comp.out
@@ -1,6 +1,6 @@
spv.shaderBallot.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 318
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out
index 62ce6f27d9f..eb8f404fea4 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderBallotAMD.comp.out
@@ -1,6 +1,6 @@
spv.shaderBallotAMD.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 1343
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderDrawParams.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderDrawParams.vert.out
index d6b43e8fe9b..ad51de19a01 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderDrawParams.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderDrawParams.vert.out
@@ -1,6 +1,6 @@
spv.shaderDrawParams.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 53
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderFragMaskAMD.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderFragMaskAMD.frag.out
index 788d3ee6973..b1e5c0d690f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderFragMaskAMD.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderFragMaskAMD.frag.out
@@ -1,6 +1,6 @@
spv.shaderFragMaskAMD.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 80
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderGroupVote.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderGroupVote.comp.out
index e45f5858376..a09e798d474 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderGroupVote.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderGroupVote.comp.out
@@ -1,6 +1,6 @@
spv.shaderGroupVote.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 33
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderImageFootprint.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderImageFootprint.frag.out
index 8218ee42b3f..7559564825a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderImageFootprint.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderImageFootprint.frag.out
@@ -1,6 +1,6 @@
spv.shaderImageFootprint.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 622
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderStencilExport.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderStencilExport.frag.out
index 8fc691ee1d1..37fce5fcb38 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderStencilExport.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shaderStencilExport.frag.out
@@ -1,6 +1,6 @@
spv.shaderStencilExport.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 10
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shadingRate.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shadingRate.frag.out
index 11477769b13..ce561132711 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shadingRate.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shadingRate.frag.out
@@ -1,6 +1,6 @@
spv.shadingRate.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 21
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shiftOps.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shiftOps.frag.out
index 3085a55d452..15df2365378 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shiftOps.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shiftOps.frag.out
@@ -1,6 +1,6 @@
spv.shiftOps.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 38
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shortCircuit.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shortCircuit.frag.out
index d651824597a..6104b04c43e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shortCircuit.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.shortCircuit.frag.out
@@ -1,6 +1,6 @@
spv.shortCircuit.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 147
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.simpleFunctionCall.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.simpleFunctionCall.frag.out
index 627b31c1a8c..8e666a6024f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.simpleFunctionCall.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.simpleFunctionCall.frag.out
@@ -1,6 +1,6 @@
spv.simpleFunctionCall.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 19
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.simpleMat.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.simpleMat.vert.out
index 85574585454..ff51dc0d009 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.simpleMat.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.simpleMat.vert.out
@@ -2,7 +2,7 @@ spv.simpleMat.vert
WARNING: 0:3: varying deprecated in version 130; may be removed in future release
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 39
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.smBuiltins.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.smBuiltins.frag.out
index fda06eb5069..9f4cc60fed1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.smBuiltins.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.smBuiltins.frag.out
@@ -1,6 +1,6 @@
spv.smBuiltins.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 20
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.smBuiltins.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.smBuiltins.vert.out
index 8423e5b8a5e..0453b0cf355 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.smBuiltins.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.smBuiltins.vert.out
@@ -1,6 +1,6 @@
spv.smBuiltins.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 29
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sparseTexture.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sparseTexture.frag.out
index 7fdea0c41f1..34142008083 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sparseTexture.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sparseTexture.frag.out
@@ -1,7 +1,7 @@
spv.sparseTexture.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 438
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out
index ff7dce5652c..fedd64aa022 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.sparseTextureClamp.frag.out
@@ -1,7 +1,7 @@
spv.sparseTextureClamp.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 360
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConst.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConst.vert.out
index 70fbd09e2e6..116c136fdc7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConst.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConst.vert.out
@@ -1,6 +1,6 @@
spv.specConst.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 27
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstant.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstant.comp.out
index 2f641501c8f..e0ad6991b51 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstant.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstant.comp.out
@@ -1,6 +1,6 @@
spv.specConstant.comp
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 27
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstant.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstant.vert.out
index 49bcca6920f..1be395015e7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstant.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstant.vert.out
@@ -1,6 +1,6 @@
spv.specConstant.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 81
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstantComposite.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstantComposite.vert.out
index 58d4b6a3fd6..20a071b1fd4 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstantComposite.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstantComposite.vert.out
@@ -1,6 +1,6 @@
spv.specConstantComposite.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 43
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstantOperations.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstantOperations.vert.out
index 0f141e38682..747d50b5156 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstantOperations.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.specConstantOperations.vert.out
@@ -1,6 +1,6 @@
spv.specConstantOperations.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 162
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out
index 40afa15f1c6..7d64847928d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out
@@ -1,6 +1,6 @@
spv.ssbo.autoassign.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 99
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ssboAlias.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ssboAlias.frag.out
index f03d2ca9a93..1711d9d9374 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ssboAlias.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.ssboAlias.frag.out
@@ -1,6 +1,6 @@
spv.ssboAlias.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 44
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out
index 43afff9717f..2cab0640d51 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.stereoViewRendering.tesc.out
@@ -1,6 +1,6 @@
spv.stereoViewRendering.tesc
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 42
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.stereoViewRendering.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.stereoViewRendering.vert.out
index afd8c75a27f..acb8338cdd2 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.stereoViewRendering.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.stereoViewRendering.vert.out
@@ -1,6 +1,6 @@
spv.stereoViewRendering.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 27
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.storageBuffer.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.storageBuffer.vert.out
index 5006e4cc1f4..79cf9f1919d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.storageBuffer.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.storageBuffer.vert.out
@@ -1,6 +1,6 @@
spv.storageBuffer.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 31
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structAssignment.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structAssignment.frag.out
index 4b357da878b..d61c0e49deb 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structAssignment.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structAssignment.frag.out
@@ -3,7 +3,7 @@ WARNING: 0:6: '' : all default precisions are highp; use precision statements to
"precision mediump int; precision highp float;"
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 50
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structDeref.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structDeref.frag.out
index 6888a8508d1..2a114d7299e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structDeref.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structDeref.frag.out
@@ -1,6 +1,6 @@
spv.structDeref.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 123
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structure.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structure.frag.out
index f1da59fa43a..e8f8b394963 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structure.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.structure.frag.out
@@ -1,6 +1,6 @@
spv.structure.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 60
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.frag.out
index 4dd636e5a20..ee932bfc3b7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.frag.out
@@ -1,6 +1,6 @@
spv.subgroup.frag
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 17
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.geom.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.geom.out
index a68343af6b3..279e64661dd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.geom.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.geom.out
@@ -1,6 +1,6 @@
spv.subgroup.geom
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 26
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.tesc.out
index 4e362e2dda0..bc55b4e7f3e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.tesc.out
@@ -1,6 +1,6 @@
spv.subgroup.tesc
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 26
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.tese.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.tese.out
index e09f558d580..6b0a5ce71d9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.tese.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.tese.out
@@ -1,6 +1,6 @@
spv.subgroup.tese
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 26
Capability Tessellation
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.vert.out
index 2fbc92ba217..6deaf5522b2 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroup.vert.out
@@ -1,6 +1,6 @@
spv.subgroup.vert
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 26
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out
index f4e251a0c05..29ea9ece516 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out
@@ -1,6 +1,6 @@
spv.subgroupArithmetic.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 2085
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupBallot.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupBallot.comp.out
index ea152d9af9a..9fe196487c8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupBallot.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupBallot.comp.out
@@ -1,6 +1,6 @@
spv.subgroupBallot.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 397
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupBasic.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupBasic.comp.out
index 641534d5b73..2f6571b484f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupBasic.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupBasic.comp.out
@@ -1,6 +1,6 @@
spv.subgroupBasic.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 40
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupClustered.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupClustered.comp.out
index 150eb8aa45b..39712813392 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupClustered.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupClustered.comp.out
@@ -1,6 +1,6 @@
spv.subgroupClustered.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 737
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesArithmetic.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesArithmetic.comp.out
index 453d6fc8109..263f48d0cd8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesArithmetic.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesArithmetic.comp.out
@@ -1,6 +1,6 @@
spv.subgroupExtendedTypesArithmetic.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 3665
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesBallot.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesBallot.comp.out
index 4e1b2dc19bc..9f6a8c0f5ac 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesBallot.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesBallot.comp.out
@@ -1,6 +1,6 @@
spv.subgroupExtendedTypesBallot.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 441
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesClustered.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesClustered.comp.out
index b0b94b502b8..af3385ef780 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesClustered.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesClustered.comp.out
@@ -1,6 +1,6 @@
spv.subgroupExtendedTypesClustered.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 1273
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesPartitioned.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesPartitioned.comp.out
index 2f5a5703e49..9de4b981544 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesPartitioned.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesPartitioned.comp.out
@@ -1,6 +1,6 @@
spv.subgroupExtendedTypesPartitioned.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 1558
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesQuad.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesQuad.comp.out
index 7d37a410df5..ebd6132e1b7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesQuad.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesQuad.comp.out
@@ -1,6 +1,6 @@
spv.subgroupExtendedTypesQuad.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 806
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesShuffle.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesShuffle.comp.out
index d647ded5e57..f2413892902 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesShuffle.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesShuffle.comp.out
@@ -1,6 +1,6 @@
spv.subgroupExtendedTypesShuffle.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 497
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesShuffleRelative.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesShuffleRelative.comp.out
index ef5def56139..06150b03728 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesShuffleRelative.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesShuffleRelative.comp.out
@@ -1,6 +1,6 @@
spv.subgroupExtendedTypesShuffleRelative.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 497
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesVote.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesVote.comp.out
index a32c25d282b..63cc844d362 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesVote.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupExtendedTypesVote.comp.out
@@ -1,6 +1,6 @@
spv.subgroupExtendedTypesVote.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 277
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out
index 742e5bc499b..e16e3091706 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out
@@ -1,6 +1,6 @@
spv.subgroupPartitioned.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 2506
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupQuad.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupQuad.comp.out
index 435c490f439..1c5e9634189 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupQuad.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupQuad.comp.out
@@ -1,6 +1,6 @@
spv.subgroupQuad.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 616
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupShuffle.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupShuffle.comp.out
index 991c6fa77a7..532b0d289c0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupShuffle.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupShuffle.comp.out
@@ -1,6 +1,6 @@
spv.subgroupShuffle.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 379
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out
index 3aad7605b07..ae5589afca1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out
@@ -1,6 +1,6 @@
spv.subgroupShuffleRelative.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 379
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupVote.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupVote.comp.out
index 4fdbb0be037..6f6f8cfee56 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupVote.comp.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subgroupVote.comp.out
@@ -1,6 +1,6 @@
spv.subgroupVote.comp
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 216
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subpass.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subpass.frag.out
index 706624df1b7..4bc556ad6fe 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subpass.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.subpass.frag.out
@@ -1,6 +1,6 @@
spv.subpass.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 67
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.switch.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.switch.frag.out
index 47cc5d4c12f..729257c51e4 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.switch.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.switch.frag.out
@@ -4,7 +4,7 @@ WARNING: 0:134: 'switch' : last case/default label not followed by statements
WARNING: 0:139: 'switch' : last case/default label not followed by statements
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 269
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.swizzle.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.swizzle.frag.out
index 2a132d5824f..9b31a26854c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.swizzle.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.swizzle.frag.out
@@ -1,6 +1,6 @@
spv.swizzle.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 108
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.swizzleInversion.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.swizzleInversion.frag.out
index 0aee7ae7294..796436075d2 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.swizzleInversion.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.swizzleInversion.frag.out
@@ -1,6 +1,6 @@
spv.swizzleInversion.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 46
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.test.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.test.frag.out
index 02e4f669dcc..db77cbbc2e8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.test.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.test.frag.out
@@ -1,6 +1,6 @@
spv.test.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 55
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.test.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.test.vert.out
index 3303c88b542..3b06c666cd3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.test.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.test.vert.out
@@ -2,7 +2,7 @@ spv.test.vert
WARNING: 0:5: attribute deprecated in version 130; may be removed in future release
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 24
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.frag.out
index d518ad7b565..3ea73382495 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.frag.out
@@ -4,7 +4,7 @@ WARNING: 0:11: varying deprecated in version 130; may be removed in future relea
WARNING: 0:12: varying deprecated in version 130; may be removed in future release
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 305
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out
index 612f2a90a17..f2306e7362c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.sampler.transform.frag.out
@@ -1,6 +1,6 @@
spv.texture.sampler.transform.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 20
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.vert.out
index f3f979c907b..3f9336bac57 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.texture.vert.out
@@ -1,6 +1,6 @@
spv.texture.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 150
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.textureBuffer.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.textureBuffer.vert.out
index 252a9c82e90..463129020c9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.textureBuffer.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.textureBuffer.vert.out
@@ -1,6 +1,6 @@
spv.textureBuffer.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 42
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out
index cd18688f626..aada70db947 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.textureGatherBiasLod.frag.out
@@ -1,7 +1,7 @@
spv.textureGatherBiasLod.frag
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 298
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.types.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.types.frag.out
index e6fd3e0c206..3f7fd12710b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.types.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.types.frag.out
@@ -1,6 +1,6 @@
spv.types.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 260
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.uint.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.uint.frag.out
index e6fe5e4da35..612b323ffc9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.uint.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.uint.frag.out
@@ -1,6 +1,6 @@
spv.uint.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 213
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.uniformArray.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.uniformArray.frag.out
index 0f9883e464d..339d1decab5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.uniformArray.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.uniformArray.frag.out
@@ -1,6 +1,6 @@
spv.uniformArray.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 53
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.unit1.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.unit1.frag.out
index d64d437fc1c..b2ec724bfbb 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.unit1.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.unit1.frag.out
@@ -193,7 +193,7 @@ gl_FragCoord origin is upper left
0:? 'h3' ( global highp float)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 69
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.variableArrayIndex.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.variableArrayIndex.frag.out
index 87d934ec17f..cc6d96b3cf2 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.variableArrayIndex.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.variableArrayIndex.frag.out
@@ -1,6 +1,6 @@
spv.variableArrayIndex.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 93
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.varyingArray.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.varyingArray.frag.out
index 2628f829df1..d5a59aea81d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.varyingArray.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.varyingArray.frag.out
@@ -1,6 +1,6 @@
spv.varyingArray.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 61
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out
index 60e9857bc10..799def9e473 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.varyingArrayIndirect.frag.out
@@ -1,6 +1,6 @@
spv.varyingArrayIndirect.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 70
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vecMatConstruct.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vecMatConstruct.frag.out
index 57ecd67ed11..004b2bc6142 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vecMatConstruct.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vecMatConstruct.frag.out
@@ -1,6 +1,6 @@
spv.vecMatConstruct.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 62
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.viewportArray2.tesc.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.viewportArray2.tesc.out
index a4016d401ee..78ee00df900 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.viewportArray2.tesc.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.viewportArray2.tesc.out
@@ -1,7 +1,7 @@
spv.viewportArray2.tesc
Validation failed
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 25
Capability Geometry
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.viewportArray2.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.viewportArray2.vert.out
index df116cfce54..6d419a627a4 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.viewportArray2.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.viewportArray2.vert.out
@@ -1,6 +1,6 @@
spv.viewportArray2.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 19
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.voidFunction.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.voidFunction.frag.out
index fbaee8784ff..804b32ca528 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.voidFunction.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.voidFunction.frag.out
@@ -1,6 +1,6 @@
spv.voidFunction.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 43
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.volatileAtomic.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.volatileAtomic.comp.out
new file mode 100644
index 00000000000..8326374dce6
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.volatileAtomic.comp.out
@@ -0,0 +1,40 @@
+spv.volatileAtomic.comp
+// Module Version 10000
+// Generated by (magic number): 80008
+// Id's are bound by 18
+
+ Capability Shader
+ 1: ExtInstImport "GLSL.std.450"
+ MemoryModel Logical GLSL450
+ EntryPoint GLCompute 4 "main"
+ ExecutionMode 4 LocalSize 1 1 1
+ Source GLSL 450
+ Name 4 "main"
+ Name 8 "D"
+ MemberName 8(D) 0 "d"
+ Name 10 "d"
+ Decorate 7 ArrayStride 4
+ MemberDecorate 8(D) 0 Volatile
+ MemberDecorate 8(D) 0 Coherent
+ MemberDecorate 8(D) 0 Offset 0
+ Decorate 8(D) BufferBlock
+ Decorate 10(d) DescriptorSet 0
+ Decorate 10(d) Binding 3
+ 2: TypeVoid
+ 3: TypeFunction 2
+ 6: TypeInt 32 0
+ 7: TypeRuntimeArray 6(int)
+ 8(D): TypeStruct 7
+ 9: TypePointer Uniform 8(D)
+ 10(d): 9(ptr) Variable Uniform
+ 11: TypeInt 32 1
+ 12: 11(int) Constant 0
+ 13: TypePointer Uniform 6(int)
+ 15: 6(int) Constant 0
+ 16: 6(int) Constant 1
+ 4(main): 2 Function None 3
+ 5: Label
+ 14: 13(ptr) AccessChain 10(d) 12 12
+ 17: 6(int) AtomicExchange 14 16 15 15
+ Return
+ FunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vulkan110.int16.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vulkan110.int16.frag.out
index 11f1cd3ea8f..b94593c8b6b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vulkan110.int16.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vulkan110.int16.frag.out
@@ -1,6 +1,6 @@
spv.vulkan110.int16.frag
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 523
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out
index a0194713808..7592cf715cf 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.vulkan110.storageBuffer.vert.out
@@ -1,6 +1,6 @@
spv.vulkan110.storageBuffer.vert
// Module Version 10300
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 31
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.while-continue-break.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.while-continue-break.vert.out
index d49bca09b1d..132f50305b0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.while-continue-break.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.while-continue-break.vert.out
@@ -1,6 +1,6 @@
spv.while-continue-break.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 41
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.while-simple.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.while-simple.vert.out
index b507da3ed03..ea9a98017db 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.while-simple.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.while-simple.vert.out
@@ -1,6 +1,6 @@
spv.while-simple.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 22
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.whileLoop.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.whileLoop.frag.out
index e29497235e9..67d44f4ebf9 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.whileLoop.frag.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.whileLoop.frag.out
@@ -1,6 +1,6 @@
spv.whileLoop.frag
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 35
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb.vert.out
index 3cd93d50019..7eb38b39f13 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb.vert.out
@@ -1,6 +1,6 @@
spv.xfb.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 16
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb2.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb2.vert.out
index a8551a1a70e..0f593daea08 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb2.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb2.vert.out
@@ -1,6 +1,6 @@
spv.xfb2.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 35
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb3.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb3.vert.out
index 0218847e3ee..77894b49b46 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb3.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfb3.vert.out
@@ -1,6 +1,6 @@
spv.xfb3.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 35
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOffsetOnBlockMembersAssignment.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOffsetOnBlockMembersAssignment.vert.out
index 066aa3a0872..52ce965294f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOffsetOnBlockMembersAssignment.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOffsetOnBlockMembersAssignment.vert.out
@@ -1,6 +1,6 @@
spv.xfbOffsetOnBlockMembersAssignment.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 33
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOffsetOnStructMembersAssignment.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOffsetOnStructMembersAssignment.vert.out
index 668d24a59ba..13be843bb9a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOffsetOnStructMembersAssignment.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOffsetOnStructMembersAssignment.vert.out
@@ -1,6 +1,6 @@
spv.xfbOffsetOnStructMembersAssignment.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 40
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert.out
index ebc496299b9..7159f4a8659 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert.out
@@ -1,6 +1,6 @@
spv.xfbOverlapOffsetCheckWithBlockAndMember.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 39
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbStrideJustOnce.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbStrideJustOnce.vert.out
index 9b459b503e0..270d17a1a5c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbStrideJustOnce.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/spv.xfbStrideJustOnce.vert.out
@@ -1,6 +1,6 @@
spv.xfbStrideJustOnce.vert
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 33
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/vulkan.ast.vert.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/vulkan.ast.vert.out
index 72a45705eec..2bf2065a4cd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/vulkan.ast.vert.out
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/vulkan.ast.vert.out
@@ -258,7 +258,7 @@ Shader version: 450
0:? 2 (const int)
// Module Version 10000
-// Generated by (magic number): 80007
+// Generated by (magic number): 80008
// Id's are bound by 50
Capability Shader
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/web.comp.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/web.comp.out
new file mode 100644
index 00000000000..79a30729671
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/web.comp.out
@@ -0,0 +1,157 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 7
+; Bound: 108
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main" %gl_NumWorkGroups %gl_WorkGroupID %gl_LocalInvocationID %gl_GlobalInvocationID %gl_LocalInvocationIndex
+ OpExecutionMode %main LocalSize 2 5 7
+ OpSource ESSL 310
+ OpName %main "main"
+ OpName %bName "bName"
+ OpMemberName %bName 0 "size"
+ OpMemberName %bName 1 "count"
+ OpMemberName %bName 2 "data"
+ OpName %bInst "bInst"
+ OpName %s "s"
+ OpName %arrX "arrX"
+ OpName %arrY "arrY"
+ OpName %arrZ "arrZ"
+ OpName %gl_NumWorkGroups "gl_NumWorkGroups"
+ OpName %gl_WorkGroupID "gl_WorkGroupID"
+ OpName %gl_LocalInvocationID "gl_LocalInvocationID"
+ OpName %gl_GlobalInvocationID "gl_GlobalInvocationID"
+ OpName %gl_LocalInvocationIndex "gl_LocalInvocationIndex"
+ OpDecorate %_runtimearr_v4float ArrayStride 16
+ OpMemberDecorate %bName 0 Offset 0
+ OpMemberDecorate %bName 1 Offset 16
+ OpMemberDecorate %bName 2 Offset 32
+ OpDecorate %bName BufferBlock
+ OpDecorate %bInst DescriptorSet 0
+ OpDecorate %bInst Binding 0
+ OpDecorate %39 SpecId 18
+ OpDecorate %41 SpecId 19
+ OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+ OpDecorate %gl_NumWorkGroups BuiltIn NumWorkgroups
+ OpDecorate %gl_WorkGroupID BuiltIn WorkgroupId
+ OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId
+ OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
+ OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_264 = OpConstant %uint 264
+ %int = OpTypeInt 32 1
+ %v3uint = OpTypeVector %uint 3
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_runtimearr_v4float = OpTypeRuntimeArray %v4float
+ %bName = OpTypeStruct %int %v3uint %_runtimearr_v4float
+%_ptr_Uniform_bName = OpTypePointer Uniform %bName
+ %bInst = OpVariable %_ptr_Uniform_bName Uniform
+ %int_2 = OpConstant %int 2
+ %int_0 = OpConstant %int 0
+%_ptr_Uniform_int = OpTypePointer Uniform %int
+ %float_7 = OpConstant %float 7
+ %24 = OpConstantComposite %v4float %float_7 %float_7 %float_7 %float_7
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+ %uint_1 = OpConstant %uint 1
+ %uint_3400 = OpConstant %uint 3400
+ %uint_72 = OpConstant %uint 72
+%uint_197645 = OpConstant %uint 197645
+%_arr_v4float_uint_197645 = OpTypeArray %v4float %uint_197645
+%_ptr_Workgroup__arr_v4float_uint_197645 = OpTypePointer Workgroup %_arr_v4float_uint_197645
+ %s = OpVariable %_ptr_Workgroup__arr_v4float_uint_197645 Workgroup
+ %int_3 = OpConstant %int 3
+ %float_0 = OpConstant %float 0
+ %39 = OpSpecConstant %uint 2
+ %uint_5 = OpConstant %uint 5
+ %41 = OpSpecConstant %uint 7
+%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %39 %uint_5 %41
+ %uint_0 = OpConstant %uint 0
+%_arr_int_44 = OpTypeArray %int %44
+%_ptr_Private__arr_int_44 = OpTypePointer Private %_arr_int_44
+ %arrX = OpVariable %_ptr_Private__arr_int_44 Private
+%_ptr_Private_int = OpTypePointer Private %int
+%_arr_int_52 = OpTypeArray %int %52
+%_ptr_Private__arr_int_52 = OpTypePointer Private %_arr_int_52
+ %arrY = OpVariable %_ptr_Private__arr_int_52 Private
+%_arr_int_59 = OpTypeArray %int %59
+%_ptr_Private__arr_int_59 = OpTypePointer Private %_arr_int_59
+ %arrZ = OpVariable %_ptr_Private__arr_int_59 Private
+%_ptr_Workgroup_v4float = OpTypePointer Workgroup %v4float
+ %int_1 = OpConstant %int 1
+%_ptr_Input_v3uint = OpTypePointer Input %v3uint
+%gl_NumWorkGroups = OpVariable %_ptr_Input_v3uint Input
+%gl_WorkGroupID = OpVariable %_ptr_Input_v3uint Input
+%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input
+%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
+%_ptr_Input_uint = OpTypePointer Input %uint
+%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input
+%_ptr_Uniform_v3uint = OpTypePointer Uniform %v3uint
+ %int_5 = OpConstant %int 5
+ %int_197645 = OpConstant %int 197645
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ OpControlBarrier %uint_2 %uint_2 %uint_264
+ %20 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
+ %21 = OpLoad %int %20
+ %22 = OpSDiv %int %21 %int_2
+ %26 = OpAccessChain %_ptr_Uniform_v4float %bInst %int_2 %22
+ %27 = OpLoad %v4float %26
+ %28 = OpFMul %v4float %27 %24
+ %29 = OpAccessChain %_ptr_Uniform_v4float %bInst %int_2 %22
+ OpStore %29 %28
+ OpMemoryBarrier %uint_1 %uint_3400
+ OpMemoryBarrier %uint_2 %uint_3400
+ OpMemoryBarrier %uint_1 %uint_264
+ OpMemoryBarrier %uint_1 %uint_72
+ %44 = OpCompositeExtract %uint %gl_WorkGroupSize 0
+ %49 = OpAccessChain %_ptr_Private_int %arrX %int_0
+ %50 = OpLoad %int %49
+ %51 = OpConvertSToF %float %50
+ %52 = OpCompositeExtract %uint %gl_WorkGroupSize 1
+ %56 = OpAccessChain %_ptr_Private_int %arrY %int_0
+ %57 = OpLoad %int %56
+ %58 = OpConvertSToF %float %57
+ %59 = OpCompositeExtract %uint %gl_WorkGroupSize 2
+ %63 = OpAccessChain %_ptr_Private_int %arrZ %int_0
+ %64 = OpLoad %int %63
+ %65 = OpConvertSToF %float %64
+ %66 = OpCompositeConstruct %v4float %float_0 %51 %58 %65
+ %68 = OpAccessChain %_ptr_Workgroup_v4float %s %int_3
+ OpStore %68 %66
+ %72 = OpLoad %v3uint %gl_NumWorkGroups
+ %73 = OpIAdd %v3uint %72 %gl_WorkGroupSize
+ %75 = OpLoad %v3uint %gl_WorkGroupID
+ %76 = OpIAdd %v3uint %73 %75
+ %78 = OpLoad %v3uint %gl_LocalInvocationID
+ %79 = OpIAdd %v3uint %76 %78
+ %81 = OpLoad %v3uint %gl_GlobalInvocationID
+ %84 = OpLoad %uint %gl_LocalInvocationIndex
+ %85 = OpCompositeConstruct %v3uint %84 %84 %84
+ %86 = OpIMul %v3uint %81 %85
+ %87 = OpIAdd %v3uint %79 %86
+ %89 = OpAccessChain %_ptr_Uniform_v3uint %bInst %int_1
+ OpStore %89 %87
+ %90 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
+ %91 = OpAtomicIAdd %int %90 %uint_1 %uint_0 %int_2
+ %92 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
+ %93 = OpAtomicSMin %int %92 %uint_1 %uint_0 %int_2
+ %94 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
+ %95 = OpAtomicSMax %int %94 %uint_1 %uint_0 %int_2
+ %96 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
+ %97 = OpAtomicAnd %int %96 %uint_1 %uint_0 %int_2
+ %98 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
+ %99 = OpAtomicOr %int %98 %uint_1 %uint_0 %int_2
+ %100 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
+ %101 = OpAtomicXor %int %100 %uint_1 %uint_0 %int_2
+ %102 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
+ %103 = OpAtomicExchange %int %102 %uint_1 %uint_0 %int_2
+ %104 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
+ %106 = OpAtomicCompareExchange %int %104 %uint_1 %uint_0 %uint_0 %int_2 %int_5
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/web.separate.frag.out b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/web.separate.frag.out
new file mode 100644
index 00000000000..e31ddca3761
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/baseResults/web.separate.frag.out
@@ -0,0 +1,178 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 7
+; Bound: 99
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %color %i
+ OpExecutionMode %main OriginUpperLeft
+ OpSource ESSL 310
+ OpName %main "main"
+ OpName %color "color"
+ OpName %t2d "t2d"
+ OpName %s "s"
+ OpName %t3d "t3d"
+ OpName %sA "sA"
+ OpName %sShadow "sShadow"
+ OpName %i "i"
+ OpName %tex2D "tex2D"
+ OpName %texCube "texCube"
+ OpName %tex2DArray "tex2DArray"
+ OpName %itex2D "itex2D"
+ OpName %itex3D "itex3D"
+ OpName %itexCube "itexCube"
+ OpName %itex2DArray "itex2DArray"
+ OpName %utex2D "utex2D"
+ OpName %utex3D "utex3D"
+ OpName %utexCube "utexCube"
+ OpName %utex2DArray "utex2DArray"
+ OpName %tex3D "tex3D"
+ OpDecorate %color Location 0
+ OpDecorate %t2d RelaxedPrecision
+ OpDecorate %t2d DescriptorSet 0
+ OpDecorate %t2d Binding 3
+ OpDecorate %14 RelaxedPrecision
+ OpDecorate %s DescriptorSet 0
+ OpDecorate %s Binding 0
+ OpDecorate %23 RelaxedPrecision
+ OpDecorate %t3d DescriptorSet 0
+ OpDecorate %t3d Binding 4
+ OpDecorate %sA DescriptorSet 0
+ OpDecorate %sA Binding 2
+ OpDecorate %48 RelaxedPrecision
+ OpDecorate %51 RelaxedPrecision
+ OpDecorate %sShadow DescriptorSet 0
+ OpDecorate %sShadow Binding 1
+ OpDecorate %i RelaxedPrecision
+ OpDecorate %i Flat
+ OpDecorate %i Location 0
+ OpDecorate %tex2D RelaxedPrecision
+ OpDecorate %tex2D DescriptorSet 0
+ OpDecorate %tex2D Binding 5
+ OpDecorate %texCube RelaxedPrecision
+ OpDecorate %texCube DescriptorSet 0
+ OpDecorate %texCube Binding 6
+ OpDecorate %tex2DArray DescriptorSet 0
+ OpDecorate %tex2DArray Binding 15
+ OpDecorate %itex2D DescriptorSet 0
+ OpDecorate %itex2D Binding 16
+ OpDecorate %itex3D DescriptorSet 0
+ OpDecorate %itex3D Binding 17
+ OpDecorate %itexCube DescriptorSet 0
+ OpDecorate %itexCube Binding 18
+ OpDecorate %itex2DArray DescriptorSet 0
+ OpDecorate %itex2DArray Binding 19
+ OpDecorate %utex2D DescriptorSet 0
+ OpDecorate %utex2D Binding 20
+ OpDecorate %utex3D DescriptorSet 0
+ OpDecorate %utex3D Binding 21
+ OpDecorate %utexCube DescriptorSet 0
+ OpDecorate %utexCube Binding 22
+ OpDecorate %utex2DArray DescriptorSet 0
+ OpDecorate %utex2DArray Binding 23
+ OpDecorate %tex3D DescriptorSet 0
+ OpDecorate %tex3D Binding 36
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %color = OpVariable %_ptr_Output_v4float Output
+ %10 = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %11 = OpTypeSampledImage %10
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %t2d = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %15 = OpTypeSampler
+%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
+ %s = OpVariable %_ptr_UniformConstant_15 UniformConstant
+ %v2float = OpTypeVector %float 2
+ %float_0_5 = OpConstant %float 0.5
+ %22 = OpConstantComposite %v2float %float_0_5 %float_0_5
+ %24 = OpTypeImage %float 3D 0 0 0 1 Unknown
+ %25 = OpTypeSampledImage %24
+ %uint = OpTypeInt 32 0
+ %uint_4 = OpConstant %uint 4
+%_arr_25_uint_4 = OpTypeArray %25 %uint_4
+%_ptr_UniformConstant__arr_25_uint_4 = OpTypePointer UniformConstant %_arr_25_uint_4
+ %t3d = OpVariable %_ptr_UniformConstant__arr_25_uint_4 UniformConstant
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_UniformConstant_25 = OpTypePointer UniformConstant %25
+%_arr_15_uint_4 = OpTypeArray %15 %uint_4
+%_ptr_UniformConstant__arr_15_uint_4 = OpTypePointer UniformConstant %_arr_15_uint_4
+ %sA = OpVariable %_ptr_UniformConstant__arr_15_uint_4 UniformConstant
+ %int_2 = OpConstant %int 2
+ %v3float = OpTypeVector %float 3
+ %44 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
+ %sShadow = OpVariable %_ptr_UniformConstant_15 UniformConstant
+%_ptr_Input_int = OpTypePointer Input %int
+ %i = OpVariable %_ptr_Input_int Input
+ %tex2D = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %58 = OpTypeImage %float Cube 0 0 0 1 Unknown
+ %59 = OpTypeSampledImage %58
+%_ptr_UniformConstant_59 = OpTypePointer UniformConstant %59
+ %texCube = OpVariable %_ptr_UniformConstant_59 UniformConstant
+ %62 = OpTypeImage %float 2D 0 1 0 1 Unknown
+ %63 = OpTypeSampledImage %62
+%_ptr_UniformConstant_63 = OpTypePointer UniformConstant %63
+ %tex2DArray = OpVariable %_ptr_UniformConstant_63 UniformConstant
+ %66 = OpTypeImage %int 2D 0 0 0 1 Unknown
+ %67 = OpTypeSampledImage %66
+%_ptr_UniformConstant_67 = OpTypePointer UniformConstant %67
+ %itex2D = OpVariable %_ptr_UniformConstant_67 UniformConstant
+ %70 = OpTypeImage %int 3D 0 0 0 1 Unknown
+ %71 = OpTypeSampledImage %70
+%_ptr_UniformConstant_71 = OpTypePointer UniformConstant %71
+ %itex3D = OpVariable %_ptr_UniformConstant_71 UniformConstant
+ %74 = OpTypeImage %int Cube 0 0 0 1 Unknown
+ %75 = OpTypeSampledImage %74
+%_ptr_UniformConstant_75 = OpTypePointer UniformConstant %75
+ %itexCube = OpVariable %_ptr_UniformConstant_75 UniformConstant
+ %78 = OpTypeImage %int 2D 0 1 0 1 Unknown
+ %79 = OpTypeSampledImage %78
+%_ptr_UniformConstant_79 = OpTypePointer UniformConstant %79
+%itex2DArray = OpVariable %_ptr_UniformConstant_79 UniformConstant
+ %82 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+ %83 = OpTypeSampledImage %82
+%_ptr_UniformConstant_83 = OpTypePointer UniformConstant %83
+ %utex2D = OpVariable %_ptr_UniformConstant_83 UniformConstant
+ %86 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+ %87 = OpTypeSampledImage %86
+%_ptr_UniformConstant_87 = OpTypePointer UniformConstant %87
+ %utex3D = OpVariable %_ptr_UniformConstant_87 UniformConstant
+ %90 = OpTypeImage %uint Cube 0 0 0 1 Unknown
+ %91 = OpTypeSampledImage %90
+%_ptr_UniformConstant_91 = OpTypePointer UniformConstant %91
+ %utexCube = OpVariable %_ptr_UniformConstant_91 UniformConstant
+ %94 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+ %95 = OpTypeSampledImage %94
+%_ptr_UniformConstant_95 = OpTypePointer UniformConstant %95
+%utex2DArray = OpVariable %_ptr_UniformConstant_95 UniformConstant
+ %tex3D = OpVariable %_ptr_UniformConstant_25 UniformConstant
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %14 = OpLoad %11 %t2d
+ %18 = OpLoad %15 %s
+ %19 = OpSampledImage %11 %14 %18
+ %23 = OpImageSampleImplicitLod %v4float %19 %22
+ OpStore %color %23
+ %34 = OpAccessChain %_ptr_UniformConstant_25 %t3d %int_1
+ %35 = OpLoad %25 %34
+ %40 = OpAccessChain %_ptr_UniformConstant_15 %sA %int_2
+ %41 = OpLoad %15 %40
+ %42 = OpSampledImage %25 %35 %41
+ %45 = OpImageSampleImplicitLod %v4float %42 %44
+ %46 = OpLoad %v4float %color
+ %47 = OpFAdd %v4float %46 %45
+ OpStore %color %47
+ %48 = OpLoad %11 %t2d
+ %49 = OpLoad %15 %s
+ %50 = OpSampledImage %11 %48 %49
+ %51 = OpImageSampleImplicitLod %v4float %50 %22
+ %52 = OpLoad %v4float %color
+ %53 = OpFAdd %v4float %52 %51
+ OpStore %color %53
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/glsl.450.subgroup.frag b/3rdparty/bgfx/3rdparty/glslang/Test/glsl.450.subgroup.frag
index 883554e0964..70bee79faba 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/glsl.450.subgroup.frag
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/glsl.450.subgroup.frag
@@ -114,12 +114,14 @@ void main (void)
#extension GL_KHR_shader_subgroup_ballot: enable
void ballot_works(vec4 f4) {
+ int i;
gl_SubgroupEqMask;
gl_SubgroupGeMask;
gl_SubgroupGtMask;
gl_SubgroupLeMask;
gl_SubgroupLtMask;
subgroupBroadcast(f4, 0);
+ subgroupBroadcast(f4, i);
subgroupBroadcastFirst(f4);
uvec4 ballot = subgroupBallot(false);
subgroupInverseBallot(uvec4(0x1));
@@ -192,7 +194,9 @@ void clustered_works(vec4 f4)
#extension GL_KHR_shader_subgroup_quad: enable
void quad_works(vec4 f4)
{
+ int i;
subgroupQuadBroadcast(f4, 0);
+ subgroupQuadBroadcast(f4, i);
subgroupQuadSwapHorizontal(f4);
subgroupQuadSwapVertical(f4);
subgroupQuadSwapDiagonal(f4);
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.doLoop.frag b/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.doLoop.frag
index 0318dc8f39e..8f4bfdcebe1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.doLoop.frag
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.doLoop.frag
@@ -1,9 +1,29 @@
-float4 PixelShaderFunction(float input) : COLOR0
-{
+void f0() {
[unroll] do {} while (false);
+}
+
+void f1() {
[unroll] do {;} while (false);
+}
+
+float f2(float input) {
do { return (float4)input; } while (input > 2.0);
+}
+
+void f3(float input) {
do ++input; while (input < 10.0);
+}
+
+void f4(float input) {
do while (++input < 10.0); while (++input < 10.0); // nest while inside do-while
+}
+
+float4 PixelShaderFunction(float input) : COLOR0
+{
+ f0();
+ f1();
+ f2(input);
+ f3(input);
+ f4(input);
return (float4)input;
}
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.forLoop.frag b/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.forLoop.frag
index 9cf60ee4600..c0783dbdc3c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.forLoop.frag
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.forLoop.frag
@@ -1,17 +1,59 @@
-float4 PixelShaderFunction(float4 input) : COLOR0
-{
+void f0() {
for (;;) ;
+}
+
+void f1(float4 input) {
for (++input; ; ) ;
+}
+
+void f2(float4 input) {
[unroll] for (; any(input != input); ) {}
+}
+
+float f3(float4 input) {
for (; any(input != input); ) { return -input; }
+}
+
+float f4(float4 input) {
for (--input; any(input != input); input += 2) { return -input; }
+}
+
+void f5(float4 input) {
for (;;) if (input.x > 2.0) break;
+}
+
+void f6(float4 input) {
for (;;) if (input.x > 2.0) continue;
+}
+
+void f99() {
+ for (int first = 0, second = 1; ;) first + second;
+}
+
+void f100(float ii) {
+ for (--ii, --ii, --ii;;) ii;
+}
+
+float4 PixelShaderFunction(float4 input) : COLOR0
+{
+ f0();
+ f1(input);
+ f2(input);
+ f3(input);
+ f4(input);
+ f5(input);
+ f6(input);
+
float ii;
for (int ii = -1; ii < 3; ++ii) if (ii == 2) continue;
--ii;
- for (int first = 0, second = 1; ;) first + second;
+
+ f99();
+
for ( int i = 0, count = int(ii); i < count; i++ );
for (float first = 0, second[2], third; first < second[0]; ++second[1]) first + second[1] + third;
- for (--ii, --ii, --ii;;) ii;
+
+ f100(ii);
+
+ return input;
}
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.if.frag b/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.if.frag
index b62eda15186..a2e47f6a1f6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.if.frag
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/hlsl.if.frag
@@ -1,12 +1,24 @@
-float4 PixelShaderFunction(float4 input) : COLOR0
-{
+float4 f0(float4 input) {
if (all(input == input))
return input;
+ else
+ return -input;
+}
- if (all(input == input))
+float4 f1(float4 input) {
+ if (all(input == input)) {
return input;
- else
+ } else {
return -input;
+ }
+}
+
+float4 PixelShaderFunction(float4 input) : COLOR0
+{
+ if (all(input == input))
+ return input;
+
+ f0(input);
if (all(input == input))
;
@@ -20,11 +32,7 @@ float4 PixelShaderFunction(float4 input) : COLOR0
return input;
}
- if (all(input == input)) {
- return input;
- } else {
- return -input;
- }
+ f1(input);
int ii;
if (float ii = input.z)
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/runtests b/3rdparty/bgfx/3rdparty/glslang/Test/runtests
index 8e31c0696cf..23406dc3407 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/runtests
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/runtests
@@ -1,11 +1,16 @@
#!/usr/bin/env bash
-TARGETDIR=localResults
+# Arguments:
+# 1- TargetDirectory, where to write test results and intermediary files
+# 2- Path to glslangValidator
+# 3- Path to spirv-remap
+
+TARGETDIR=${1:-localResults}
BASEDIR=baseResults
-EXE=../build/install/bin/glslangValidator
-REMAPEXE=../build/install/bin/spirv-remap
+EXE=${2:-../build/install/bin/glslangValidator}
+REMAPEXE=${3:-../build/install/bin/spirv-remap}
HASERROR=0
-mkdir -p localResults
+mkdir -p $TARGETDIR
if [ -a localtestlist ]
then
@@ -55,13 +60,13 @@ diff -b $BASEDIR/hlsl.automap.frag.out $TARGETDIR/hlsl.automap.frag.out || HASER
# multi-threaded test
#
echo Comparing single thread to multithread for all tests in current directory...
-$EXE -i -C *.vert *.geom *.frag *.tesc *.tese *.comp > singleThread.out
-$EXE -i -C *.vert *.geom *.frag *.tesc *.tese *.comp -t > multiThread.out
-diff singleThread.out multiThread.out || HASERROR=1
+$EXE -i -C *.vert *.geom *.frag *.tesc *.tese *.comp > $TARGETDIR/singleThread.out
+$EXE -i -C *.vert *.geom *.frag *.tesc *.tese *.comp -t > $TARGETDIR/multiThread.out
+diff $TARGETDIR/singleThread.out $TARGETDIR/multiThread.out || HASERROR=1
if [ $HASERROR -eq 0 ]
then
- rm singleThread.out
- rm multiThread.out
+ rm $TARGETDIR/singleThread.out
+ rm $TARGETDIR/multiThread.out
fi
#
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/spv.controlFlowAttributes.frag b/3rdparty/bgfx/3rdparty/glslang/Test/spv.controlFlowAttributes.frag
index 6d90c0db2c1..cedd60225c5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/spv.controlFlowAttributes.frag
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/spv.controlFlowAttributes.frag
@@ -4,11 +4,18 @@
bool cond;
+void f0() {
+ [[loop]] for (;;) { }
+}
+
+void f1() {
+ [[dont_unroll]] while(true) { }
+}
+
void main()
{
[[unroll]] for (int i = 0; i < 8; ++i) { }
- [[loop]] for (;;) { }
- [[dont_unroll]] while(true) { }
+ f0();
[[dependency_infinite]] do { } while(true);
[[dependency_length(1+3)]] for (int i = 0; i < 8; ++i) { }
[[flatten]] if (cond) { } else { }
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-continue.vert b/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-continue.vert
new file mode 100644
index 00000000000..86e8eea8da7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-continue.vert
@@ -0,0 +1,14 @@
+#version 450
+
+layout(location =0 ) in int c;
+layout(location =0 ) out int o;
+
+void main() {
+ int i;
+ for (i=0; i < 5; i++) {
+ o = 1;
+ continue;
+ o = 2;
+ }
+ o = 3;
+}
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-discard.frag b/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-discard.frag
new file mode 100644
index 00000000000..769592bd599
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-discard.frag
@@ -0,0 +1,10 @@
+#version 450
+
+layout(location =0 ) in float c;
+layout(location =0 ) out int o;
+
+void main() {
+ o = 1;
+ discard;
+ o = 3;
+}
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-loop-break.vert b/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-loop-break.vert
new file mode 100644
index 00000000000..5498497c3e3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-loop-break.vert
@@ -0,0 +1,19 @@
+#version 450
+
+layout(location =0 ) in int c;
+layout(location =0 ) out int o;
+
+void main() {
+ int i;
+ o = 1;
+ for (i=0; i < 5; i++) {
+ o = 2;
+ if (i==c) {
+ o = 3;
+ break;
+ o = 4;
+ }
+ o = 5;
+ }
+ o = 6;
+}
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-return.vert b/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-return.vert
new file mode 100644
index 00000000000..71726963ab2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-return.vert
@@ -0,0 +1,10 @@
+#version 450
+
+layout(location =0 ) in int c;
+layout(location =0 ) out int o;
+
+void main() {
+ o = 1;
+ return;
+ o = 3;
+}
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-switch-break.vert b/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-switch-break.vert
new file mode 100644
index 00000000000..b1483e8d9a0
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-after-switch-break.vert
@@ -0,0 +1,15 @@
+#version 450
+
+layout(location =0 ) in int c;
+layout(location =0 ) out int o;
+
+void main() {
+ int i;
+ switch(c) {
+ case 0: o=1;
+ break;
+ o=2;
+ default: break;
+ }
+ o = 3;
+}
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-complex-continue-after-return.vert b/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-complex-continue-after-return.vert
new file mode 100644
index 00000000000..85932a366ac
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-complex-continue-after-return.vert
@@ -0,0 +1,19 @@
+#version 450
+
+layout(location =0 ) in int c;
+layout(location =0 ) out int o;
+
+void main() {
+ int i = 0;
+ o = 1;
+ // This has non-trivial continue target.
+ for (i=0; i < 5; ++i, o=99) {
+ o = 2;
+ return;
+ o = 3;
+ }
+ // This is considered reachable since Glslang codegen will
+ // create a conditional branch in the header, and one arm
+ // of that branch reaches this merge block.
+ o = 4;
+}
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-complex-merge-after-return.vert b/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-complex-merge-after-return.vert
new file mode 100644
index 00000000000..2fff1a29738
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/spv.dead-complex-merge-after-return.vert
@@ -0,0 +1,23 @@
+#version 450
+
+layout(location =0 ) in int c;
+layout(location =0 ) out int o;
+
+void main() {
+ int i = 0;
+ o = 1;
+ do {
+ o = 2;
+ return;
+ o = 3;
+ } while(i++ < 5);
+
+ // All this is a dead merge block.
+ o = 4;
+ if (c==4) {
+ o = 100;
+ } else {
+ o = 200;
+ }
+ o = 300;
+}
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/spv.volatileAtomic.comp b/3rdparty/bgfx/3rdparty/glslang/Test/spv.volatileAtomic.comp
new file mode 100644
index 00000000000..a86f896274a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/spv.volatileAtomic.comp
@@ -0,0 +1,8 @@
+#version 450 core
+
+layout(set=0, binding=3) volatile buffer D { uint d[]; } d;
+
+void main()
+{
+ atomicExchange(d.d[0], 0);
+}
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/web.comp b/3rdparty/bgfx/3rdparty/glslang/Test/web.comp
new file mode 100644
index 00000000000..07847b4268d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/web.comp
@@ -0,0 +1,50 @@
+#version 310 es
+
+layout(local_size_x_id = 18, local_size_z_id = 19) in;
+
+layout(local_size_x = 2) in;
+layout(local_size_y = 5) in;
+layout(local_size_z = 7) in;
+
+const int total = gl_MaxComputeWorkGroupCount.x
+ + gl_MaxComputeWorkGroupCount.y
+ + gl_MaxComputeWorkGroupCount.z
+ + gl_MaxComputeUniformComponents
+ + gl_MaxComputeTextureImageUnits;
+
+shared vec4 s[total];
+
+int arrX[gl_WorkGroupSize.x];
+int arrY[gl_WorkGroupSize.y];
+int arrZ[gl_WorkGroupSize.z];
+
+layout(binding = 0, set = 0) buffer bName {
+ int size;
+ uvec3 count;
+ vec4 data[];
+} bInst;
+
+void main()
+{
+ barrier();
+
+ bInst.data[bInst.size / 2] *= vec4(7.0);
+
+ memoryBarrier();
+ groupMemoryBarrier();
+ memoryBarrierShared();
+ memoryBarrierBuffer();
+
+ s[3] = vec4(0, arrX[0], arrY[0], arrZ[0]);
+ bInst.count = gl_NumWorkGroups + gl_WorkGroupSize + gl_WorkGroupID + gl_LocalInvocationID +
+ gl_GlobalInvocationID * gl_LocalInvocationIndex;
+
+ atomicAdd(bInst.size, 2);
+ atomicMin(bInst.size, 2);
+ atomicMax(bInst.size, 2);
+ atomicAnd(bInst.size, 2);
+ atomicOr(bInst.size, 2);
+ atomicXor(bInst.size, 2);
+ atomicExchange(bInst.size, 2);
+ atomicCompSwap(bInst.size, 5, 2);
+}
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/web.separate.frag b/3rdparty/bgfx/3rdparty/glslang/Test/web.separate.frag
new file mode 100644
index 00000000000..b747cba5785
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/web.separate.frag
@@ -0,0 +1,63 @@
+#version 310 es
+
+precision highp sampler;
+precision highp samplerShadow;
+precision highp texture2DArray;
+precision highp itexture2D;
+precision highp itexture3D;
+precision highp itextureCube;
+precision highp itexture2DArray;
+precision highp utexture2D;
+precision highp utexture3D;
+precision highp utextureCube;
+precision highp utexture2DArray;
+precision highp texture3D;
+precision highp float;
+
+layout(binding = 0) uniform sampler s;
+layout(binding = 1) uniform samplerShadow sShadow;
+layout(binding = 2) uniform sampler sA[4];
+layout(binding = 3) uniform texture2D t2d;
+layout(binding = 4) uniform texture3D t3d[4];
+layout(location = 0) flat in int i;
+
+layout(location = 0) out vec4 color;
+
+void main()
+{
+ color = texture(sampler2D(t2d, s), vec2(0.5));
+ color += texture(sampler3D(t3d[1], sA[2]), vec3(0.5));
+ color += texture(sampler2D(t2d, s), vec2(0.5));
+}
+
+layout(binding = 5) uniform texture2D tex2D;
+layout(binding = 6) uniform textureCube texCube;
+layout(binding = 15) uniform texture2DArray tex2DArray;
+layout(binding = 16) uniform itexture2D itex2D;
+layout(binding = 17) uniform itexture3D itex3D;
+layout(binding = 18) uniform itextureCube itexCube;
+layout(binding = 19) uniform itexture2DArray itex2DArray;
+layout(binding = 20) uniform utexture2D utex2D;
+layout(binding = 21) uniform utexture3D utex3D;
+layout(binding = 22) uniform utextureCube utexCube;
+layout(binding = 23) uniform utexture2DArray utex2DArray;
+layout(binding = 36) uniform texture3D tex3D;
+
+void foo()
+{
+ sampler2D (tex2D, s);
+ samplerCube (texCube, s);
+ samplerCubeShadow (texCube, sShadow);
+ sampler2DArray (tex2DArray, s);
+ sampler2DArrayShadow (tex2DArray, sShadow);
+ isampler2D (itex2D, s);
+ isampler3D (itex3D, s);
+ isamplerCube (itexCube, s);
+ isampler2DArray (itex2DArray, s);
+ usampler2D (utex2D, s);
+ usampler3D (utex3D, s);
+ usamplerCube (utexCube, s);
+ usampler2DArray (utex2DArray, s);
+ sampler3D (tex3D, s);
+ sampler2DShadow (tex2D, sShadow);
+}
diff --git a/3rdparty/bgfx/3rdparty/glslang/Test/web.testlist b/3rdparty/bgfx/3rdparty/glslang/Test/web.testlist
index fba92127a60..764c0c0f2f0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/Test/web.testlist
+++ b/3rdparty/bgfx/3rdparty/glslang/Test/web.testlist
@@ -5,3 +5,5 @@ web.controlFlow.frag
web.operations.frag
web.texture.frag
web.array.frag
+web.separate.frag
+web.comp
diff --git a/3rdparty/bgfx/3rdparty/glslang/WORKSPACE b/3rdparty/bgfx/3rdparty/glslang/WORKSPACE
new file mode 100644
index 00000000000..3c38e61d08b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/WORKSPACE
@@ -0,0 +1,27 @@
+workspace(name = "org_khronos_glslang")
+load(
+ "@bazel_tools//tools/build_defs/repo:http.bzl",
+ "http_archive",
+)
+
+http_archive(
+ name = "com_google_googletest",
+ sha256 = "ef9e2e12e7bf115ee48b427ae171fc869eeaf1b532c0fcfd982f6a353d2471b4",
+ strip_prefix = "googletest-37ae1fc5e6be26f367d76c078beabd7024fed53a",
+ urls = ["https://github.com/google/googletest/archive/37ae1fc5e6be26f367d76c078beabd7024fed53a.zip"], # 2018-07-16
+)
+
+http_archive(
+ name = "com_googlesource_code_re2",
+ sha256 = "b885bb965ab4b6cf8718bbb8154d8f6474cd00331481b6d3e390babb3532263e",
+ strip_prefix = "re2-e860767c86e577b87deadf24cc4567ea83c4f162/",
+ urls = ["https://github.com/google/re2/archive/e860767c86e577b87deadf24cc4567ea83c4f162.zip"],
+)
+
+http_archive(
+ name = "com_google_effcee",
+ build_file = "BUILD.effcee.bazel",
+ sha256 = "b0c21a01995fdf9792510566d78d5e7fe6f83cb4ba986eba691f4926f127cb34",
+ strip_prefix = "effcee-8f0a61dc95e0df18c18e0ac56d83b3fa9d2fe90b/",
+ urls = ["https://github.com/google/effcee/archive/8f0a61dc95e0df18c18e0ac56d83b3fa9d2fe90b.zip"],
+)
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/CMakeLists.txt b/3rdparty/bgfx/3rdparty/glslang/glslang/CMakeLists.txt
index 930893c2ff2..42df1d1e64c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/CMakeLists.txt
@@ -82,7 +82,9 @@ add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${H
set_property(TARGET glslang PROPERTY FOLDER glslang)
set_property(TARGET glslang PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_libraries(glslang OGLCompiler OSDependent)
-target_include_directories(glslang PUBLIC ..)
+target_include_directories(glslang PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
if(WIN32 AND BUILD_SHARED_LIBS)
set_target_properties(glslang PROPERTIES PREFIX "")
@@ -102,14 +104,15 @@ endif(WIN32)
if(ENABLE_GLSLANG_INSTALL)
if(BUILD_SHARED_LIBS)
- install(TARGETS glslang
+ install(TARGETS glslang EXPORT glslangTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
else()
- install(TARGETS glslang
+ install(TARGETS glslang EXPORT glslangTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
+ install(EXPORT glslangTargets DESTINATION lib/cmake)
endif(ENABLE_GLSLANG_INSTALL)
if(ENABLE_GLSLANG_INSTALL)
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h
index 9961c943a09..3ed402d4902 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h
@@ -79,6 +79,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
bool ms : 1;
bool image : 1; // image, combined should be false
bool combined : 1; // true means texture is combined with a sampler, false means texture with no sampler
+ bool sampler : 1; // true means a pure sampler, other fields should be clear()
#ifdef ENABLE_HLSL
unsigned int vectorSize : 3; // vector return type size.
unsigned int getVectorSize() const { return vectorSize; }
@@ -105,8 +106,6 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
bool isRect() const { return false; }
bool isSubpass() const { return false; }
bool isCombined() const { return true; }
- bool isPureSampler() const { return false; }
- bool isTexture() const { return false; }
bool isImage() const { return false; }
bool isImageClass() const { return false; }
bool isMultiSample() const { return false; }
@@ -114,7 +113,6 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
void setExternal(bool e) { }
bool isYuv() const { return false; }
#else
- bool sampler : 1; // true means a pure sampler, other fields should be clear()
bool external : 1; // GL_OES_EGL_image_external
bool yuv : 1; // GL_EXT_YUV_target
// Some languages support structures as sample results. Storing the whole structure in the
@@ -125,8 +123,6 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
bool isRect() const { return dim == EsdRect; }
bool isSubpass() const { return dim == EsdSubpass; }
bool isCombined() const { return combined; }
- bool isPureSampler() const { return sampler; }
- bool isTexture() const { return !sampler && !image; }
bool isImage() const { return image && !isSubpass(); }
bool isImageClass() const { return image; }
bool isMultiSample() const { return ms; }
@@ -134,7 +130,12 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
void setExternal(bool e) { external = e; }
bool isYuv() const { return yuv; }
#endif
+ bool isTexture() const { return !sampler && !image; }
+ bool isPureSampler() const { return sampler; }
+
void setCombined(bool c) { combined = c; }
+ void setBasicType(TBasicType t) { type = t; }
+ TBasicType getBasicType() const { return type; }
bool isShadow() const { return shadow; }
bool isArrayed() const { return arrayed; }
@@ -147,8 +148,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
ms = false;
image = false;
combined = false;
-#ifndef GLSLANG_WEB
sampler = false;
+#ifndef GLSLANG_WEB
external = false;
yuv = false;
#endif
@@ -195,6 +196,14 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
ms = m;
}
+ // make a pure sampler, no texture, no image, nothing combined, the 'sampler' keyword
+ void setPureSampler(bool s)
+ {
+ clear();
+ sampler = true;
+ shadow = s;
+ }
+
#ifndef GLSLANG_WEB
// make a subpass input attachment
void setSubpass(TBasicType t, bool m = false)
@@ -205,14 +214,6 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
dim = EsdSubpass;
ms = m;
}
-
- // make a pure sampler, no texture, no image, nothing combined, the 'sampler' keyword
- void setPureSampler(bool s)
- {
- clear();
- sampler = true;
- shadow = s;
- }
#endif
bool operator==(const TSampler& right) const
@@ -527,6 +528,7 @@ public:
void clearMemory()
{
+#ifndef GLSLANG_WEB
coherent = false;
devicecoherent = false;
queuefamilycoherent = false;
@@ -537,6 +539,7 @@ public:
restrict = false;
readonly = false;
writeonly = false;
+#endif
}
const char* semanticName;
@@ -549,16 +552,6 @@ public:
bool centroid : 1;
bool smooth : 1;
bool flat : 1;
- bool coherent : 1;
- bool devicecoherent : 1;
- bool queuefamilycoherent : 1;
- bool workgroupcoherent : 1;
- bool subgroupcoherent : 1;
- bool nonprivate : 1;
- bool volatil : 1;
- bool restrict : 1;
- bool readonly : 1;
- bool writeonly : 1;
// having a constant_id is not sufficient: expressions have no id, but are still specConstant
bool specConstant : 1;
bool nonUniform : 1;
@@ -566,6 +559,9 @@ public:
#ifdef GLSLANG_WEB
bool isWriteOnly() const { return false; }
bool isReadOnly() const { return false; }
+ bool isRestrict() const { return false; }
+ bool isCoherent() const { return false; }
+ bool isVolatile() const { return false; }
bool isSample() const { return false; }
bool isMemory() const { return false; }
bool isMemoryQualifierImageAndSSBOOnly() const { return false; }
@@ -587,8 +583,21 @@ public:
bool perTaskNV : 1;
bool patch : 1;
bool sample : 1;
+ bool restrict : 1;
+ bool readonly : 1;
+ bool writeonly : 1;
+ bool coherent : 1;
+ bool volatil : 1;
+ bool devicecoherent : 1;
+ bool queuefamilycoherent : 1;
+ bool workgroupcoherent : 1;
+ bool subgroupcoherent : 1;
+ bool nonprivate : 1;
bool isWriteOnly() const { return writeonly; }
bool isReadOnly() const { return readonly; }
+ bool isRestrict() const { return restrict; }
+ bool isCoherent() const { return coherent; }
+ bool isVolatile() const { return volatil; }
bool isSample() const { return sample; }
bool isMemory() const
{
@@ -779,8 +788,8 @@ public:
{
layoutLocation = layoutLocationEnd;
layoutComponent = layoutComponentEnd;
- layoutIndex = layoutIndexEnd;
#ifndef GLSLANG_WEB
+ layoutIndex = layoutIndexEnd;
clearStreamLayout();
clearXfbLayout();
#endif
@@ -885,7 +894,9 @@ public:
layoutSet = layoutSetEnd;
layoutBinding = layoutBindingEnd;
+#ifndef GLSLANG_WEB
layoutAttachment = layoutAttachmentEnd;
+#endif
}
bool hasMatrix() const
@@ -922,6 +933,7 @@ public:
bool hasOffset() const { return false; }
bool isNonPerspective() const { return false; }
bool hasIndex() const { return false; }
+ unsigned getIndex() const { return 0; }
bool hasComponent() const { return false; }
bool hasStream() const { return false; }
bool hasFormat() const { return false; }
@@ -946,6 +958,7 @@ public:
{
return layoutIndex != layoutIndexEnd;
}
+ unsigned getIndex() const { return layoutIndex; }
bool hasComponent() const
{
return layoutComponent != layoutComponentEnd;
@@ -1920,6 +1933,7 @@ public:
case EbtFloat: return "float";
case EbtInt: return "int";
case EbtUint: return "uint";
+ case EbtSampler: return "sampler/image";
#ifndef GLSLANG_WEB
case EbtVoid: return "void";
case EbtDouble: return "double";
@@ -1932,7 +1946,6 @@ public:
case EbtUint64: return "uint64_t";
case EbtBool: return "bool";
case EbtAtomicUint: return "atomic_uint";
- case EbtSampler: return "sampler/image";
case EbtStruct: return "structure";
case EbtBlock: return "block";
case EbtAccStructNV: return "accelerationStructureNV";
@@ -2193,7 +2206,8 @@ public:
const TTypeList* getStruct() const { assert(isStruct()); return structure; }
void setStruct(TTypeList* s) { assert(isStruct()); structure = s; }
TTypeList* getWritableStruct() const { assert(isStruct()); return structure; } // This should only be used when known to not be sharing with other threads
-
+ void setBasicType(const TBasicType& t) { basicType = t; }
+
int computeNumComponents() const
{
int components = 0;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/intermediate.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/intermediate.h
index b599a905ccb..4bddf1c26a0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/intermediate.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/intermediate.h
@@ -1189,6 +1189,7 @@ public:
virtual void traverse(TIntermTraverser*);
TOperator getFlowOp() const { return flowOp; }
TIntermTyped* getExpression() const { return expression; }
+ void setExpression(TIntermTyped* pExpression) { expression = pExpression; }
protected:
TOperator flowOp;
TIntermTyped* expression;
@@ -1309,11 +1310,13 @@ public:
bool isSparseTexture() const { return false; }
bool isImageFootprint() const { return false; }
bool isSparseImage() const { return false; }
+ bool isSubgroup() const { return false; }
#else
bool isImage() const { return op > EOpImageGuardBegin && op < EOpImageGuardEnd; }
bool isSparseTexture() const { return op > EOpSparseTextureGuardBegin && op < EOpSparseTextureGuardEnd; }
bool isImageFootprint() const { return op > EOpImageFootprintGuardBegin && op < EOpImageFootprintGuardEnd; }
bool isSparseImage() const { return op == EOpSparseImageLoad; }
+ bool isSubgroup() const { return op > EOpSubgroupGuardStart && op < EOpSubgroupGuardStop; }
#endif
void setOperationPrecision(TPrecisionQualifier p) { operationPrecision = p; }
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/revision.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/revision.h
index 06fccdf4049..5933bce5720 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/revision.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/revision.h
@@ -1,3 +1,3 @@
// This header is generated by the make-revision script.
-#define GLSLANG_PATCH_LEVEL 3381
+#define GLSLANG_PATCH_LEVEL 3500
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp
index 2344d36cee3..6bf847bab35 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp
@@ -85,18 +85,18 @@ const int TypeStringScalarMask = ~TypeStringColumnMask; // take type to
enum ArgType {
// numbers hardcoded to correspond to 'TypeString'; order and value matter
- TypeB = 1 << 0, // Boolean
- TypeF = 1 << 1, // float 32
- TypeI = 1 << 2, // int 32
- TypeU = 1 << 3, // uint 32
- TypeF16 = 1 << 4, // float 16
- TypeF64 = 1 << 5, // float 64
- TypeI8 = 1 << 6, // int 8
- TypeI16 = 1 << 7, // int 16
- TypeI64 = 1 << 8, // int 64
- TypeU8 = 1 << 9, // uint 8
- TypeU16 = 1 << 10, // uint 16
- TypeU64 = 1 << 11, // uint 64
+ TypeB = 1 << 0, // Boolean
+ TypeF = 1 << 1, // float 32
+ TypeI = 1 << 2, // int 32
+ TypeU = 1 << 3, // uint 32
+ TypeF16 = 1 << 4, // float 16
+ TypeF64 = 1 << 5, // float 64
+ TypeI8 = 1 << 6, // int 8
+ TypeI16 = 1 << 7, // int 16
+ TypeI64 = 1 << 8, // int 64
+ TypeU8 = 1 << 9, // uint 8
+ TypeU16 = 1 << 10, // uint 16
+ TypeU64 = 1 << 11, // uint 64
};
// Mixtures of the above, to help the function tables
const ArgType TypeFI = static_cast<ArgType>(TypeF | TypeI);
@@ -106,22 +106,22 @@ const ArgType TypeIU = static_cast<ArgType>(TypeI | TypeU);
// The relationships between arguments and return type, whether anything is
// output, or other unusual situations.
enum ArgClass {
- ClassRegular = 0, // nothing special, just all vector widths with matching return type; traditional arithmetic
- ClassLS = 1 << 0, // the last argument is also held fixed as a (type-matched) scalar while the others cycle
- ClassXLS = 1 << 1, // the last argument is exclusively a (type-matched) scalar while the others cycle
- ClassLS2 = 1 << 2, // the last two arguments are held fixed as a (type-matched) scalar while the others cycle
- ClassFS = 1 << 3, // the first argument is held fixed as a (type-matched) scalar while the others cycle
- ClassFS2 = 1 << 4, // the first two arguments are held fixed as a (type-matched) scalar while the others cycle
- ClassLO = 1 << 5, // the last argument is an output
- ClassB = 1 << 6, // return type cycles through only bool/bvec, matching vector width of args
- ClassLB = 1 << 7, // last argument cycles through only bool/bvec, matching vector width of args
- ClassV1 = 1 << 8, // scalar only
- ClassFIO = 1 << 9, // first argument is inout
- ClassRS = 1 << 10, // the return is held scalar as the arguments cycle
- ClassNS = 1 << 11, // no scalar prototype
- ClassCV = 1 << 12, // first argument is 'coherent volatile'
- ClassFO = 1 << 13, // first argument is output
- ClassV3 = 1 << 14, // vec3 only
+ ClassRegular = 0, // nothing special, just all vector widths with matching return type; traditional arithmetic
+ ClassLS = 1 << 0, // the last argument is also held fixed as a (type-matched) scalar while the others cycle
+ ClassXLS = 1 << 1, // the last argument is exclusively a (type-matched) scalar while the others cycle
+ ClassLS2 = 1 << 2, // the last two arguments are held fixed as a (type-matched) scalar while the others cycle
+ ClassFS = 1 << 3, // the first argument is held fixed as a (type-matched) scalar while the others cycle
+ ClassFS2 = 1 << 4, // the first two arguments are held fixed as a (type-matched) scalar while the others cycle
+ ClassLO = 1 << 5, // the last argument is an output
+ ClassB = 1 << 6, // return type cycles through only bool/bvec, matching vector width of args
+ ClassLB = 1 << 7, // last argument cycles through only bool/bvec, matching vector width of args
+ ClassV1 = 1 << 8, // scalar only
+ ClassFIO = 1 << 9, // first argument is inout
+ ClassRS = 1 << 10, // the return is held scalar as the arguments cycle
+ ClassNS = 1 << 11, // no scalar prototype
+ ClassCV = 1 << 12, // first argument is 'coherent volatile'
+ ClassFO = 1 << 13, // first argument is output
+ ClassV3 = 1 << 14, // vec3 only
};
// Mixtures of the above, to help the function tables
const ArgClass ClassV1FIOCV = (ArgClass)(ClassV1 | ClassFIO | ClassCV);
@@ -147,6 +147,7 @@ EProfile EDesktopProfile = static_cast<EProfile>(ENoProfile | ECoreProfile | ECo
// Declare pointers to put into the table for versioning.
#ifdef GLSLANG_WEB
const Versioning* Es300Desktop130 = nullptr;
+ const Versioning* Es310Desktop430 = nullptr;
#else
const Versioning Es300Desktop130Version[] = { { EEsProfile, 0, 300, 0, nullptr },
{ EDesktopProfile, 0, 130, 0, nullptr },
@@ -256,7 +257,6 @@ const BuiltInFunction BaseFunctions[] = {
{ EOpGreaterThanEqual, "greaterThanEqual", 2, TypeU, ClassBNS, Es300Desktop130 },
{ EOpVectorEqual, "equal", 2, TypeU, ClassBNS, Es300Desktop130 },
{ EOpVectorNotEqual, "notEqual", 2, TypeU, ClassBNS, Es300Desktop130 },
-#ifndef GLSLANG_WEB
{ EOpAtomicAdd, "atomicAdd", 2, TypeIU, ClassV1FIOCV, Es310Desktop430 },
{ EOpAtomicMin, "atomicMin", 2, TypeIU, ClassV1FIOCV, Es310Desktop430 },
{ EOpAtomicMax, "atomicMax", 2, TypeIU, ClassV1FIOCV, Es310Desktop430 },
@@ -265,9 +265,11 @@ const BuiltInFunction BaseFunctions[] = {
{ EOpAtomicXor, "atomicXor", 2, TypeIU, ClassV1FIOCV, Es310Desktop430 },
{ EOpAtomicExchange, "atomicExchange", 2, TypeIU, ClassV1FIOCV, Es310Desktop430 },
{ EOpAtomicCompSwap, "atomicCompSwap", 3, TypeIU, ClassV1FIOCV, Es310Desktop430 },
+#ifndef GLSLANG_WEB
{ EOpMix, "mix", 3, TypeB, ClassRegular, Es310Desktop450 },
{ EOpMix, "mix", 3, TypeIU, ClassLB, Es310Desktop450 },
#endif
+
{ EOpNull }
};
@@ -278,6 +280,59 @@ const BuiltInFunction DerivativeFunctions[] = {
{ EOpNull }
};
+// For functions declared some other way, but still use the table to relate to operator.
+struct CustomFunction {
+ TOperator op; // operator to map the name to
+ const char* name; // function name
+ const Versioning* versioning; // nullptr means always a valid version
+};
+
+const CustomFunction CustomFunctions[] = {
+ { EOpBarrier, "barrier", nullptr },
+ { EOpMemoryBarrierShared, "memoryBarrierShared", nullptr },
+ { EOpGroupMemoryBarrier, "groupMemoryBarrier", nullptr },
+ { EOpMemoryBarrier, "memoryBarrier", nullptr },
+ { EOpMemoryBarrierBuffer, "memoryBarrierBuffer", nullptr },
+
+ { EOpPackSnorm2x16, "packSnorm2x16", nullptr },
+ { EOpUnpackSnorm2x16, "unpackSnorm2x16", nullptr },
+ { EOpPackUnorm2x16, "packUnorm2x16", nullptr },
+ { EOpUnpackUnorm2x16, "unpackUnorm2x16", nullptr },
+ { EOpPackHalf2x16, "packHalf2x16", nullptr },
+ { EOpUnpackHalf2x16, "unpackHalf2x16", nullptr },
+
+ { EOpMul, "matrixCompMult", nullptr },
+ { EOpOuterProduct, "outerProduct", nullptr },
+ { EOpTranspose, "transpose", nullptr },
+ { EOpDeterminant, "determinant", nullptr },
+ { EOpMatrixInverse, "inverse", nullptr },
+ { EOpFloatBitsToInt, "floatBitsToInt", nullptr },
+ { EOpFloatBitsToUint, "floatBitsToUint", nullptr },
+ { EOpIntBitsToFloat, "intBitsToFloat", nullptr },
+ { EOpUintBitsToFloat, "uintBitsToFloat", nullptr },
+
+ { EOpTextureQuerySize, "textureSize", nullptr },
+ { EOpTextureQueryLod, "textureQueryLod", nullptr },
+ { EOpTextureQueryLevels, "textureQueryLevels", nullptr },
+ { EOpTextureQuerySamples, "textureSamples", nullptr },
+ { EOpTexture, "texture", nullptr },
+ { EOpTextureProj, "textureProj", nullptr },
+ { EOpTextureLod, "textureLod", nullptr },
+ { EOpTextureOffset, "textureOffset", nullptr },
+ { EOpTextureFetch, "texelFetch", nullptr },
+ { EOpTextureFetchOffset, "texelFetchOffset", nullptr },
+ { EOpTextureProjOffset, "textureProjOffset", nullptr },
+ { EOpTextureLodOffset, "textureLodOffset", nullptr },
+ { EOpTextureProjLod, "textureProjLod", nullptr },
+ { EOpTextureProjLodOffset, "textureProjLodOffset", nullptr },
+ { EOpTextureGrad, "textureGrad", nullptr },
+ { EOpTextureGradOffset, "textureGradOffset", nullptr },
+ { EOpTextureProjGrad, "textureProjGrad", nullptr },
+ { EOpTextureProjGradOffset, "textureProjGradOffset", nullptr },
+
+ { EOpNull }
+};
+
// For the given table of functions, add all the indicated prototypes for each
// one, to be returned in the passed in decls.
void AddTabledBuiltin(TString& decls, const BuiltInFunction& function)
@@ -331,8 +386,10 @@ void AddTabledBuiltin(TString& decls, const BuiltInFunction& function)
if (arg == function.numArguments - 1 && (function.classes & ClassLO))
decls.append("out ");
if (arg == 0) {
+#ifndef GLSLANG_WEB
if (function.classes & ClassCV)
decls.append("coherent volatile ");
+#endif
if (function.classes & ClassFIO)
decls.append("inout ");
if (function.classes & ClassFO)
@@ -382,9 +439,10 @@ bool ValidVersion(const BuiltInFunction& function, int version, EProfile profile
// Relate a single table of built-ins to their AST operator.
// This can get called redundantly (especially for the common built-ins, when
// called once per stage). This is a performance issue only, not a correctness
-// concern. It is done for quality arising from simplicity, as there are subtlies
+// concern. It is done for quality arising from simplicity, as there are subtleties
// to get correct if instead trying to do it surgically.
-void RelateTabledBuiltins(const BuiltInFunction* functions, TSymbolTable& symbolTable)
+template<class FunctionT>
+void RelateTabledBuiltins(const FunctionT* functions, TSymbolTable& symbolTable)
{
while (functions->op != EOpNull) {
symbolTable.relateToOperator(functions->name, functions->op);
@@ -408,10 +466,6 @@ void TBuiltIns::addTabledBuiltins(int version, EProfile profile, const SpvVersio
forEachFunction(commonBuiltins, BaseFunctions);
forEachFunction(stageBuiltins[EShLangFragment], DerivativeFunctions);
-#ifdef GLSLANG_WEB
- return;
-#endif
-
if ((profile == EEsProfile && version >= 320) || (profile != EEsProfile && version >= 450))
forEachFunction(stageBuiltins[EShLangCompute], DerivativeFunctions);
}
@@ -421,6 +475,7 @@ void TBuiltIns::relateTabledBuiltins(int /* version */, EProfile /* profile */,
{
RelateTabledBuiltins(BaseFunctions, symbolTable);
RelateTabledBuiltins(DerivativeFunctions, symbolTable);
+ RelateTabledBuiltins(CustomFunctions, symbolTable);
}
inline bool IncludeLegacy(int version, EProfile profile, const SpvVersion& spvVersion)
@@ -465,7 +520,7 @@ TBuiltIns::TBuiltIns()
dimMap[Esd1D] = 1;
dimMap[EsdRect] = 2;
dimMap[EsdBuffer] = 1;
- dimMap[EsdSubpass] = 2; // potientially unused for now
+ dimMap[EsdSubpass] = 2; // potentially unused for now
#endif
}
@@ -484,6 +539,10 @@ TBuiltIns::~TBuiltIns()
//
void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvVersion)
{
+#ifdef GLSLANG_WEB
+ version = 310;
+ profile = EEsProfile;
+#endif
addTabledBuiltins(version, profile, spvVersion);
//============================================================================
@@ -1306,14 +1365,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
commonBuiltins.append(
"mediump vec2 unpackHalf2x16(highp uint);"
"\n");
- }
-#ifndef GLSLANG_WEB
- else if (profile != EEsProfile && version >= 420) {
+ } else if (profile != EEsProfile && version >= 420) {
commonBuiltins.append(
" vec2 unpackHalf2x16(highp uint);"
"\n");
}
+#ifndef GLSLANG_WEB
if ((profile == EEsProfile && version >= 310) ||
(profile != EEsProfile && version >= 400)) {
commonBuiltins.append(
@@ -3795,6 +3853,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"void EndPrimitive();"
"\n");
}
+#endif
//============================================================================
//
@@ -3824,15 +3883,20 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
);
if ((profile != EEsProfile && version >= 420) || esBarrier) {
commonBuiltins.append(
- "void memoryBarrierAtomicCounter();"
"void memoryBarrierBuffer();"
- "void memoryBarrierImage();"
);
stageBuiltins[EShLangCompute].append(
"void memoryBarrierShared();"
"void groupMemoryBarrier();"
);
}
+#ifndef GLSLANG_WEB
+ if ((profile != EEsProfile && version >= 420) || esBarrier) {
+ commonBuiltins.append(
+ "void memoryBarrierAtomicCounter();"
+ "void memoryBarrierImage();"
+ );
+ }
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
stageBuiltins[EShLangMeshNV].append(
"void memoryBarrierShared();"
@@ -4279,6 +4343,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
+#endif
//============================================================================
//
@@ -4308,6 +4373,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
+#ifndef GLSLANG_WEB
//============================================================================
//
// Define the interface to the mesh/task shader.
@@ -5314,10 +5380,9 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
#ifdef GLSLANG_WEB
const int ms = 0;
#else
- for (int ms = 0; ms <= 1; ++ms)
+ for (int ms = 0; ms <= 1; ++ms) // loop over "bool" multisample or not
#endif
{
-#ifndef GLSLANG_WEB
if ((ms || image) && shadow)
continue;
if (ms && profile != EEsProfile && version < 150)
@@ -5326,7 +5391,6 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
continue;
if (ms && profile == EEsProfile && version < 310)
continue;
-#endif
for (int arrayed = 0; arrayed <= 1; ++arrayed) { // loop over "bool" arrayed or not
#ifdef GLSLANG_WEB
@@ -5431,14 +5495,12 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
}
}
-#ifndef GLSLANG_WEB
//
// sparseTexelsResidentARB()
//
if (profile != EEsProfile && version >= 450) {
commonBuiltins.append("bool sparseTexelsResidentARB(int code);\n");
}
-#endif
}
//
@@ -5725,6 +5787,11 @@ void TBuiltIns::addSubpassSampling(TSampler sampler, const TString& typeName, in
//
void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile)
{
+#ifdef GLSLANG_WEB
+ profile = EEsProfile;
+ version = 310;
+#endif
+
//
// texturing
//
@@ -6005,6 +6072,11 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName,
//
void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile)
{
+#ifdef GLSLANG_WEB
+ profile = EEsProfile;
+ version = 310;
+#endif
+
switch (sampler.dim) {
case Esd2D:
case EsdRect:
@@ -6243,6 +6315,11 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, in
//
void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language)
{
+#ifdef GLSLANG_WEB
+ version = 310;
+ profile = EEsProfile;
+#endif
+
//
// Initialize the context-dependent (resource-dependent) built-in strings for parsing.
//
@@ -6300,9 +6377,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
s.append(builtInConstant);
}
-#ifdef GLSLANG_WEB
- }
-#else
+#ifndef GLSLANG_WEB
if (version >= 310) {
// geometry
@@ -6584,8 +6659,29 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
snprintf(builtInConstant, maxSize, "const int gl_MaxTransformFeedbackInterleavedComponents = %d;", resources.maxTransformFeedbackInterleavedComponents);
s.append(builtInConstant);
}
+#endif
}
+ // compute
+ if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 420)) {
+ snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupCount = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupCountX,
+ resources.maxComputeWorkGroupCountY,
+ resources.maxComputeWorkGroupCountZ);
+ s.append(builtInConstant);
+ snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupSize = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupSizeX,
+ resources.maxComputeWorkGroupSizeY,
+ resources.maxComputeWorkGroupSizeZ);
+ s.append(builtInConstant);
+
+ snprintf(builtInConstant, maxSize, "const int gl_MaxComputeUniformComponents = %d;", resources.maxComputeUniformComponents);
+ s.append(builtInConstant);
+ snprintf(builtInConstant, maxSize, "const int gl_MaxComputeTextureImageUnits = %d;", resources.maxComputeTextureImageUnits);
+ s.append(builtInConstant);
+
+ s.append("\n");
+ }
+
+#ifndef GLSLANG_WEB
// images (some in compute below)
if ((profile == EEsProfile && version >= 310) ||
(profile != EEsProfile && version >= 130)) {
@@ -6601,6 +6697,18 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
s.append(builtInConstant);
}
+ // compute
+ if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 420)) {
+ snprintf(builtInConstant, maxSize, "const int gl_MaxComputeImageUniforms = %d;", resources.maxComputeImageUniforms);
+ s.append(builtInConstant);
+ snprintf(builtInConstant, maxSize, "const int gl_MaxComputeAtomicCounters = %d;", resources.maxComputeAtomicCounters);
+ s.append(builtInConstant);
+ snprintf(builtInConstant, maxSize, "const int gl_MaxComputeAtomicCounterBuffers = %d;", resources.maxComputeAtomicCounterBuffers);
+ s.append(builtInConstant);
+
+ s.append("\n");
+ }
+
// atomic counters (some in compute below)
if ((profile == EEsProfile && version >= 310) ||
(profile != EEsProfile && version >= 420)) {
@@ -6638,31 +6746,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
s.append("\n");
}
- // compute
- if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 420)) {
- snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupCount = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupCountX,
- resources.maxComputeWorkGroupCountY,
- resources.maxComputeWorkGroupCountZ);
- s.append(builtInConstant);
- snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupSize = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupSizeX,
- resources.maxComputeWorkGroupSizeY,
- resources.maxComputeWorkGroupSizeZ);
- s.append(builtInConstant);
-
- snprintf(builtInConstant, maxSize, "const int gl_MaxComputeUniformComponents = %d;", resources.maxComputeUniformComponents);
- s.append(builtInConstant);
- snprintf(builtInConstant, maxSize, "const int gl_MaxComputeTextureImageUnits = %d;", resources.maxComputeTextureImageUnits);
- s.append(builtInConstant);
- snprintf(builtInConstant, maxSize, "const int gl_MaxComputeImageUniforms = %d;", resources.maxComputeImageUniforms);
- s.append(builtInConstant);
- snprintf(builtInConstant, maxSize, "const int gl_MaxComputeAtomicCounters = %d;", resources.maxComputeAtomicCounters);
- s.append(builtInConstant);
- snprintf(builtInConstant, maxSize, "const int gl_MaxComputeAtomicCounterBuffers = %d;", resources.maxComputeAtomicCounterBuffers);
- s.append(builtInConstant);
-
- s.append("\n");
- }
-
// GL_ARB_cull_distance
if (profile != EEsProfile && version >= 450) {
snprintf(builtInConstant, maxSize, "const int gl_MaxCullDistances = %d;", resources.maxCullDistances);
@@ -6781,6 +6864,11 @@ static void BuiltInVariable(const char* blockName, const char* name, TBuiltInVar
//
void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable)
{
+#ifdef GLSLANG_WEB
+ version = 310;
+ profile = EEsProfile;
+#endif
+
//
// Tag built-in variables and functions with additional qualifier and extension information
// that cannot be declared with the text strings.
@@ -7547,7 +7635,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
#endif
break;
-#ifndef GLSLANG_WEB
case EShLangCompute:
BuiltInVariable("gl_NumWorkGroups", EbvNumWorkGroups, symbolTable);
BuiltInVariable("gl_WorkGroupSize", EbvWorkGroupSize, symbolTable);
@@ -7555,6 +7642,15 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable("gl_LocalInvocationID", EbvLocalInvocationId, symbolTable);
BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable);
BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable);
+ BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable);
+ BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable);
+
+#ifndef GLSLANG_WEB
+ if ((profile != EEsProfile && version >= 140) ||
+ (profile == EEsProfile && version >= 310)) {
+ symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group);
+ symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview);
+ }
if (profile != EEsProfile && version < 430) {
symbolTable.setVariableExtensions("gl_NumWorkGroups", 1, &E_GL_ARB_compute_shader);
@@ -7636,14 +7732,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable);
}
- if ((profile != EEsProfile && version >= 140) ||
- (profile == EEsProfile && version >= 310)) {
- symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group);
- BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable);
- symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview);
- BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable);
- }
-
// GL_KHR_shader_subgroup
if ((profile == EEsProfile && version >= 310) ||
(profile != EEsProfile && version >= 140)) {
@@ -7674,8 +7762,10 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setFunctionExtensions("dFdyCoarse", 1, &E_GL_NV_compute_shader_derivatives);
symbolTable.setFunctionExtensions("fwidthCoarse", 1, &E_GL_NV_compute_shader_derivatives);
}
-
+#endif
break;
+
+#ifndef GLSLANG_WEB
case EShLangRayGenNV:
case EShLangIntersectNV:
case EShLangAnyHitNV:
@@ -8034,21 +8124,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
relateTabledBuiltins(version, profile, spvVersion, language, symbolTable);
- symbolTable.relateToOperator("matrixCompMult", EOpMul);
- // 120 and 150 are correct for both ES and desktop
- if (version >= 120) {
- symbolTable.relateToOperator("outerProduct", EOpOuterProduct);
- symbolTable.relateToOperator("transpose", EOpTranspose);
- if (version >= 150) {
- symbolTable.relateToOperator("determinant", EOpDeterminant);
- symbolTable.relateToOperator("inverse", EOpMatrixInverse);
- }
- }
-
- symbolTable.relateToOperator("floatBitsToInt", EOpFloatBitsToInt);
- symbolTable.relateToOperator("floatBitsToUint", EOpFloatBitsToUint);
- symbolTable.relateToOperator("intBitsToFloat", EOpIntBitsToFloat);
- symbolTable.relateToOperator("uintBitsToFloat", EOpUintBitsToFloat);
#ifndef GLSLANG_WEB
symbolTable.relateToOperator("doubleBitsToInt64", EOpDoubleBitsToInt64);
symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64);
@@ -8063,14 +8138,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.relateToOperator("int16BitsToHalf", EOpInt16BitsToFloat16);
symbolTable.relateToOperator("uint16BitsToHalf", EOpUint16BitsToFloat16);
-#endif
-
- symbolTable.relateToOperator("packSnorm2x16", EOpPackSnorm2x16);
- symbolTable.relateToOperator("unpackSnorm2x16", EOpUnpackSnorm2x16);
- symbolTable.relateToOperator("packUnorm2x16", EOpPackUnorm2x16);
- symbolTable.relateToOperator("unpackUnorm2x16", EOpUnpackUnorm2x16);
-#ifndef GLSLANG_WEB
symbolTable.relateToOperator("packSnorm4x8", EOpPackSnorm4x8);
symbolTable.relateToOperator("unpackSnorm4x8", EOpUnpackSnorm4x8);
symbolTable.relateToOperator("packUnorm4x8", EOpPackUnorm4x8);
@@ -8078,17 +8146,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.relateToOperator("packDouble2x32", EOpPackDouble2x32);
symbolTable.relateToOperator("unpackDouble2x32", EOpUnpackDouble2x32);
-#endif
-
- symbolTable.relateToOperator("packHalf2x16", EOpPackHalf2x16);
- symbolTable.relateToOperator("unpackHalf2x16", EOpUnpackHalf2x16);
symbolTable.relateToOperator("packInt2x32", EOpPackInt2x32);
symbolTable.relateToOperator("unpackInt2x32", EOpUnpackInt2x32);
symbolTable.relateToOperator("packUint2x32", EOpPackUint2x32);
symbolTable.relateToOperator("unpackUint2x32", EOpUnpackUint2x32);
-#ifndef GLSLANG_WEB
symbolTable.relateToOperator("packInt2x16", EOpPackInt2x16);
symbolTable.relateToOperator("unpackInt2x16", EOpUnpackInt2x16);
symbolTable.relateToOperator("packUint2x16", EOpPackUint2x16);
@@ -8109,11 +8172,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.relateToOperator("unpack16", EOpUnpack16);
symbolTable.relateToOperator("unpack8", EOpUnpack8);
- symbolTable.relateToOperator("barrier", EOpBarrier);
symbolTable.relateToOperator("controlBarrier", EOpBarrier);
- symbolTable.relateToOperator("memoryBarrier", EOpMemoryBarrier);
symbolTable.relateToOperator("memoryBarrierAtomicCounter", EOpMemoryBarrierAtomicCounter);
- symbolTable.relateToOperator("memoryBarrierBuffer", EOpMemoryBarrierBuffer);
symbolTable.relateToOperator("memoryBarrierImage", EOpMemoryBarrierImage);
symbolTable.relateToOperator("atomicLoad", EOpAtomicLoad);
@@ -8156,10 +8216,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.relateToOperator("findMSB", EOpFindMSB);
symbolTable.relateToOperator("helperInvocationEXT", EOpIsHelperInvocation);
-#endif
if (PureOperatorBuiltins) {
-#ifndef GLSLANG_WEB
symbolTable.relateToOperator("imageSize", EOpImageQuerySize);
symbolTable.relateToOperator("imageSamples", EOpImageQuerySamples);
symbolTable.relateToOperator("imageLoad", EOpImageLoad);
@@ -8177,28 +8235,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.relateToOperator("subpassLoad", EOpSubpassLoad);
symbolTable.relateToOperator("subpassLoadMS", EOpSubpassLoadMS);
-#endif
- symbolTable.relateToOperator("textureSize", EOpTextureQuerySize);
- symbolTable.relateToOperator("textureQueryLod", EOpTextureQueryLod);
- symbolTable.relateToOperator("textureQueryLevels", EOpTextureQueryLevels);
- symbolTable.relateToOperator("textureSamples", EOpTextureQuerySamples);
- symbolTable.relateToOperator("texture", EOpTexture);
- symbolTable.relateToOperator("textureProj", EOpTextureProj);
- symbolTable.relateToOperator("textureLod", EOpTextureLod);
- symbolTable.relateToOperator("textureOffset", EOpTextureOffset);
- symbolTable.relateToOperator("texelFetch", EOpTextureFetch);
- symbolTable.relateToOperator("texelFetchOffset", EOpTextureFetchOffset);
- symbolTable.relateToOperator("textureProjOffset", EOpTextureProjOffset);
- symbolTable.relateToOperator("textureLodOffset", EOpTextureLodOffset);
- symbolTable.relateToOperator("textureProjLod", EOpTextureProjLod);
- symbolTable.relateToOperator("textureProjLodOffset", EOpTextureProjLodOffset);
- symbolTable.relateToOperator("textureGrad", EOpTextureGrad);
- symbolTable.relateToOperator("textureGradOffset", EOpTextureGradOffset);
- symbolTable.relateToOperator("textureProjGrad", EOpTextureProjGrad);
- symbolTable.relateToOperator("textureProjGradOffset", EOpTextureProjGradOffset);
-
-#ifndef GLSLANG_WEB
symbolTable.relateToOperator("textureGather", EOpTextureGather);
symbolTable.relateToOperator("textureGatherOffset", EOpTextureGatherOffset);
symbolTable.relateToOperator("textureGatherOffsets", EOpTextureGatherOffsets);
@@ -8440,10 +8477,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.relateToOperator("shadow2DEXT", EOpTexture);
symbolTable.relateToOperator("shadow2DProjEXT", EOpTextureProj);
}
-#endif
}
-#ifndef GLSLANG_WEB
switch(language) {
case EShLangVertex:
break;
@@ -8481,8 +8516,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
break;
case EShLangCompute:
- symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared);
- symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier);
symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared);
if ((profile != EEsProfile && version >= 450) ||
(profile == EEsProfile && version >= 320)) {
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp
index 93d41f7dabf..fcf3e715302 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp
@@ -562,56 +562,12 @@ bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const
return true;
}
-// This is 'mechanism' here, it does any conversion told.
-// It is about basic type, not about shape.
-// The policy comes from the shader or the calling code.
-TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped* node) const
+bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& newOp) const
{
- //
- // Add a new newNode for the conversion.
- //
- TIntermUnary* newNode = nullptr;
-
- TOperator newOp = EOpNull;
-
- bool convertToIntTypes = (convertTo == EbtInt8 || convertTo == EbtUint8 ||
- convertTo == EbtInt16 || convertTo == EbtUint16 ||
- convertTo == EbtInt || convertTo == EbtUint ||
- convertTo == EbtInt64 || convertTo == EbtUint64);
-
- bool convertFromIntTypes = (node->getBasicType() == EbtInt8 || node->getBasicType() == EbtUint8 ||
- node->getBasicType() == EbtInt16 || node->getBasicType() == EbtUint16 ||
- node->getBasicType() == EbtInt || node->getBasicType() == EbtUint ||
- node->getBasicType() == EbtInt64 || node->getBasicType() == EbtUint64);
-
- bool convertToFloatTypes = (convertTo == EbtFloat16 || convertTo == EbtFloat || convertTo == EbtDouble);
-
- bool convertFromFloatTypes = (node->getBasicType() == EbtFloat16 ||
- node->getBasicType() == EbtFloat ||
- node->getBasicType() == EbtDouble);
-
- if (! getArithemeticInt8Enabled()) {
- if (((convertTo == EbtInt8 || convertTo == EbtUint8) && ! convertFromIntTypes) ||
- ((node->getBasicType() == EbtInt8 || node->getBasicType() == EbtUint8) && ! convertToIntTypes))
- return nullptr;
- }
-
- if (! getArithemeticInt16Enabled()) {
- if (((convertTo == EbtInt16 || convertTo == EbtUint16) && ! convertFromIntTypes) ||
- ((node->getBasicType() == EbtInt16 || node->getBasicType() == EbtUint16) && ! convertToIntTypes))
- return nullptr;
- }
-
- if (! getArithemeticFloat16Enabled()) {
- if ((convertTo == EbtFloat16 && ! convertFromFloatTypes) ||
- (node->getBasicType() == EbtFloat16 && ! convertToFloatTypes))
- return nullptr;
- }
-
- switch (convertTo) {
+ switch (dst) {
#ifndef GLSLANG_WEB
case EbtDouble:
- switch (node->getBasicType()) {
+ switch (src) {
case EbtUint: newOp = EOpConvUintToDouble; break;
case EbtBool: newOp = EOpConvBoolToDouble; break;
case EbtFloat: newOp = EOpConvFloatToDouble; break;
@@ -624,12 +580,12 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
case EbtInt64: newOp = EOpConvInt64ToDouble; break;
case EbtUint64: newOp = EOpConvUint64ToDouble; break;
default:
- return nullptr;
+ return false;
}
break;
#endif
case EbtFloat:
- switch (node->getBasicType()) {
+ switch (src) {
case EbtInt: newOp = EOpConvIntToFloat; break;
case EbtUint: newOp = EOpConvUintToFloat; break;
case EbtBool: newOp = EOpConvBoolToFloat; break;
@@ -644,12 +600,12 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
case EbtUint64: newOp = EOpConvUint64ToFloat; break;
#endif
default:
- return nullptr;
+ return false;
}
break;
#ifndef GLSLANG_WEB
case EbtFloat16:
- switch (node->getBasicType()) {
+ switch (src) {
case EbtInt8: newOp = EOpConvInt8ToFloat16; break;
case EbtUint8: newOp = EOpConvUint8ToFloat16; break;
case EbtInt16: newOp = EOpConvInt16ToFloat16; break;
@@ -662,12 +618,12 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
case EbtInt64: newOp = EOpConvInt64ToFloat16; break;
case EbtUint64: newOp = EOpConvUint64ToFloat16; break;
default:
- return nullptr;
+ return false;
}
break;
#endif
case EbtBool:
- switch (node->getBasicType()) {
+ switch (src) {
case EbtInt: newOp = EOpConvIntToBool; break;
case EbtUint: newOp = EOpConvUintToBool; break;
case EbtFloat: newOp = EOpConvFloatToBool; break;
@@ -682,12 +638,12 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
case EbtUint64: newOp = EOpConvUint64ToBool; break;
#endif
default:
- return nullptr;
+ return false;
}
break;
#ifndef GLSLANG_WEB
case EbtInt8:
- switch (node->getBasicType()) {
+ switch (src) {
case EbtUint8: newOp = EOpConvUint8ToInt8; break;
case EbtInt16: newOp = EOpConvInt16ToInt8; break;
case EbtUint16: newOp = EOpConvUint16ToInt8; break;
@@ -700,11 +656,11 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
case EbtDouble: newOp = EOpConvDoubleToInt8; break;
case EbtFloat16: newOp = EOpConvFloat16ToInt8; break;
default:
- return nullptr;
+ return false;
}
break;
case EbtUint8:
- switch (node->getBasicType()) {
+ switch (src) {
case EbtInt8: newOp = EOpConvInt8ToUint8; break;
case EbtInt16: newOp = EOpConvInt16ToUint8; break;
case EbtUint16: newOp = EOpConvUint16ToUint8; break;
@@ -717,12 +673,12 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
case EbtDouble: newOp = EOpConvDoubleToUint8; break;
case EbtFloat16: newOp = EOpConvFloat16ToUint8; break;
default:
- return nullptr;
+ return false;
}
break;
case EbtInt16:
- switch (node->getBasicType()) {
+ switch (src) {
case EbtUint8: newOp = EOpConvUint8ToInt16; break;
case EbtInt8: newOp = EOpConvInt8ToInt16; break;
case EbtUint16: newOp = EOpConvUint16ToInt16; break;
@@ -735,11 +691,11 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
case EbtDouble: newOp = EOpConvDoubleToInt16; break;
case EbtFloat16: newOp = EOpConvFloat16ToInt16; break;
default:
- return nullptr;
+ return false;
}
break;
case EbtUint16:
- switch (node->getBasicType()) {
+ switch (src) {
case EbtInt8: newOp = EOpConvInt8ToUint16; break;
case EbtUint8: newOp = EOpConvUint8ToUint16; break;
case EbtInt16: newOp = EOpConvInt16ToUint16; break;
@@ -752,13 +708,13 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
case EbtDouble: newOp = EOpConvDoubleToUint16; break;
case EbtFloat16: newOp = EOpConvFloat16ToUint16; break;
default:
- return nullptr;
+ return false;
}
break;
#endif
case EbtInt:
- switch (node->getBasicType()) {
+ switch (src) {
case EbtUint: newOp = EOpConvUintToInt; break;
case EbtBool: newOp = EOpConvBoolToInt; break;
case EbtFloat: newOp = EOpConvFloatToInt; break;
@@ -773,11 +729,11 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
case EbtUint64: newOp = EOpConvUint64ToInt; break;
#endif
default:
- return nullptr;
+ return false;
}
break;
case EbtUint:
- switch (node->getBasicType()) {
+ switch (src) {
case EbtInt: newOp = EOpConvIntToUint; break;
case EbtBool: newOp = EOpConvBoolToUint; break;
case EbtFloat: newOp = EOpConvFloatToUint; break;
@@ -792,12 +748,12 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
case EbtUint64: newOp = EOpConvUint64ToUint; break;
#endif
default:
- return nullptr;
+ return false;
}
break;
#ifndef GLSLANG_WEB
case EbtInt64:
- switch (node->getBasicType()) {
+ switch (src) {
case EbtInt8: newOp = EOpConvInt8ToInt64; break;
case EbtUint8: newOp = EOpConvUint8ToInt64; break;
case EbtInt16: newOp = EOpConvInt16ToInt64; break;
@@ -810,11 +766,11 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
case EbtFloat16: newOp = EOpConvFloat16ToInt64; break;
case EbtUint64: newOp = EOpConvUint64ToInt64; break;
default:
- return nullptr;
+ return false;
}
break;
case EbtUint64:
- switch (node->getBasicType()) {
+ switch (src) {
case EbtInt8: newOp = EOpConvInt8ToUint64; break;
case EbtUint8: newOp = EOpConvUint8ToUint64; break;
case EbtInt16: newOp = EOpConvInt16ToUint64; break;
@@ -827,11 +783,64 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
case EbtFloat16: newOp = EOpConvFloat16ToUint64; break;
case EbtInt64: newOp = EOpConvInt64ToUint64; break;
default:
- return nullptr;
+ return false;
}
break;
#endif
default:
+ return false;
+ }
+ return true;
+}
+
+// This is 'mechanism' here, it does any conversion told.
+// It is about basic type, not about shape.
+// The policy comes from the shader or the calling code.
+TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped* node) const
+{
+ //
+ // Add a new newNode for the conversion.
+ //
+
+#ifndef GLSLANG_WEB
+ bool convertToIntTypes = (convertTo == EbtInt8 || convertTo == EbtUint8 ||
+ convertTo == EbtInt16 || convertTo == EbtUint16 ||
+ convertTo == EbtInt || convertTo == EbtUint ||
+ convertTo == EbtInt64 || convertTo == EbtUint64);
+
+ bool convertFromIntTypes = (node->getBasicType() == EbtInt8 || node->getBasicType() == EbtUint8 ||
+ node->getBasicType() == EbtInt16 || node->getBasicType() == EbtUint16 ||
+ node->getBasicType() == EbtInt || node->getBasicType() == EbtUint ||
+ node->getBasicType() == EbtInt64 || node->getBasicType() == EbtUint64);
+
+ bool convertToFloatTypes = (convertTo == EbtFloat16 || convertTo == EbtFloat || convertTo == EbtDouble);
+
+ bool convertFromFloatTypes = (node->getBasicType() == EbtFloat16 ||
+ node->getBasicType() == EbtFloat ||
+ node->getBasicType() == EbtDouble);
+
+ if (! getArithemeticInt8Enabled()) {
+ if (((convertTo == EbtInt8 || convertTo == EbtUint8) && ! convertFromIntTypes) ||
+ ((node->getBasicType() == EbtInt8 || node->getBasicType() == EbtUint8) && ! convertToIntTypes))
+ return nullptr;
+ }
+
+ if (! getArithemeticInt16Enabled()) {
+ if (((convertTo == EbtInt16 || convertTo == EbtUint16) && ! convertFromIntTypes) ||
+ ((node->getBasicType() == EbtInt16 || node->getBasicType() == EbtUint16) && ! convertToIntTypes))
+ return nullptr;
+ }
+
+ if (! getArithemeticFloat16Enabled()) {
+ if ((convertTo == EbtFloat16 && ! convertFromFloatTypes) ||
+ (node->getBasicType() == EbtFloat16 && ! convertToFloatTypes))
+ return nullptr;
+ }
+#endif
+
+ TIntermUnary* newNode = nullptr;
+ TOperator newOp = EOpNull;
+ if (!buildConvertOp(convertTo, node->getBasicType(), newOp)) {
return nullptr;
}
@@ -839,11 +848,14 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
newNode = addUnaryNode(newOp, node, node->getLoc(), newType);
if (node->getAsConstantUnion()) {
+#ifndef GLSLANG_WEB
// 8/16-bit storage extensions don't support 8/16-bit constants, so don't fold conversions
// to those types
if ((getArithemeticInt8Enabled() || !(convertTo == EbtInt8 || convertTo == EbtUint8)) &&
(getArithemeticInt16Enabled() || !(convertTo == EbtInt16 || convertTo == EbtUint16)) &&
- (getArithemeticFloat16Enabled() || !(convertTo == EbtFloat16))) {
+ (getArithemeticFloat16Enabled() || !(convertTo == EbtFloat16)))
+#endif
+ {
TIntermTyped* folded = node->getAsConstantUnion()->fold(newOp, newType);
if (folded)
return folded;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp
index b5ea803db8d..619bf81dd0c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp
@@ -1160,6 +1160,7 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
const TQualifier& argQualifier = argType.getQualifier();
if (argQualifier.isMemory() && (argType.containsOpaque() || argType.isReference())) {
const char* message = "argument cannot drop memory qualifier when passed to formal parameter";
+#ifndef GLSLANG_WEB
if (argQualifier.volatil && ! formalQualifier.volatil)
error(arguments->getLoc(), message, "volatile", "");
if (argQualifier.coherent && ! (formalQualifier.devicecoherent || formalQualifier.coherent))
@@ -1179,6 +1180,7 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
// Don't check 'restrict', it is different than the rest:
// "...but only restrict can be taken away from a calling argument, by a formal parameter that
// lacks the restrict qualifier..."
+#endif
}
if (!builtIn && argQualifier.getFormat() != formalQualifier.getFormat()) {
// we have mismatched formats, which should only be allowed if writeonly
@@ -2155,6 +2157,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
break;
case EOpSubgroupBroadcast:
+ case EOpSubgroupQuadBroadcast:
if (spvVersion.spv < EShTargetSpv_1_5) {
// <id> must be an integral constant expression.
if ((*argp)[1]->getAsConstantUnion() == nullptr)
@@ -2200,7 +2203,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
break;
}
- if (callNode.getOp() > EOpSubgroupGuardStart && callNode.getOp() < EOpSubgroupGuardStop) {
+ if (callNode.isSubgroup()) {
// these require SPIR-V 1.3
if (spvVersion.spv > 0 && spvVersion.spv < EShTargetSpv_1_3)
error(loc, "requires SPIR-V 1.3", "subgroup op", "");
@@ -2778,6 +2781,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
// it, in which case the type comes from the argument instead of from the
// constructor function.
switch (op) {
+#ifndef GLSLANG_WEB
case EOpConstructNonuniform:
if (node != nullptr && node->getAsTyped() != nullptr) {
type.shallowCopy(node->getAsTyped()->getType());
@@ -2785,6 +2789,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
type.getQualifier().nonUniform = true;
}
break;
+#endif
default:
type.shallowCopy(function.getType());
break;
@@ -2793,10 +2798,8 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
// See if it's a matrix
bool constructingMatrix = false;
switch (op) {
-#ifndef GLSLANG_WEB
case EOpConstructTextureSampler:
return constructorTextureSamplerError(loc, function);
-#endif
case EOpConstructMat2x2:
case EOpConstructMat2x3:
case EOpConstructMat2x4:
@@ -3388,11 +3391,11 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
requireProfile(loc, ~EEsProfile, "fragment-shader struct input containing an array");
}
break;
-#ifndef GLSLANG_WEB
case EShLangCompute:
if (! symbolTable.atBuiltInLevel())
error(loc, "global storage input qualifier cannot be used in a compute shader", "in", "");
break;
+#ifndef GLSLANG_WEB
case EShLangTessControl:
if (qualifier.patch)
error(loc, "can only use on output in tessellation-control shader", "patch", "");
@@ -3433,10 +3436,10 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
error(loc, "cannot contain a double, int64, or uint64", GetStorageQualifierString(qualifier.storage), "");
break;
-#ifndef GLSLANG_WEB
case EShLangCompute:
error(loc, "global storage output qualifier cannot be used in a compute shader", "out", "");
break;
+#ifndef GLSLANG_WEB
case EShLangTessEvaluation:
if (qualifier.patch)
error(loc, "can only use on input in tessellation-evaluation shader", "patch", "");
@@ -3814,10 +3817,6 @@ void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qua
// for ES, if size isn't coming from an initializer, it has to be explicitly declared now,
// with very few exceptions
- // last member of ssbo block exception:
- if (qualifier.storage == EvqBuffer && lastMember)
- return;
-
// implicitly-sized io exceptions:
switch (language) {
case EShLangGeometry:
@@ -3852,6 +3851,10 @@ void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qua
#endif
+ // last member of ssbo block exception:
+ if (qualifier.storage == EvqBuffer && lastMember)
+ return;
+
arraySizeRequiredCheck(loc, *arraySizes);
}
@@ -4476,6 +4479,7 @@ void TParseContext::paramCheckFixStorage(const TSourceLoc& loc, const TStorageQu
void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& qualifier, TType& type)
{
+#ifndef GLSLANG_WEB
if (qualifier.isMemory()) {
type.getQualifier().volatil = qualifier.volatil;
type.getQualifier().coherent = qualifier.coherent;
@@ -4488,6 +4492,7 @@ void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& quali
type.getQualifier().writeonly = qualifier.writeonly;
type.getQualifier().restrict = qualifier.restrict;
}
+#endif
if (qualifier.isAuxiliary() ||
qualifier.isInterpolation())
@@ -5149,7 +5154,8 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
return;
} else if (id == "location") {
profileRequires(loc, EEsProfile, 300, nullptr, "location");
- const char* exts[2] = { E_GL_ARB_separate_shader_objects, E_GL_ARB_explicit_attrib_location };
+ const char* exts[2] = { E_GL_ARB_separate_shader_objects, E_GL_ARB_explicit_attrib_location };
+ // GL_ARB_explicit_uniform_location requires 330 or GL_ARB_explicit_attrib_location we do not need to add it here
profileRequires(loc, ~EEsProfile, 330, 2, exts, "location");
if ((unsigned int)value >= TQualifier::layoutLocationEnd)
error(loc, "location is too large", id.c_str(), "");
@@ -5293,11 +5299,10 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
error(loc, "needs a literal integer", "buffer_reference_align", "");
return;
}
+#endif
switch (language) {
- case EShLangVertex:
- break;
-
+#ifndef GLSLANG_WEB
case EShLangTessControl:
if (id == "vertices") {
if (value == 0)
@@ -5310,9 +5315,6 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
}
break;
- case EShLangTessEvaluation:
- break;
-
case EShLangGeometry:
if (id == "invocations") {
profileRequires(loc, ECompatibilityProfile | ECoreProfile, 400, nullptr, "invocations");
@@ -5385,16 +5387,17 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
case EShLangTaskNV:
// Fall through
+#endif
case EShLangCompute:
if (id.compare(0, 11, "local_size_") == 0) {
+#ifndef GLSLANG_WEB
if (language == EShLangMeshNV || language == EShLangTaskNV) {
requireExtensions(loc, 1, &E_GL_NV_mesh_shader, "gl_WorkGroupSize");
- }
- else
- {
+ } else {
profileRequires(loc, EEsProfile, 310, 0, "gl_WorkGroupSize");
profileRequires(loc, ~EEsProfile, 430, E_GL_ARB_compute_shader, "gl_WorkGroupSize");
}
+#endif
if (nonLiteral)
error(loc, "needs a literal integer", "local_size", "");
if (id.size() == 12 && value == 0) {
@@ -5432,12 +5435,11 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
}
}
break;
+
default:
break;
}
-#endif // GLSLANG_WEB
-
error(loc, "there is no such layout identifier for this stage taking an assigned value", id.c_str(), "");
}
@@ -5909,8 +5911,9 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier
case EvqBuffer:
{
const char* feature = "location qualifier on uniform or buffer";
- requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, feature);
- profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, nullptr, feature);
+ requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile | ENoProfile, feature);
+ profileRequires(loc, ~EEsProfile, 330, E_GL_ARB_explicit_attrib_location, feature);
+ profileRequires(loc, ~EEsProfile, 430, E_GL_ARB_explicit_uniform_location, feature);
profileRequires(loc, EEsProfile, 310, nullptr, feature);
break;
}
@@ -7383,6 +7386,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
for (unsigned int member = 0; member < typeList.size(); ++member) {
TQualifier& memberQualifier = typeList[member].type->getQualifier();
const TSourceLoc& memberLoc = typeList[member].loc;
+#ifndef GLSLANG_WEB
if (memberQualifier.hasStream()) {
if (defaultQualification.layoutStream != memberQualifier.layoutStream)
error(memberLoc, "member cannot contradict block", "stream", "");
@@ -7396,6 +7400,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
if (defaultQualification.layoutXfbBuffer != memberQualifier.layoutXfbBuffer)
error(memberLoc, "member cannot contradict block (or what block inherited from global)", "xfb_buffer", "");
}
+#endif
if (memberQualifier.hasPacking())
error(memberLoc, "member of block cannot have a packing layout qualifier", typeList[member].type->getFieldName().c_str(), "");
@@ -7438,6 +7443,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
layoutMemberLocationArrayCheck(loc, memberWithLocation, arraySizes);
+#ifndef GLSLANG_WEB
// Ensure that the block has an XfbBuffer assigned. This is needed
// because if the block has a XfbOffset assigned, then it is
// assumed that it has implicitly assigned the current global
@@ -7447,6 +7453,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
if (!currentBlockQualifier.hasXfbBuffer() && currentBlockQualifier.hasXfbOffset())
currentBlockQualifier.layoutXfbBuffer = globalOutputDefaults.layoutXfbBuffer;
}
+#endif
// Process the members
fixBlockLocations(loc, currentBlockQualifier, typeList, memberWithLocation, memberWithoutLocation);
@@ -8003,6 +8010,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
else
error(loc, "can only apply to 'in'", "point_mode", "");
}
+#endif
for (int i = 0; i < 3; ++i) {
if (publicType.shaderQualifiers.localSizeNotDefault[i]) {
if (publicType.qualifier.storage == EvqVaryingIn) {
@@ -8019,7 +8027,9 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
}
if (intermediate.getLocalSize(i) > (unsigned int)max)
error(loc, "too large; see gl_MaxComputeWorkGroupSize", "local_size", "");
- } else if (language == EShLangMeshNV) {
+ }
+#ifndef GLSLANG_WEB
+ else if (language == EShLangMeshNV) {
switch (i) {
case 0: max = resources.maxMeshWorkGroupSizeX_NV; break;
case 1: max = resources.maxMeshWorkGroupSizeY_NV; break;
@@ -8037,7 +8047,9 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
}
if (intermediate.getLocalSize(i) > (unsigned int)max)
error(loc, "too large; see gl_MaxTaskWorkGroupSizeNV", "local_size", "");
- } else {
+ }
+#endif
+ else {
assert(0);
}
@@ -8062,6 +8074,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
}
}
+#ifndef GLSLANG_WEB
if (publicType.shaderQualifiers.earlyFragmentTests) {
if (publicType.qualifier.storage == EvqVaryingIn)
intermediate.setEarlyFragmentTests();
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h
index 5cee05e116d..39363f1a2a7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h
@@ -283,7 +283,7 @@ public:
const TString* entryPoint = nullptr);
virtual ~TParseContext();
- bool obeyPrecisionQualifiers() const { return precisionManager.respectingPrecisionQualifiers(); };
+ bool obeyPrecisionQualifiers() const { return precisionManager.respectingPrecisionQualifiers(); }
void setPrecisionDefaults();
void setLimits(const TBuiltInResource&) override;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp
index 9a9b69cc40a..7b0093d7b23 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp
@@ -343,6 +343,7 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["const"] = CONST;
(*KeywordMap)["uniform"] = UNIFORM;
+ (*KeywordMap)["buffer"] = BUFFER;
(*KeywordMap)["in"] = IN;
(*KeywordMap)["out"] = OUT;
(*KeywordMap)["smooth"] = SMOOTH;
@@ -410,7 +411,6 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["attribute"] = ATTRIBUTE;
(*KeywordMap)["varying"] = VARYING;
(*KeywordMap)["noperspective"] = NOPERSPECTIVE;
- (*KeywordMap)["buffer"] = BUFFER;
(*KeywordMap)["coherent"] = COHERENT;
(*KeywordMap)["devicecoherent"] = DEVICECOHERENT;
(*KeywordMap)["queuefamilycoherent"] = QUEUEFAMILYCOHERENT;
@@ -564,10 +564,6 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["sampler2D"] = SAMPLER2D;
(*KeywordMap)["samplerCube"] = SAMPLERCUBE;
- (*KeywordMap)["samplerCubeArray"] = SAMPLERCUBEARRAY;
- (*KeywordMap)["samplerCubeArrayShadow"] = SAMPLERCUBEARRAYSHADOW;
- (*KeywordMap)["isamplerCubeArray"] = ISAMPLERCUBEARRAY;
- (*KeywordMap)["usamplerCubeArray"] = USAMPLERCUBEARRAY;
(*KeywordMap)["samplerCubeShadow"] = SAMPLERCUBESHADOW;
(*KeywordMap)["sampler2DArray"] = SAMPLER2DARRAY;
(*KeywordMap)["sampler2DArrayShadow"] = SAMPLER2DARRAYSHADOW;
@@ -582,7 +578,30 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["sampler3D"] = SAMPLER3D;
(*KeywordMap)["sampler2DShadow"] = SAMPLER2DSHADOW;
+ (*KeywordMap)["texture2D"] = TEXTURE2D;
+ (*KeywordMap)["textureCube"] = TEXTURECUBE;
+ (*KeywordMap)["texture2DArray"] = TEXTURE2DARRAY;
+ (*KeywordMap)["itexture2D"] = ITEXTURE2D;
+ (*KeywordMap)["itexture3D"] = ITEXTURE3D;
+ (*KeywordMap)["itextureCube"] = ITEXTURECUBE;
+ (*KeywordMap)["itexture2DArray"] = ITEXTURE2DARRAY;
+ (*KeywordMap)["utexture2D"] = UTEXTURE2D;
+ (*KeywordMap)["utexture3D"] = UTEXTURE3D;
+ (*KeywordMap)["utextureCube"] = UTEXTURECUBE;
+ (*KeywordMap)["utexture2DArray"] = UTEXTURE2DARRAY;
+ (*KeywordMap)["texture3D"] = TEXTURE3D;
+
+ (*KeywordMap)["sampler"] = SAMPLER;
+ (*KeywordMap)["samplerShadow"] = SAMPLERSHADOW;
+
#ifndef GLSLANG_WEB
+ (*KeywordMap)["textureCubeArray"] = TEXTURECUBEARRAY;
+ (*KeywordMap)["itextureCubeArray"] = ITEXTURECUBEARRAY;
+ (*KeywordMap)["utextureCubeArray"] = UTEXTURECUBEARRAY;
+ (*KeywordMap)["samplerCubeArray"] = SAMPLERCUBEARRAY;
+ (*KeywordMap)["samplerCubeArrayShadow"] = SAMPLERCUBEARRAYSHADOW;
+ (*KeywordMap)["isamplerCubeArray"] = ISAMPLERCUBEARRAY;
+ (*KeywordMap)["usamplerCubeArray"] = USAMPLERCUBEARRAY;
(*KeywordMap)["sampler1DArrayShadow"] = SAMPLER1DARRAYSHADOW;
(*KeywordMap)["isampler1DArray"] = ISAMPLER1DARRAY;
(*KeywordMap)["usampler1D"] = USAMPLER1D;
@@ -609,28 +628,11 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["__samplerExternal2DY2YEXT"] = SAMPLEREXTERNAL2DY2YEXT; // GL_EXT_YUV_target
- (*KeywordMap)["sampler"] = SAMPLER;
- (*KeywordMap)["samplerShadow"] = SAMPLERSHADOW;
-
- (*KeywordMap)["texture2D"] = TEXTURE2D;
- (*KeywordMap)["textureCube"] = TEXTURECUBE;
- (*KeywordMap)["textureCubeArray"] = TEXTURECUBEARRAY;
- (*KeywordMap)["itextureCubeArray"] = ITEXTURECUBEARRAY;
- (*KeywordMap)["utextureCubeArray"] = UTEXTURECUBEARRAY;
(*KeywordMap)["itexture1DArray"] = ITEXTURE1DARRAY;
(*KeywordMap)["utexture1D"] = UTEXTURE1D;
(*KeywordMap)["itexture1D"] = ITEXTURE1D;
(*KeywordMap)["utexture1DArray"] = UTEXTURE1DARRAY;
(*KeywordMap)["textureBuffer"] = TEXTUREBUFFER;
- (*KeywordMap)["texture2DArray"] = TEXTURE2DARRAY;
- (*KeywordMap)["itexture2D"] = ITEXTURE2D;
- (*KeywordMap)["itexture3D"] = ITEXTURE3D;
- (*KeywordMap)["itextureCube"] = ITEXTURECUBE;
- (*KeywordMap)["itexture2DArray"] = ITEXTURE2DARRAY;
- (*KeywordMap)["utexture2D"] = UTEXTURE2D;
- (*KeywordMap)["utexture3D"] = UTEXTURE3D;
- (*KeywordMap)["utextureCube"] = UTEXTURECUBE;
- (*KeywordMap)["utexture2DArray"] = UTEXTURE2DARRAY;
(*KeywordMap)["itexture2DRect"] = ITEXTURE2DRECT;
(*KeywordMap)["utexture2DRect"] = UTEXTURE2DRECT;
(*KeywordMap)["itextureBuffer"] = ITEXTUREBUFFER;
@@ -642,7 +644,6 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["itexture2DMSArray"] = ITEXTURE2DMSARRAY;
(*KeywordMap)["utexture2DMSArray"] = UTEXTURE2DMSARRAY;
(*KeywordMap)["texture1D"] = TEXTURE1D;
- (*KeywordMap)["texture3D"] = TEXTURE3D;
(*KeywordMap)["texture2DRect"] = TEXTURE2DRECT;
(*KeywordMap)["texture1DArray"] = TEXTURE1DARRAY;
@@ -904,6 +905,13 @@ int TScanContext::tokenizeIdentifier()
case CASE:
return keyword;
+ case BUFFER:
+ afterBuffer = true;
+ if ((parseContext.isEsProfile() && parseContext.version < 310) ||
+ (!parseContext.isEsProfile() && parseContext.version < 430))
+ return identifierOrType();
+ return keyword;
+
case STRUCT:
afterStruct = true;
return keyword;
@@ -997,12 +1005,6 @@ int TScanContext::tokenizeIdentifier()
if (parseContext.isEsProfile() && parseContext.version >= 300)
reservedWord();
return keyword;
- case BUFFER:
- afterBuffer = true;
- if ((parseContext.isEsProfile() && parseContext.version < 310) ||
- (!parseContext.isEsProfile() && parseContext.version < 430))
- return identifierOrType();
- return keyword;
case PAYLOADNV:
case PAYLOADINNV:
case HITATTRNV:
@@ -1057,13 +1059,12 @@ int TScanContext::tokenizeIdentifier()
case SUBROUTINE:
return es30ReservedFromGLSL(400);
+#endif
case SHARED:
if ((parseContext.isEsProfile() && parseContext.version < 300) ||
(!parseContext.isEsProfile() && parseContext.version < 140))
return identifierOrType();
return keyword;
-#endif
-
case LAYOUT:
{
const int numLayoutExts = 2;
@@ -1321,7 +1322,6 @@ int TScanContext::tokenizeIdentifier()
return keyword;
return identifierOrType();
-#endif
case SAMPLERCUBEARRAY:
case SAMPLERCUBEARRAYSHADOW:
@@ -1335,6 +1335,15 @@ int TScanContext::tokenizeIdentifier()
reservedWord();
return keyword;
+ case TEXTURECUBEARRAY:
+ case ITEXTURECUBEARRAY:
+ case UTEXTURECUBEARRAY:
+ if (parseContext.spvVersion.vulkan > 0)
+ return keyword;
+ else
+ return identifierOrType();
+#endif
+
case UINT:
case UVEC2:
case UVEC3:
@@ -1369,6 +1378,25 @@ int TScanContext::tokenizeIdentifier()
}
return keyword;
+ case TEXTURE2D:
+ case TEXTURECUBE:
+ case TEXTURE2DARRAY:
+ case ITEXTURE2D:
+ case ITEXTURE3D:
+ case ITEXTURECUBE:
+ case ITEXTURE2DARRAY:
+ case UTEXTURE2D:
+ case UTEXTURE3D:
+ case UTEXTURECUBE:
+ case UTEXTURE2DARRAY:
+ case TEXTURE3D:
+ case SAMPLER:
+ case SAMPLERSHADOW:
+ if (parseContext.spvVersion.vulkan > 0)
+ return keyword;
+ else
+ return identifierOrType();
+
#ifndef GLSLANG_WEB
case ISAMPLER1D:
case ISAMPLER1DARRAY:
@@ -1458,25 +1486,11 @@ int TScanContext::tokenizeIdentifier()
return keyword;
return identifierOrType();
- case TEXTURE2D:
- case TEXTURECUBE:
- case TEXTURECUBEARRAY:
- case ITEXTURECUBEARRAY:
- case UTEXTURECUBEARRAY:
case ITEXTURE1DARRAY:
case UTEXTURE1D:
case ITEXTURE1D:
case UTEXTURE1DARRAY:
case TEXTUREBUFFER:
- case TEXTURE2DARRAY:
- case ITEXTURE2D:
- case ITEXTURE3D:
- case ITEXTURECUBE:
- case ITEXTURE2DARRAY:
- case UTEXTURE2D:
- case UTEXTURE3D:
- case UTEXTURECUBE:
- case UTEXTURE2DARRAY:
case ITEXTURE2DRECT:
case UTEXTURE2DRECT:
case ITEXTUREBUFFER:
@@ -1488,11 +1502,8 @@ int TScanContext::tokenizeIdentifier()
case ITEXTURE2DMSARRAY:
case UTEXTURE2DMSARRAY:
case TEXTURE1D:
- case TEXTURE3D:
case TEXTURE2DRECT:
case TEXTURE1DARRAY:
- case SAMPLER:
- case SAMPLERSHADOW:
if (parseContext.spvVersion.vulkan > 0)
return keyword;
else
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp
index 9b3cdc6d351..44ce1c19d1a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp
@@ -288,6 +288,11 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
EShLanguage language, EShSource source, TInfoSink& infoSink, TSymbolTable** commonTable,
TSymbolTable** symbolTables)
{
+#ifdef GLSLANG_WEB
+ profile = EEsProfile;
+ version = 310;
+#endif
+
(*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]);
InitializeSymbolTable(builtInParseables.getStageString(language), version, profile, spvVersion, language, source,
infoSink, *symbolTables[language]);
@@ -304,6 +309,11 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
//
bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, const SpvVersion& spvVersion, EShSource source)
{
+#ifdef GLSLANG_WEB
+ profile = EEsProfile;
+ version = 310;
+#endif
+
std::unique_ptr<TBuiltInParseables> builtInParseables(CreateBuiltInParseables(infoSink, source));
if (builtInParseables == nullptr)
@@ -341,6 +351,7 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
(profile == EEsProfile && version >= 310))
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangGeometry, source,
infoSink, commonTable, symbolTables);
+#endif
// check for compute
if ((profile != EEsProfile && version >= 420) ||
@@ -375,7 +386,6 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
(profile == EEsProfile && version >= 320))
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTaskNV, source,
infoSink, commonTable, symbolTables);
-#endif
return true;
}
@@ -871,6 +881,11 @@ bool ProcessDeferred(
bool goodVersion = DeduceVersionProfile(compiler->infoSink, stage,
versionNotFirst, defaultVersion, source, version, profile, spvVersion);
+#ifdef GLSLANG_WEB
+ profile = EEsProfile;
+ version = 310;
+#endif
+
bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst));
#ifndef GLSLANG_WEB
bool warnVersionNotFirst = false;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp
index 644acb1c90e..518ba6cd256 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp
@@ -174,6 +174,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_ARB_texture_cube_map_array] = EBhDisable;
extensionBehavior[E_GL_ARB_shader_texture_lod] = EBhDisable;
extensionBehavior[E_GL_ARB_explicit_attrib_location] = EBhDisable;
+ extensionBehavior[E_GL_ARB_explicit_uniform_location] = EBhDisable;
extensionBehavior[E_GL_ARB_shader_image_load_store] = EBhDisable;
extensionBehavior[E_GL_ARB_shader_atomic_counters] = EBhDisable;
extensionBehavior[E_GL_ARB_shader_draw_parameters] = EBhDisable;
@@ -378,6 +379,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_ARB_texture_cube_map_array 1\n"
"#define GL_ARB_shader_texture_lod 1\n"
"#define GL_ARB_explicit_attrib_location 1\n"
+ "#define GL_ARB_explicit_uniform_location 1\n"
"#define GL_ARB_shader_image_load_store 1\n"
"#define GL_ARB_shader_atomic_counters 1\n"
"#define GL_ARB_shader_draw_parameters 1\n"
@@ -525,11 +527,11 @@ const char* StageName(EShLanguage stage)
switch(stage) {
case EShLangVertex: return "vertex";
case EShLangFragment: return "fragment";
+ case EShLangCompute: return "compute";
#ifndef GLSLANG_WEB
case EShLangTessControl: return "tessellation control";
case EShLangTessEvaluation: return "tessellation evaluation";
case EShLangGeometry: return "geometry";
- case EShLangCompute: return "compute";
case EShLangRayGenNV: return "ray-generation";
case EShLangIntersectNV: return "intersection";
case EShLangAnyHitNV: return "any-hit";
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.h b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.h
index fae04f45615..84fafd77c4e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.h
@@ -126,6 +126,7 @@ const char* const E_GL_ARB_enhanced_layouts = "GL_ARB_enhanced_layou
const char* const E_GL_ARB_texture_cube_map_array = "GL_ARB_texture_cube_map_array";
const char* const E_GL_ARB_shader_texture_lod = "GL_ARB_shader_texture_lod";
const char* const E_GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attrib_location";
+const char* const E_GL_ARB_explicit_uniform_location = "GL_ARB_explicit_uniform_location";
const char* const E_GL_ARB_shader_image_load_store = "GL_ARB_shader_image_load_store";
const char* const E_GL_ARB_shader_atomic_counters = "GL_ARB_shader_atomic_counters";
const char* const E_GL_ARB_shader_draw_parameters = "GL_ARB_shader_draw_parameters";
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4
index 6ace0380415..20f2ba40dfa 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4
@@ -38,7 +38,7 @@
//
// Do not edit the .y file, only edit the .m4 file.
-// The .y bison file is not a source file, it is a derivitive of the .m4 file.
+// The .y bison file is not a source file, it is a derivative of the .m4 file.
// The m4 file needs to be processed by m4 to generate the .y bison file.
//
// Code sandwiched between a pair:
@@ -49,7 +49,7 @@
// ...
// GLSLANG_WEB_EXCLUDE_OFF
//
-// Will be exluded from the grammar when m4 is executed as:
+// Will be excluded from the grammar when m4 is executed as:
//
// m4 -P -DGLSLANG_WEB
//
@@ -166,8 +166,12 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> SAMPLER2DARRAYSHADOW ISAMPLER2D ISAMPLER3D ISAMPLERCUBE
%token <lex> ISAMPLER2DARRAY USAMPLER2D USAMPLER3D
%token <lex> USAMPLERCUBE USAMPLER2DARRAY
-%token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
-%token <lex> ISAMPLERCUBEARRAY USAMPLERCUBEARRAY
+
+// separate image/sampler
+%token <lex> SAMPLER SAMPLERSHADOW
+%token <lex> TEXTURE2D TEXTURE3D TEXTURECUBE TEXTURE2DARRAY
+%token <lex> ITEXTURE2D ITEXTURE3D ITEXTURECUBE ITEXTURE2DARRAY
+%token <lex> UTEXTURE2D UTEXTURE3D UTEXTURECUBE UTEXTURE2DARRAY
GLSLANG_WEB_EXCLUDE_ON
@@ -203,6 +207,8 @@ GLSLANG_WEB_EXCLUDE_ON
%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
// combined image/sampler
+%token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
+%token <lex> ISAMPLERCUBEARRAY USAMPLERCUBEARRAY
%token <lex> SAMPLER1D SAMPLER1DARRAY SAMPLER1DARRAYSHADOW ISAMPLER1D SAMPLER1DSHADOW
%token <lex> SAMPLER2DRECT SAMPLER2DRECTSHADOW ISAMPLER2DRECT USAMPLER2DRECT
%token <lex> SAMPLERBUFFER ISAMPLERBUFFER USAMPLERBUFFER
@@ -233,18 +239,12 @@ GLSLANG_WEB_EXCLUDE_ON
%token <lex> F16IMAGECUBE F16IMAGE1DARRAY F16IMAGE2DARRAY F16IMAGECUBEARRAY
%token <lex> F16IMAGEBUFFER F16IMAGE2DMS F16IMAGE2DMSARRAY
-// pure sampler
-%token <lex> SAMPLER SAMPLERSHADOW
-
// texture without sampler
-%token <lex> TEXTURE1D TEXTURE2D TEXTURE3D TEXTURECUBE
-%token <lex> TEXTURE1DARRAY TEXTURE2DARRAY
-%token <lex> ITEXTURE1D ITEXTURE2D ITEXTURE3D ITEXTURECUBE
-%token <lex> ITEXTURE1DARRAY ITEXTURE2DARRAY UTEXTURE1D UTEXTURE2D UTEXTURE3D
-%token <lex> UTEXTURECUBE UTEXTURE1DARRAY UTEXTURE2DARRAY
+%token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY
+%token <lex> TEXTURE1D ITEXTURE1D UTEXTURE1D
+%token <lex> TEXTURE1DARRAY ITEXTURE1DARRAY UTEXTURE1DARRAY
%token <lex> TEXTURE2DRECT ITEXTURE2DRECT UTEXTURE2DRECT
%token <lex> TEXTUREBUFFER ITEXTUREBUFFER UTEXTUREBUFFER
-%token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY
%token <lex> TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS
%token <lex> TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY
@@ -277,7 +277,7 @@ GLSLANG_WEB_EXCLUDE_OFF
%token <lex> CENTROID IN OUT INOUT
%token <lex> STRUCT VOID WHILE
%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT
-%token <lex> UNIFORM SHARED
+%token <lex> UNIFORM SHARED BUFFER
%token <lex> FLAT SMOOTH LAYOUT
GLSLANG_WEB_EXCLUDE_ON
@@ -285,7 +285,7 @@ GLSLANG_WEB_EXCLUDE_ON
%token <lex> INT64CONSTANT UINT64CONSTANT
%token <lex> SUBROUTINE DEMOTE
%token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV
-%token <lex> PATCH SAMPLE BUFFER NONUNIFORM
+%token <lex> PATCH SAMPLE NONUNIFORM
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
%token <lex> SUBGROUPCOHERENT NONPRIVATE
%token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV
@@ -1360,7 +1360,6 @@ storage_qualifier
$$.init($1.loc);
$$.qualifier.storage = EvqUniform;
}
-GLSLANG_WEB_EXCLUDE_ON
| SHARED {
parseContext.globalCheck($1.loc, "shared");
parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
@@ -1374,6 +1373,7 @@ GLSLANG_WEB_EXCLUDE_ON
$$.init($1.loc);
$$.qualifier.storage = EvqBuffer;
}
+GLSLANG_WEB_EXCLUDE_ON
| ATTRIBUTE {
parseContext.requireStage($1.loc, EShLangVertex, "attribute");
parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute");
@@ -2354,6 +2354,16 @@ GLSLANG_WEB_EXCLUDE_OFF
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, EsdCube, false, true);
}
+ | SAMPLER2DARRAY {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.set(EbtFloat, Esd2D, true);
+ }
+ | SAMPLER2DARRAYSHADOW {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.set(EbtFloat, Esd2D, true, true);
+ }
GLSLANG_WEB_EXCLUDE_ON
| SAMPLER1DSHADOW {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@@ -2370,17 +2380,6 @@ GLSLANG_WEB_EXCLUDE_ON
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, Esd1D, true, true);
}
-GLSLANG_WEB_EXCLUDE_OFF
- | SAMPLER2DARRAY {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.set(EbtFloat, Esd2D, true);
- }
- | SAMPLER2DARRAYSHADOW {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.set(EbtFloat, Esd2D, true, true);
- }
| SAMPLERCUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@@ -2391,7 +2390,6 @@ GLSLANG_WEB_EXCLUDE_OFF
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, EsdCube, true, true);
}
-GLSLANG_WEB_EXCLUDE_ON
| F16SAMPLER1D {
parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@@ -2491,50 +2489,66 @@ GLSLANG_WEB_EXCLUDE_OFF
$$.basicType = EbtSampler;
$$.sampler.set(EbtInt, EsdCube);
}
-GLSLANG_WEB_EXCLUDE_ON
- | ISAMPLER1DARRAY {
+ | ISAMPLER2DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
- $$.sampler.set(EbtInt, Esd1D, true);
+ $$.sampler.set(EbtInt, Esd2D, true);
}
-GLSLANG_WEB_EXCLUDE_OFF
- | ISAMPLER2DARRAY {
+ | USAMPLER2D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
- $$.sampler.set(EbtInt, Esd2D, true);
+ $$.sampler.set(EbtUint, Esd2D);
+ }
+ | USAMPLER3D {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.set(EbtUint, Esd3D);
+ }
+ | USAMPLERCUBE {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.set(EbtUint, EsdCube);
+ }
+GLSLANG_WEB_EXCLUDE_ON
+ | ISAMPLER1DARRAY {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.set(EbtInt, Esd1D, true);
}
| ISAMPLERCUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtInt, EsdCube, true);
}
-GLSLANG_WEB_EXCLUDE_ON
| USAMPLER1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtUint, Esd1D);
}
-GLSLANG_WEB_EXCLUDE_OFF
- | USAMPLER2D {
+ | USAMPLER1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
- $$.sampler.set(EbtUint, Esd2D);
+ $$.sampler.set(EbtUint, Esd1D, true);
}
- | USAMPLER3D {
+ | USAMPLERCUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
- $$.sampler.set(EbtUint, Esd3D);
+ $$.sampler.set(EbtUint, EsdCube, true);
}
- | USAMPLERCUBE {
+ | TEXTURECUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
- $$.sampler.set(EbtUint, EsdCube);
+ $$.sampler.setTexture(EbtFloat, EsdCube, true);
}
-GLSLANG_WEB_EXCLUDE_ON
- | USAMPLER1DARRAY {
+ | ITEXTURECUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
- $$.sampler.set(EbtUint, Esd1D, true);
+ $$.sampler.setTexture(EbtInt, EsdCube, true);
+ }
+ | UTEXTURECUBEARRAY {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtUint, EsdCube, true);
}
GLSLANG_WEB_EXCLUDE_OFF
| USAMPLER2DARRAY {
@@ -2542,10 +2556,75 @@ GLSLANG_WEB_EXCLUDE_OFF
$$.basicType = EbtSampler;
$$.sampler.set(EbtUint, Esd2D, true);
}
- | USAMPLERCUBEARRAY {
+ | TEXTURE2D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
- $$.sampler.set(EbtUint, EsdCube, true);
+ $$.sampler.setTexture(EbtFloat, Esd2D);
+ }
+ | TEXTURE3D {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtFloat, Esd3D);
+ }
+ | TEXTURE2DARRAY {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtFloat, Esd2D, true);
+ }
+ | TEXTURECUBE {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtFloat, EsdCube);
+ }
+ | ITEXTURE2D {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtInt, Esd2D);
+ }
+ | ITEXTURE3D {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtInt, Esd3D);
+ }
+ | ITEXTURECUBE {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtInt, EsdCube);
+ }
+ | ITEXTURE2DARRAY {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtInt, Esd2D, true);
+ }
+ | UTEXTURE2D {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtUint, Esd2D);
+ }
+ | UTEXTURE3D {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtUint, Esd3D);
+ }
+ | UTEXTURECUBE {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtUint, EsdCube);
+ }
+ | UTEXTURE2DARRAY {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtUint, Esd2D, true);
+ }
+ | SAMPLER {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setPureSampler(false);
+ }
+ | SAMPLERSHADOW {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setPureSampler(true);
}
GLSLANG_WEB_EXCLUDE_ON
| SAMPLER2DRECT {
@@ -2643,16 +2722,6 @@ GLSLANG_WEB_EXCLUDE_ON
$$.basicType = EbtSampler;
$$.sampler.set(EbtUint, Esd2D, true, false, true);
}
- | SAMPLER {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setPureSampler(false);
- }
- | SAMPLERSHADOW {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setPureSampler(true);
- }
| TEXTURE1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@@ -2664,33 +2733,18 @@ GLSLANG_WEB_EXCLUDE_ON
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, Esd1D);
}
- | TEXTURE2D {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtFloat, Esd2D);
- }
| F16TEXTURE2D {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, Esd2D);
}
- | TEXTURE3D {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtFloat, Esd3D);
- }
| F16TEXTURE3D {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, Esd3D);
}
- | TEXTURECUBE {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtFloat, EsdCube);
- }
| F16TEXTURECUBE {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@@ -2708,22 +2762,12 @@ GLSLANG_WEB_EXCLUDE_ON
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, Esd1D, true);
}
- | TEXTURE2DARRAY {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtFloat, Esd2D, true);
- }
| F16TEXTURE2DARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, Esd2D, true);
}
- | TEXTURECUBEARRAY {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtFloat, EsdCube, true);
- }
| F16TEXTURECUBEARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@@ -2735,71 +2779,21 @@ GLSLANG_WEB_EXCLUDE_ON
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, Esd1D);
}
- | ITEXTURE2D {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtInt, Esd2D);
- }
- | ITEXTURE3D {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtInt, Esd3D);
- }
- | ITEXTURECUBE {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtInt, EsdCube);
- }
| ITEXTURE1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, Esd1D, true);
}
- | ITEXTURE2DARRAY {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtInt, Esd2D, true);
- }
- | ITEXTURECUBEARRAY {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtInt, EsdCube, true);
- }
| UTEXTURE1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, Esd1D);
}
- | UTEXTURE2D {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtUint, Esd2D);
- }
- | UTEXTURE3D {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtUint, Esd3D);
- }
- | UTEXTURECUBE {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtUint, EsdCube);
- }
| UTEXTURE1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, Esd1D, true);
}
- | UTEXTURE2DARRAY {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtUint, Esd2D, true);
- }
- | UTEXTURECUBEARRAY {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtUint, EsdCube, true);
- }
| TEXTURE2DRECT {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.y b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.y
index 008faf0ee20..e263f3d7a17 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.y
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.y
@@ -38,7 +38,7 @@
//
// Do not edit the .y file, only edit the .m4 file.
-// The .y bison file is not a source file, it is a derivitive of the .m4 file.
+// The .y bison file is not a source file, it is a derivative of the .m4 file.
// The m4 file needs to be processed by m4 to generate the .y bison file.
//
// Code sandwiched between a pair:
@@ -49,7 +49,7 @@
// ...
// GLSLANG_WEB_EXCLUDE_OFF
//
-// Will be exluded from the grammar when m4 is executed as:
+// Will be excluded from the grammar when m4 is executed as:
//
// m4 -P -DGLSLANG_WEB
//
@@ -166,8 +166,12 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> SAMPLER2DARRAYSHADOW ISAMPLER2D ISAMPLER3D ISAMPLERCUBE
%token <lex> ISAMPLER2DARRAY USAMPLER2D USAMPLER3D
%token <lex> USAMPLERCUBE USAMPLER2DARRAY
-%token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
-%token <lex> ISAMPLERCUBEARRAY USAMPLERCUBEARRAY
+
+// separate image/sampler
+%token <lex> SAMPLER SAMPLERSHADOW
+%token <lex> TEXTURE2D TEXTURE3D TEXTURECUBE TEXTURE2DARRAY
+%token <lex> ITEXTURE2D ITEXTURE3D ITEXTURECUBE ITEXTURE2DARRAY
+%token <lex> UTEXTURE2D UTEXTURE3D UTEXTURECUBE UTEXTURE2DARRAY
@@ -203,6 +207,8 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
// combined image/sampler
+%token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
+%token <lex> ISAMPLERCUBEARRAY USAMPLERCUBEARRAY
%token <lex> SAMPLER1D SAMPLER1DARRAY SAMPLER1DARRAYSHADOW ISAMPLER1D SAMPLER1DSHADOW
%token <lex> SAMPLER2DRECT SAMPLER2DRECTSHADOW ISAMPLER2DRECT USAMPLER2DRECT
%token <lex> SAMPLERBUFFER ISAMPLERBUFFER USAMPLERBUFFER
@@ -233,18 +239,12 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> F16IMAGECUBE F16IMAGE1DARRAY F16IMAGE2DARRAY F16IMAGECUBEARRAY
%token <lex> F16IMAGEBUFFER F16IMAGE2DMS F16IMAGE2DMSARRAY
-// pure sampler
-%token <lex> SAMPLER SAMPLERSHADOW
-
// texture without sampler
-%token <lex> TEXTURE1D TEXTURE2D TEXTURE3D TEXTURECUBE
-%token <lex> TEXTURE1DARRAY TEXTURE2DARRAY
-%token <lex> ITEXTURE1D ITEXTURE2D ITEXTURE3D ITEXTURECUBE
-%token <lex> ITEXTURE1DARRAY ITEXTURE2DARRAY UTEXTURE1D UTEXTURE2D UTEXTURE3D
-%token <lex> UTEXTURECUBE UTEXTURE1DARRAY UTEXTURE2DARRAY
+%token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY
+%token <lex> TEXTURE1D ITEXTURE1D UTEXTURE1D
+%token <lex> TEXTURE1DARRAY ITEXTURE1DARRAY UTEXTURE1DARRAY
%token <lex> TEXTURE2DRECT ITEXTURE2DRECT UTEXTURE2DRECT
%token <lex> TEXTUREBUFFER ITEXTUREBUFFER UTEXTUREBUFFER
-%token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY
%token <lex> TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS
%token <lex> TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY
@@ -277,7 +277,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> CENTROID IN OUT INOUT
%token <lex> STRUCT VOID WHILE
%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT
-%token <lex> UNIFORM SHARED
+%token <lex> UNIFORM SHARED BUFFER
%token <lex> FLAT SMOOTH LAYOUT
@@ -285,7 +285,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> INT64CONSTANT UINT64CONSTANT
%token <lex> SUBROUTINE DEMOTE
%token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV
-%token <lex> PATCH SAMPLE BUFFER NONUNIFORM
+%token <lex> PATCH SAMPLE NONUNIFORM
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
%token <lex> SUBGROUPCOHERENT NONPRIVATE
%token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV
@@ -1360,7 +1360,6 @@ storage_qualifier
$$.init($1.loc);
$$.qualifier.storage = EvqUniform;
}
-
| SHARED {
parseContext.globalCheck($1.loc, "shared");
parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
@@ -1374,6 +1373,7 @@ storage_qualifier
$$.init($1.loc);
$$.qualifier.storage = EvqBuffer;
}
+
| ATTRIBUTE {
parseContext.requireStage($1.loc, EShLangVertex, "attribute");
parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute");
@@ -2354,6 +2354,16 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, EsdCube, false, true);
}
+ | SAMPLER2DARRAY {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.set(EbtFloat, Esd2D, true);
+ }
+ | SAMPLER2DARRAYSHADOW {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.set(EbtFloat, Esd2D, true, true);
+ }
| SAMPLER1DSHADOW {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@@ -2370,17 +2380,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, Esd1D, true, true);
}
-
- | SAMPLER2DARRAY {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.set(EbtFloat, Esd2D, true);
- }
- | SAMPLER2DARRAYSHADOW {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.set(EbtFloat, Esd2D, true, true);
- }
| SAMPLERCUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@@ -2391,7 +2390,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, EsdCube, true, true);
}
-
| F16SAMPLER1D {
parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@@ -2491,50 +2489,66 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.set(EbtInt, EsdCube);
}
-
- | ISAMPLER1DARRAY {
+ | ISAMPLER2DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
- $$.sampler.set(EbtInt, Esd1D, true);
+ $$.sampler.set(EbtInt, Esd2D, true);
+ }
+ | USAMPLER2D {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.set(EbtUint, Esd2D);
+ }
+ | USAMPLER3D {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.set(EbtUint, Esd3D);
+ }
+ | USAMPLERCUBE {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.set(EbtUint, EsdCube);
}
- | ISAMPLER2DARRAY {
+ | ISAMPLER1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
- $$.sampler.set(EbtInt, Esd2D, true);
+ $$.sampler.set(EbtInt, Esd1D, true);
}
| ISAMPLERCUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtInt, EsdCube, true);
}
-
| USAMPLER1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtUint, Esd1D);
}
-
- | USAMPLER2D {
+ | USAMPLER1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
- $$.sampler.set(EbtUint, Esd2D);
+ $$.sampler.set(EbtUint, Esd1D, true);
}
- | USAMPLER3D {
+ | USAMPLERCUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
- $$.sampler.set(EbtUint, Esd3D);
+ $$.sampler.set(EbtUint, EsdCube, true);
}
- | USAMPLERCUBE {
+ | TEXTURECUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
- $$.sampler.set(EbtUint, EsdCube);
+ $$.sampler.setTexture(EbtFloat, EsdCube, true);
}
-
- | USAMPLER1DARRAY {
+ | ITEXTURECUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
- $$.sampler.set(EbtUint, Esd1D, true);
+ $$.sampler.setTexture(EbtInt, EsdCube, true);
+ }
+ | UTEXTURECUBEARRAY {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtUint, EsdCube, true);
}
| USAMPLER2DARRAY {
@@ -2542,10 +2556,75 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.set(EbtUint, Esd2D, true);
}
- | USAMPLERCUBEARRAY {
+ | TEXTURE2D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
- $$.sampler.set(EbtUint, EsdCube, true);
+ $$.sampler.setTexture(EbtFloat, Esd2D);
+ }
+ | TEXTURE3D {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtFloat, Esd3D);
+ }
+ | TEXTURE2DARRAY {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtFloat, Esd2D, true);
+ }
+ | TEXTURECUBE {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtFloat, EsdCube);
+ }
+ | ITEXTURE2D {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtInt, Esd2D);
+ }
+ | ITEXTURE3D {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtInt, Esd3D);
+ }
+ | ITEXTURECUBE {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtInt, EsdCube);
+ }
+ | ITEXTURE2DARRAY {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtInt, Esd2D, true);
+ }
+ | UTEXTURE2D {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtUint, Esd2D);
+ }
+ | UTEXTURE3D {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtUint, Esd3D);
+ }
+ | UTEXTURECUBE {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtUint, EsdCube);
+ }
+ | UTEXTURE2DARRAY {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setTexture(EbtUint, Esd2D, true);
+ }
+ | SAMPLER {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setPureSampler(false);
+ }
+ | SAMPLERSHADOW {
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+ $$.basicType = EbtSampler;
+ $$.sampler.setPureSampler(true);
}
| SAMPLER2DRECT {
@@ -2643,16 +2722,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.set(EbtUint, Esd2D, true, false, true);
}
- | SAMPLER {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setPureSampler(false);
- }
- | SAMPLERSHADOW {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setPureSampler(true);
- }
| TEXTURE1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@@ -2664,33 +2733,18 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, Esd1D);
}
- | TEXTURE2D {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtFloat, Esd2D);
- }
| F16TEXTURE2D {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, Esd2D);
}
- | TEXTURE3D {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtFloat, Esd3D);
- }
| F16TEXTURE3D {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, Esd3D);
}
- | TEXTURECUBE {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtFloat, EsdCube);
- }
| F16TEXTURECUBE {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@@ -2708,22 +2762,12 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, Esd1D, true);
}
- | TEXTURE2DARRAY {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtFloat, Esd2D, true);
- }
| F16TEXTURE2DARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, Esd2D, true);
}
- | TEXTURECUBEARRAY {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtFloat, EsdCube, true);
- }
| F16TEXTURECUBEARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@@ -2735,71 +2779,21 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, Esd1D);
}
- | ITEXTURE2D {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtInt, Esd2D);
- }
- | ITEXTURE3D {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtInt, Esd3D);
- }
- | ITEXTURECUBE {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtInt, EsdCube);
- }
| ITEXTURE1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, Esd1D, true);
}
- | ITEXTURE2DARRAY {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtInt, Esd2D, true);
- }
- | ITEXTURECUBEARRAY {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtInt, EsdCube, true);
- }
| UTEXTURE1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, Esd1D);
}
- | UTEXTURE2D {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtUint, Esd2D);
- }
- | UTEXTURE3D {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtUint, Esd3D);
- }
- | UTEXTURECUBE {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtUint, EsdCube);
- }
| UTEXTURE1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, Esd1D, true);
}
- | UTEXTURE2DARRAY {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtUint, Esd2D, true);
- }
- | UTEXTURECUBEARRAY {
- $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
- $$.basicType = EbtSampler;
- $$.sampler.setTexture(EbtUint, EsdCube, true);
- }
| TEXTURE2DRECT {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
index 523e4058c6d..d2967973d38 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
@@ -167,227 +167,227 @@ extern int yydebug;
USAMPLER3D = 299,
USAMPLERCUBE = 300,
USAMPLER2DARRAY = 301,
- SAMPLERCUBEARRAY = 302,
- SAMPLERCUBEARRAYSHADOW = 303,
- ISAMPLERCUBEARRAY = 304,
- USAMPLERCUBEARRAY = 305,
- ATTRIBUTE = 306,
- VARYING = 307,
- FLOAT16_T = 308,
- FLOAT32_T = 309,
- DOUBLE = 310,
- FLOAT64_T = 311,
- INT64_T = 312,
- UINT64_T = 313,
- INT32_T = 314,
- UINT32_T = 315,
- INT16_T = 316,
- UINT16_T = 317,
- INT8_T = 318,
- UINT8_T = 319,
- I64VEC2 = 320,
- I64VEC3 = 321,
- I64VEC4 = 322,
- U64VEC2 = 323,
- U64VEC3 = 324,
- U64VEC4 = 325,
- I32VEC2 = 326,
- I32VEC3 = 327,
- I32VEC4 = 328,
- U32VEC2 = 329,
- U32VEC3 = 330,
- U32VEC4 = 331,
- I16VEC2 = 332,
- I16VEC3 = 333,
- I16VEC4 = 334,
- U16VEC2 = 335,
- U16VEC3 = 336,
- U16VEC4 = 337,
- I8VEC2 = 338,
- I8VEC3 = 339,
- I8VEC4 = 340,
- U8VEC2 = 341,
- U8VEC3 = 342,
- U8VEC4 = 343,
- DVEC2 = 344,
- DVEC3 = 345,
- DVEC4 = 346,
- DMAT2 = 347,
- DMAT3 = 348,
- DMAT4 = 349,
- F16VEC2 = 350,
- F16VEC3 = 351,
- F16VEC4 = 352,
- F16MAT2 = 353,
- F16MAT3 = 354,
- F16MAT4 = 355,
- F32VEC2 = 356,
- F32VEC3 = 357,
- F32VEC4 = 358,
- F32MAT2 = 359,
- F32MAT3 = 360,
- F32MAT4 = 361,
- F64VEC2 = 362,
- F64VEC3 = 363,
- F64VEC4 = 364,
- F64MAT2 = 365,
- F64MAT3 = 366,
- F64MAT4 = 367,
- DMAT2X2 = 368,
- DMAT2X3 = 369,
- DMAT2X4 = 370,
- DMAT3X2 = 371,
- DMAT3X3 = 372,
- DMAT3X4 = 373,
- DMAT4X2 = 374,
- DMAT4X3 = 375,
- DMAT4X4 = 376,
- F16MAT2X2 = 377,
- F16MAT2X3 = 378,
- F16MAT2X4 = 379,
- F16MAT3X2 = 380,
- F16MAT3X3 = 381,
- F16MAT3X4 = 382,
- F16MAT4X2 = 383,
- F16MAT4X3 = 384,
- F16MAT4X4 = 385,
- F32MAT2X2 = 386,
- F32MAT2X3 = 387,
- F32MAT2X4 = 388,
- F32MAT3X2 = 389,
- F32MAT3X3 = 390,
- F32MAT3X4 = 391,
- F32MAT4X2 = 392,
- F32MAT4X3 = 393,
- F32MAT4X4 = 394,
- F64MAT2X2 = 395,
- F64MAT2X3 = 396,
- F64MAT2X4 = 397,
- F64MAT3X2 = 398,
- F64MAT3X3 = 399,
- F64MAT3X4 = 400,
- F64MAT4X2 = 401,
- F64MAT4X3 = 402,
- F64MAT4X4 = 403,
- ATOMIC_UINT = 404,
- ACCSTRUCTNV = 405,
- FCOOPMATNV = 406,
- ICOOPMATNV = 407,
- UCOOPMATNV = 408,
- SAMPLER1D = 409,
- SAMPLER1DARRAY = 410,
- SAMPLER1DARRAYSHADOW = 411,
- ISAMPLER1D = 412,
- SAMPLER1DSHADOW = 413,
- SAMPLER2DRECT = 414,
- SAMPLER2DRECTSHADOW = 415,
- ISAMPLER2DRECT = 416,
- USAMPLER2DRECT = 417,
- SAMPLERBUFFER = 418,
- ISAMPLERBUFFER = 419,
- USAMPLERBUFFER = 420,
- SAMPLER2DMS = 421,
- ISAMPLER2DMS = 422,
- USAMPLER2DMS = 423,
- SAMPLER2DMSARRAY = 424,
- ISAMPLER2DMSARRAY = 425,
- USAMPLER2DMSARRAY = 426,
- SAMPLEREXTERNALOES = 427,
- SAMPLEREXTERNAL2DY2YEXT = 428,
- ISAMPLER1DARRAY = 429,
- USAMPLER1D = 430,
- USAMPLER1DARRAY = 431,
- F16SAMPLER1D = 432,
- F16SAMPLER2D = 433,
- F16SAMPLER3D = 434,
- F16SAMPLER2DRECT = 435,
- F16SAMPLERCUBE = 436,
- F16SAMPLER1DARRAY = 437,
- F16SAMPLER2DARRAY = 438,
- F16SAMPLERCUBEARRAY = 439,
- F16SAMPLERBUFFER = 440,
- F16SAMPLER2DMS = 441,
- F16SAMPLER2DMSARRAY = 442,
- F16SAMPLER1DSHADOW = 443,
- F16SAMPLER2DSHADOW = 444,
- F16SAMPLER1DARRAYSHADOW = 445,
- F16SAMPLER2DARRAYSHADOW = 446,
- F16SAMPLER2DRECTSHADOW = 447,
- F16SAMPLERCUBESHADOW = 448,
- F16SAMPLERCUBEARRAYSHADOW = 449,
- IMAGE1D = 450,
- IIMAGE1D = 451,
- UIMAGE1D = 452,
- IMAGE2D = 453,
- IIMAGE2D = 454,
- UIMAGE2D = 455,
- IMAGE3D = 456,
- IIMAGE3D = 457,
- UIMAGE3D = 458,
- IMAGE2DRECT = 459,
- IIMAGE2DRECT = 460,
- UIMAGE2DRECT = 461,
- IMAGECUBE = 462,
- IIMAGECUBE = 463,
- UIMAGECUBE = 464,
- IMAGEBUFFER = 465,
- IIMAGEBUFFER = 466,
- UIMAGEBUFFER = 467,
- IMAGE1DARRAY = 468,
- IIMAGE1DARRAY = 469,
- UIMAGE1DARRAY = 470,
- IMAGE2DARRAY = 471,
- IIMAGE2DARRAY = 472,
- UIMAGE2DARRAY = 473,
- IMAGECUBEARRAY = 474,
- IIMAGECUBEARRAY = 475,
- UIMAGECUBEARRAY = 476,
- IMAGE2DMS = 477,
- IIMAGE2DMS = 478,
- UIMAGE2DMS = 479,
- IMAGE2DMSARRAY = 480,
- IIMAGE2DMSARRAY = 481,
- UIMAGE2DMSARRAY = 482,
- F16IMAGE1D = 483,
- F16IMAGE2D = 484,
- F16IMAGE3D = 485,
- F16IMAGE2DRECT = 486,
- F16IMAGECUBE = 487,
- F16IMAGE1DARRAY = 488,
- F16IMAGE2DARRAY = 489,
- F16IMAGECUBEARRAY = 490,
- F16IMAGEBUFFER = 491,
- F16IMAGE2DMS = 492,
- F16IMAGE2DMSARRAY = 493,
- SAMPLER = 494,
- SAMPLERSHADOW = 495,
- TEXTURE1D = 496,
- TEXTURE2D = 497,
- TEXTURE3D = 498,
- TEXTURECUBE = 499,
- TEXTURE1DARRAY = 500,
- TEXTURE2DARRAY = 501,
- ITEXTURE1D = 502,
- ITEXTURE2D = 503,
- ITEXTURE3D = 504,
- ITEXTURECUBE = 505,
- ITEXTURE1DARRAY = 506,
- ITEXTURE2DARRAY = 507,
- UTEXTURE1D = 508,
- UTEXTURE2D = 509,
- UTEXTURE3D = 510,
- UTEXTURECUBE = 511,
- UTEXTURE1DARRAY = 512,
- UTEXTURE2DARRAY = 513,
- TEXTURE2DRECT = 514,
- ITEXTURE2DRECT = 515,
- UTEXTURE2DRECT = 516,
- TEXTUREBUFFER = 517,
- ITEXTUREBUFFER = 518,
- UTEXTUREBUFFER = 519,
- TEXTURECUBEARRAY = 520,
- ITEXTURECUBEARRAY = 521,
- UTEXTURECUBEARRAY = 522,
+ SAMPLER = 302,
+ SAMPLERSHADOW = 303,
+ TEXTURE2D = 304,
+ TEXTURE3D = 305,
+ TEXTURECUBE = 306,
+ TEXTURE2DARRAY = 307,
+ ITEXTURE2D = 308,
+ ITEXTURE3D = 309,
+ ITEXTURECUBE = 310,
+ ITEXTURE2DARRAY = 311,
+ UTEXTURE2D = 312,
+ UTEXTURE3D = 313,
+ UTEXTURECUBE = 314,
+ UTEXTURE2DARRAY = 315,
+ ATTRIBUTE = 316,
+ VARYING = 317,
+ FLOAT16_T = 318,
+ FLOAT32_T = 319,
+ DOUBLE = 320,
+ FLOAT64_T = 321,
+ INT64_T = 322,
+ UINT64_T = 323,
+ INT32_T = 324,
+ UINT32_T = 325,
+ INT16_T = 326,
+ UINT16_T = 327,
+ INT8_T = 328,
+ UINT8_T = 329,
+ I64VEC2 = 330,
+ I64VEC3 = 331,
+ I64VEC4 = 332,
+ U64VEC2 = 333,
+ U64VEC3 = 334,
+ U64VEC4 = 335,
+ I32VEC2 = 336,
+ I32VEC3 = 337,
+ I32VEC4 = 338,
+ U32VEC2 = 339,
+ U32VEC3 = 340,
+ U32VEC4 = 341,
+ I16VEC2 = 342,
+ I16VEC3 = 343,
+ I16VEC4 = 344,
+ U16VEC2 = 345,
+ U16VEC3 = 346,
+ U16VEC4 = 347,
+ I8VEC2 = 348,
+ I8VEC3 = 349,
+ I8VEC4 = 350,
+ U8VEC2 = 351,
+ U8VEC3 = 352,
+ U8VEC4 = 353,
+ DVEC2 = 354,
+ DVEC3 = 355,
+ DVEC4 = 356,
+ DMAT2 = 357,
+ DMAT3 = 358,
+ DMAT4 = 359,
+ F16VEC2 = 360,
+ F16VEC3 = 361,
+ F16VEC4 = 362,
+ F16MAT2 = 363,
+ F16MAT3 = 364,
+ F16MAT4 = 365,
+ F32VEC2 = 366,
+ F32VEC3 = 367,
+ F32VEC4 = 368,
+ F32MAT2 = 369,
+ F32MAT3 = 370,
+ F32MAT4 = 371,
+ F64VEC2 = 372,
+ F64VEC3 = 373,
+ F64VEC4 = 374,
+ F64MAT2 = 375,
+ F64MAT3 = 376,
+ F64MAT4 = 377,
+ DMAT2X2 = 378,
+ DMAT2X3 = 379,
+ DMAT2X4 = 380,
+ DMAT3X2 = 381,
+ DMAT3X3 = 382,
+ DMAT3X4 = 383,
+ DMAT4X2 = 384,
+ DMAT4X3 = 385,
+ DMAT4X4 = 386,
+ F16MAT2X2 = 387,
+ F16MAT2X3 = 388,
+ F16MAT2X4 = 389,
+ F16MAT3X2 = 390,
+ F16MAT3X3 = 391,
+ F16MAT3X4 = 392,
+ F16MAT4X2 = 393,
+ F16MAT4X3 = 394,
+ F16MAT4X4 = 395,
+ F32MAT2X2 = 396,
+ F32MAT2X3 = 397,
+ F32MAT2X4 = 398,
+ F32MAT3X2 = 399,
+ F32MAT3X3 = 400,
+ F32MAT3X4 = 401,
+ F32MAT4X2 = 402,
+ F32MAT4X3 = 403,
+ F32MAT4X4 = 404,
+ F64MAT2X2 = 405,
+ F64MAT2X3 = 406,
+ F64MAT2X4 = 407,
+ F64MAT3X2 = 408,
+ F64MAT3X3 = 409,
+ F64MAT3X4 = 410,
+ F64MAT4X2 = 411,
+ F64MAT4X3 = 412,
+ F64MAT4X4 = 413,
+ ATOMIC_UINT = 414,
+ ACCSTRUCTNV = 415,
+ FCOOPMATNV = 416,
+ ICOOPMATNV = 417,
+ UCOOPMATNV = 418,
+ SAMPLERCUBEARRAY = 419,
+ SAMPLERCUBEARRAYSHADOW = 420,
+ ISAMPLERCUBEARRAY = 421,
+ USAMPLERCUBEARRAY = 422,
+ SAMPLER1D = 423,
+ SAMPLER1DARRAY = 424,
+ SAMPLER1DARRAYSHADOW = 425,
+ ISAMPLER1D = 426,
+ SAMPLER1DSHADOW = 427,
+ SAMPLER2DRECT = 428,
+ SAMPLER2DRECTSHADOW = 429,
+ ISAMPLER2DRECT = 430,
+ USAMPLER2DRECT = 431,
+ SAMPLERBUFFER = 432,
+ ISAMPLERBUFFER = 433,
+ USAMPLERBUFFER = 434,
+ SAMPLER2DMS = 435,
+ ISAMPLER2DMS = 436,
+ USAMPLER2DMS = 437,
+ SAMPLER2DMSARRAY = 438,
+ ISAMPLER2DMSARRAY = 439,
+ USAMPLER2DMSARRAY = 440,
+ SAMPLEREXTERNALOES = 441,
+ SAMPLEREXTERNAL2DY2YEXT = 442,
+ ISAMPLER1DARRAY = 443,
+ USAMPLER1D = 444,
+ USAMPLER1DARRAY = 445,
+ F16SAMPLER1D = 446,
+ F16SAMPLER2D = 447,
+ F16SAMPLER3D = 448,
+ F16SAMPLER2DRECT = 449,
+ F16SAMPLERCUBE = 450,
+ F16SAMPLER1DARRAY = 451,
+ F16SAMPLER2DARRAY = 452,
+ F16SAMPLERCUBEARRAY = 453,
+ F16SAMPLERBUFFER = 454,
+ F16SAMPLER2DMS = 455,
+ F16SAMPLER2DMSARRAY = 456,
+ F16SAMPLER1DSHADOW = 457,
+ F16SAMPLER2DSHADOW = 458,
+ F16SAMPLER1DARRAYSHADOW = 459,
+ F16SAMPLER2DARRAYSHADOW = 460,
+ F16SAMPLER2DRECTSHADOW = 461,
+ F16SAMPLERCUBESHADOW = 462,
+ F16SAMPLERCUBEARRAYSHADOW = 463,
+ IMAGE1D = 464,
+ IIMAGE1D = 465,
+ UIMAGE1D = 466,
+ IMAGE2D = 467,
+ IIMAGE2D = 468,
+ UIMAGE2D = 469,
+ IMAGE3D = 470,
+ IIMAGE3D = 471,
+ UIMAGE3D = 472,
+ IMAGE2DRECT = 473,
+ IIMAGE2DRECT = 474,
+ UIMAGE2DRECT = 475,
+ IMAGECUBE = 476,
+ IIMAGECUBE = 477,
+ UIMAGECUBE = 478,
+ IMAGEBUFFER = 479,
+ IIMAGEBUFFER = 480,
+ UIMAGEBUFFER = 481,
+ IMAGE1DARRAY = 482,
+ IIMAGE1DARRAY = 483,
+ UIMAGE1DARRAY = 484,
+ IMAGE2DARRAY = 485,
+ IIMAGE2DARRAY = 486,
+ UIMAGE2DARRAY = 487,
+ IMAGECUBEARRAY = 488,
+ IIMAGECUBEARRAY = 489,
+ UIMAGECUBEARRAY = 490,
+ IMAGE2DMS = 491,
+ IIMAGE2DMS = 492,
+ UIMAGE2DMS = 493,
+ IMAGE2DMSARRAY = 494,
+ IIMAGE2DMSARRAY = 495,
+ UIMAGE2DMSARRAY = 496,
+ F16IMAGE1D = 497,
+ F16IMAGE2D = 498,
+ F16IMAGE3D = 499,
+ F16IMAGE2DRECT = 500,
+ F16IMAGECUBE = 501,
+ F16IMAGE1DARRAY = 502,
+ F16IMAGE2DARRAY = 503,
+ F16IMAGECUBEARRAY = 504,
+ F16IMAGEBUFFER = 505,
+ F16IMAGE2DMS = 506,
+ F16IMAGE2DMSARRAY = 507,
+ TEXTURECUBEARRAY = 508,
+ ITEXTURECUBEARRAY = 509,
+ UTEXTURECUBEARRAY = 510,
+ TEXTURE1D = 511,
+ ITEXTURE1D = 512,
+ UTEXTURE1D = 513,
+ TEXTURE1DARRAY = 514,
+ ITEXTURE1DARRAY = 515,
+ UTEXTURE1DARRAY = 516,
+ TEXTURE2DRECT = 517,
+ ITEXTURE2DRECT = 518,
+ UTEXTURE2DRECT = 519,
+ TEXTUREBUFFER = 520,
+ ITEXTUREBUFFER = 521,
+ UTEXTUREBUFFER = 522,
TEXTURE2DMS = 523,
ITEXTURE2DMS = 524,
UTEXTURE2DMS = 525,
@@ -492,27 +492,27 @@ extern int yydebug;
DEFAULT = 624,
UNIFORM = 625,
SHARED = 626,
- FLAT = 627,
- SMOOTH = 628,
- LAYOUT = 629,
- DOUBLECONSTANT = 630,
- INT16CONSTANT = 631,
- UINT16CONSTANT = 632,
- FLOAT16CONSTANT = 633,
- INT32CONSTANT = 634,
- UINT32CONSTANT = 635,
- INT64CONSTANT = 636,
- UINT64CONSTANT = 637,
- SUBROUTINE = 638,
- DEMOTE = 639,
- PAYLOADNV = 640,
- PAYLOADINNV = 641,
- HITATTRNV = 642,
- CALLDATANV = 643,
- CALLDATAINNV = 644,
- PATCH = 645,
- SAMPLE = 646,
- BUFFER = 647,
+ BUFFER = 627,
+ FLAT = 628,
+ SMOOTH = 629,
+ LAYOUT = 630,
+ DOUBLECONSTANT = 631,
+ INT16CONSTANT = 632,
+ UINT16CONSTANT = 633,
+ FLOAT16CONSTANT = 634,
+ INT32CONSTANT = 635,
+ UINT32CONSTANT = 636,
+ INT64CONSTANT = 637,
+ UINT64CONSTANT = 638,
+ SUBROUTINE = 639,
+ DEMOTE = 640,
+ PAYLOADNV = 641,
+ PAYLOADINNV = 642,
+ HITATTRNV = 643,
+ CALLDATANV = 644,
+ CALLDATAINNV = 645,
+ PATCH = 646,
+ SAMPLE = 647,
NONUNIFORM = 648,
COHERENT = 649,
VOLATILE = 650,
@@ -960,7 +960,7 @@ static const yytype_uint16 yyrline[] =
1142, 1169, 1178, 1185, 1193, 1200, 1207, 1215, 1225, 1232,
1243, 1249, 1252, 1259, 1263, 1267, 1276, 1286, 1289, 1300,
1303, 1306, 1310, 1314, 1319, 1323, 1330, 1334, 1339, 1345,
- 1351, 1358, 1364, 1372, 1377, 1389, 1403, 1409, 1414, 1422,
+ 1351, 1358, 1363, 1371, 1377, 1389, 1403, 1409, 1414, 1422,
1430, 1438, 1446, 1453, 1457, 1462, 1467, 1472, 1477, 1482,
1486, 1490, 1494, 1498, 1504, 1515, 1522, 1525, 1534, 1539,
1549, 1554, 1562, 1566, 1576, 1579, 1585, 1591, 1598, 1608,
@@ -977,32 +977,32 @@ static const yytype_uint16 yyrline[] =
2173, 2179, 2185, 2191, 2197, 2203, 2209, 2215, 2221, 2227,
2233, 2239, 2245, 2251, 2257, 2263, 2269, 2275, 2281, 2287,
2293, 2299, 2305, 2311, 2317, 2321, 2326, 2332, 2337, 2342,
- 2347, 2352, 2358, 2363, 2368, 2374, 2379, 2384, 2389, 2395,
- 2401, 2407, 2413, 2419, 2425, 2431, 2437, 2443, 2449, 2455,
- 2461, 2467, 2473, 2479, 2484, 2489, 2495, 2501, 2506, 2512,
- 2518, 2523, 2528, 2534, 2540, 2545, 2551, 2556, 2561, 2567,
- 2573, 2578, 2583, 2588, 2594, 2599, 2604, 2609, 2615, 2620,
- 2625, 2630, 2636, 2641, 2646, 2651, 2656, 2661, 2667, 2672,
- 2678, 2683, 2689, 2694, 2700, 2705, 2711, 2716, 2722, 2727,
- 2733, 2738, 2743, 2748, 2753, 2758, 2763, 2768, 2773, 2778,
- 2783, 2788, 2793, 2798, 2803, 2808, 2814, 2819, 2824, 2829,
- 2835, 2840, 2845, 2850, 2856, 2861, 2866, 2871, 2877, 2882,
- 2887, 2892, 2898, 2903, 2908, 2913, 2919, 2924, 2929, 2934,
- 2940, 2945, 2950, 2955, 2961, 2966, 2971, 2976, 2982, 2987,
- 2992, 2997, 3003, 3008, 3013, 3018, 3024, 3029, 3034, 3039,
- 3045, 3050, 3055, 3060, 3066, 3071, 3076, 3081, 3087, 3092,
- 3097, 3102, 3108, 3113, 3118, 3124, 3130, 3136, 3142, 3149,
- 3156, 3162, 3168, 3174, 3180, 3186, 3192, 3199, 3204, 3220,
- 3225, 3230, 3238, 3238, 3249, 3249, 3259, 3262, 3275, 3297,
- 3324, 3328, 3334, 3339, 3350, 3354, 3360, 3371, 3374, 3381,
- 3385, 3386, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3400,
- 3406, 3415, 3416, 3420, 3416, 3432, 3433, 3437, 3437, 3444,
- 3444, 3458, 3461, 3469, 3477, 3488, 3489, 3493, 3497, 3504,
- 3511, 3515, 3523, 3527, 3540, 3544, 3551, 3551, 3571, 3574,
- 3580, 3592, 3604, 3608, 3615, 3615, 3630, 3630, 3646, 3646,
- 3667, 3670, 3676, 3679, 3685, 3689, 3696, 3701, 3706, 3713,
- 3716, 3725, 3729, 3738, 3741, 3745, 3754, 3754, 3777, 3783,
- 3786, 3791, 3794
+ 2347, 2352, 2357, 2362, 2368, 2373, 2378, 2383, 2388, 2393,
+ 2399, 2405, 2411, 2417, 2423, 2429, 2435, 2441, 2447, 2453,
+ 2459, 2465, 2471, 2477, 2482, 2487, 2492, 2497, 2502, 2507,
+ 2513, 2518, 2523, 2528, 2533, 2538, 2543, 2548, 2554, 2559,
+ 2564, 2569, 2574, 2579, 2584, 2589, 2594, 2599, 2604, 2609,
+ 2614, 2619, 2624, 2630, 2635, 2640, 2646, 2652, 2657, 2662,
+ 2667, 2673, 2678, 2683, 2688, 2694, 2699, 2704, 2709, 2715,
+ 2720, 2725, 2730, 2736, 2742, 2748, 2754, 2759, 2765, 2771,
+ 2777, 2782, 2787, 2792, 2797, 2802, 2808, 2813, 2818, 2823,
+ 2829, 2834, 2839, 2844, 2850, 2855, 2860, 2865, 2871, 2876,
+ 2881, 2886, 2892, 2897, 2902, 2907, 2913, 2918, 2923, 2928,
+ 2934, 2939, 2944, 2949, 2955, 2960, 2965, 2970, 2976, 2981,
+ 2986, 2991, 2997, 3002, 3007, 3012, 3018, 3023, 3028, 3033,
+ 3039, 3044, 3049, 3054, 3060, 3065, 3070, 3075, 3081, 3086,
+ 3091, 3096, 3102, 3107, 3112, 3118, 3124, 3130, 3136, 3143,
+ 3150, 3156, 3162, 3168, 3174, 3180, 3186, 3193, 3198, 3214,
+ 3219, 3224, 3232, 3232, 3243, 3243, 3253, 3256, 3269, 3291,
+ 3318, 3322, 3328, 3333, 3344, 3348, 3354, 3365, 3368, 3375,
+ 3379, 3380, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3394,
+ 3400, 3409, 3410, 3414, 3410, 3426, 3427, 3431, 3431, 3438,
+ 3438, 3452, 3455, 3463, 3471, 3482, 3483, 3487, 3491, 3498,
+ 3505, 3509, 3517, 3521, 3534, 3538, 3545, 3545, 3565, 3568,
+ 3574, 3586, 3598, 3602, 3609, 3609, 3624, 3624, 3640, 3640,
+ 3661, 3664, 3670, 3673, 3679, 3683, 3690, 3695, 3700, 3707,
+ 3710, 3719, 3723, 3732, 3735, 3739, 3748, 3748, 3771, 3777,
+ 3780, 3785, 3788
};
#endif
@@ -1018,9 +1018,11 @@ static const char *const yytname[] =
"MAT4X4", "SAMPLER2D", "SAMPLER3D", "SAMPLERCUBE", "SAMPLER2DSHADOW",
"SAMPLERCUBESHADOW", "SAMPLER2DARRAY", "SAMPLER2DARRAYSHADOW",
"ISAMPLER2D", "ISAMPLER3D", "ISAMPLERCUBE", "ISAMPLER2DARRAY",
- "USAMPLER2D", "USAMPLER3D", "USAMPLERCUBE", "USAMPLER2DARRAY",
- "SAMPLERCUBEARRAY", "SAMPLERCUBEARRAYSHADOW", "ISAMPLERCUBEARRAY",
- "USAMPLERCUBEARRAY", "ATTRIBUTE", "VARYING", "FLOAT16_T", "FLOAT32_T",
+ "USAMPLER2D", "USAMPLER3D", "USAMPLERCUBE", "USAMPLER2DARRAY", "SAMPLER",
+ "SAMPLERSHADOW", "TEXTURE2D", "TEXTURE3D", "TEXTURECUBE",
+ "TEXTURE2DARRAY", "ITEXTURE2D", "ITEXTURE3D", "ITEXTURECUBE",
+ "ITEXTURE2DARRAY", "UTEXTURE2D", "UTEXTURE3D", "UTEXTURECUBE",
+ "UTEXTURE2DARRAY", "ATTRIBUTE", "VARYING", "FLOAT16_T", "FLOAT32_T",
"DOUBLE", "FLOAT64_T", "INT64_T", "UINT64_T", "INT32_T", "UINT32_T",
"INT16_T", "UINT16_T", "INT8_T", "UINT8_T", "I64VEC2", "I64VEC3",
"I64VEC4", "U64VEC2", "U64VEC3", "U64VEC4", "I32VEC2", "I32VEC3",
@@ -1038,14 +1040,15 @@ static const char *const yytname[] =
"F32MAT4X4", "F64MAT2X2", "F64MAT2X3", "F64MAT2X4", "F64MAT3X2",
"F64MAT3X3", "F64MAT3X4", "F64MAT4X2", "F64MAT4X3", "F64MAT4X4",
"ATOMIC_UINT", "ACCSTRUCTNV", "FCOOPMATNV", "ICOOPMATNV", "UCOOPMATNV",
- "SAMPLER1D", "SAMPLER1DARRAY", "SAMPLER1DARRAYSHADOW", "ISAMPLER1D",
- "SAMPLER1DSHADOW", "SAMPLER2DRECT", "SAMPLER2DRECTSHADOW",
- "ISAMPLER2DRECT", "USAMPLER2DRECT", "SAMPLERBUFFER", "ISAMPLERBUFFER",
- "USAMPLERBUFFER", "SAMPLER2DMS", "ISAMPLER2DMS", "USAMPLER2DMS",
- "SAMPLER2DMSARRAY", "ISAMPLER2DMSARRAY", "USAMPLER2DMSARRAY",
- "SAMPLEREXTERNALOES", "SAMPLEREXTERNAL2DY2YEXT", "ISAMPLER1DARRAY",
- "USAMPLER1D", "USAMPLER1DARRAY", "F16SAMPLER1D", "F16SAMPLER2D",
- "F16SAMPLER3D", "F16SAMPLER2DRECT", "F16SAMPLERCUBE",
+ "SAMPLERCUBEARRAY", "SAMPLERCUBEARRAYSHADOW", "ISAMPLERCUBEARRAY",
+ "USAMPLERCUBEARRAY", "SAMPLER1D", "SAMPLER1DARRAY",
+ "SAMPLER1DARRAYSHADOW", "ISAMPLER1D", "SAMPLER1DSHADOW", "SAMPLER2DRECT",
+ "SAMPLER2DRECTSHADOW", "ISAMPLER2DRECT", "USAMPLER2DRECT",
+ "SAMPLERBUFFER", "ISAMPLERBUFFER", "USAMPLERBUFFER", "SAMPLER2DMS",
+ "ISAMPLER2DMS", "USAMPLER2DMS", "SAMPLER2DMSARRAY", "ISAMPLER2DMSARRAY",
+ "USAMPLER2DMSARRAY", "SAMPLEREXTERNALOES", "SAMPLEREXTERNAL2DY2YEXT",
+ "ISAMPLER1DARRAY", "USAMPLER1D", "USAMPLER1DARRAY", "F16SAMPLER1D",
+ "F16SAMPLER2D", "F16SAMPLER3D", "F16SAMPLER2DRECT", "F16SAMPLERCUBE",
"F16SAMPLER1DARRAY", "F16SAMPLER2DARRAY", "F16SAMPLERCUBEARRAY",
"F16SAMPLERBUFFER", "F16SAMPLER2DMS", "F16SAMPLER2DMSARRAY",
"F16SAMPLER1DSHADOW", "F16SAMPLER2DSHADOW", "F16SAMPLER1DARRAYSHADOW",
@@ -1061,40 +1064,37 @@ static const char *const yytname[] =
"F16IMAGE1D", "F16IMAGE2D", "F16IMAGE3D", "F16IMAGE2DRECT",
"F16IMAGECUBE", "F16IMAGE1DARRAY", "F16IMAGE2DARRAY",
"F16IMAGECUBEARRAY", "F16IMAGEBUFFER", "F16IMAGE2DMS",
- "F16IMAGE2DMSARRAY", "SAMPLER", "SAMPLERSHADOW", "TEXTURE1D",
- "TEXTURE2D", "TEXTURE3D", "TEXTURECUBE", "TEXTURE1DARRAY",
- "TEXTURE2DARRAY", "ITEXTURE1D", "ITEXTURE2D", "ITEXTURE3D",
- "ITEXTURECUBE", "ITEXTURE1DARRAY", "ITEXTURE2DARRAY", "UTEXTURE1D",
- "UTEXTURE2D", "UTEXTURE3D", "UTEXTURECUBE", "UTEXTURE1DARRAY",
- "UTEXTURE2DARRAY", "TEXTURE2DRECT", "ITEXTURE2DRECT", "UTEXTURE2DRECT",
- "TEXTUREBUFFER", "ITEXTUREBUFFER", "UTEXTUREBUFFER", "TEXTURECUBEARRAY",
- "ITEXTURECUBEARRAY", "UTEXTURECUBEARRAY", "TEXTURE2DMS", "ITEXTURE2DMS",
- "UTEXTURE2DMS", "TEXTURE2DMSARRAY", "ITEXTURE2DMSARRAY",
- "UTEXTURE2DMSARRAY", "F16TEXTURE1D", "F16TEXTURE2D", "F16TEXTURE3D",
- "F16TEXTURE2DRECT", "F16TEXTURECUBE", "F16TEXTURE1DARRAY",
- "F16TEXTURE2DARRAY", "F16TEXTURECUBEARRAY", "F16TEXTUREBUFFER",
- "F16TEXTURE2DMS", "F16TEXTURE2DMSARRAY", "SUBPASSINPUT",
- "SUBPASSINPUTMS", "ISUBPASSINPUT", "ISUBPASSINPUTMS", "USUBPASSINPUT",
- "USUBPASSINPUTMS", "F16SUBPASSINPUT", "F16SUBPASSINPUTMS", "LEFT_OP",
- "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP",
- "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
- "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
- "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
- "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
- "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
- "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
- "AMPERSAND", "QUESTION", "INVARIANT", "HIGH_PRECISION",
- "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "PACKED", "RESOURCE",
- "SUPERP", "FLOATCONSTANT", "INTCONSTANT", "UINTCONSTANT", "BOOLCONSTANT",
- "IDENTIFIER", "TYPE_NAME", "CENTROID", "IN", "OUT", "INOUT", "STRUCT",
- "VOID", "WHILE", "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF",
- "DISCARD", "RETURN", "SWITCH", "CASE", "DEFAULT", "UNIFORM", "SHARED",
- "FLAT", "SMOOTH", "LAYOUT", "DOUBLECONSTANT", "INT16CONSTANT",
- "UINT16CONSTANT", "FLOAT16CONSTANT", "INT32CONSTANT", "UINT32CONSTANT",
- "INT64CONSTANT", "UINT64CONSTANT", "SUBROUTINE", "DEMOTE", "PAYLOADNV",
- "PAYLOADINNV", "HITATTRNV", "CALLDATANV", "CALLDATAINNV", "PATCH",
- "SAMPLE", "BUFFER", "NONUNIFORM", "COHERENT", "VOLATILE", "RESTRICT",
- "READONLY", "WRITEONLY", "DEVICECOHERENT", "QUEUEFAMILYCOHERENT",
+ "F16IMAGE2DMSARRAY", "TEXTURECUBEARRAY", "ITEXTURECUBEARRAY",
+ "UTEXTURECUBEARRAY", "TEXTURE1D", "ITEXTURE1D", "UTEXTURE1D",
+ "TEXTURE1DARRAY", "ITEXTURE1DARRAY", "UTEXTURE1DARRAY", "TEXTURE2DRECT",
+ "ITEXTURE2DRECT", "UTEXTURE2DRECT", "TEXTUREBUFFER", "ITEXTUREBUFFER",
+ "UTEXTUREBUFFER", "TEXTURE2DMS", "ITEXTURE2DMS", "UTEXTURE2DMS",
+ "TEXTURE2DMSARRAY", "ITEXTURE2DMSARRAY", "UTEXTURE2DMSARRAY",
+ "F16TEXTURE1D", "F16TEXTURE2D", "F16TEXTURE3D", "F16TEXTURE2DRECT",
+ "F16TEXTURECUBE", "F16TEXTURE1DARRAY", "F16TEXTURE2DARRAY",
+ "F16TEXTURECUBEARRAY", "F16TEXTUREBUFFER", "F16TEXTURE2DMS",
+ "F16TEXTURE2DMSARRAY", "SUBPASSINPUT", "SUBPASSINPUTMS", "ISUBPASSINPUT",
+ "ISUBPASSINPUTMS", "USUBPASSINPUT", "USUBPASSINPUTMS", "F16SUBPASSINPUT",
+ "F16SUBPASSINPUTMS", "LEFT_OP", "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP",
+ "GE_OP", "EQ_OP", "NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN",
+ "DIV_ASSIGN", "ADD_ASSIGN", "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN",
+ "AND_ASSIGN", "XOR_ASSIGN", "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN",
+ "RIGHT_PAREN", "LEFT_BRACKET", "RIGHT_BRACKET", "LEFT_BRACE",
+ "RIGHT_BRACE", "DOT", "COMMA", "COLON", "EQUAL", "SEMICOLON", "BANG",
+ "DASH", "TILDE", "PLUS", "STAR", "SLASH", "PERCENT", "LEFT_ANGLE",
+ "RIGHT_ANGLE", "VERTICAL_BAR", "CARET", "AMPERSAND", "QUESTION",
+ "INVARIANT", "HIGH_PRECISION", "MEDIUM_PRECISION", "LOW_PRECISION",
+ "PRECISION", "PACKED", "RESOURCE", "SUPERP", "FLOATCONSTANT",
+ "INTCONSTANT", "UINTCONSTANT", "BOOLCONSTANT", "IDENTIFIER", "TYPE_NAME",
+ "CENTROID", "IN", "OUT", "INOUT", "STRUCT", "VOID", "WHILE", "BREAK",
+ "CONTINUE", "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN", "SWITCH",
+ "CASE", "DEFAULT", "UNIFORM", "SHARED", "BUFFER", "FLAT", "SMOOTH",
+ "LAYOUT", "DOUBLECONSTANT", "INT16CONSTANT", "UINT16CONSTANT",
+ "FLOAT16CONSTANT", "INT32CONSTANT", "UINT32CONSTANT", "INT64CONSTANT",
+ "UINT64CONSTANT", "SUBROUTINE", "DEMOTE", "PAYLOADNV", "PAYLOADINNV",
+ "HITATTRNV", "CALLDATANV", "CALLDATAINNV", "PATCH", "SAMPLE",
+ "NONUNIFORM", "COHERENT", "VOLATILE", "RESTRICT", "READONLY",
+ "WRITEONLY", "DEVICECOHERENT", "QUEUEFAMILYCOHERENT",
"WORKGROUPCOHERENT", "SUBGROUPCOHERENT", "NONPRIVATE", "NOPERSPECTIVE",
"EXPLICITINTERPAMD", "PERVERTEXNV", "PERPRIMITIVENV", "PERVIEWNV",
"PERTASKNV", "PRECISE", "$accept", "variable_identifier",
@@ -1189,10 +1189,10 @@ static const yytype_uint16 yytoknum[] =
};
# endif
-#define YYPACT_NINF -367
+#define YYPACT_NINF -453
#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-367)))
+ (!!((Yystate) == (-453)))
#define YYTABLE_NINF -528
@@ -1203,79 +1203,79 @@ static const yytype_uint16 yytoknum[] =
STATE-NUM. */
static const yytype_int16 yypact[] =
{
- 3994, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -13, -367, -367, -367,
- -367, -367, 13, -367, -367, -367, -367, -367, 28, 40,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -2, -1, 88,
- 98, 6034, 116, -367, 74, -367, -367, -367, -367, 4402,
- -367, -367, -367, -367, 104, -367, -367, 730, -367, -367,
- 11, -367, 136, -25, 111, -367, 8, -367, 147, -367,
- 6034, -367, -367, -367, 6034, 139, 140, -367, 61, -367,
- 78, -367, -367, 8391, 155, -367, -367, -367, 149, 6034,
- -367, 152, -367, -309, -367, -367, 80, 6831, -367, 27,
- 1138, -367, -367, -367, -367, 155, 53, -367, 7221, 69,
- -367, 141, -367, 117, 8391, 8391, 8391, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, 77, -367, -367, -367,
- 164, 89, 8781, 172, -367, 8391, -367, -367, -320, 176,
- -367, 6034, 143, 4810, -367, 6034, 8391, -367, -25, -367,
- 145, -367, -367, 138, 144, -231, 23, 65, 158, 153,
- 162, 196, 197, 16, 182, 7611, -367, 185, 183, -367,
- -367, 189, 180, 181, -367, 195, 198, 186, 8001, 200,
- 8391, 199, 187, 122, -367, -367, 123, -367, -1, 203,
- 204, -367, -367, -367, -367, -367, 1546, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -353, 176, 7221, 71,
- 7221, -367, -367, 7221, 6034, -367, 169, -367, -367, -367,
- 91, -367, -367, 8391, 170, -367, -367, 8391, 207, -367,
- -367, -367, 8391, -367, 143, 155, 125, -367, -367, -367,
- 5218, -367, -367, -367, -367, 8391, 8391, 8391, 8391, 8391,
+ 3994, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, 97, -453, -453, -453,
+ -453, -453, 6, -453, -453, -453, -453, -453, -453, -307,
+ -241, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -3, 95, 36,
+ 125, 6034, 82, -453, -22, -453, -453, -453, -453, 4402,
+ -453, -453, -453, -453, 131, -453, -453, 730, -453, -453,
+ 11, -453, 153, -28, 127, -453, 7, -453, 157, -453,
+ 6034, -453, -453, -453, 6034, 129, 134, -453, 13, -453,
+ 73, -453, -453, 8391, 162, -453, -453, -453, 161, 6034,
+ -453, 163, -453, -309, -453, -453, 27, 6831, -453, 16,
+ 1138, -453, -453, -453, -453, 162, 23, -453, 7221, 49,
+ -453, 138, -453, 87, 8391, 8391, 8391, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, 68, -453, -453, -453,
+ 174, 60, 8781, 176, -453, 8391, -453, -453, -320, 175,
+ -453, 6034, 142, 4810, -453, 6034, 8391, -453, -28, -453,
+ 143, -453, -453, 119, 128, 32, 21, 38, 158, 160,
+ 165, 195, 194, 18, 183, 7611, -453, 185, 184, -453,
+ -453, 188, 180, 181, -453, 196, 197, 190, 8001, 198,
+ 8391, 187, 193, 122, -453, -453, 91, -453, 95, 204,
+ 205, -453, -453, -453, -453, -453, 1546, -453, -453, -453,
+ -453, -453, -453, -453, -453, -453, -353, 175, 7221, 69,
+ 7221, -453, -453, 7221, 6034, -453, 170, -453, -453, -453,
+ 78, -453, -453, 8391, 171, -453, -453, 8391, 207, -453,
+ -453, -453, 8391, -453, 142, 162, 93, -453, -453, -453,
+ 5218, -453, -453, -453, -453, 8391, 8391, 8391, 8391, 8391,
8391, 8391, 8391, 8391, 8391, 8391, 8391, 8391, 8391, 8391,
- 8391, 8391, 8391, 8391, -367, -367, -367, 206, 177, -367,
- 1954, -367, -367, -367, 1954, -367, 8391, -367, -367, 135,
- 8391, 60, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, 8391, 8391, -367, -367, -367,
- -367, -367, -367, -367, 7221, -367, 129, -367, 5626, -367,
- -367, 209, 208, -367, -367, -367, 142, 176, 143, -367,
- -367, -367, -367, -367, 138, 138, 144, 144, -231, -231,
- -231, -231, 23, 23, 65, 158, 153, 162, 196, 197,
- 8391, -367, 214, -314, -367, 1954, 3586, 173, 3178, 93,
- -367, 96, -367, -367, -367, -367, -367, 6441, -367, -367,
- -367, -367, 121, 8391, 213, 177, 215, 208, 188, 6034,
- 217, 221, -367, -367, 3586, 218, -367, -367, -367, 8391,
- 222, -367, -367, -367, 216, 2362, 8391, -367, 219, 226,
- 190, 224, 2770, -367, 227, -367, -367, 7221, -367, -367,
- -367, 100, 8391, 2362, 218, -367, -367, 1954, -367, 220,
- 208, -367, -367, 1954, 228, -367, -367
+ 8391, 8391, 8391, 8391, -453, -453, -453, 206, 177, -453,
+ 1954, -453, -453, -453, 1954, -453, 8391, -453, -453, 100,
+ 8391, 144, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, -453, -453, -453, 8391, 8391, -453, -453, -453,
+ -453, -453, -453, -453, 7221, -453, 140, -453, 5626, -453,
+ -453, 209, 208, -453, -453, -453, 123, 175, 142, -453,
+ -453, -453, -453, -453, 119, 119, 128, 128, 32, 32,
+ 32, 32, 21, 21, 38, 158, 160, 165, 195, 194,
+ 8391, -453, 214, 56, -453, 1954, 3586, 172, 3178, 80,
+ -453, 81, -453, -453, -453, -453, -453, 6441, -453, -453,
+ -453, -453, 146, 8391, 215, 177, 212, 208, 186, 6034,
+ 219, 221, -453, -453, 3586, 220, -453, -453, -453, 8391,
+ 222, -453, -453, -453, 216, 2362, 8391, -453, 217, 227,
+ 182, 225, 2770, -453, 229, -453, -453, 7221, -453, -453,
+ -453, 89, 8391, 2362, 220, -453, -453, 1954, -453, 224,
+ 208, -453, -453, 1954, 226, -453, -453
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -1286,8 +1286,9 @@ static const yytype_uint16 yydefact[] =
0, 156, 203, 201, 202, 200, 207, 208, 209, 210,
211, 212, 213, 214, 215, 204, 205, 206, 216, 217,
218, 219, 220, 221, 222, 223, 224, 225, 226, 227,
- 327, 328, 329, 330, 331, 335, 336, 353, 354, 355,
- 357, 360, 361, 362, 364, 337, 338, 358, 365, 164,
+ 327, 328, 329, 330, 331, 332, 333, 353, 354, 355,
+ 356, 357, 358, 359, 368, 381, 382, 369, 370, 372,
+ 371, 373, 374, 375, 376, 377, 378, 379, 380, 164,
165, 229, 230, 228, 231, 238, 239, 236, 237, 234,
235, 232, 233, 261, 262, 263, 273, 274, 275, 258,
259, 260, 270, 271, 272, 255, 256, 257, 267, 268,
@@ -1298,23 +1299,22 @@ static const yytype_uint16 yydefact[] =
291, 292, 293, 294, 295, 296, 297, 298, 299, 303,
304, 305, 306, 307, 308, 309, 310, 311, 315, 316,
317, 318, 319, 320, 321, 322, 323, 325, 324, 484,
- 485, 486, 326, 333, 334, 352, 332, 366, 367, 370,
- 371, 372, 374, 375, 376, 378, 379, 380, 382, 383,
- 474, 475, 356, 359, 363, 339, 340, 341, 368, 342,
- 346, 347, 350, 373, 377, 381, 343, 344, 348, 349,
- 369, 345, 351, 430, 432, 433, 434, 436, 437, 438,
- 440, 441, 442, 444, 445, 446, 448, 449, 450, 452,
- 453, 454, 456, 457, 458, 460, 461, 462, 464, 465,
- 466, 468, 469, 470, 472, 473, 431, 435, 439, 443,
- 447, 455, 459, 463, 451, 467, 471, 384, 385, 386,
- 388, 390, 392, 394, 396, 400, 401, 402, 403, 404,
- 405, 407, 408, 409, 410, 411, 412, 414, 416, 417,
- 418, 420, 421, 398, 406, 413, 422, 424, 425, 426,
- 428, 429, 387, 389, 391, 415, 393, 395, 397, 399,
+ 485, 486, 337, 338, 361, 364, 326, 335, 336, 352,
+ 334, 383, 384, 387, 388, 389, 391, 392, 393, 395,
+ 396, 397, 399, 400, 474, 475, 360, 362, 363, 339,
+ 340, 341, 385, 342, 346, 347, 350, 390, 394, 398,
+ 343, 344, 348, 349, 386, 345, 351, 430, 432, 433,
+ 434, 436, 437, 438, 440, 441, 442, 444, 445, 446,
+ 448, 449, 450, 452, 453, 454, 456, 457, 458, 460,
+ 461, 462, 464, 465, 466, 468, 469, 470, 472, 473,
+ 431, 435, 439, 443, 447, 455, 459, 463, 451, 467,
+ 471, 365, 366, 367, 401, 410, 412, 406, 411, 413,
+ 414, 416, 417, 418, 420, 421, 422, 424, 425, 426,
+ 428, 429, 402, 403, 404, 415, 405, 407, 408, 409,
419, 423, 427, 476, 477, 480, 481, 482, 483, 478,
479, 575, 131, 489, 490, 491, 0, 488, 160, 158,
- 159, 157, 0, 199, 161, 162, 133, 132, 0, 183,
- 169, 170, 168, 171, 172, 166, 167, 163, 185, 173,
+ 159, 157, 0, 199, 161, 162, 163, 133, 132, 0,
+ 183, 169, 170, 168, 171, 172, 166, 167, 185, 173,
179, 180, 181, 182, 174, 175, 176, 177, 178, 134,
135, 136, 137, 138, 139, 146, 574, 0, 576, 0,
108, 107, 0, 119, 124, 153, 152, 150, 154, 0,
@@ -1361,17 +1361,17 @@ static const yytype_uint16 yydefact[] =
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, 8696, -367, -81, -78, -225, -82, -20, -18,
- -21, -17, -19, -16, -367, -85, -367, -98, -367, -110,
- -118, 2, -367, -367, -367, 4, -367, -367, -367, 184,
- 191, 192, -367, -367, -339, -367, -367, -367, -367, 102,
- -367, -37, -44, -367, 9, -367, 0, -71, -367, -367,
- -367, -367, 260, -367, -367, -367, -136, -137, 18, -65,
- -209, -367, -94, -198, -366, -367, -134, -367, -367, -148,
- -146, -367, -367, 202, -265, -87, -367, 56, -367, -111,
- -367, 59, -367, -367, -367, -367, 62, -367, -367, -367,
- -367, -367, -367, -367, -367, 225, -367, -367, -367, -367,
+ -453, -453, -453, -453, -453, -453, -453, -453, -453, -453,
+ -453, -453, 8696, -453, -89, -88, -122, -84, -19, -18,
+ -17, -16, -20, -15, -453, -85, -453, -98, -453, -110,
+ -119, 2, -453, -453, -453, 4, -453, -453, -453, 189,
+ 191, 192, -453, -453, -339, -453, -453, -453, -453, 98,
+ -453, -37, -44, -453, 9, -453, 0, -71, -453, -453,
+ -453, -453, 261, -453, -453, -453, -452, -137, 20, -68,
+ -209, -453, -96, -198, -326, -453, -136, -453, -453, -146,
+ -144, -453, -453, 200, -265, -87, -453, 57, -453, -112,
+ -453, 59, -453, -453, -453, -453, 61, -453, -453, -453,
+ -453, -453, -453, -453, -453, 228, -453, -453, -453, -453,
-99
};
@@ -1397,14 +1397,14 @@ static const yytype_int16 yydefgoto[] =
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int16 yytable[] =
{
- 353, 542, 336, 674, 338, 481, 457, 675, 484, 352,
+ 353, 542, 336, 550, 338, 481, 457, 363, 484, 352,
485, 486, 458, 543, 489, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 560, 561, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 618, 364, 61, 62, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
@@ -1428,34 +1428,34 @@ static const yytype_int16 yytable[] =
267, 268, 269, 270, 271, 272, 273, 274, 275, 276,
277, 278, 279, 280, 281, 282, 283, 284, 285, 286,
287, 288, 289, 290, 374, 381, 530, 409, 609, 613,
- 521, 615, 474, 449, 617, 655, 549, 678, 573, 550,
- 562, 563, 365, 367, 397, 391, 293, 294, 295, 708,
- 381, 361, 398, 374, 517, 519, 716, 638, 639, 640,
- 641, 375, 363, 475, 539, 678, 392, 708, 366, 382,
- 352, 476, 451, 574, 364, 564, 565, 353, 352, 336,
- 388, 338, 297, 362, 566, 567, 352, 302, 303, 397,
- 375, 551, 531, 532, 375, 407, 518, 397, 589, 352,
- 591, 606, 662, 352, 408, 475, 657, 475, 618, 452,
- 577, -34, 523, 533, 614, 459, 410, 534, 352, 411,
- 500, 460, 412, 369, 536, 665, 620, 381, 685, 499,
- 537, 686, 606, 549, 606, 719, 451, 606, 451, 370,
- 521, 606, 521, 622, 378, 521, 594, 595, 596, 597,
- 598, 599, 600, 601, 602, 603, 383, 376, 526, 624,
- 377, 527, 606, 689, 606, 604, 628, 607, 666, 629,
- 667, 544, 723, 452, 390, 452, 606, 609, 688, 660,
- 352, 395, 352, 628, 352, 400, 670, 555, 556, 557,
- 558, 397, 559, 450, 627, 456, 659, 634, 635, 535,
- 661, 549, 636, 637, 642, 643, 540, 451, 569, 405,
- 406, 525, 475, 545, 568, 554, 570, 571, 718, 575,
- 572, 578, 579, 581, 582, 583, 500, 663, 664, 585,
- 587, 593, 586, 451, 590, 499, 521, -35, -33, 619,
- 623, 592, -28, 651, 452, 609, 669, 652, 673, 606,
- 691, 681, 695, 352, 693, 696, -527, 706, 694, 707,
- 672, 713, 478, 712, 725, 717, 677, 726, 644, 646,
- 452, 645, 714, 648, 647, 690, 360, 649, 403, 352,
- 553, 402, 626, 671, 682, 721, 404, 715, 722, 521,
- 401, 683, 610, 697, 677, 611, 692, 0, 612, 0,
- 500, 451, 387, 0, 500, 0, 711, 0, 551, 499,
+ 521, 615, 474, 449, 617, 655, 549, 678, 562, 563,
+ 573, 365, 391, 397, 361, 560, 561, 407, 378, 397,
+ 381, 398, 475, 374, 517, 519, 408, 566, 567, 397,
+ 476, 375, 459, 392, 539, 678, 518, 366, 460, 382,
+ 352, 369, 451, 564, 565, 574, 362, 353, 352, 336,
+ 388, 338, 297, 531, 532, 475, 352, 302, 303, 708,
+ 375, 551, 523, 674, 375, 536, 716, 675, 589, 352,
+ 591, 537, -34, 352, 533, 475, 657, 708, 534, 452,
+ 577, 410, 614, 620, 411, 685, 686, 412, 352, 606,
+ 500, 606, 606, 376, 719, 665, 377, 381, 526, 499,
+ 606, 527, 606, 549, 628, 607, 451, 629, 451, 367,
+ 521, 606, 521, 622, 660, 521, 594, 595, 596, 597,
+ 598, 599, 600, 601, 602, 603, 293, 294, 295, 624,
+ 638, 639, 640, 641, 628, 604, 370, 670, 555, 556,
+ 557, 544, 723, 452, 558, 452, 559, 609, 688, 666,
+ 352, 667, 352, 383, 352, 606, 662, 606, 689, 634,
+ 635, 390, 636, 637, 627, 400, 659, 395, 397, 405,
+ 661, 549, 642, 643, 406, 450, 456, 451, 525, 535,
+ 540, 475, 545, 554, 568, 569, 571, 572, 718, 570,
+ 575, 578, 581, 579, 582, 583, 500, 663, 664, 592,
+ 585, 586, 590, 451, 587, 499, 521, 593, -35, -33,
+ 619, 623, -28, 651, 452, 609, 669, 652, 673, 606,
+ 681, 693, 691, 352, 695, 696, 694, 706, -527, 707,
+ 672, 712, 713, 478, 714, 726, 677, 717, 725, 644,
+ 452, 645, 648, 646, 690, 647, 553, 360, 649, 352,
+ 671, 402, 682, 403, 626, 715, 404, 721, 401, 521,
+ 722, 683, 697, 610, 677, 611, 692, 612, 0, 0,
+ 500, 451, 0, 0, 500, 387, 711, 0, 551, 499,
0, 705, 0, 499, 0, 0, 0, 0, 0, 0,
0, 0, 720, 0, 0, 0, 0, 0, 0, 521,
0, 0, 0, 0, 0, 0, 0, 0, 452, 679,
@@ -1507,8 +1507,8 @@ static const yytype_int16 yytable[] =
294, 295, 296, 0, 0, 0, 0, 0, 0, 0,
0, 297, 298, 299, 300, 301, 302, 303, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 304, 305, 306, 307, 308, 0, 0, 0, 0, 0,
- 0, 0, 0, 309, 0, 310, 311, 312, 313, 314,
+ 304, 305, 306, 307, 308, 309, 0, 0, 0, 0,
+ 0, 0, 0, 0, 310, 0, 311, 312, 313, 314,
315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
335, 1, 2, 3, 4, 5, 6, 7, 8, 9,
@@ -1548,8 +1548,8 @@ static const yytype_int16 yytable[] =
296, 0, 0, 0, 421, 422, 423, 424, 425, 297,
298, 299, 300, 301, 302, 303, 481, 482, 483, 484,
0, 485, 486, 487, 488, 489, 490, 491, 304, 305,
- 306, 307, 308, 426, 427, 428, 429, 430, 431, 432,
- 433, 309, 492, 310, 311, 312, 313, 314, 315, 316,
+ 306, 307, 308, 309, 426, 427, 428, 429, 430, 431,
+ 432, 433, 310, 492, 311, 312, 313, 314, 315, 316,
317, 318, 319, 320, 321, 322, 323, 324, 325, 326,
327, 328, 329, 330, 331, 332, 333, 334, 335, 1,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
@@ -1589,8 +1589,8 @@ static const yytype_int16 yytable[] =
0, 0, 421, 422, 423, 424, 425, 297, 298, 299,
300, 301, 302, 303, 481, 482, 483, 484, 0, 485,
486, 487, 488, 489, 490, 491, 304, 305, 306, 307,
- 308, 426, 427, 428, 429, 430, 431, 432, 433, 309,
- 492, 310, 311, 312, 313, 314, 315, 316, 317, 318,
+ 308, 309, 426, 427, 428, 429, 430, 431, 432, 433,
+ 310, 492, 311, 312, 313, 314, 315, 316, 317, 318,
319, 320, 321, 322, 323, 324, 325, 326, 327, 328,
329, 330, 331, 332, 333, 334, 335, 1, 2, 3,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
@@ -1629,8 +1629,8 @@ static const yytype_int16 yytable[] =
0, 0, 292, 293, 294, 295, 296, 0, 0, 0,
421, 422, 423, 424, 425, 297, 298, 299, 300, 301,
302, 303, 481, 482, 483, 484, 0, 485, 486, 487,
- 488, 489, 490, 491, 304, 305, 306, 307, 308, 426,
- 427, 428, 429, 430, 431, 432, 433, 309, 492, 310,
+ 488, 489, 490, 491, 304, 305, 306, 307, 308, 309,
+ 426, 427, 428, 429, 430, 431, 432, 433, 310, 492,
311, 312, 313, 314, 315, 316, 317, 318, 319, 320,
321, 322, 323, 324, 325, 326, 327, 328, 329, 330,
331, 332, 333, 334, 335, 1, 2, 3, 4, 5,
@@ -1670,8 +1670,8 @@ static const yytype_int16 yytable[] =
292, 293, 294, 295, 296, 0, 0, 0, 421, 422,
423, 424, 425, 297, 298, 299, 300, 301, 302, 303,
481, 482, 483, 484, 0, 485, 486, 487, 488, 489,
- 490, 491, 304, 305, 306, 307, 308, 426, 427, 428,
- 429, 430, 431, 432, 433, 309, 492, 310, 311, 312,
+ 490, 491, 304, 305, 306, 307, 308, 309, 426, 427,
+ 428, 429, 430, 431, 432, 433, 310, 492, 311, 312,
313, 314, 315, 316, 317, 318, 319, 320, 321, 322,
323, 324, 325, 326, 327, 328, 329, 330, 331, 332,
333, 334, 335, 1, 2, 3, 4, 5, 6, 7,
@@ -1711,8 +1711,8 @@ static const yytype_int16 yytable[] =
294, 295, 296, 0, 0, 0, 421, 422, 423, 424,
425, 297, 298, 299, 300, 301, 302, 303, 481, 482,
483, 484, 0, 485, 486, 487, 488, 489, 490, 491,
- 304, 305, 306, 307, 308, 426, 427, 428, 429, 430,
- 431, 432, 433, 309, 492, 310, 311, 312, 313, 314,
+ 304, 305, 306, 307, 308, 309, 426, 427, 428, 429,
+ 430, 431, 432, 433, 310, 492, 311, 312, 313, 314,
315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
335, 1, 2, 3, 4, 5, 6, 7, 8, 9,
@@ -1752,8 +1752,8 @@ static const yytype_int16 yytable[] =
296, 0, 0, 0, 421, 422, 423, 424, 425, 297,
298, 299, 300, 301, 302, 303, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 304, 305,
- 306, 307, 308, 426, 427, 428, 429, 430, 431, 432,
- 433, 309, 0, 310, 311, 312, 313, 314, 315, 316,
+ 306, 307, 308, 309, 426, 427, 428, 429, 430, 431,
+ 432, 433, 310, 0, 311, 312, 313, 314, 315, 316,
317, 318, 319, 320, 321, 322, 323, 324, 325, 326,
327, 328, 329, 330, 331, 332, 333, 334, 335, 1,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
@@ -1793,8 +1793,8 @@ static const yytype_int16 yytable[] =
0, 0, 421, 422, 423, 424, 425, 297, 298, 299,
300, 301, 302, 303, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 304, 305, 306, 307,
- 308, 426, 427, 428, 429, 430, 431, 432, 433, 309,
- 0, 310, 311, 312, 313, 314, 315, 316, 317, 318,
+ 308, 309, 426, 427, 428, 429, 430, 431, 432, 433,
+ 310, 0, 311, 312, 313, 314, 315, 316, 317, 318,
319, 320, 321, 322, 323, 324, 325, 326, 327, 328,
329, 330, 331, 332, 333, 334, 335, 1, 2, 3,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
@@ -1833,8 +1833,8 @@ static const yytype_int16 yytable[] =
0, 0, 292, 293, 294, 295, 296, 0, 0, 0,
0, 0, 0, 0, 0, 297, 298, 299, 300, 301,
302, 303, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 304, 305, 306, 307, 308, 0,
- 0, 0, 0, 0, 0, 0, 0, 309, 0, 310,
+ 0, 0, 0, 0, 304, 305, 306, 307, 308, 309,
+ 0, 0, 0, 0, 0, 0, 0, 0, 310, 0,
311, 312, 313, 314, 315, 316, 317, 318, 319, 320,
321, 322, 323, 324, 325, 326, 327, 328, 329, 330,
331, 332, 333, 334, 335, 1, 2, 3, 4, 5,
@@ -1874,8 +1874,8 @@ static const yytype_int16 yytable[] =
292, 293, 294, 295, 0, 0, 0, 0, 0, 0,
0, 0, 380, 297, 298, 299, 300, 301, 302, 303,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 304, 305, 306, 307, 308, 0, 0, 0,
- 0, 0, 0, 0, 0, 309, 0, 310, 311, 312,
+ 0, 0, 304, 305, 306, 307, 308, 309, 0, 0,
+ 0, 0, 0, 0, 0, 0, 310, 0, 311, 312,
313, 314, 315, 316, 317, 318, 319, 320, 321, 322,
323, 324, 325, 326, 327, 328, 329, 330, 331, 332,
333, 334, 335, 1, 2, 3, 4, 5, 6, 7,
@@ -1915,8 +1915,8 @@ static const yytype_int16 yytable[] =
294, 295, 0, 0, 0, 0, 0, 0, 0, 0,
0, 297, 298, 299, 300, 301, 302, 303, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 304, 305, 306, 307, 308, 0, 0, 0, 0, 0,
- 0, 0, 0, 309, 0, 310, 311, 312, 313, 314,
+ 304, 305, 306, 307, 308, 309, 0, 0, 0, 0,
+ 0, 0, 0, 0, 310, 0, 311, 312, 313, 314,
315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
335, 1, 2, 3, 4, 5, 6, 7, 8, 9,
@@ -1956,8 +1956,8 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 297,
298, 299, 300, 301, 302, 303, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 304, 305,
- 306, 307, 308, 0, 0, 0, 0, 0, 0, 0,
- 0, 309, 0, 310, 311, 312, 313, 314, 315, 316,
+ 306, 307, 308, 309, 0, 0, 0, 0, 0, 0,
+ 0, 0, 310, 0, 311, 312, 313, 314, 315, 316,
317, 318, 319, 320, 321, 322, 323, 324, 325, 326,
327, 328, 329, 330, 331, 332, 333, 334, 335, 1,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
@@ -1997,8 +1997,8 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 297, 298, 299,
300, 301, 302, 303, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 304, 305, 306, 307,
- 308, 0, 0, 0, 0, 0, 0, 0, 0, 309,
- 0, 310, 311, 312, 313, 314, 315, 316, 317, 318,
+ 308, 309, 0, 0, 0, 0, 0, 0, 0, 0,
+ 310, 0, 311, 312, 313, 314, 315, 316, 317, 318,
319, 320, 321, 322, 323, 324, 325, 326, 327, 328,
329, 330, 331, 332, 333, 334, 335, 1, 2, 3,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
@@ -2037,8 +2037,8 @@ static const yytype_int16 yytable[] =
0, 0, 292, 293, 294, 295, 0, 0, 0, 0,
0, 0, 0, 0, 0, 297, 298, 299, 300, 301,
302, 303, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 304, 305, 306, 307, 308, 0,
- 0, 0, 0, 0, 0, 0, 0, 309, 0, 310,
+ 0, 0, 0, 0, 304, 305, 306, 307, 308, 309,
+ 0, 0, 0, 0, 0, 0, 0, 0, 310, 0,
311, 312, 313, 314, 315, 316, 317, 318, 319, 320,
321, 322, 323, 324, 325, 326, 327, 328, 329, 330,
331, 332, 333, 334, 335, 2, 3, 4, 5, 6,
@@ -2046,8 +2046,8 @@ static const yytype_int16 yytable[] =
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 0, 0, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 0, 0, 61, 62, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
@@ -2078,15 +2078,15 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 421, 422, 423,
424, 425, 297, 0, 0, 0, 0, 302, 303, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 426, 427, 428, 429,
- 430, 431, 432, 433, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 426, 427, 428,
+ 429, 430, 431, 432, 433, 0, 0, 0, 0, 0,
0, 0, 0, 0, 318, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 0, 0, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 0, 0, 61, 62, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
@@ -2117,15 +2117,15 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 421, 422, 423,
424, 425, 297, 0, 0, 0, 0, 302, 303, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 426, 427, 428, 429,
- 430, 431, 432, 433, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 426, 427, 428,
+ 429, 430, 431, 432, 433, 0, 0, 0, 0, 0,
0, 0, 0, 0, 318, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 0, 0, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 0, 0, 61, 62, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
@@ -2156,15 +2156,15 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 421, 422, 423,
424, 425, 297, 0, 0, 0, 0, 302, 303, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 426, 427, 428, 429,
- 430, 431, 432, 433, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 426, 427, 428,
+ 429, 430, 431, 432, 433, 0, 0, 0, 0, 0,
0, 0, 0, 0, 318, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 0, 0, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 0, 0, 61, 62, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
@@ -2195,15 +2195,15 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 421, 422, 423,
424, 425, 297, 0, 0, 0, 0, 302, 303, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 426, 427, 428, 429,
- 430, 431, 432, 433, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 426, 427, 428,
+ 429, 430, 431, 432, 433, 0, 0, 0, 0, 0,
0, 0, 0, 0, 318, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 0, 0, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 0, 0, 61, 62, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
@@ -2234,15 +2234,15 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 421, 422, 423,
424, 425, 297, 0, 0, 0, 0, 302, 303, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 426, 427, 428, 429,
- 430, 431, 432, 433, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 426, 427, 428,
+ 429, 430, 431, 432, 433, 0, 0, 0, 0, 0,
0, 0, 0, 0, 318, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 0, 0, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 0, 0, 61, 62, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
@@ -2273,15 +2273,15 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 421, 422, 423,
424, 425, 297, 0, 0, 0, 0, 302, 303, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 426, 427, 428, 429,
- 430, 431, 432, 433, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 426, 427, 428,
+ 429, 430, 431, 432, 433, 0, 0, 0, 0, 0,
0, 0, 0, 0, 318, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 0, 0, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 0, 0, 61, 62, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
@@ -2312,8 +2312,8 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 421, 422, 423,
424, 425, 297, 0, 0, 0, 0, 302, 538, 0,
0, 541, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 462, 0, 0, 0, 426, 427, 428, 429,
- 430, 431, 432, 433, 0, 0, 0, 0, 0, 0,
+ 0, 0, 462, 0, 0, 0, 0, 426, 427, 428,
+ 429, 430, 431, 432, 433, 0, 0, 0, 0, 0,
0, 462, 0, 0, 318, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -2338,14 +2338,14 @@ static const yytype_int16 yytable[] =
static const yytype_int16 yycheck[] =
{
- 0, 321, 0, 317, 0, 358, 315, 321, 361, 0,
+ 0, 321, 0, 455, 0, 358, 315, 314, 361, 0,
363, 364, 321, 333, 367, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 293, 294, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, 524, 314, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
@@ -2369,34 +2369,34 @@ static const yytype_int16 yycheck[] =
269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
279, 280, 281, 282, 283, 284, 285, 286, 287, 288,
289, 290, 291, 292, 341, 349, 416, 378, 506, 518,
- 408, 520, 397, 384, 523, 580, 453, 656, 302, 455,
- 297, 298, 324, 324, 316, 350, 339, 340, 341, 695,
- 374, 318, 324, 370, 405, 406, 702, 562, 563, 564,
- 565, 341, 314, 316, 442, 684, 371, 713, 350, 349,
- 341, 324, 389, 337, 314, 332, 333, 357, 349, 357,
- 360, 357, 351, 350, 299, 300, 357, 356, 357, 316,
- 370, 456, 295, 296, 374, 314, 323, 316, 488, 370,
- 490, 321, 322, 374, 323, 316, 584, 316, 524, 389,
- 475, 314, 323, 316, 323, 315, 318, 320, 389, 321,
- 400, 321, 324, 315, 315, 614, 315, 451, 315, 400,
- 321, 315, 321, 550, 321, 315, 453, 321, 455, 321,
- 518, 321, 520, 533, 350, 523, 304, 305, 306, 307,
- 308, 309, 310, 311, 312, 313, 332, 321, 321, 537,
- 324, 324, 321, 322, 321, 323, 321, 324, 319, 324,
- 321, 451, 717, 453, 318, 455, 321, 655, 667, 324,
- 451, 350, 453, 321, 455, 318, 324, 329, 330, 331,
- 326, 316, 328, 324, 545, 323, 586, 558, 559, 315,
- 590, 618, 560, 561, 566, 567, 314, 524, 335, 350,
- 350, 350, 316, 350, 336, 350, 334, 301, 707, 317,
- 303, 316, 319, 314, 324, 324, 506, 605, 606, 314,
- 324, 324, 314, 550, 314, 506, 614, 314, 314, 350,
- 350, 322, 315, 317, 524, 723, 317, 350, 314, 321,
- 317, 358, 315, 524, 319, 314, 318, 315, 350, 323,
- 650, 315, 318, 324, 324, 318, 656, 319, 568, 570,
- 550, 569, 362, 572, 571, 673, 296, 573, 374, 550,
- 458, 370, 544, 628, 658, 713, 374, 701, 714, 667,
- 368, 658, 516, 684, 684, 516, 675, -1, 516, -1,
- 580, 618, 357, -1, 584, -1, 696, -1, 673, 580,
+ 408, 520, 397, 384, 523, 580, 453, 656, 297, 298,
+ 302, 324, 350, 316, 318, 293, 294, 314, 350, 316,
+ 374, 324, 316, 370, 405, 406, 323, 299, 300, 316,
+ 324, 341, 315, 371, 442, 684, 323, 350, 321, 349,
+ 341, 315, 389, 332, 333, 337, 350, 357, 349, 357,
+ 360, 357, 351, 295, 296, 316, 357, 356, 357, 695,
+ 370, 456, 323, 317, 374, 315, 702, 321, 488, 370,
+ 490, 321, 314, 374, 316, 316, 584, 713, 320, 389,
+ 475, 318, 323, 315, 321, 315, 315, 324, 389, 321,
+ 400, 321, 321, 321, 315, 614, 324, 451, 321, 400,
+ 321, 324, 321, 550, 321, 324, 453, 324, 455, 324,
+ 518, 321, 520, 533, 324, 523, 304, 305, 306, 307,
+ 308, 309, 310, 311, 312, 313, 339, 340, 341, 537,
+ 562, 563, 564, 565, 321, 323, 321, 324, 329, 330,
+ 331, 451, 717, 453, 326, 455, 328, 655, 667, 319,
+ 451, 321, 453, 332, 455, 321, 322, 321, 322, 558,
+ 559, 318, 560, 561, 545, 318, 586, 350, 316, 350,
+ 590, 618, 566, 567, 350, 324, 323, 524, 350, 315,
+ 314, 316, 350, 350, 336, 335, 301, 303, 707, 334,
+ 317, 316, 314, 319, 324, 324, 506, 605, 606, 322,
+ 314, 314, 314, 550, 324, 506, 614, 324, 314, 314,
+ 350, 350, 315, 317, 524, 723, 317, 350, 314, 321,
+ 358, 319, 317, 524, 315, 314, 350, 315, 318, 323,
+ 650, 324, 315, 318, 362, 319, 656, 318, 324, 568,
+ 550, 569, 572, 570, 673, 571, 458, 296, 573, 550,
+ 628, 370, 658, 374, 544, 701, 374, 713, 368, 667,
+ 714, 658, 684, 516, 684, 516, 675, 516, -1, -1,
+ 580, 618, -1, -1, 584, 357, 696, -1, 673, 580,
-1, 689, -1, 584, -1, -1, -1, -1, -1, -1,
-1, -1, 712, -1, -1, -1, -1, -1, -1, 707,
-1, -1, -1, -1, -1, -1, -1, -1, 618, 656,
@@ -2448,8 +2448,8 @@ static const yytype_int16 yycheck[] =
340, 341, 342, -1, -1, -1, -1, -1, -1, -1,
-1, 351, 352, 353, 354, 355, 356, 357, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 370, 371, 372, 373, 374, -1, -1, -1, -1, -1,
- -1, -1, -1, 383, -1, 385, 386, 387, 388, 389,
+ 370, 371, 372, 373, 374, 375, -1, -1, -1, -1,
+ -1, -1, -1, -1, 384, -1, 386, 387, 388, 389,
390, 391, 392, 393, 394, 395, 396, 397, 398, 399,
400, 401, 402, 403, 404, 405, 406, 407, 408, 409,
410, 3, 4, 5, 6, 7, 8, 9, 10, 11,
@@ -2694,7 +2694,7 @@ static const yytype_int16 yycheck[] =
352, 353, 354, 355, 356, 357, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 370, 371,
372, 373, 374, 375, 376, 377, 378, 379, 380, 381,
- 382, 383, -1, 385, 386, 387, 388, 389, 390, 391,
+ 382, 383, 384, -1, 386, 387, 388, 389, 390, 391,
392, 393, 394, 395, 396, 397, 398, 399, 400, 401,
402, 403, 404, 405, 406, 407, 408, 409, 410, 3,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
@@ -2735,7 +2735,7 @@ static const yytype_int16 yycheck[] =
354, 355, 356, 357, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 370, 371, 372, 373,
374, 375, 376, 377, 378, 379, 380, 381, 382, 383,
- -1, 385, 386, 387, 388, 389, 390, 391, 392, 393,
+ 384, -1, 386, 387, 388, 389, 390, 391, 392, 393,
394, 395, 396, 397, 398, 399, 400, 401, 402, 403,
404, 405, 406, 407, 408, 409, 410, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
@@ -2774,8 +2774,8 @@ static const yytype_int16 yycheck[] =
-1, -1, 338, 339, 340, 341, 342, -1, -1, -1,
-1, -1, -1, -1, -1, 351, 352, 353, 354, 355,
356, 357, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 370, 371, 372, 373, 374, -1,
- -1, -1, -1, -1, -1, -1, -1, 383, -1, 385,
+ -1, -1, -1, -1, 370, 371, 372, 373, 374, 375,
+ -1, -1, -1, -1, -1, -1, -1, -1, 384, -1,
386, 387, 388, 389, 390, 391, 392, 393, 394, 395,
396, 397, 398, 399, 400, 401, 402, 403, 404, 405,
406, 407, 408, 409, 410, 3, 4, 5, 6, 7,
@@ -2815,8 +2815,8 @@ static const yytype_int16 yycheck[] =
338, 339, 340, 341, -1, -1, -1, -1, -1, -1,
-1, -1, 350, 351, 352, 353, 354, 355, 356, 357,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 370, 371, 372, 373, 374, -1, -1, -1,
- -1, -1, -1, -1, -1, 383, -1, 385, 386, 387,
+ -1, -1, 370, 371, 372, 373, 374, 375, -1, -1,
+ -1, -1, -1, -1, -1, -1, 384, -1, 386, 387,
388, 389, 390, 391, 392, 393, 394, 395, 396, 397,
398, 399, 400, 401, 402, 403, 404, 405, 406, 407,
408, 409, 410, 3, 4, 5, 6, 7, 8, 9,
@@ -2856,8 +2856,8 @@ static const yytype_int16 yycheck[] =
340, 341, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 351, 352, 353, 354, 355, 356, 357, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 370, 371, 372, 373, 374, -1, -1, -1, -1, -1,
- -1, -1, -1, 383, -1, 385, 386, 387, 388, 389,
+ 370, 371, 372, 373, 374, 375, -1, -1, -1, -1,
+ -1, -1, -1, -1, 384, -1, 386, 387, 388, 389,
390, 391, 392, 393, 394, 395, 396, 397, 398, 399,
400, 401, 402, 403, 404, 405, 406, 407, 408, 409,
410, 3, 4, 5, 6, 7, 8, 9, 10, 11,
@@ -2897,8 +2897,8 @@ static const yytype_int16 yycheck[] =
-1, -1, -1, -1, -1, -1, -1, -1, -1, 351,
352, 353, 354, 355, 356, 357, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 370, 371,
- 372, 373, 374, -1, -1, -1, -1, -1, -1, -1,
- -1, 383, -1, 385, 386, 387, 388, 389, 390, 391,
+ 372, 373, 374, 375, -1, -1, -1, -1, -1, -1,
+ -1, -1, 384, -1, 386, 387, 388, 389, 390, 391,
392, 393, 394, 395, 396, 397, 398, 399, 400, 401,
402, 403, 404, 405, 406, 407, 408, 409, 410, 3,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
@@ -2938,8 +2938,8 @@ static const yytype_int16 yycheck[] =
-1, -1, -1, -1, -1, -1, -1, 351, 352, 353,
354, 355, 356, 357, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 370, 371, 372, 373,
- 374, -1, -1, -1, -1, -1, -1, -1, -1, 383,
- -1, 385, 386, 387, 388, 389, 390, 391, 392, 393,
+ 374, 375, -1, -1, -1, -1, -1, -1, -1, -1,
+ 384, -1, 386, 387, 388, 389, 390, 391, 392, 393,
394, 395, 396, 397, 398, 399, 400, 401, 402, 403,
404, 405, 406, 407, 408, 409, 410, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
@@ -2978,8 +2978,8 @@ static const yytype_int16 yycheck[] =
-1, -1, 338, 339, 340, 341, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 351, 352, 353, 354, 355,
356, 357, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 370, 371, 372, 373, 374, -1,
- -1, -1, -1, -1, -1, -1, -1, 383, -1, 385,
+ -1, -1, -1, -1, 370, 371, 372, 373, 374, 375,
+ -1, -1, -1, -1, -1, -1, -1, -1, 384, -1,
386, 387, 388, 389, 390, 391, 392, 393, 394, 395,
396, 397, 398, 399, 400, 401, 402, 403, 404, 405,
406, 407, 408, 409, 410, 4, 5, 6, 7, 8,
@@ -2987,8 +2987,8 @@ static const yytype_int16 yycheck[] =
19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, -1, -1, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, -1, -1, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
@@ -3019,15 +3019,15 @@ static const yytype_int16 yycheck[] =
-1, -1, -1, -1, -1, -1, -1, 346, 347, 348,
349, 350, 351, -1, -1, -1, -1, 356, 357, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 375, 376, 377, 378,
- 379, 380, 381, 382, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 376, 377, 378,
+ 379, 380, 381, 382, 383, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 393, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, -1, -1, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, -1, -1, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
@@ -3058,15 +3058,15 @@ static const yytype_int16 yycheck[] =
-1, -1, -1, -1, -1, -1, -1, 346, 347, 348,
349, 350, 351, -1, -1, -1, -1, 356, 357, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 375, 376, 377, 378,
- 379, 380, 381, 382, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 376, 377, 378,
+ 379, 380, 381, 382, 383, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 393, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, -1, -1, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, -1, -1, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
@@ -3097,15 +3097,15 @@ static const yytype_int16 yycheck[] =
-1, -1, -1, -1, -1, -1, -1, 346, 347, 348,
349, 350, 351, -1, -1, -1, -1, 356, 357, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 375, 376, 377, 378,
- 379, 380, 381, 382, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 376, 377, 378,
+ 379, 380, 381, 382, 383, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 393, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, -1, -1, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, -1, -1, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
@@ -3136,15 +3136,15 @@ static const yytype_int16 yycheck[] =
-1, -1, -1, -1, -1, -1, -1, 346, 347, 348,
349, 350, 351, -1, -1, -1, -1, 356, 357, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 375, 376, 377, 378,
- 379, 380, 381, 382, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 376, 377, 378,
+ 379, 380, 381, 382, 383, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 393, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, -1, -1, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, -1, -1, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
@@ -3175,15 +3175,15 @@ static const yytype_int16 yycheck[] =
-1, -1, -1, -1, -1, -1, -1, 346, 347, 348,
349, 350, 351, -1, -1, -1, -1, 356, 357, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 375, 376, 377, 378,
- 379, 380, 381, 382, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 376, 377, 378,
+ 379, 380, 381, 382, 383, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 393, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, -1, -1, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, -1, -1, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
@@ -3214,15 +3214,15 @@ static const yytype_int16 yycheck[] =
-1, -1, -1, -1, -1, -1, -1, 346, 347, 348,
349, 350, 351, -1, -1, -1, -1, 356, 357, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 375, 376, 377, 378,
- 379, 380, 381, 382, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 376, 377, 378,
+ 379, 380, 381, 382, 383, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 393, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, -1, -1, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, -1, -1, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
@@ -3253,8 +3253,8 @@ static const yytype_int16 yycheck[] =
-1, -1, -1, -1, -1, -1, -1, 346, 347, 348,
349, 350, 351, -1, -1, -1, -1, 356, 357, -1,
-1, 445, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 456, -1, -1, -1, 375, 376, 377, 378,
- 379, 380, 381, 382, -1, -1, -1, -1, -1, -1,
+ -1, -1, 456, -1, -1, -1, -1, 376, 377, 378,
+ 379, 380, 381, 382, 383, -1, -1, -1, -1, -1,
-1, 475, -1, -1, 393, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -3311,8 +3311,8 @@ static const yytype_uint16 yystos[] =
272, 273, 274, 275, 276, 277, 278, 279, 280, 281,
282, 283, 284, 285, 286, 287, 288, 289, 290, 291,
292, 324, 338, 339, 340, 341, 342, 351, 352, 353,
- 354, 355, 356, 357, 370, 371, 372, 373, 374, 383,
- 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
+ 354, 355, 356, 357, 370, 371, 372, 373, 374, 375,
+ 384, 386, 387, 388, 389, 390, 391, 392, 393, 394,
395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
405, 406, 407, 408, 409, 410, 442, 443, 446, 447,
448, 449, 453, 454, 455, 456, 457, 458, 461, 462,
@@ -3323,14 +3323,14 @@ static const yytype_uint16 yystos[] =
318, 350, 371, 459, 460, 350, 466, 316, 324, 468,
318, 494, 451, 450, 452, 350, 350, 314, 323, 468,
318, 321, 324, 445, 295, 296, 314, 325, 326, 327,
- 328, 346, 347, 348, 349, 350, 375, 376, 377, 378,
- 379, 380, 381, 382, 412, 413, 414, 416, 417, 418,
+ 328, 346, 347, 348, 349, 350, 376, 377, 378, 379,
+ 380, 381, 382, 383, 412, 413, 414, 416, 417, 418,
419, 420, 421, 422, 423, 424, 465, 467, 471, 468,
324, 462, 467, 477, 478, 475, 323, 315, 321, 315,
321, 317, 423, 425, 426, 427, 428, 429, 430, 431,
432, 433, 434, 435, 436, 316, 324, 316, 318, 319,
324, 358, 359, 360, 361, 363, 364, 365, 366, 367,
- 368, 369, 384, 423, 436, 438, 440, 442, 446, 465,
+ 368, 369, 385, 423, 436, 438, 440, 442, 446, 465,
467, 483, 484, 485, 486, 487, 495, 496, 497, 498,
501, 502, 505, 506, 507, 514, 519, 468, 323, 468,
318, 438, 481, 323, 444, 350, 321, 324, 423, 423,
@@ -5805,7 +5805,7 @@ yyreduce:
break;
case 162:
-#line 1364 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 1363 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.globalCheck((yyvsp[0].lex).loc, "shared");
parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
@@ -5818,7 +5818,7 @@ yyreduce:
break;
case 163:
-#line 1372 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 1371 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.globalCheck((yyvsp[0].lex).loc, "buffer");
(yyval.interm.type).init((yyvsp[0].lex).loc);
@@ -7619,21 +7619,21 @@ yyreduce:
break;
case 332:
-#line 2358 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2357 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true);
+ (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true);
}
#line 7629 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 333:
-#line 2363 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2362 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true);
+ (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true);
}
#line 7639 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
@@ -7643,33 +7643,33 @@ yyreduce:
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true);
+ (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true);
}
#line 7649 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 335:
-#line 2374 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2373 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true);
+ (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true);
}
#line 7659 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 336:
-#line 2379 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2378 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true);
+ (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true);
}
#line 7669 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 337:
-#line 2384 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2383 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -7679,7 +7679,7 @@ yyreduce:
break;
case 338:
-#line 2389 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2388 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -7689,7 +7689,7 @@ yyreduce:
break;
case 339:
-#line 2395 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2393 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -7700,7 +7700,7 @@ yyreduce:
break;
case 340:
-#line 2401 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2399 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -7711,7 +7711,7 @@ yyreduce:
break;
case 341:
-#line 2407 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2405 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -7722,7 +7722,7 @@ yyreduce:
break;
case 342:
-#line 2413 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2411 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -7733,7 +7733,7 @@ yyreduce:
break;
case 343:
-#line 2419 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2417 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -7744,7 +7744,7 @@ yyreduce:
break;
case 344:
-#line 2425 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2423 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -7755,7 +7755,7 @@ yyreduce:
break;
case 345:
-#line 2431 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2429 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -7766,7 +7766,7 @@ yyreduce:
break;
case 346:
-#line 2437 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2435 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -7777,7 +7777,7 @@ yyreduce:
break;
case 347:
-#line 2443 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2441 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -7788,7 +7788,7 @@ yyreduce:
break;
case 348:
-#line 2449 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2447 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -7799,7 +7799,7 @@ yyreduce:
break;
case 349:
-#line 2455 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2453 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -7810,7 +7810,7 @@ yyreduce:
break;
case 350:
-#line 2461 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2459 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -7821,7 +7821,7 @@ yyreduce:
break;
case 351:
-#line 2467 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2465 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -7832,7 +7832,7 @@ yyreduce:
break;
case 352:
-#line 2473 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2471 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -7842,7 +7842,7 @@ yyreduce:
break;
case 353:
-#line 2479 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2477 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -7852,7 +7852,7 @@ yyreduce:
break;
case 354:
-#line 2484 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2482 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -7862,7 +7862,7 @@ yyreduce:
break;
case 355:
-#line 2489 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2487 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -7872,77 +7872,77 @@ yyreduce:
break;
case 356:
-#line 2495 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2492 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtInt, Esd1D, true);
+ (yyval.interm.type).sampler.set(EbtInt, Esd2D, true);
}
#line 7882 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 357:
-#line 2501 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2497 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtInt, Esd2D, true);
+ (yyval.interm.type).sampler.set(EbtUint, Esd2D);
}
#line 7892 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 358:
-#line 2506 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2502 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtInt, EsdCube, true);
+ (yyval.interm.type).sampler.set(EbtUint, Esd3D);
}
#line 7902 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 359:
-#line 2512 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2507 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtUint, Esd1D);
+ (yyval.interm.type).sampler.set(EbtUint, EsdCube);
}
#line 7912 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 360:
-#line 2518 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2513 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtUint, Esd2D);
+ (yyval.interm.type).sampler.set(EbtInt, Esd1D, true);
}
#line 7922 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 361:
-#line 2523 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2518 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtUint, Esd3D);
+ (yyval.interm.type).sampler.set(EbtInt, EsdCube, true);
}
#line 7932 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 362:
-#line 2528 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2523 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtUint, EsdCube);
+ (yyval.interm.type).sampler.set(EbtUint, Esd1D);
}
#line 7942 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 363:
-#line 2534 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2528 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -7952,519 +7952,519 @@ yyreduce:
break;
case 364:
-#line 2540 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2533 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtUint, Esd2D, true);
+ (yyval.interm.type).sampler.set(EbtUint, EsdCube, true);
}
#line 7962 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 365:
-#line 2545 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2538 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtUint, EsdCube, true);
+ (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true);
}
#line 7972 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 366:
-#line 2551 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2543 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat, EsdRect);
+ (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true);
}
#line 7982 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 367:
-#line 2556 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2548 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true);
+ (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true);
}
#line 7992 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 368:
-#line 2561 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2554 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
- parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat16, EsdRect);
+ (yyval.interm.type).sampler.set(EbtUint, Esd2D, true);
}
-#line 8003 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8002 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 369:
-#line 2567 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2559 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
- parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat16, EsdRect, false, true);
+ (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D);
}
-#line 8014 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8012 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 370:
-#line 2573 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2564 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtInt, EsdRect);
+ (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D);
}
-#line 8024 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8022 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 371:
-#line 2578 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2569 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtUint, EsdRect);
+ (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true);
}
-#line 8034 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8032 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 372:
-#line 2583 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2574 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer);
+ (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube);
}
-#line 8044 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8042 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 373:
-#line 2588 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2579 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
- parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat16, EsdBuffer);
+ (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D);
}
-#line 8055 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8052 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 374:
-#line 2594 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2584 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtInt, EsdBuffer);
+ (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D);
}
-#line 8065 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8062 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 375:
-#line 2599 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2589 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtUint, EsdBuffer);
+ (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube);
}
-#line 8075 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8072 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 376:
-#line 2604 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2594 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true);
+ (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true);
}
-#line 8085 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8082 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 377:
-#line 2609 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2599 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
- parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, false, true);
+ (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D);
}
-#line 8096 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8092 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 378:
-#line 2615 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2604 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true);
+ (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D);
}
-#line 8106 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8102 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 379:
-#line 2620 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2609 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true);
+ (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube);
}
-#line 8116 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8112 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 380:
-#line 2625 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2614 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true);
+ (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true);
}
-#line 8126 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8122 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 381:
-#line 2630 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2619 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
- parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, false, true);
+ (yyval.interm.type).sampler.setPureSampler(false);
}
-#line 8137 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8132 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 382:
-#line 2636 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2624 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true);
+ (yyval.interm.type).sampler.setPureSampler(true);
}
-#line 8147 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8142 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 383:
-#line 2641 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2630 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true);
+ (yyval.interm.type).sampler.set(EbtFloat, EsdRect);
}
-#line 8157 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8152 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 384:
-#line 2646 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2635 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setPureSampler(false);
+ (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true);
}
-#line 8167 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8162 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 385:
-#line 2651 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2640 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
+ parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setPureSampler(true);
+ (yyval.interm.type).sampler.set(EbtFloat16, EsdRect);
}
-#line 8177 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8173 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 386:
-#line 2656 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2646 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
+ parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D);
+ (yyval.interm.type).sampler.set(EbtFloat16, EsdRect, false, true);
}
-#line 8187 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8184 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 387:
-#line 2661 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2652 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
- parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D);
+ (yyval.interm.type).sampler.set(EbtInt, EsdRect);
}
-#line 8198 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8194 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 388:
-#line 2667 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2657 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D);
+ (yyval.interm.type).sampler.set(EbtUint, EsdRect);
}
-#line 8208 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8204 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 389:
-#line 2672 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2662 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
- parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D);
+ (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer);
}
-#line 8219 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8214 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 390:
-#line 2678 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2667 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
+ parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D);
+ (yyval.interm.type).sampler.set(EbtFloat16, EsdBuffer);
}
-#line 8229 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8225 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 391:
-#line 2683 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2673 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
- parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd3D);
+ (yyval.interm.type).sampler.set(EbtInt, EsdBuffer);
}
-#line 8240 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8235 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 392:
-#line 2689 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2678 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube);
+ (yyval.interm.type).sampler.set(EbtUint, EsdBuffer);
}
-#line 8250 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8245 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 393:
-#line 2694 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2683 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
- parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube);
+ (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true);
}
-#line 8261 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8255 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 394:
-#line 2700 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2688 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
+ parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true);
+ (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, false, true);
}
-#line 8271 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8266 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 395:
-#line 2705 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2694 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
- parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D, true);
+ (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true);
}
-#line 8282 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8276 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 396:
-#line 2711 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2699 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true);
+ (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true);
}
-#line 8292 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8286 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 397:
-#line 2716 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2704 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
- parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true);
+ (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true);
}
-#line 8303 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8296 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 398:
-#line 2722 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2709 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
+ parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true);
+ (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, false, true);
}
-#line 8313 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8307 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 399:
-#line 2727 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2715 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
- parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube, true);
+ (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true);
}
-#line 8324 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8317 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 400:
-#line 2733 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2720 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D);
+ (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true);
}
-#line 8334 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8327 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 401:
-#line 2738 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2725 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D);
+ (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D);
}
-#line 8344 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 402:
-#line 2743 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2730 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
+ parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D);
+ (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D);
}
-#line 8354 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8348 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 403:
-#line 2748 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2736 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
+ parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube);
+ (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D);
}
-#line 8364 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8359 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 404:
-#line 2753 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2742 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
+ parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true);
+ (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd3D);
}
-#line 8374 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8370 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 405:
-#line 2758 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2748 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
+ parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true);
+ (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube);
}
-#line 8384 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8381 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 406:
-#line 2763 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2754 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true);
+ (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true);
}
-#line 8394 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 407:
-#line 2768 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2759 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
+ parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D);
+ (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D, true);
}
-#line 8404 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8402 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 408:
-#line 2773 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2765 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
+ parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D);
+ (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true);
}
-#line 8414 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
+#line 8413 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 409:
-#line 2778 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2771 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
+ parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D);
+ (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube, true);
}
#line 8424 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 410:
-#line 2783 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2777 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube);
+ (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D);
}
#line 8434 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 411:
-#line 2788 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2782 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true);
+ (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true);
}
#line 8444 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 412:
-#line 2793 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2787 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true);
+ (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D);
}
#line 8454 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 413:
-#line 2798 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2792 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
- (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true);
+ (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true);
}
#line 8464 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 414:
-#line 2803 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2797 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8474,7 +8474,7 @@ yyreduce:
break;
case 415:
-#line 2808 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2802 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -8485,7 +8485,7 @@ yyreduce:
break;
case 416:
-#line 2814 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2808 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8495,7 +8495,7 @@ yyreduce:
break;
case 417:
-#line 2819 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2813 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8505,7 +8505,7 @@ yyreduce:
break;
case 418:
-#line 2824 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2818 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8515,7 +8515,7 @@ yyreduce:
break;
case 419:
-#line 2829 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2823 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -8526,7 +8526,7 @@ yyreduce:
break;
case 420:
-#line 2835 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2829 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8536,7 +8536,7 @@ yyreduce:
break;
case 421:
-#line 2840 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2834 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8546,7 +8546,7 @@ yyreduce:
break;
case 422:
-#line 2845 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2839 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8556,7 +8556,7 @@ yyreduce:
break;
case 423:
-#line 2850 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2844 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -8567,7 +8567,7 @@ yyreduce:
break;
case 424:
-#line 2856 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2850 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8577,7 +8577,7 @@ yyreduce:
break;
case 425:
-#line 2861 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2855 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8587,7 +8587,7 @@ yyreduce:
break;
case 426:
-#line 2866 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2860 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8597,7 +8597,7 @@ yyreduce:
break;
case 427:
-#line 2871 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2865 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -8608,7 +8608,7 @@ yyreduce:
break;
case 428:
-#line 2877 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2871 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8618,7 +8618,7 @@ yyreduce:
break;
case 429:
-#line 2882 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2876 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8628,7 +8628,7 @@ yyreduce:
break;
case 430:
-#line 2887 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2881 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8638,7 +8638,7 @@ yyreduce:
break;
case 431:
-#line 2892 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2886 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -8649,7 +8649,7 @@ yyreduce:
break;
case 432:
-#line 2898 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2892 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8659,7 +8659,7 @@ yyreduce:
break;
case 433:
-#line 2903 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2897 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8669,7 +8669,7 @@ yyreduce:
break;
case 434:
-#line 2908 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2902 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8679,7 +8679,7 @@ yyreduce:
break;
case 435:
-#line 2913 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2907 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -8690,7 +8690,7 @@ yyreduce:
break;
case 436:
-#line 2919 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2913 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8700,7 +8700,7 @@ yyreduce:
break;
case 437:
-#line 2924 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2918 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8710,7 +8710,7 @@ yyreduce:
break;
case 438:
-#line 2929 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2923 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8720,7 +8720,7 @@ yyreduce:
break;
case 439:
-#line 2934 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2928 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -8731,7 +8731,7 @@ yyreduce:
break;
case 440:
-#line 2940 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2934 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8741,7 +8741,7 @@ yyreduce:
break;
case 441:
-#line 2945 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2939 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8751,7 +8751,7 @@ yyreduce:
break;
case 442:
-#line 2950 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2944 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8761,7 +8761,7 @@ yyreduce:
break;
case 443:
-#line 2955 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2949 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -8772,7 +8772,7 @@ yyreduce:
break;
case 444:
-#line 2961 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2955 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8782,7 +8782,7 @@ yyreduce:
break;
case 445:
-#line 2966 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2960 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8792,7 +8792,7 @@ yyreduce:
break;
case 446:
-#line 2971 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2965 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8802,7 +8802,7 @@ yyreduce:
break;
case 447:
-#line 2976 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2970 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -8813,7 +8813,7 @@ yyreduce:
break;
case 448:
-#line 2982 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2976 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8823,7 +8823,7 @@ yyreduce:
break;
case 449:
-#line 2987 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2981 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8833,7 +8833,7 @@ yyreduce:
break;
case 450:
-#line 2992 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2986 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8843,7 +8843,7 @@ yyreduce:
break;
case 451:
-#line 2997 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2991 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -8854,7 +8854,7 @@ yyreduce:
break;
case 452:
-#line 3003 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 2997 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8864,7 +8864,7 @@ yyreduce:
break;
case 453:
-#line 3008 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3002 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8874,7 +8874,7 @@ yyreduce:
break;
case 454:
-#line 3013 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3007 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8884,7 +8884,7 @@ yyreduce:
break;
case 455:
-#line 3018 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3012 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -8895,7 +8895,7 @@ yyreduce:
break;
case 456:
-#line 3024 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3018 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8905,7 +8905,7 @@ yyreduce:
break;
case 457:
-#line 3029 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3023 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8915,7 +8915,7 @@ yyreduce:
break;
case 458:
-#line 3034 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3028 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8925,7 +8925,7 @@ yyreduce:
break;
case 459:
-#line 3039 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3033 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -8936,7 +8936,7 @@ yyreduce:
break;
case 460:
-#line 3045 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3039 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8946,7 +8946,7 @@ yyreduce:
break;
case 461:
-#line 3050 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3044 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8956,7 +8956,7 @@ yyreduce:
break;
case 462:
-#line 3055 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3049 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8966,7 +8966,7 @@ yyreduce:
break;
case 463:
-#line 3060 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3054 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -8977,7 +8977,7 @@ yyreduce:
break;
case 464:
-#line 3066 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3060 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8987,7 +8987,7 @@ yyreduce:
break;
case 465:
-#line 3071 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3065 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -8997,7 +8997,7 @@ yyreduce:
break;
case 466:
-#line 3076 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3070 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -9007,7 +9007,7 @@ yyreduce:
break;
case 467:
-#line 3081 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3075 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -9018,7 +9018,7 @@ yyreduce:
break;
case 468:
-#line 3087 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3081 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -9028,7 +9028,7 @@ yyreduce:
break;
case 469:
-#line 3092 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3086 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -9038,7 +9038,7 @@ yyreduce:
break;
case 470:
-#line 3097 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3091 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -9048,7 +9048,7 @@ yyreduce:
break;
case 471:
-#line 3102 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3096 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -9059,7 +9059,7 @@ yyreduce:
break;
case 472:
-#line 3108 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3102 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -9069,7 +9069,7 @@ yyreduce:
break;
case 473:
-#line 3113 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3107 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -9079,7 +9079,7 @@ yyreduce:
break;
case 474:
-#line 3118 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3112 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ // GL_OES_EGL_image_external
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -9090,7 +9090,7 @@ yyreduce:
break;
case 475:
-#line 3124 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3118 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ // GL_EXT_YUV_target
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtSampler;
@@ -9101,7 +9101,7 @@ yyreduce:
break;
case 476:
-#line 3130 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3124 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input");
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -9112,7 +9112,7 @@ yyreduce:
break;
case 477:
-#line 3136 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3130 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input");
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -9123,7 +9123,7 @@ yyreduce:
break;
case 478:
-#line 3142 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3136 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input");
@@ -9135,7 +9135,7 @@ yyreduce:
break;
case 479:
-#line 3149 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3143 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel());
parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input");
@@ -9147,7 +9147,7 @@ yyreduce:
break;
case 480:
-#line 3156 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3150 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input");
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -9158,7 +9158,7 @@ yyreduce:
break;
case 481:
-#line 3162 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3156 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input");
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -9169,7 +9169,7 @@ yyreduce:
break;
case 482:
-#line 3168 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3162 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input");
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -9180,7 +9180,7 @@ yyreduce:
break;
case 483:
-#line 3174 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3168 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input");
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -9191,7 +9191,7 @@ yyreduce:
break;
case 484:
-#line 3180 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3174 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.fcoopmatCheck((yyvsp[0].lex).loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -9202,7 +9202,7 @@ yyreduce:
break;
case 485:
-#line 3186 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3180 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.intcoopmatCheck((yyvsp[0].lex).loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -9213,7 +9213,7 @@ yyreduce:
break;
case 486:
-#line 3192 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3186 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.intcoopmatCheck((yyvsp[0].lex).loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -9224,7 +9224,7 @@ yyreduce:
break;
case 487:
-#line 3199 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3193 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.type) = (yyvsp[0].interm.type);
(yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -9234,7 +9234,7 @@ yyreduce:
break;
case 488:
-#line 3204 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3198 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
//
// This is for user defined type names. The lexical phase looked up the
@@ -9252,7 +9252,7 @@ yyreduce:
break;
case 489:
-#line 3220 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3214 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "highp precision qualifier");
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -9262,7 +9262,7 @@ yyreduce:
break;
case 490:
-#line 3225 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3219 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier");
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -9272,7 +9272,7 @@ yyreduce:
break;
case 491:
-#line 3230 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3224 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier");
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
@@ -9282,13 +9282,13 @@ yyreduce:
break;
case 492:
-#line 3238 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3232 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ parseContext.nestedStructCheck((yyvsp[-2].lex).loc); }
#line 9288 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 493:
-#line 3238 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3232 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string);
parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure);
@@ -9304,13 +9304,13 @@ yyreduce:
break;
case 494:
-#line 3249 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3243 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ parseContext.nestedStructCheck((yyvsp[-1].lex).loc); }
#line 9310 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 495:
-#line 3249 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3243 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
TType* structure = new TType((yyvsp[-1].interm.typeList), TString(""));
(yyval.interm.type).init((yyvsp[-4].lex).loc);
@@ -9322,7 +9322,7 @@ yyreduce:
break;
case 496:
-#line 3259 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3253 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.typeList) = (yyvsp[0].interm.typeList);
}
@@ -9330,7 +9330,7 @@ yyreduce:
break;
case 497:
-#line 3262 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3256 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.typeList) = (yyvsp[-1].interm.typeList);
for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) {
@@ -9345,7 +9345,7 @@ yyreduce:
break;
case 498:
-#line 3275 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3269 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
if ((yyvsp[-2].interm.type).arraySizes) {
parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
@@ -9372,7 +9372,7 @@ yyreduce:
break;
case 499:
-#line 3297 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3291 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
if ((yyvsp[-2].interm.type).arraySizes) {
parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
@@ -9401,7 +9401,7 @@ yyreduce:
break;
case 500:
-#line 3324 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3318 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.typeList) = new TTypeList;
(yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine));
@@ -9410,7 +9410,7 @@ yyreduce:
break;
case 501:
-#line 3328 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3322 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine));
}
@@ -9418,7 +9418,7 @@ yyreduce:
break;
case 502:
-#line 3334 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3328 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.typeLine).type = new TType(EbtVoid);
(yyval.interm.typeLine).loc = (yyvsp[0].lex).loc;
@@ -9428,7 +9428,7 @@ yyreduce:
break;
case 503:
-#line 3339 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3333 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes);
@@ -9441,7 +9441,7 @@ yyreduce:
break;
case 504:
-#line 3350 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3344 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
@@ -9449,7 +9449,7 @@ yyreduce:
break;
case 505:
-#line 3354 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3348 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
const char* initFeature = "{ } style initializers";
parseContext.requireProfile((yyvsp[-2].lex).loc, ~EEsProfile, initFeature);
@@ -9460,7 +9460,7 @@ yyreduce:
break;
case 506:
-#line 3360 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3354 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
const char* initFeature = "{ } style initializers";
parseContext.requireProfile((yyvsp[-3].lex).loc, ~EEsProfile, initFeature);
@@ -9471,7 +9471,7 @@ yyreduce:
break;
case 507:
-#line 3371 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3365 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc());
}
@@ -9479,7 +9479,7 @@ yyreduce:
break;
case 508:
-#line 3374 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3368 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
}
@@ -9487,73 +9487,73 @@ yyreduce:
break;
case 509:
-#line 3381 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3375 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
#line 9493 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 510:
-#line 3385 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3379 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
#line 9499 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 511:
-#line 3386 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3380 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
#line 9505 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 512:
-#line 3392 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3386 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
#line 9511 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 513:
-#line 3393 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3387 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
#line 9517 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 514:
-#line 3394 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3388 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
#line 9523 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 515:
-#line 3395 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3389 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
#line 9529 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 516:
-#line 3396 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3390 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
#line 9535 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 517:
-#line 3397 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3391 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
#line 9541 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 518:
-#line 3398 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3392 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
#line 9547 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 519:
-#line 3400 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3394 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
#line 9553 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 520:
-#line 3406 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3400 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "demote");
parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_demote_to_helper_invocation, "demote");
@@ -9563,13 +9563,13 @@ yyreduce:
break;
case 521:
-#line 3415 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3409 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = 0; }
#line 9569 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 522:
-#line 3416 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3410 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.symbolTable.push();
++parseContext.statementNestingLevel;
@@ -9578,7 +9578,7 @@ yyreduce:
break;
case 523:
-#line 3420 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3414 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
--parseContext.statementNestingLevel;
@@ -9587,7 +9587,7 @@ yyreduce:
break;
case 524:
-#line 3424 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3418 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate())
(yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence);
@@ -9597,19 +9597,19 @@ yyreduce:
break;
case 525:
-#line 3432 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3426 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
#line 9603 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 526:
-#line 3433 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3427 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
#line 9609 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 527:
-#line 3437 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3431 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
++parseContext.controlFlowNestingLevel;
}
@@ -9617,7 +9617,7 @@ yyreduce:
break;
case 528:
-#line 3440 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3434 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
--parseContext.controlFlowNestingLevel;
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
@@ -9626,7 +9626,7 @@ yyreduce:
break;
case 529:
-#line 3444 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3438 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.symbolTable.push();
++parseContext.statementNestingLevel;
@@ -9636,7 +9636,7 @@ yyreduce:
break;
case 530:
-#line 3449 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3443 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
--parseContext.statementNestingLevel;
@@ -9647,7 +9647,7 @@ yyreduce:
break;
case 531:
-#line 3458 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3452 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = 0;
}
@@ -9655,7 +9655,7 @@ yyreduce:
break;
case 532:
-#line 3461 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3455 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate())
(yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence);
@@ -9665,7 +9665,7 @@ yyreduce:
break;
case 533:
-#line 3469 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3463 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode));
if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase ||
@@ -9678,7 +9678,7 @@ yyreduce:
break;
case 534:
-#line 3477 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3471 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase ||
(yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) {
@@ -9691,19 +9691,19 @@ yyreduce:
break;
case 535:
-#line 3488 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3482 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = 0; }
#line 9697 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 536:
-#line 3489 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3483 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{ (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[-1].interm.intermTypedNode)); }
#line 9703 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
break;
case 537:
-#line 3493 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3487 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
@@ -9711,7 +9711,7 @@ yyreduce:
break;
case 538:
-#line 3497 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3491 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.handleSelectionAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode));
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
@@ -9720,7 +9720,7 @@ yyreduce:
break;
case 539:
-#line 3504 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3498 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-2].interm.intermTypedNode));
(yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yyvsp[-4].lex).loc);
@@ -9729,7 +9729,7 @@ yyreduce:
break;
case 540:
-#line 3511 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3505 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode);
(yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode);
@@ -9738,7 +9738,7 @@ yyreduce:
break;
case 541:
-#line 3515 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3509 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode);
(yyval.interm.nodePair).node2 = 0;
@@ -9747,7 +9747,7 @@ yyreduce:
break;
case 542:
-#line 3523 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3517 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode));
@@ -9756,7 +9756,7 @@ yyreduce:
break;
case 543:
-#line 3527 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3521 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type));
@@ -9771,7 +9771,7 @@ yyreduce:
break;
case 544:
-#line 3540 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3534 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
@@ -9779,7 +9779,7 @@ yyreduce:
break;
case 545:
-#line 3544 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3538 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.handleSwitchAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode));
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
@@ -9788,7 +9788,7 @@ yyreduce:
break;
case 546:
-#line 3551 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3545 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
// start new switch sequence on the switch stack
++parseContext.controlFlowNestingLevel;
@@ -9801,7 +9801,7 @@ yyreduce:
break;
case 547:
-#line 3559 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3553 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0);
delete parseContext.switchSequenceStack.back();
@@ -9815,7 +9815,7 @@ yyreduce:
break;
case 548:
-#line 3571 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3565 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = 0;
}
@@ -9823,7 +9823,7 @@ yyreduce:
break;
case 549:
-#line 3574 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3568 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
@@ -9831,7 +9831,7 @@ yyreduce:
break;
case 550:
-#line 3580 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3574 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = 0;
if (parseContext.switchLevel.size() == 0)
@@ -9848,7 +9848,7 @@ yyreduce:
break;
case 551:
-#line 3592 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3586 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = 0;
if (parseContext.switchLevel.size() == 0)
@@ -9862,7 +9862,7 @@ yyreduce:
break;
case 552:
-#line 3604 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3598 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
@@ -9870,7 +9870,7 @@ yyreduce:
break;
case 553:
-#line 3608 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3602 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.handleLoopAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode));
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
@@ -9879,7 +9879,7 @@ yyreduce:
break;
case 554:
-#line 3615 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3609 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
if (! parseContext.limits.whileLoops)
parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", "");
@@ -9892,7 +9892,7 @@ yyreduce:
break;
case 555:
-#line 3623 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3617 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
(yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, true, (yyvsp[-5].lex).loc);
@@ -9904,7 +9904,7 @@ yyreduce:
break;
case 556:
-#line 3630 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3624 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
++parseContext.loopNestingLevel;
++parseContext.statementNestingLevel;
@@ -9914,7 +9914,7 @@ yyreduce:
break;
case 557:
-#line 3635 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3629 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
if (! parseContext.limits.whileLoops)
parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", "");
@@ -9930,7 +9930,7 @@ yyreduce:
break;
case 558:
-#line 3646 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3640 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.symbolTable.push();
++parseContext.loopNestingLevel;
@@ -9941,7 +9941,7 @@ yyreduce:
break;
case 559:
-#line 3652 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3646 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
(yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc);
@@ -9958,7 +9958,7 @@ yyreduce:
break;
case 560:
-#line 3667 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3661 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
@@ -9966,7 +9966,7 @@ yyreduce:
break;
case 561:
-#line 3670 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3664 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
@@ -9974,7 +9974,7 @@ yyreduce:
break;
case 562:
-#line 3676 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3670 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
@@ -9982,7 +9982,7 @@ yyreduce:
break;
case 563:
-#line 3679 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3673 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermTypedNode) = 0;
}
@@ -9990,7 +9990,7 @@ yyreduce:
break;
case 564:
-#line 3685 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3679 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode);
(yyval.interm.nodePair).node2 = 0;
@@ -9999,7 +9999,7 @@ yyreduce:
break;
case 565:
-#line 3689 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3683 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode);
(yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode);
@@ -10008,7 +10008,7 @@ yyreduce:
break;
case 566:
-#line 3696 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3690 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
if (parseContext.loopNestingLevel <= 0)
parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", "");
@@ -10018,7 +10018,7 @@ yyreduce:
break;
case 567:
-#line 3701 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3695 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0)
parseContext.error((yyvsp[-1].lex).loc, "break statement only allowed in switch and loops", "", "");
@@ -10028,7 +10028,7 @@ yyreduce:
break;
case 568:
-#line 3706 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3700 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc);
if (parseContext.currentFunctionType->getBasicType() != EbtVoid)
@@ -10040,7 +10040,7 @@ yyreduce:
break;
case 569:
-#line 3713 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3707 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode));
}
@@ -10048,7 +10048,7 @@ yyreduce:
break;
case 570:
-#line 3716 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3710 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard");
(yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc);
@@ -10057,7 +10057,7 @@ yyreduce:
break;
case 571:
-#line 3725 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3719 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
parseContext.intermediate.setTreeRoot((yyval.interm.intermNode));
@@ -10066,7 +10066,7 @@ yyreduce:
break;
case 572:
-#line 3729 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3723 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
if ((yyvsp[0].interm.intermNode) != nullptr) {
(yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode));
@@ -10077,7 +10077,7 @@ yyreduce:
break;
case 573:
-#line 3738 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3732 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
@@ -10085,7 +10085,7 @@ yyreduce:
break;
case 574:
-#line 3741 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3735 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
@@ -10093,7 +10093,7 @@ yyreduce:
break;
case 575:
-#line 3745 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3739 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "extraneous semicolon");
parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, nullptr, "extraneous semicolon");
@@ -10103,7 +10103,7 @@ yyreduce:
break;
case 576:
-#line 3754 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3748 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyvsp[0].interm).function = parseContext.handleFunctionDeclarator((yyvsp[0].interm).loc, *(yyvsp[0].interm).function, false /* not prototype */);
(yyvsp[0].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[0].interm).loc, *(yyvsp[0].interm).function);
@@ -10112,7 +10112,7 @@ yyreduce:
break;
case 577:
-#line 3758 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3752 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
// May be best done as post process phase on intermediate code
if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue)
@@ -10132,7 +10132,7 @@ yyreduce:
break;
case 578:
-#line 3777 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3771 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.attributes) = (yyvsp[-2].interm.attributes);
parseContext.requireExtensions((yyvsp[-4].lex).loc, 1, &E_GL_EXT_control_flow_attributes, "attribute");
@@ -10141,7 +10141,7 @@ yyreduce:
break;
case 579:
-#line 3783 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3777 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.attributes) = (yyvsp[0].interm.attributes);
}
@@ -10149,7 +10149,7 @@ yyreduce:
break;
case 580:
-#line 3786 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3780 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes));
}
@@ -10157,7 +10157,7 @@ yyreduce:
break;
case 581:
-#line 3791 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3785 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string);
}
@@ -10165,7 +10165,7 @@ yyreduce:
break;
case 582:
-#line 3794 "MachineIndependent/glslang.y" /* yacc.c:1646 */
+#line 3788 "MachineIndependent/glslang.y" /* yacc.c:1646 */
{
(yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode));
}
@@ -10401,5 +10401,5 @@ yyreturn:
#endif
return yyresult;
}
-#line 3799 "MachineIndependent/glslang.y" /* yacc.c:1906 */
+#line 3793 "MachineIndependent/glslang.y" /* yacc.c:1906 */
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h
index f3f0251f22e..f4f41147305 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h
@@ -89,227 +89,227 @@ extern int yydebug;
USAMPLER3D = 299,
USAMPLERCUBE = 300,
USAMPLER2DARRAY = 301,
- SAMPLERCUBEARRAY = 302,
- SAMPLERCUBEARRAYSHADOW = 303,
- ISAMPLERCUBEARRAY = 304,
- USAMPLERCUBEARRAY = 305,
- ATTRIBUTE = 306,
- VARYING = 307,
- FLOAT16_T = 308,
- FLOAT32_T = 309,
- DOUBLE = 310,
- FLOAT64_T = 311,
- INT64_T = 312,
- UINT64_T = 313,
- INT32_T = 314,
- UINT32_T = 315,
- INT16_T = 316,
- UINT16_T = 317,
- INT8_T = 318,
- UINT8_T = 319,
- I64VEC2 = 320,
- I64VEC3 = 321,
- I64VEC4 = 322,
- U64VEC2 = 323,
- U64VEC3 = 324,
- U64VEC4 = 325,
- I32VEC2 = 326,
- I32VEC3 = 327,
- I32VEC4 = 328,
- U32VEC2 = 329,
- U32VEC3 = 330,
- U32VEC4 = 331,
- I16VEC2 = 332,
- I16VEC3 = 333,
- I16VEC4 = 334,
- U16VEC2 = 335,
- U16VEC3 = 336,
- U16VEC4 = 337,
- I8VEC2 = 338,
- I8VEC3 = 339,
- I8VEC4 = 340,
- U8VEC2 = 341,
- U8VEC3 = 342,
- U8VEC4 = 343,
- DVEC2 = 344,
- DVEC3 = 345,
- DVEC4 = 346,
- DMAT2 = 347,
- DMAT3 = 348,
- DMAT4 = 349,
- F16VEC2 = 350,
- F16VEC3 = 351,
- F16VEC4 = 352,
- F16MAT2 = 353,
- F16MAT3 = 354,
- F16MAT4 = 355,
- F32VEC2 = 356,
- F32VEC3 = 357,
- F32VEC4 = 358,
- F32MAT2 = 359,
- F32MAT3 = 360,
- F32MAT4 = 361,
- F64VEC2 = 362,
- F64VEC3 = 363,
- F64VEC4 = 364,
- F64MAT2 = 365,
- F64MAT3 = 366,
- F64MAT4 = 367,
- DMAT2X2 = 368,
- DMAT2X3 = 369,
- DMAT2X4 = 370,
- DMAT3X2 = 371,
- DMAT3X3 = 372,
- DMAT3X4 = 373,
- DMAT4X2 = 374,
- DMAT4X3 = 375,
- DMAT4X4 = 376,
- F16MAT2X2 = 377,
- F16MAT2X3 = 378,
- F16MAT2X4 = 379,
- F16MAT3X2 = 380,
- F16MAT3X3 = 381,
- F16MAT3X4 = 382,
- F16MAT4X2 = 383,
- F16MAT4X3 = 384,
- F16MAT4X4 = 385,
- F32MAT2X2 = 386,
- F32MAT2X3 = 387,
- F32MAT2X4 = 388,
- F32MAT3X2 = 389,
- F32MAT3X3 = 390,
- F32MAT3X4 = 391,
- F32MAT4X2 = 392,
- F32MAT4X3 = 393,
- F32MAT4X4 = 394,
- F64MAT2X2 = 395,
- F64MAT2X3 = 396,
- F64MAT2X4 = 397,
- F64MAT3X2 = 398,
- F64MAT3X3 = 399,
- F64MAT3X4 = 400,
- F64MAT4X2 = 401,
- F64MAT4X3 = 402,
- F64MAT4X4 = 403,
- ATOMIC_UINT = 404,
- ACCSTRUCTNV = 405,
- FCOOPMATNV = 406,
- ICOOPMATNV = 407,
- UCOOPMATNV = 408,
- SAMPLER1D = 409,
- SAMPLER1DARRAY = 410,
- SAMPLER1DARRAYSHADOW = 411,
- ISAMPLER1D = 412,
- SAMPLER1DSHADOW = 413,
- SAMPLER2DRECT = 414,
- SAMPLER2DRECTSHADOW = 415,
- ISAMPLER2DRECT = 416,
- USAMPLER2DRECT = 417,
- SAMPLERBUFFER = 418,
- ISAMPLERBUFFER = 419,
- USAMPLERBUFFER = 420,
- SAMPLER2DMS = 421,
- ISAMPLER2DMS = 422,
- USAMPLER2DMS = 423,
- SAMPLER2DMSARRAY = 424,
- ISAMPLER2DMSARRAY = 425,
- USAMPLER2DMSARRAY = 426,
- SAMPLEREXTERNALOES = 427,
- SAMPLEREXTERNAL2DY2YEXT = 428,
- ISAMPLER1DARRAY = 429,
- USAMPLER1D = 430,
- USAMPLER1DARRAY = 431,
- F16SAMPLER1D = 432,
- F16SAMPLER2D = 433,
- F16SAMPLER3D = 434,
- F16SAMPLER2DRECT = 435,
- F16SAMPLERCUBE = 436,
- F16SAMPLER1DARRAY = 437,
- F16SAMPLER2DARRAY = 438,
- F16SAMPLERCUBEARRAY = 439,
- F16SAMPLERBUFFER = 440,
- F16SAMPLER2DMS = 441,
- F16SAMPLER2DMSARRAY = 442,
- F16SAMPLER1DSHADOW = 443,
- F16SAMPLER2DSHADOW = 444,
- F16SAMPLER1DARRAYSHADOW = 445,
- F16SAMPLER2DARRAYSHADOW = 446,
- F16SAMPLER2DRECTSHADOW = 447,
- F16SAMPLERCUBESHADOW = 448,
- F16SAMPLERCUBEARRAYSHADOW = 449,
- IMAGE1D = 450,
- IIMAGE1D = 451,
- UIMAGE1D = 452,
- IMAGE2D = 453,
- IIMAGE2D = 454,
- UIMAGE2D = 455,
- IMAGE3D = 456,
- IIMAGE3D = 457,
- UIMAGE3D = 458,
- IMAGE2DRECT = 459,
- IIMAGE2DRECT = 460,
- UIMAGE2DRECT = 461,
- IMAGECUBE = 462,
- IIMAGECUBE = 463,
- UIMAGECUBE = 464,
- IMAGEBUFFER = 465,
- IIMAGEBUFFER = 466,
- UIMAGEBUFFER = 467,
- IMAGE1DARRAY = 468,
- IIMAGE1DARRAY = 469,
- UIMAGE1DARRAY = 470,
- IMAGE2DARRAY = 471,
- IIMAGE2DARRAY = 472,
- UIMAGE2DARRAY = 473,
- IMAGECUBEARRAY = 474,
- IIMAGECUBEARRAY = 475,
- UIMAGECUBEARRAY = 476,
- IMAGE2DMS = 477,
- IIMAGE2DMS = 478,
- UIMAGE2DMS = 479,
- IMAGE2DMSARRAY = 480,
- IIMAGE2DMSARRAY = 481,
- UIMAGE2DMSARRAY = 482,
- F16IMAGE1D = 483,
- F16IMAGE2D = 484,
- F16IMAGE3D = 485,
- F16IMAGE2DRECT = 486,
- F16IMAGECUBE = 487,
- F16IMAGE1DARRAY = 488,
- F16IMAGE2DARRAY = 489,
- F16IMAGECUBEARRAY = 490,
- F16IMAGEBUFFER = 491,
- F16IMAGE2DMS = 492,
- F16IMAGE2DMSARRAY = 493,
- SAMPLER = 494,
- SAMPLERSHADOW = 495,
- TEXTURE1D = 496,
- TEXTURE2D = 497,
- TEXTURE3D = 498,
- TEXTURECUBE = 499,
- TEXTURE1DARRAY = 500,
- TEXTURE2DARRAY = 501,
- ITEXTURE1D = 502,
- ITEXTURE2D = 503,
- ITEXTURE3D = 504,
- ITEXTURECUBE = 505,
- ITEXTURE1DARRAY = 506,
- ITEXTURE2DARRAY = 507,
- UTEXTURE1D = 508,
- UTEXTURE2D = 509,
- UTEXTURE3D = 510,
- UTEXTURECUBE = 511,
- UTEXTURE1DARRAY = 512,
- UTEXTURE2DARRAY = 513,
- TEXTURE2DRECT = 514,
- ITEXTURE2DRECT = 515,
- UTEXTURE2DRECT = 516,
- TEXTUREBUFFER = 517,
- ITEXTUREBUFFER = 518,
- UTEXTUREBUFFER = 519,
- TEXTURECUBEARRAY = 520,
- ITEXTURECUBEARRAY = 521,
- UTEXTURECUBEARRAY = 522,
+ SAMPLER = 302,
+ SAMPLERSHADOW = 303,
+ TEXTURE2D = 304,
+ TEXTURE3D = 305,
+ TEXTURECUBE = 306,
+ TEXTURE2DARRAY = 307,
+ ITEXTURE2D = 308,
+ ITEXTURE3D = 309,
+ ITEXTURECUBE = 310,
+ ITEXTURE2DARRAY = 311,
+ UTEXTURE2D = 312,
+ UTEXTURE3D = 313,
+ UTEXTURECUBE = 314,
+ UTEXTURE2DARRAY = 315,
+ ATTRIBUTE = 316,
+ VARYING = 317,
+ FLOAT16_T = 318,
+ FLOAT32_T = 319,
+ DOUBLE = 320,
+ FLOAT64_T = 321,
+ INT64_T = 322,
+ UINT64_T = 323,
+ INT32_T = 324,
+ UINT32_T = 325,
+ INT16_T = 326,
+ UINT16_T = 327,
+ INT8_T = 328,
+ UINT8_T = 329,
+ I64VEC2 = 330,
+ I64VEC3 = 331,
+ I64VEC4 = 332,
+ U64VEC2 = 333,
+ U64VEC3 = 334,
+ U64VEC4 = 335,
+ I32VEC2 = 336,
+ I32VEC3 = 337,
+ I32VEC4 = 338,
+ U32VEC2 = 339,
+ U32VEC3 = 340,
+ U32VEC4 = 341,
+ I16VEC2 = 342,
+ I16VEC3 = 343,
+ I16VEC4 = 344,
+ U16VEC2 = 345,
+ U16VEC3 = 346,
+ U16VEC4 = 347,
+ I8VEC2 = 348,
+ I8VEC3 = 349,
+ I8VEC4 = 350,
+ U8VEC2 = 351,
+ U8VEC3 = 352,
+ U8VEC4 = 353,
+ DVEC2 = 354,
+ DVEC3 = 355,
+ DVEC4 = 356,
+ DMAT2 = 357,
+ DMAT3 = 358,
+ DMAT4 = 359,
+ F16VEC2 = 360,
+ F16VEC3 = 361,
+ F16VEC4 = 362,
+ F16MAT2 = 363,
+ F16MAT3 = 364,
+ F16MAT4 = 365,
+ F32VEC2 = 366,
+ F32VEC3 = 367,
+ F32VEC4 = 368,
+ F32MAT2 = 369,
+ F32MAT3 = 370,
+ F32MAT4 = 371,
+ F64VEC2 = 372,
+ F64VEC3 = 373,
+ F64VEC4 = 374,
+ F64MAT2 = 375,
+ F64MAT3 = 376,
+ F64MAT4 = 377,
+ DMAT2X2 = 378,
+ DMAT2X3 = 379,
+ DMAT2X4 = 380,
+ DMAT3X2 = 381,
+ DMAT3X3 = 382,
+ DMAT3X4 = 383,
+ DMAT4X2 = 384,
+ DMAT4X3 = 385,
+ DMAT4X4 = 386,
+ F16MAT2X2 = 387,
+ F16MAT2X3 = 388,
+ F16MAT2X4 = 389,
+ F16MAT3X2 = 390,
+ F16MAT3X3 = 391,
+ F16MAT3X4 = 392,
+ F16MAT4X2 = 393,
+ F16MAT4X3 = 394,
+ F16MAT4X4 = 395,
+ F32MAT2X2 = 396,
+ F32MAT2X3 = 397,
+ F32MAT2X4 = 398,
+ F32MAT3X2 = 399,
+ F32MAT3X3 = 400,
+ F32MAT3X4 = 401,
+ F32MAT4X2 = 402,
+ F32MAT4X3 = 403,
+ F32MAT4X4 = 404,
+ F64MAT2X2 = 405,
+ F64MAT2X3 = 406,
+ F64MAT2X4 = 407,
+ F64MAT3X2 = 408,
+ F64MAT3X3 = 409,
+ F64MAT3X4 = 410,
+ F64MAT4X2 = 411,
+ F64MAT4X3 = 412,
+ F64MAT4X4 = 413,
+ ATOMIC_UINT = 414,
+ ACCSTRUCTNV = 415,
+ FCOOPMATNV = 416,
+ ICOOPMATNV = 417,
+ UCOOPMATNV = 418,
+ SAMPLERCUBEARRAY = 419,
+ SAMPLERCUBEARRAYSHADOW = 420,
+ ISAMPLERCUBEARRAY = 421,
+ USAMPLERCUBEARRAY = 422,
+ SAMPLER1D = 423,
+ SAMPLER1DARRAY = 424,
+ SAMPLER1DARRAYSHADOW = 425,
+ ISAMPLER1D = 426,
+ SAMPLER1DSHADOW = 427,
+ SAMPLER2DRECT = 428,
+ SAMPLER2DRECTSHADOW = 429,
+ ISAMPLER2DRECT = 430,
+ USAMPLER2DRECT = 431,
+ SAMPLERBUFFER = 432,
+ ISAMPLERBUFFER = 433,
+ USAMPLERBUFFER = 434,
+ SAMPLER2DMS = 435,
+ ISAMPLER2DMS = 436,
+ USAMPLER2DMS = 437,
+ SAMPLER2DMSARRAY = 438,
+ ISAMPLER2DMSARRAY = 439,
+ USAMPLER2DMSARRAY = 440,
+ SAMPLEREXTERNALOES = 441,
+ SAMPLEREXTERNAL2DY2YEXT = 442,
+ ISAMPLER1DARRAY = 443,
+ USAMPLER1D = 444,
+ USAMPLER1DARRAY = 445,
+ F16SAMPLER1D = 446,
+ F16SAMPLER2D = 447,
+ F16SAMPLER3D = 448,
+ F16SAMPLER2DRECT = 449,
+ F16SAMPLERCUBE = 450,
+ F16SAMPLER1DARRAY = 451,
+ F16SAMPLER2DARRAY = 452,
+ F16SAMPLERCUBEARRAY = 453,
+ F16SAMPLERBUFFER = 454,
+ F16SAMPLER2DMS = 455,
+ F16SAMPLER2DMSARRAY = 456,
+ F16SAMPLER1DSHADOW = 457,
+ F16SAMPLER2DSHADOW = 458,
+ F16SAMPLER1DARRAYSHADOW = 459,
+ F16SAMPLER2DARRAYSHADOW = 460,
+ F16SAMPLER2DRECTSHADOW = 461,
+ F16SAMPLERCUBESHADOW = 462,
+ F16SAMPLERCUBEARRAYSHADOW = 463,
+ IMAGE1D = 464,
+ IIMAGE1D = 465,
+ UIMAGE1D = 466,
+ IMAGE2D = 467,
+ IIMAGE2D = 468,
+ UIMAGE2D = 469,
+ IMAGE3D = 470,
+ IIMAGE3D = 471,
+ UIMAGE3D = 472,
+ IMAGE2DRECT = 473,
+ IIMAGE2DRECT = 474,
+ UIMAGE2DRECT = 475,
+ IMAGECUBE = 476,
+ IIMAGECUBE = 477,
+ UIMAGECUBE = 478,
+ IMAGEBUFFER = 479,
+ IIMAGEBUFFER = 480,
+ UIMAGEBUFFER = 481,
+ IMAGE1DARRAY = 482,
+ IIMAGE1DARRAY = 483,
+ UIMAGE1DARRAY = 484,
+ IMAGE2DARRAY = 485,
+ IIMAGE2DARRAY = 486,
+ UIMAGE2DARRAY = 487,
+ IMAGECUBEARRAY = 488,
+ IIMAGECUBEARRAY = 489,
+ UIMAGECUBEARRAY = 490,
+ IMAGE2DMS = 491,
+ IIMAGE2DMS = 492,
+ UIMAGE2DMS = 493,
+ IMAGE2DMSARRAY = 494,
+ IIMAGE2DMSARRAY = 495,
+ UIMAGE2DMSARRAY = 496,
+ F16IMAGE1D = 497,
+ F16IMAGE2D = 498,
+ F16IMAGE3D = 499,
+ F16IMAGE2DRECT = 500,
+ F16IMAGECUBE = 501,
+ F16IMAGE1DARRAY = 502,
+ F16IMAGE2DARRAY = 503,
+ F16IMAGECUBEARRAY = 504,
+ F16IMAGEBUFFER = 505,
+ F16IMAGE2DMS = 506,
+ F16IMAGE2DMSARRAY = 507,
+ TEXTURECUBEARRAY = 508,
+ ITEXTURECUBEARRAY = 509,
+ UTEXTURECUBEARRAY = 510,
+ TEXTURE1D = 511,
+ ITEXTURE1D = 512,
+ UTEXTURE1D = 513,
+ TEXTURE1DARRAY = 514,
+ ITEXTURE1DARRAY = 515,
+ UTEXTURE1DARRAY = 516,
+ TEXTURE2DRECT = 517,
+ ITEXTURE2DRECT = 518,
+ UTEXTURE2DRECT = 519,
+ TEXTUREBUFFER = 520,
+ ITEXTUREBUFFER = 521,
+ UTEXTUREBUFFER = 522,
TEXTURE2DMS = 523,
ITEXTURE2DMS = 524,
UTEXTURE2DMS = 525,
@@ -414,27 +414,27 @@ extern int yydebug;
DEFAULT = 624,
UNIFORM = 625,
SHARED = 626,
- FLAT = 627,
- SMOOTH = 628,
- LAYOUT = 629,
- DOUBLECONSTANT = 630,
- INT16CONSTANT = 631,
- UINT16CONSTANT = 632,
- FLOAT16CONSTANT = 633,
- INT32CONSTANT = 634,
- UINT32CONSTANT = 635,
- INT64CONSTANT = 636,
- UINT64CONSTANT = 637,
- SUBROUTINE = 638,
- DEMOTE = 639,
- PAYLOADNV = 640,
- PAYLOADINNV = 641,
- HITATTRNV = 642,
- CALLDATANV = 643,
- CALLDATAINNV = 644,
- PATCH = 645,
- SAMPLE = 646,
- BUFFER = 647,
+ BUFFER = 627,
+ FLAT = 628,
+ SMOOTH = 629,
+ LAYOUT = 630,
+ DOUBLECONSTANT = 631,
+ INT16CONSTANT = 632,
+ UINT16CONSTANT = 633,
+ FLOAT16CONSTANT = 634,
+ INT32CONSTANT = 635,
+ UINT32CONSTANT = 636,
+ INT64CONSTANT = 637,
+ UINT64CONSTANT = 638,
+ SUBROUTINE = 639,
+ DEMOTE = 640,
+ PAYLOADNV = 641,
+ PAYLOADINNV = 642,
+ HITATTRNV = 643,
+ CALLDATANV = 644,
+ CALLDATAINNV = 645,
+ PATCH = 646,
+ SAMPLE = 647,
NONUNIFORM = 648,
COHERENT = 649,
VOLATILE = 650,
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.h b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.h
index 01afc5a21e9..684e88d5710 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.h
@@ -114,7 +114,7 @@ public:
bool doAutoLocationMapping() const;
TSlotSet::iterator findSlot(int set, int slot);
bool checkEmpty(int set, int slot);
- bool validateInOut(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; };
+ bool validateInOut(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; }
int reserveSlot(int set, int slot, int size = 1);
int getFreeSlot(int set, int base, int size = 1);
int resolveSet(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
@@ -125,7 +125,7 @@ public:
void addStage(EShLanguage stage) override {
if (stage < EShLangCount)
stageMask[stage] = true;
- };
+ }
uint32_t computeTypeLocationSize(const TType& type, EShLanguage stage);
TSlotSetMap slots;
@@ -191,7 +191,7 @@ public:
typedef std::map<TString, int> TVarSlotMap; // <resourceName, location/binding>
typedef std::map<int, TVarSlotMap> TSlotMap; // <resourceKey, TVarSlotMap>
TDefaultGlslIoResolver(const TIntermediate& intermediate);
- bool validateBinding(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; };
+ bool validateBinding(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; }
TResourceType getResourceType(const glslang::TType& type) override;
int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) override;
int resolveUniformLocation(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
@@ -209,7 +209,7 @@ public:
int buildStorageKey(EShLanguage stage, TStorageQualifier type) {
assert(static_cast<uint32_t>(stage) <= 0x0000ffff && static_cast<uint32_t>(type) <= 0x0000ffff);
return (stage << 16) | type;
- };
+ }
protected:
// Use for mark pre stage, to get more interface symbol information.
@@ -242,7 +242,7 @@ struct TVarLivePair : std::pair<const TString, TVarEntryInfo> {
const_cast<TString&>(first) = _Right.first;
second = _Right.second;
return (*this);
- };
+ }
};
typedef std::vector<TVarLivePair> TVarLiveVector;
@@ -253,7 +253,7 @@ public:
virtual ~TIoMapper() {}
// grow the reflection stage by stage
bool virtual addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*);
- bool virtual doMap(TIoMapResolver*, TInfoSink&) { return true; };
+ bool virtual doMap(TIoMapResolver*, TInfoSink&) { return true; }
};
// I/O mapper for OpenGL
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp
index 5b920f2d524..921eb84e58c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp
@@ -496,6 +496,7 @@ void TIntermediate::mergeImplicitArraySizes(TType& type, const TType& unitType)
//
void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& symbol, const TIntermSymbol& unitSymbol, bool crossStage)
{
+#ifndef GLSLANG_WEB
bool writeTypeComparison = false;
// Types have to match
@@ -546,7 +547,6 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
writeTypeComparison = true;
}
-#ifndef GLSLANG_WEB
// Memory...
if (symbol.getQualifier().coherent != unitSymbol.getQualifier().coherent ||
symbol.getQualifier().devicecoherent != unitSymbol.getQualifier().devicecoherent ||
@@ -561,7 +561,6 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
error(infoSink, "Memory qualifiers must match:");
writeTypeComparison = true;
}
-#endif
// Layouts...
// TODO: 4.4 enhanced layouts: Generalize to include offset/align: current spec
@@ -591,6 +590,7 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
if (writeTypeComparison)
infoSink.info << " " << symbol.getName() << ": \"" << symbol.getType().getCompleteString() << "\" versus \"" <<
unitSymbol.getType().getCompleteString() << "\"\n";
+#endif
}
//
@@ -1095,7 +1095,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
}
// combine location and component ranges
- TIoRange range(locationRange, componentRange, type.getBasicType(), qualifier.hasIndex() ? qualifier.layoutIndex : 0);
+ TIoRange range(locationRange, componentRange, type.getBasicType(), qualifier.hasIndex() ? qualifier.getIndex() : 0);
// check for collisions, except for vertex inputs on desktop targeting OpenGL
if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0)
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h
index 10f994788cf..5f34a6c745f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h
@@ -147,6 +147,7 @@ struct TOffsetRange {
TRange offset;
};
+#ifndef GLSLANG_WEB
// Things that need to be tracked per xfb buffer.
struct TXfbBuffer {
TXfbBuffer() : stride(TQualifier::layoutXfbStrideEnd), implicitStride(0), contains64BitType(false),
@@ -158,6 +159,7 @@ struct TXfbBuffer {
bool contains32BitType;
bool contains16BitType;
};
+#endif
// Track a set of strings describing how the module was processed.
// Using the form:
@@ -267,7 +269,6 @@ public:
uniformLocationBase(0)
#endif
{
-#ifndef GLSLANG_WEB
localSize[0] = 1;
localSize[1] = 1;
localSize[2] = 1;
@@ -277,6 +278,7 @@ public:
localSizeSpecId[0] = TQualifier::layoutNotSet;
localSizeSpecId[1] = TQualifier::layoutNotSet;
localSizeSpecId[2] = TQualifier::layoutNotSet;
+#ifndef GLSLANG_WEB
xfbBuffers.resize(TQualifier::layoutXfbBufferEnd);
shiftBinding.fill(0);
#endif
@@ -465,7 +467,23 @@ public:
bool usingStorageBuffer() const { return useStorageBuffer; }
void setDepthReplacing() { depthReplacing = true; }
bool isDepthReplacing() const { return depthReplacing; }
-
+ bool setLocalSize(int dim, int size)
+ {
+ if (localSizeNotDefault[dim])
+ return size == localSize[dim];
+ localSizeNotDefault[dim] = true;
+ localSize[dim] = size;
+ return true;
+ }
+ unsigned int getLocalSize(int dim) const { return localSize[dim]; }
+ bool setLocalSizeSpecId(int dim, int id)
+ {
+ if (localSizeSpecId[dim] != TQualifier::layoutNotSet)
+ return id == localSizeSpecId[dim];
+ localSizeSpecId[dim] = id;
+ return true;
+ }
+ int getLocalSizeSpecId(int dim) const { return localSizeSpecId[dim]; }
#ifdef GLSLANG_WEB
void output(TInfoSink&, bool tree) { }
@@ -492,6 +510,7 @@ public:
bool usingVariablePointers() const { return false; }
unsigned getXfbStride(int buffer) const { return 0; }
bool hasLayoutDerivativeModeNone() const { return false; }
+ ComputeDerivativeMode getLayoutDerivativeModeNone() const { return LayoutDerivativeNone; }
#else
void output(TInfoSink&, bool tree);
@@ -655,24 +674,6 @@ public:
}
TInterlockOrdering getInterlockOrdering() const { return interlockOrdering; }
- bool setLocalSize(int dim, int size)
- {
- if (localSizeNotDefault[dim])
- return size == localSize[dim];
- localSizeNotDefault[dim] = true;
- localSize[dim] = size;
- return true;
- }
- unsigned int getLocalSize(int dim) const { return localSize[dim]; }
-
- bool setLocalSizeSpecId(int dim, int id)
- {
- if (localSizeSpecId[dim] != TQualifier::layoutNotSet)
- return id == localSizeSpecId[dim];
- localSizeSpecId[dim] = id;
- return true;
- }
- int getLocalSizeSpecId(int dim) const { return localSizeSpecId[dim]; }
void setXfbMode() { xfbMode = true; }
bool getXfbMode() const { return xfbMode; }
void setMultiStream() { multiStream = true; }
@@ -757,7 +758,7 @@ public:
void setBinaryDoubleOutput() { binaryDoubleOutput = true; }
bool getBinaryDoubleOutput() { return binaryDoubleOutput; }
-#endif
+#endif // GLSLANG_WEB
#ifdef ENABLE_HLSL
void setHlslFunctionality1() { hlslFunctionality1 = true; }
@@ -786,6 +787,9 @@ public:
void merge(TInfoSink&, TIntermediate&);
void finalCheck(TInfoSink&, bool keepUncalled);
+ bool buildConvertOp(TBasicType dst, TBasicType src, TOperator& convertOp) const;
+ TIntermTyped* createConversion(TBasicType convertTo, TIntermTyped* node) const;
+
void addIoAccessed(const TString& name) { ioAccessed.insert(name); }
bool inIoAccessed(const TString& name) const { return ioAccessed.find(name) != ioAccessed.end(); }
@@ -876,7 +880,6 @@ protected:
bool specConstantPropagates(const TIntermTyped&, const TIntermTyped&);
void performTextureUpgradeAndSamplerRemovalTransformation(TIntermNode* root);
bool isConversionAllowed(TOperator op, TIntermTyped* node) const;
- TIntermTyped* createConversion(TBasicType convertTo, TIntermTyped* node) const;
std::tuple<TBasicType, TBasicType> getConversionDestinatonType(TBasicType type0, TBasicType type1, TOperator op) const;
// JohnK: I think this function should go away.
@@ -918,6 +921,9 @@ protected:
bool useStorageBuffer;
bool nanMinMaxClamp; // true if desiring min/max/clamp to favor non-NaN over NaN
bool depthReplacing;
+ int localSize[3];
+ bool localSizeNotDefault[3];
+ int localSizeSpecId[3];
#ifndef GLSLANG_WEB
bool useVulkanMemoryModel;
int invocations;
@@ -930,9 +936,6 @@ protected:
TVertexOrder vertexOrder;
TInterlockOrdering interlockOrdering;
bool pointMode;
- int localSize[3];
- bool localSizeNotDefault[3];
- int localSizeSpecId[3];
bool earlyFragmentTests;
bool postDepthCoverage;
TLayoutDepth depthLayout;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp
index 9f1089ded71..b09367113cf 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp
@@ -137,7 +137,7 @@ public:
if (it == ioMapper.end()) {
// seperate pipe i/o params from uniforms and blocks
// in is only for input in first stage as out is only for last stage. check traverse in call stack.
- ioMapper[name.c_str()] = ioItems.size();
+ ioMapper[name.c_str()] = static_cast<int>(ioItems.size());
ioItems.push_back(
TObjectReflection(name.c_str(), type, 0, mapToGlType(type), mapToGlArraySize(type), 0));
EShLanguageMask& stages = ioItems.back().stages;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Unix/CMakeLists.txt b/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Unix/CMakeLists.txt
index e652f456249..91fb45a7140 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Unix/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Unix/CMakeLists.txt
@@ -20,6 +20,7 @@ else()
endif()
if(ENABLE_GLSLANG_INSTALL)
- install(TARGETS OSDependent
+ install(TARGETS OSDependent EXPORT OSDependentTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(EXPORT OSDependentTargets DESTINATION lib/cmake)
endif(ENABLE_GLSLANG_INSTALL)
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Windows/CMakeLists.txt b/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Windows/CMakeLists.txt
index f257418abbe..f6bd4e9db2e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Windows/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Windows/CMakeLists.txt
@@ -15,6 +15,7 @@ if(WIN32)
endif(WIN32)
if(ENABLE_GLSLANG_INSTALL)
- install(TARGETS OSDependent
+ install(TARGETS OSDependent EXPORT OSDependentTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(EXPORT OSDependentTargets DESTINATION lib/cmake)
endif(ENABLE_GLSLANG_INSTALL)
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Public/ShaderLang.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Public/ShaderLang.h
index bb06acc0a3b..4cc6c2f4889 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Public/ShaderLang.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Public/ShaderLang.h
@@ -487,6 +487,8 @@ public:
environment.target.version = version;
}
+ void getStrings(const char* const* &s, int& n) { s = strings; n = numStrings; }
+
#ifdef ENABLE_HLSL
void setEnvTargetHlslFunctionality1() { environment.target.hlslFunctionality1 = true; }
bool getEnvTargetHlslFunctionality1() const { return environment.target.hlslFunctionality1; }
@@ -773,7 +775,7 @@ public:
TProgram();
virtual ~TProgram();
void addShader(TShader* shader) { stages[shader->stage].push_back(shader); }
-
+ std::list<TShader*>& getShaders(EShLanguage stage) { return stages[stage]; }
// Link Validation interface
bool link(EShMessages);
const char* getInfoLog();
diff --git a/3rdparty/bgfx/3rdparty/glslang/gtests/CMakeLists.txt b/3rdparty/bgfx/3rdparty/glslang/gtests/CMakeLists.txt
index f678cb6ea5c..77d217f1adb 100644
--- a/3rdparty/bgfx/3rdparty/glslang/gtests/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/glslang/gtests/CMakeLists.txt
@@ -31,8 +31,9 @@ if(BUILD_TESTING)
set_property(TARGET glslangtests PROPERTY FOLDER tests)
glslang_set_link_args(glslangtests)
if(ENABLE_GLSLANG_INSTALL)
- install(TARGETS glslangtests
+ install(TARGETS glslangtests EXPORT glslangtestsTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ install(EXPORT glslangtestsTargets DESTINATION lib/cmake)
endif(ENABLE_GLSLANG_INSTALL)
set(GLSLANG_TEST_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../Test")
diff --git a/3rdparty/bgfx/3rdparty/glslang/gtests/Spv.FromFile.cpp b/3rdparty/bgfx/3rdparty/glslang/gtests/Spv.FromFile.cpp
index d0c075156a6..ce5960c8ea5 100644
--- a/3rdparty/bgfx/3rdparty/glslang/gtests/Spv.FromFile.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/gtests/Spv.FromFile.cpp
@@ -63,6 +63,7 @@ std::string FileNameAsCustomTestSuffixIoMap(
}
using CompileVulkanToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
+using CompileVulkanToSpirvDeadCodeElimTest = GlslangTest<::testing::TestWithParam<std::string>>;
using CompileVulkanToDebugSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
using CompileVulkan1_1ToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
using CompileToSpirv14Test = GlslangTest<::testing::TestWithParam<std::string>>;
@@ -85,6 +86,13 @@ TEST_P(CompileVulkanToSpirvTest, FromFile)
Target::Spv);
}
+TEST_P(CompileVulkanToSpirvDeadCodeElimTest, FromFile)
+{
+ loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
+ Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
+ Target::Spv);
+}
+
// Compiling GLSL to SPIR-V with debug info under Vulkan semantics. Expected
// to successfully generate SPIR-V.
TEST_P(CompileVulkanToDebugSpirvTest, FromFile)
@@ -404,6 +412,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.storageBuffer.vert",
"spv.precise.tese",
"spv.precise.tesc",
+ "spv.volatileAtomic.comp",
"spv.vulkan100.subgroupArithmetic.comp",
"spv.vulkan100.subgroupPartitioned.comp",
"spv.xfb.vert",
@@ -416,6 +425,23 @@ INSTANTIATE_TEST_CASE_P(
FileNameAsCustomTestSuffix
);
+// Cases with deliberately unreachable code.
+// By default the compiler will aggressively eliminate
+// unreachable merges and continues.
+INSTANTIATE_TEST_CASE_P(
+ GlslWithDeadCode, CompileVulkanToSpirvDeadCodeElimTest,
+ ::testing::ValuesIn(std::vector<std::string>({
+ "spv.dead-after-continue.vert",
+ "spv.dead-after-discard.frag",
+ "spv.dead-after-return.vert",
+ "spv.dead-after-loop-break.vert",
+ "spv.dead-after-switch-break.vert",
+ "spv.dead-complex-continue-after-return.vert",
+ "spv.dead-complex-merge-after-return.vert",
+ })),
+ FileNameAsCustomTestSuffix
+);
+
// clang-format off
INSTANTIATE_TEST_CASE_P(
Glsl, CompileVulkanToDebugSpirvTest,
diff --git a/3rdparty/bgfx/3rdparty/glslang/gtests/TestFixture.h b/3rdparty/bgfx/3rdparty/glslang/gtests/TestFixture.h
index 61a8f23268e..8d2ebd92575 100755
--- a/3rdparty/bgfx/3rdparty/glslang/gtests/TestFixture.h
+++ b/3rdparty/bgfx/3rdparty/glslang/gtests/TestFixture.h
@@ -113,7 +113,7 @@ public:
forceVersionProfile(false),
isForwardCompatible(false) {
// Perform validation by default.
- validatorOptions.validate = true;
+ spirvOptions.validate = true;
}
// Tries to load the contents from the file at the given |path|. On success,
@@ -693,14 +693,14 @@ public:
expectedOutputFname, result.spirvWarningsErrors);
}
- glslang::SpvOptions& options() { return validatorOptions; }
+ glslang::SpvOptions& options() { return spirvOptions; }
private:
const int defaultVersion;
const EProfile defaultProfile;
const bool forceVersionProfile;
const bool isForwardCompatible;
- glslang::SpvOptions validatorOptions;
+ glslang::SpvOptions spirvOptions;
};
} // namespace glslangtest
diff --git a/3rdparty/bgfx/3rdparty/glslang/hlsl/CMakeLists.txt b/3rdparty/bgfx/3rdparty/glslang/hlsl/CMakeLists.txt
index 7436dde69dc..44f9d6a26ff 100644
--- a/3rdparty/bgfx/3rdparty/glslang/hlsl/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/glslang/hlsl/CMakeLists.txt
@@ -33,12 +33,13 @@ endif(WIN32)
if(ENABLE_GLSLANG_INSTALL)
if(BUILD_SHARED_LIBS)
- install(TARGETS HLSL
+ install(TARGETS HLSL EXPORT HLSLTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
else()
- install(TARGETS HLSL
+ install(TARGETS HLSL EXPORT HLSLTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
+ install(EXPORT HLSLTargets DESTINATION lib/cmake)
endif(ENABLE_GLSLANG_INSTALL)
diff --git a/3rdparty/bgfx/3rdparty/glslang/known_good.json b/3rdparty/bgfx/3rdparty/glslang/known_good.json
index 6a13907090c..8bb705359bd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/known_good.json
+++ b/3rdparty/bgfx/3rdparty/glslang/known_good.json
@@ -5,14 +5,14 @@
"site" : "github",
"subrepo" : "KhronosGroup/SPIRV-Tools",
"subdir" : "External/spirv-tools",
- "commit" : "bbb29870b510f83f99994358179c9ea6838c3100"
+ "commit" : "02910ffdffaa2966f613ede0c516645f5555c13c"
},
{
"name" : "spirv-tools/external/spirv-headers",
"site" : "github",
"subrepo" : "KhronosGroup/SPIRV-Headers",
"subdir" : "External/spirv-tools/external/spirv-headers",
- "commit" : "601d738723ac381741311c6c98c36d6170be14a2"
+ "commit" : "af64a9e826bf5bb5fcd2434dd71be1e41e922563"
}
]
}
diff --git a/3rdparty/bgfx/3rdparty/glslang/kokoro/linux-clang-release-bazel/build.sh b/3rdparty/bgfx/3rdparty/glslang/kokoro/linux-clang-release-bazel/build.sh
new file mode 100644
index 00000000000..f73162f6209
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/kokoro/linux-clang-release-bazel/build.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+# Copyright (C) 2019 Google, Inc.
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+#
+# Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# Linux Build Script.
+
+# Fail on any error.
+set -e
+# Display commands being run.
+set -x
+
+CC=clang
+CXX=clang++
+SRC=$PWD/github/glslang
+cd $SRC
+
+# Bazel limitation: No 'External' directory is allowed!!
+mv External third_party
+
+gsutil cp gs://bazel/0.29.1/release/bazel-0.29.1-linux-x86_64 .
+chmod +x bazel-0.29.1-linux-x86_64
+
+echo $(date): Build everything...
+./bazel-0.29.1-linux-x86_64 build :all
+echo $(date): Build completed.
+
+echo $(date): Starting bazel test...
+./bazel-0.29.1-linux-x86_64 test :all
+echo $(date): Bazel test completed.
diff --git a/3rdparty/bgfx/3rdparty/glslang/kokoro/linux-clang-release-bazel/continuous.cfg b/3rdparty/bgfx/3rdparty/glslang/kokoro/linux-clang-release-bazel/continuous.cfg
new file mode 100644
index 00000000000..767556d0b4b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/kokoro/linux-clang-release-bazel/continuous.cfg
@@ -0,0 +1,35 @@
+# Copyright (C) 2019 Google, Inc.
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+#
+# Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# Continuous build configuration.
+build_file: "glslang/kokoro/linux-clang-release-bazel/build.sh"
diff --git a/3rdparty/bgfx/3rdparty/glslang/kokoro/linux-clang-release-bazel/presubmit.cfg b/3rdparty/bgfx/3rdparty/glslang/kokoro/linux-clang-release-bazel/presubmit.cfg
new file mode 100644
index 00000000000..669491f8294
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/kokoro/linux-clang-release-bazel/presubmit.cfg
@@ -0,0 +1,35 @@
+# Copyright (C) 2019 Google, Inc.
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+#
+# Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# Presubmit build configuration.
+build_file: "glslang/kokoro/linux-clang-release-bazel/build.sh"
diff --git a/3rdparty/bgfx/3rdparty/glslang/kokoro/macos-clang-release-bazel/build.sh b/3rdparty/bgfx/3rdparty/glslang/kokoro/macos-clang-release-bazel/build.sh
new file mode 100644
index 00000000000..cc51fadf14e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/kokoro/macos-clang-release-bazel/build.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+# Copyright (C) 2019 Google, Inc.
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+#
+# Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# macOS Build Script.
+
+# Fail on any error.
+set -e
+# Display commands being run.
+set -x
+
+CC=clang
+CXX=clang++
+SRC=$PWD/github/glslang
+cd $SRC
+
+mv External third_party
+
+# Get bazel 0.29.1.
+gsutil cp gs://bazel/0.29.1/release/bazel-0.29.1-darwin-x86_64 .
+chmod +x bazel-0.29.1-darwin-x86_64
+
+echo $(date): Build everything...
+./bazel-0.29.1-darwin-x86_64 build :all
+echo $(date): Build completed.
+
+echo $(date): Starting bazel test...
+./bazel-0.29.1-darwin-x86_64 test :all
+echo $(date): Bazel test completed.
diff --git a/3rdparty/bgfx/3rdparty/glslang/kokoro/macos-clang-release-bazel/continuous.cfg b/3rdparty/bgfx/3rdparty/glslang/kokoro/macos-clang-release-bazel/continuous.cfg
new file mode 100644
index 00000000000..f1980790e28
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/kokoro/macos-clang-release-bazel/continuous.cfg
@@ -0,0 +1,35 @@
+# Copyright (C) 2019 Google, Inc.
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+#
+# Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# Continuous build configuration.
+build_file: "glslang/kokoro/macos-clang-release-bazel/build.sh"
diff --git a/3rdparty/bgfx/3rdparty/glslang/kokoro/macos-clang-release-bazel/presubmit.cfg b/3rdparty/bgfx/3rdparty/glslang/kokoro/macos-clang-release-bazel/presubmit.cfg
new file mode 100644
index 00000000000..daa30be5cb1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/kokoro/macos-clang-release-bazel/presubmit.cfg
@@ -0,0 +1,35 @@
+# Copyright (C) 2019 Google, Inc.
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+#
+# Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# Presubmit build configuration.
+build_file: "glslang/kokoro/macos-clang-release-bazel/build.sh"
diff --git a/3rdparty/bgfx/3rdparty/glslang/kokoro/windows-msvc-2015-release-bazel/build.bat b/3rdparty/bgfx/3rdparty/glslang/kokoro/windows-msvc-2015-release-bazel/build.bat
new file mode 100644
index 00000000000..1a1557c980c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/kokoro/windows-msvc-2015-release-bazel/build.bat
@@ -0,0 +1,75 @@
+:: Copyright (C) 2019 Google, Inc.
+::
+:: All rights reserved.
+::
+:: Redistribution and use in source and binary forms, with or without
+:: modification, are permitted provided that the following conditions
+:: are met:
+::
+:: Redistributions of source code must retain the above copyright
+:: notice, this list of conditions and the following disclaimer.
+::
+:: Redistributions in binary form must reproduce the above
+:: copyright notice, this list of conditions and the following
+:: disclaimer in the documentation and/or other materials provided
+:: with the distribution.
+::
+:: Neither the name of Google Inc. nor the names of its
+:: contributors may be used to endorse or promote products derived
+:: from this software without specific prior written permission.
+::
+:: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+:: "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+:: LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+:: FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+:: COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+:: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+:: BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+:: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+:: CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+:: LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+:: ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+:: POSSIBILITY OF SUCH DAMAGE.
+:: Copyright (c) 2019 Google LLC.
+::
+:: Windows Build Script.
+
+@echo on
+
+set SRC=%cd%\github\glslang
+
+:: Force usage of python 3.6
+set PATH=C:\python36;%PATH%
+cd %SRC%
+
+mv External third_party
+
+:: REM Install Bazel.
+wget -q https://github.com/bazelbuild/bazel/releases/download/0.29.1/bazel-0.29.1-windows-x86_64.zip
+unzip -q bazel-0.29.1-windows-x86_64.zip
+
+:: Set up MSVC
+call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
+set BAZEL_VS=C:\Program Files (x86)\Microsoft Visual Studio 14.0
+set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
+set BAZEL_SH=c:\tools\msys64\usr\bin\bash.exe
+set BAZEL_PYTHON=c:\tools\python2\python.exe
+
+:: #########################################
+:: Start building.
+:: #########################################
+echo "Build everything... %DATE% %TIME%"
+bazel.exe build :all
+if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
+echo "Build Completed %DATE% %TIME%"
+
+:: ##############
+:: Run the tests
+:: ##############
+echo "Running Tests... %DATE% %TIME%"
+bazel.exe test :all
+if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
+echo "Tests Completed %DATE% %TIME%"
+
+exit /b 0
+
diff --git a/3rdparty/bgfx/3rdparty/glslang/kokoro/windows-msvc-2015-release-bazel/continuous.cfg b/3rdparty/bgfx/3rdparty/glslang/kokoro/windows-msvc-2015-release-bazel/continuous.cfg
new file mode 100644
index 00000000000..554d29de573
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/kokoro/windows-msvc-2015-release-bazel/continuous.cfg
@@ -0,0 +1,35 @@
+# Copyright (C) 2019 Google, Inc.
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+#
+# Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# Continuous build configuration.
+build_file: "glslang/kokoro/windows-msvc-2015-release-bazel/build.bat"
diff --git a/3rdparty/bgfx/3rdparty/glslang/kokoro/windows-msvc-2015-release-bazel/presubmit.cfg b/3rdparty/bgfx/3rdparty/glslang/kokoro/windows-msvc-2015-release-bazel/presubmit.cfg
new file mode 100644
index 00000000000..4980bb6b581
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/kokoro/windows-msvc-2015-release-bazel/presubmit.cfg
@@ -0,0 +1,35 @@
+# Copyright (C) 2019 Google, Inc.
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+#
+# Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# Presubmit build configuration.
+build_file: "glslang/kokoro/windows-msvc-2015-release-bazel/build.bat"
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan/vulkan_core.h b/3rdparty/bgfx/3rdparty/khronos/vulkan/vulkan_core.h
index 01da6ede32f..4cf54f48222 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan/vulkan_core.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan/vulkan_core.h
@@ -44,7 +44,7 @@ extern "C" {
#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff)
#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff)
// Version of this file
-#define VK_HEADER_VERSION 123
+#define VK_HEADER_VERSION 124
#define VK_NULL_HANDLE 0
@@ -449,6 +449,7 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = 1000178001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR = 1000180000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR = 1000181000,
VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD = 1000183000,
VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = 1000184000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = 1000185000,
@@ -471,6 +472,12 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV = 1000205002,
VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV = 1000206000,
VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV = 1000206001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR = 1000207000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES_KHR = 1000207001,
+ VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO_KHR = 1000207002,
+ VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR = 1000207003,
+ VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO_KHR = 1000207004,
+ VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO_KHR = 1000207005,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL = 1000209000,
VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL = 1000210000,
VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL = 1000210001,
@@ -6238,6 +6245,18 @@ typedef struct VkPhysicalDeviceShaderAtomicInt64FeaturesKHR {
+#define VK_KHR_shader_clock 1
+#define VK_KHR_SHADER_CLOCK_SPEC_VERSION 1
+#define VK_KHR_SHADER_CLOCK_EXTENSION_NAME "VK_KHR_shader_clock"
+typedef struct VkPhysicalDeviceShaderClockFeaturesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 shaderSubgroupClock;
+ VkBool32 shaderDeviceClock;
+} VkPhysicalDeviceShaderClockFeaturesKHR;
+
+
+
#define VK_KHR_driver_properties 1
#define VK_MAX_DRIVER_NAME_SIZE_KHR 256
#define VK_MAX_DRIVER_INFO_SIZE_KHR 256
@@ -6354,6 +6373,89 @@ typedef struct VkPhysicalDeviceDepthStencilResolvePropertiesKHR {
#define VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME "VK_KHR_swapchain_mutable_format"
+#define VK_KHR_timeline_semaphore 1
+#define VK_KHR_TIMELINE_SEMAPHORE_SPEC_VERSION 2
+#define VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME "VK_KHR_timeline_semaphore"
+
+typedef enum VkSemaphoreTypeKHR {
+ VK_SEMAPHORE_TYPE_BINARY_KHR = 0,
+ VK_SEMAPHORE_TYPE_TIMELINE_KHR = 1,
+ VK_SEMAPHORE_TYPE_BEGIN_RANGE_KHR = VK_SEMAPHORE_TYPE_BINARY_KHR,
+ VK_SEMAPHORE_TYPE_END_RANGE_KHR = VK_SEMAPHORE_TYPE_TIMELINE_KHR,
+ VK_SEMAPHORE_TYPE_RANGE_SIZE_KHR = (VK_SEMAPHORE_TYPE_TIMELINE_KHR - VK_SEMAPHORE_TYPE_BINARY_KHR + 1),
+ VK_SEMAPHORE_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkSemaphoreTypeKHR;
+
+typedef enum VkSemaphoreWaitFlagBitsKHR {
+ VK_SEMAPHORE_WAIT_ANY_BIT_KHR = 0x00000001,
+ VK_SEMAPHORE_WAIT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkSemaphoreWaitFlagBitsKHR;
+typedef VkFlags VkSemaphoreWaitFlagsKHR;
+typedef struct VkPhysicalDeviceTimelineSemaphoreFeaturesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 timelineSemaphore;
+} VkPhysicalDeviceTimelineSemaphoreFeaturesKHR;
+
+typedef struct VkPhysicalDeviceTimelineSemaphorePropertiesKHR {
+ VkStructureType sType;
+ void* pNext;
+ uint64_t maxTimelineSemaphoreValueDifference;
+} VkPhysicalDeviceTimelineSemaphorePropertiesKHR;
+
+typedef struct VkSemaphoreTypeCreateInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkSemaphoreTypeKHR semaphoreType;
+ uint64_t initialValue;
+} VkSemaphoreTypeCreateInfoKHR;
+
+typedef struct VkTimelineSemaphoreSubmitInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t waitSemaphoreValueCount;
+ const uint64_t* pWaitSemaphoreValues;
+ uint32_t signalSemaphoreValueCount;
+ const uint64_t* pSignalSemaphoreValues;
+} VkTimelineSemaphoreSubmitInfoKHR;
+
+typedef struct VkSemaphoreWaitInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkSemaphoreWaitFlagsKHR flags;
+ uint32_t semaphoreCount;
+ const VkSemaphore* pSemaphores;
+ const uint64_t* pValues;
+} VkSemaphoreWaitInfoKHR;
+
+typedef struct VkSemaphoreSignalInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkSemaphore semaphore;
+ uint64_t value;
+} VkSemaphoreSignalInfoKHR;
+
+typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreCounterValueKHR)(VkDevice device, VkSemaphore semaphore, uint64_t* pValue);
+typedef VkResult (VKAPI_PTR *PFN_vkWaitSemaphoresKHR)(VkDevice device, const VkSemaphoreWaitInfoKHR* pWaitInfo, uint64_t timeout);
+typedef VkResult (VKAPI_PTR *PFN_vkSignalSemaphoreKHR)(VkDevice device, const VkSemaphoreSignalInfoKHR* pSignalInfo);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreCounterValueKHR(
+ VkDevice device,
+ VkSemaphore semaphore,
+ uint64_t* pValue);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkWaitSemaphoresKHR(
+ VkDevice device,
+ const VkSemaphoreWaitInfoKHR* pWaitInfo,
+ uint64_t timeout);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkSignalSemaphoreKHR(
+ VkDevice device,
+ const VkSemaphoreSignalInfoKHR* pSignalInfo);
+#endif
+
+
#define VK_KHR_vulkan_memory_model 1
#define VK_KHR_VULKAN_MEMORY_MODEL_SPEC_VERSION 3
#define VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME "VK_KHR_vulkan_memory_model"
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/.github/workflows/build.yml b/3rdparty/bgfx/3rdparty/meshoptimizer/.github/workflows/build.yml
index 37bc09b6fad..ab29f999e4d 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/.github/workflows/build.yml
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/.github/workflows/build.yml
@@ -3,8 +3,12 @@ name: build
on: [push, pull_request]
jobs:
- linux:
- runs-on: ubuntu-latest
+ unix:
+ strategy:
+ matrix:
+ os: [ubuntu, macos]
+ name: ${{matrix.os}}
+ runs-on: ${{matrix.os}}-latest
steps:
- uses: actions/checkout@v1
- name: make test
@@ -18,27 +22,10 @@ jobs:
make -j2 config=coverage test
find . -type f -name '*.gcno' -exec gcov -p {} +
sed -i -e "s/#####\(.*\)\(\/\/ unreachable.*\)/ -\1\2/" *.gcov
- bash <(curl -s https://codecov.io/bash) -f 'src#*.gcov' -X search -t ${{secrets.CODECOV_TOKEN}}
- - uses: actions/upload-artifact@v1
- with:
- name: gltfpack-linux
- path: gltfpack
-
- macos:
- runs-on: macos-latest
- steps:
- - uses: actions/checkout@v1
- - name: make test
- run: |
- make -j2 config=sanitize test
- make -j2 config=debug test
- make -j2 config=release test
- make -j2 config=release gltfpack
- - name: make iphone
- run: make -j2 config=iphone
+ bash <(curl -s https://codecov.io/bash) -f 'src#*.gcov' -X search -t ${{secrets.CODECOV_TOKEN}} -B ${{github.ref}}
- uses: actions/upload-artifact@v1
with:
- name: gltfpack-macos
+ name: gltfpack-${{matrix.os}}
path: gltfpack
windows:
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/.travis.yml b/3rdparty/bgfx/3rdparty/meshoptimizer/.travis.yml
index 8ffa5308ff1..3c46e945ac8 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/.travis.yml
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/.travis.yml
@@ -1,21 +1,23 @@
language: cpp
-matrix:
- include:
- - os: linux
- compiler: gcc
- - os: linux
- compiler: clang
- - os: osx
- compiler: clang
- - os: windows
- compiler: cl
- env:
- - TARGET="Visual Studio 15 2017"
- - os: windows
- compiler: cl
- env:
- - TARGET="Visual Studio 15 2017 Win64"
+jobs:
+ - os: linux
+ compiler: gcc
+ - os: linux
+ compiler: clang
+ - os: linux
+ compiler: gcc
+ arch: arm64
+ - os: osx
+ compiler: clang
+ - os: windows
+ compiler: cl
+ env:
+ - TARGET="Visual Studio 15 2017"
+ - os: windows
+ compiler: cl
+ env:
+ - TARGET="Visual Studio 15 2017 Win64"
script:
- if [[ "$TRAVIS_COMPILER" == "gcc" ]]; then make -j2 config=coverage test; fi
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/CMakeLists.txt b/3rdparty/bgfx/3rdparty/meshoptimizer/CMakeLists.txt
index f57793a3f48..2fcba67016a 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/CMakeLists.txt
@@ -57,24 +57,29 @@ if(BUILD_TOOLS)
target_link_libraries(gltfpack meshoptimizer)
list(APPEND TARGETS gltfpack)
- set_target_properties(gltfpack PROPERTIES INSTALL_RPATH "$ORIGIN/../lib")
+ if(BUILD_SHARED_LIBS)
+ string(CONCAT RPATH "$ORIGIN/../" ${CMAKE_INSTALL_LIBDIR})
+ set_target_properties(gltfpack PROPERTIES INSTALL_RPATH ${RPATH})
+ endif()
endif()
+include(GNUInstallDirs)
+
install(TARGETS ${TARGETS} EXPORT meshoptimizerTargets
- RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib
- INCLUDES DESTINATION include)
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-install(FILES src/meshoptimizer.h DESTINATION include)
-install(EXPORT meshoptimizerTargets DESTINATION lib/cmake/meshoptimizer NAMESPACE meshoptimizer::)
+install(FILES src/meshoptimizer.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+install(EXPORT meshoptimizerTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/meshoptimizer NAMESPACE meshoptimizer::)
# TARGET_PDB_FILE is available since 3.1
if(MSVC AND NOT (CMAKE_VERSION VERSION_LESS "3.1"))
foreach(TARGET ${TARGETS})
get_target_property(TARGET_TYPE ${TARGET} TYPE)
if(NOT ${TARGET_TYPE} STREQUAL "STATIC_LIBRARY")
- install(FILES $<TARGET_PDB_FILE:${TARGET}> DESTINATION bin OPTIONAL)
+ install(FILES $<TARGET_PDB_FILE:${TARGET}> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
endif()
endforeach(TARGET)
endif()
@@ -83,11 +88,11 @@ include(CMakePackageConfigHelpers)
configure_package_config_file(config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/meshoptimizerConfig.cmake
- INSTALL_DESTINATION lib/cmake/meshoptimizer NO_SET_AND_CHECK_MACRO)
+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/meshoptimizer NO_SET_AND_CHECK_MACRO)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/meshoptimizerConfigVersion.cmake COMPATIBILITY ExactVersion)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/meshoptimizerConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/meshoptimizerConfigVersion.cmake
- DESTINATION lib/cmake/meshoptimizer)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/meshoptimizer)
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/Makefile b/3rdparty/bgfx/3rdparty/meshoptimizer/Makefile
index 86a50f798bf..3e43811b0f3 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/Makefile
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/Makefile
@@ -72,7 +72,7 @@ gltfpack: $(GLTFPACK_OBJECTS) $(LIBRARY)
js/meshopt_decoder.js: src/vertexcodec.cpp src/indexcodec.cpp
@mkdir -p build
- emcc $(filter %.cpp,$^) -O3 -DNDEBUG -s EXPORTED_FUNCTIONS='["_meshopt_decodeVertexBuffer", "_meshopt_decodeIndexBuffer"]' -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_STACK=24576 -s TOTAL_MEMORY=65536 -o build/meshopt_decoder.wasm
+ emcc $(filter %.cpp,$^) -O3 -DNDEBUG -s EXPORTED_FUNCTIONS='["_meshopt_decodeVertexBuffer", "_meshopt_decodeIndexBuffer", "_sbrk"]' -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_STACK=24576 -s TOTAL_MEMORY=65536 -o build/meshopt_decoder.wasm
sed -i "s#\(var wasm = \)\".*\";#\\1\"$$(cat build/meshopt_decoder.wasm | base64 -w 0)\";#" $@
$(EXECUTABLE): $(DEMO_OBJECTS) $(LIBRARY)
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/README.md b/3rdparty/bgfx/3rdparty/meshoptimizer/README.md
index c63dc921275..b499147fbbb 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/README.md
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/README.md
@@ -1,4 +1,4 @@
-# meshoptimizer [![Actions Status](https://github.com/zeux/meshoptimizer/workflows/build/badge.svg)](https://github.com/zeux/meshoptimizer/actions) [![Build Status](https://travis-ci.org/zeux/meshoptimizer.svg?branch=master)](https://travis-ci.org/zeux/meshoptimizer) [![codecov.io](https://codecov.io/github/zeux/meshoptimizer/coverage.svg?branch=master)](https://codecov.io/github/zeux/meshoptimizer?branch=master) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) [![GitHub](https://img.shields.io/badge/repo-github-green.svg)](https://github.com/zeux/meshoptimizer)
+# 🐇 meshoptimizer [![Actions Status](https://github.com/zeux/meshoptimizer/workflows/build/badge.svg)](https://github.com/zeux/meshoptimizer/actions) [![Build Status](https://travis-ci.org/zeux/meshoptimizer.svg?branch=master)](https://travis-ci.org/zeux/meshoptimizer) [![codecov.io](https://codecov.io/github/zeux/meshoptimizer/coverage.svg?branch=master)](https://codecov.io/github/zeux/meshoptimizer?branch=master) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) [![GitHub](https://img.shields.io/badge/repo-github-green.svg)](https://github.com/zeux/meshoptimizer)
## Purpose
@@ -290,10 +290,11 @@ gltfpack -i scene.gltf -o scene.glb
gltfpack substantially changes the glTF data by optimizing the meshes for vertex fetch and transform cache, quantizing the geometry to reduce the memory consumption and size, merging meshes to reduce the draw call count, quantizing and resampling animations to reduce animation size and simplify playback, and pruning the node tree by removing or collapsing redundant nodes. It will also simplify the meshes when requested to do so.
-gltfpack can produce two types of output files:
+gltfpack can produce three types of output files:
- By default gltfpack outputs regular `.glb`/`.gltf` files that have been optimized for GPU consumption using various cache optimizers and quantization. These files can be loaded by standard GLTF loaders present in frameworks such as [three.js](https://threejs.org/) (r107+) and [Babylon.js](https://www.babylonjs.com/) (4.1+).
- When using `-c` option, gltfpack outputs compressed `.glb`/`.gltf` files that use meshoptimizer codecs to reduce the download size further. Loading these files requires extending GLTF loaders with custom decompression support; `demo/GLTFLoader.js` contains a custom version of three.js loader that can be used to load them.
+- When using `-cf` option, gltfpack outputs compressed files and an extra `.fallback.bin` file with uncompressed data. These files can be loaded by standard glTF loaders; loaders with decompression support don't need to load the fallback.
> Note: files produced by gltfpack use `MESHOPT_quantized_geometry` and `MESHOPT_compression` pseudo-extensions; both of these have *not* been standardized yet but eventually will be. glTF validator doesn't recognize these extensions and produces a large number of validation errors because of this.
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/demo/GLTFLoader.js b/3rdparty/bgfx/3rdparty/meshoptimizer/demo/GLTFLoader.js
index 6a54452a82b..c98ea3af338 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/demo/GLTFLoader.js
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/demo/GLTFLoader.js
@@ -10,29 +10,29 @@ THREE.GLTFLoader = ( function () {
function GLTFLoader( manager ) {
- this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
+ THREE.Loader.call( this, manager );
+
this.dracoLoader = null;
+ this.ddsLoader = null;
this.meshoptDecoder = null;
}
- GLTFLoader.prototype = {
+ GLTFLoader.prototype = Object.assign( Object.create( THREE.Loader.prototype ), {
constructor: GLTFLoader,
- crossOrigin: 'anonymous',
-
load: function ( url, onLoad, onProgress, onError ) {
var scope = this;
var resourcePath;
- if ( this.resourcePath !== undefined ) {
+ if ( this.resourcePath !== '' ) {
resourcePath = this.resourcePath;
- } else if ( this.path !== undefined ) {
+ } else if ( this.path !== '' ) {
resourcePath = this.path;
@@ -69,6 +69,12 @@ THREE.GLTFLoader = ( function () {
loader.setPath( this.path );
loader.setResponseType( 'arraybuffer' );
+ if ( scope.crossOrigin === 'use-credentials' ) {
+
+ loader.setWithCredentials( true );
+
+ }
+
loader.load( url, function ( data ) {
try {
@@ -91,30 +97,16 @@ THREE.GLTFLoader = ( function () {
},
- setCrossOrigin: function ( value ) {
-
- this.crossOrigin = value;
- return this;
-
- },
-
- setPath: function ( value ) {
-
- this.path = value;
- return this;
-
- },
-
- setResourcePath: function ( value ) {
+ setDRACOLoader: function ( dracoLoader ) {
- this.resourcePath = value;
+ this.dracoLoader = dracoLoader;
return this;
},
- setDRACOLoader: function ( dracoLoader ) {
+ setDDSLoader: function ( ddsLoader ) {
- this.dracoLoader = dracoLoader;
+ this.ddsLoader = ddsLoader;
return this;
},
@@ -185,11 +177,11 @@ THREE.GLTFLoader = ( function () {
break;
case EXTENSIONS.KHR_MATERIALS_UNLIT:
- extensions[ extensionName ] = new GLTFMaterialsUnlitExtension( json );
+ extensions[ extensionName ] = new GLTFMaterialsUnlitExtension();
break;
case EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:
- extensions[ extensionName ] = new GLTFMaterialsPbrSpecularGlossinessExtension( json );
+ extensions[ extensionName ] = new GLTFMaterialsPbrSpecularGlossinessExtension();
break;
case EXTENSIONS.KHR_DRACO_MESH_COMPRESSION:
@@ -197,15 +189,15 @@ THREE.GLTFLoader = ( function () {
break;
case EXTENSIONS.MSFT_TEXTURE_DDS:
- extensions[ EXTENSIONS.MSFT_TEXTURE_DDS ] = new GLTFTextureDDSExtension();
+ extensions[ EXTENSIONS.MSFT_TEXTURE_DDS ] = new GLTFTextureDDSExtension( this.ddsLoader );
break;
case EXTENSIONS.KHR_TEXTURE_TRANSFORM:
- extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] = new GLTFTextureTransformExtension( json );
+ extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] = new GLTFTextureTransformExtension();
break;
case EXTENSIONS.MESHOPT_COMPRESSION:
- extensions[ extensionName ] = new GLTFMeshoptCompressionExtension( json, this.meshoptDecoder );
+ extensions[ extensionName ] = new GLTFMeshoptCompressionExtension( this.meshoptDecoder );
break;
default:
@@ -234,7 +226,7 @@ THREE.GLTFLoader = ( function () {
}
- };
+ } );
/* GLTFREGISTRY */
@@ -290,27 +282,26 @@ THREE.GLTFLoader = ( function () {
/**
* DDS Texture Extension
*
- * Specification:
- * https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_texture_dds
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_texture_dds
*
*/
- function GLTFTextureDDSExtension() {
+ function GLTFTextureDDSExtension( ddsLoader ) {
- if ( ! THREE.DDSLoader ) {
+ if ( ! ddsLoader ) {
throw new Error( 'THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader' );
}
this.name = EXTENSIONS.MSFT_TEXTURE_DDS;
- this.ddsLoader = new THREE.DDSLoader();
+ this.ddsLoader = ddsLoader;
}
/**
- * Lights Extension
+ * Punctual Lights Extension
*
- * Specification: PENDING
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual
*/
function GLTFLightsExtension( json ) {
@@ -377,9 +368,9 @@ THREE.GLTFLoader = ( function () {
};
/**
- * Unlit Materials Extension (pending)
+ * Unlit Materials Extension
*
- * PR: https://github.com/KhronosGroup/glTF/pull/1163
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit
*/
function GLTFMaterialsUnlitExtension() {
@@ -426,8 +417,6 @@ THREE.GLTFLoader = ( function () {
};
/* BINARY EXTENSION */
-
- var BINARY_EXTENSION_BUFFER_NAME = 'binary_glTF';
var BINARY_EXTENSION_HEADER_MAGIC = 'glTF';
var BINARY_EXTENSION_HEADER_LENGTH = 12;
var BINARY_EXTENSION_CHUNK_TYPES = { JSON: 0x4E4F534A, BIN: 0x004E4942 };
@@ -496,7 +485,7 @@ THREE.GLTFLoader = ( function () {
/**
* DRACO Mesh Compression Extension
*
- * Specification: https://github.com/KhronosGroup/glTF/pull/874
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression
*/
function GLTFDracoMeshCompressionExtension( json, dracoLoader ) {
@@ -574,7 +563,7 @@ THREE.GLTFLoader = ( function () {
/**
* Texture Transform Extension
*
- * Specification:
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform
*/
function GLTFTextureTransformExtension() {
@@ -864,7 +853,7 @@ THREE.GLTFLoader = ( function () {
},
// Here's based on refreshUniformsCommon() and refreshUniformsStandard() in WebGLRenderer.
- refreshUniforms: function ( renderer, scene, camera, geometry, material, group ) {
+ refreshUniforms: function ( renderer, scene, camera, geometry, material ) {
if ( material.isGLTFSpecularGlossinessMaterial !== true ) {
@@ -1008,7 +997,7 @@ THREE.GLTFLoader = ( function () {
/**
* meshoptimizer Compression Extension
*/
- function GLTFMeshoptCompressionExtension( json, meshoptDecoder ) {
+ function GLTFMeshoptCompressionExtension( meshoptDecoder ) {
if ( ! meshoptDecoder ) {
@@ -1017,21 +1006,18 @@ THREE.GLTFLoader = ( function () {
}
this.name = EXTENSIONS.MESHOPT_COMPRESSION;
- this.json = json;
this.meshoptDecoder = meshoptDecoder;
}
- GLTFMeshoptCompressionExtension.prototype.decodeBufferView = function ( bufferViewDef, buffer ) {
+ GLTFMeshoptCompressionExtension.prototype.decodeBufferView = function ( extensionDef, buffer ) {
var decoder = this.meshoptDecoder;
return decoder.ready.then( function () {
- var extensionDef = bufferViewDef.extensions[ EXTENSIONS.MESHOPT_COMPRESSION ];
-
- var byteOffset = bufferViewDef.byteOffset || 0;
- var byteLength = bufferViewDef.byteLength || 0;
+ var byteOffset = extensionDef.byteOffset || 0;
+ var byteLength = extensionDef.byteLength || 0;
var count = extensionDef.count;
var stride = extensionDef.byteStride;
@@ -1058,7 +1044,7 @@ THREE.GLTFLoader = ( function () {
} );
- }
+ };
/*********************************/
/********** INTERPOLATION ********/
@@ -1167,17 +1153,6 @@ THREE.GLTFLoader = ( function () {
UNSIGNED_SHORT: 5123
};
- var WEBGL_TYPE = {
- 5126: Number,
- //35674: THREE.Matrix2,
- 35675: THREE.Matrix3,
- 35676: THREE.Matrix4,
- 35664: THREE.Vector2,
- 35665: THREE.Vector3,
- 35666: THREE.Vector4,
- 35678: THREE.Texture
- };
-
var WEBGL_COMPONENT_TYPES = {
5120: Int8Array,
5121: Uint8Array,
@@ -1190,10 +1165,10 @@ THREE.GLTFLoader = ( function () {
var WEBGL_FILTERS = {
9728: THREE.NearestFilter,
9729: THREE.LinearFilter,
- 9984: THREE.NearestMipMapNearestFilter,
- 9985: THREE.LinearMipMapNearestFilter,
- 9986: THREE.NearestMipMapLinearFilter,
- 9987: THREE.LinearMipMapLinearFilter
+ 9984: THREE.NearestMipmapNearestFilter,
+ 9985: THREE.LinearMipmapNearestFilter,
+ 9986: THREE.NearestMipmapLinearFilter,
+ 9987: THREE.LinearMipmapLinearFilter
};
var WEBGL_WRAPPINGS = {
@@ -1202,48 +1177,6 @@ THREE.GLTFLoader = ( function () {
10497: THREE.RepeatWrapping
};
- var WEBGL_SIDES = {
- 1028: THREE.BackSide, // Culling front
- 1029: THREE.FrontSide // Culling back
- //1032: THREE.NoSide // Culling front and back, what to do?
- };
-
- var WEBGL_DEPTH_FUNCS = {
- 512: THREE.NeverDepth,
- 513: THREE.LessDepth,
- 514: THREE.EqualDepth,
- 515: THREE.LessEqualDepth,
- 516: THREE.GreaterEqualDepth,
- 517: THREE.NotEqualDepth,
- 518: THREE.GreaterEqualDepth,
- 519: THREE.AlwaysDepth
- };
-
- var WEBGL_BLEND_EQUATIONS = {
- 32774: THREE.AddEquation,
- 32778: THREE.SubtractEquation,
- 32779: THREE.ReverseSubtractEquation
- };
-
- var WEBGL_BLEND_FUNCS = {
- 0: THREE.ZeroFactor,
- 1: THREE.OneFactor,
- 768: THREE.SrcColorFactor,
- 769: THREE.OneMinusSrcColorFactor,
- 770: THREE.SrcAlphaFactor,
- 771: THREE.OneMinusSrcAlphaFactor,
- 772: THREE.DstAlphaFactor,
- 773: THREE.OneMinusDstAlphaFactor,
- 774: THREE.DstColorFactor,
- 775: THREE.OneMinusDstColorFactor,
- 776: THREE.SrcAlphaSaturateFactor
- // The followings are not supported by Three.js yet
- //32769: CONSTANT_COLOR,
- //32770: ONE_MINUS_CONSTANT_COLOR,
- //32771: CONSTANT_ALPHA,
- //32772: ONE_MINUS_CONSTANT_COLOR
- };
-
var WEBGL_TYPE_SIZES = {
'SCALAR': 1,
'VEC2': 2,
@@ -1279,15 +1212,6 @@ THREE.GLTFLoader = ( function () {
STEP: THREE.InterpolateDiscrete
};
- var STATES_ENABLES = {
- 2884: 'CULL_FACE',
- 2929: 'DEPTH_TEST',
- 3042: 'BLEND',
- 3089: 'SCISSOR_TEST',
- 32823: 'POLYGON_OFFSET_FILL',
- 32926: 'SAMPLE_ALPHA_TO_COVERAGE'
- };
-
var ALPHA_MODES = {
OPAQUE: 'OPAQUE',
MASK: 'MASK',
@@ -1306,6 +1230,13 @@ THREE.GLTFLoader = ( function () {
// Invalid URL
if ( typeof url !== 'string' || url === '' ) return '';
+ // Host Relative URL
+ if ( /^https?:\/\//i.test( path ) && /^\//.test( url ) ) {
+
+ path = path.replace( /(^https?:\/\/[^\/]+).*/i, '$1' );
+
+ }
+
// Absolute URL http://,https://,//
if ( /^(https?:)?\/\//i.test( url ) ) return url;
@@ -1581,19 +1512,6 @@ THREE.GLTFLoader = ( function () {
}
}
- function isObjectEqual( a, b ) {
-
- if ( Object.keys( a ).length !== Object.keys( b ).length ) return false;
-
- for ( var key in a ) {
-
- if ( a[ key ] !== b[ key ] ) return false;
-
- }
-
- return true;
-
- }
function createPrimitiveKey( primitiveDef ) {
@@ -1677,6 +1595,12 @@ THREE.GLTFLoader = ( function () {
this.fileLoader = new THREE.FileLoader( this.options.manager );
this.fileLoader.setResponseType( 'arraybuffer' );
+ if ( this.options.crossOrigin === 'use-credentials' ) {
+
+ this.fileLoader.setWithCredentials( true );
+
+ }
+
}
GLTFParser.prototype.parse = function ( onLoad, onError ) {
@@ -1711,6 +1635,8 @@ THREE.GLTFLoader = ( function () {
addUnknownExtensionsToUserData( extensions, result, json );
+ assignExtrasToUserData( result, json );
+
onLoad( result );
} ).catch( onError );
@@ -1933,26 +1859,25 @@ THREE.GLTFLoader = ( function () {
if ( bufferViewDef.extensions && bufferViewDef.extensions[ EXTENSIONS.MESHOPT_COMPRESSION ] ) {
var extension = this.extensions[ EXTENSIONS.MESHOPT_COMPRESSION ];
+ var extensionDef = bufferViewDef.extensions[ EXTENSIONS.MESHOPT_COMPRESSION ];
- return this.getDependency( 'buffer', bufferViewDef.buffer ).then( function ( buffer ) {
+ return this.getDependency( 'buffer', extensionDef.buffer ).then( function ( buffer ) {
- return extension.decodeBufferView( bufferViewDef, buffer );
+ return extension.decodeBufferView( extensionDef, buffer );
} );
- } else {
-
- return this.getDependency( 'buffer', bufferViewDef.buffer ).then( function ( buffer ) {
+ }
- var byteLength = bufferViewDef.byteLength || 0;
- var byteOffset = bufferViewDef.byteOffset || 0;
- return buffer.slice( byteOffset, byteOffset + byteLength );
+ return this.getDependency( 'buffer', bufferViewDef.buffer ).then( function ( buffer ) {
- } );
+ var byteLength = bufferViewDef.byteLength || 0;
+ var byteOffset = bufferViewDef.byteOffset || 0;
+ return buffer.slice( byteOffset, byteOffset + byteLength );
- }
+ } );
- }
+ };
/**
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors
@@ -2029,7 +1954,7 @@ THREE.GLTFLoader = ( function () {
}
- bufferAttribute = new THREE.InterleavedBufferAttribute( ib, itemSize, (byteOffset % byteStride) / elementBytes, normalized );
+ bufferAttribute = new THREE.InterleavedBufferAttribute( ib, itemSize, ( byteOffset % byteStride ) / elementBytes, normalized );
} else {
@@ -2062,7 +1987,7 @@ THREE.GLTFLoader = ( function () {
if ( bufferView !== null ) {
// Avoid modifying the original ArrayBuffer, if the bufferView wasn't initialized with zeroes.
- bufferAttribute.setArray( bufferAttribute.array.slice() );
+ bufferAttribute = new THREE.BufferAttribute( bufferAttribute.array.slice(), bufferAttribute.itemSize, bufferAttribute.normalized );
}
@@ -2138,7 +2063,7 @@ THREE.GLTFLoader = ( function () {
// Load Texture resource.
- var loader = THREE.Loader.Handlers.get( sourceURI );
+ var loader = options.manager.getHandler( sourceURI );
if ( ! loader ) {
@@ -2179,7 +2104,7 @@ THREE.GLTFLoader = ( function () {
var sampler = samplers[ textureDef.sampler ] || {};
texture.magFilter = WEBGL_FILTERS[ sampler.magFilter ] || THREE.LinearFilter;
- texture.minFilter = WEBGL_FILTERS[ sampler.minFilter ] || THREE.LinearMipMapLinearFilter;
+ texture.minFilter = WEBGL_FILTERS[ sampler.minFilter ] || THREE.LinearMipmapLinearFilter;
texture.wrapS = WEBGL_WRAPPINGS[ sampler.wrapS ] || THREE.RepeatWrapping;
texture.wrapT = WEBGL_WRAPPINGS[ sampler.wrapT ] || THREE.RepeatWrapping;
@@ -2269,7 +2194,6 @@ THREE.GLTFLoader = ( function () {
THREE.Material.prototype.copy.call( pointsMaterial, material );
pointsMaterial.color.copy( material.color );
pointsMaterial.map = material.map;
- pointsMaterial.lights = false; // PointsMaterial doesn't support lights yet
pointsMaterial.sizeAttenuation = false; // glTF spec says points should be 1px
this.cache.add( cacheKey, pointsMaterial );
@@ -2289,7 +2213,6 @@ THREE.GLTFLoader = ( function () {
lineMaterial = new THREE.LineBasicMaterial();
THREE.Material.prototype.copy.call( lineMaterial, material );
lineMaterial.color.copy( material.color );
- lineMaterial.lights = false; // LineBasicMaterial doesn't support lights yet
this.cache.add( cacheKey, lineMaterial );
@@ -2654,7 +2577,6 @@ THREE.GLTFLoader = ( function () {
var parser = this;
var json = this.json;
- var extensions = this.extensions;
var meshDef = json.meshes[ meshIndex ];
var primitives = meshDef.primitives;
@@ -2698,7 +2620,7 @@ THREE.GLTFLoader = ( function () {
? new THREE.SkinnedMesh( geometry, material )
: new THREE.Mesh( geometry, material );
- if ( mesh.isSkinnedMesh === true && !mesh.geometry.attributes.skinWeight.normalized ) {
+ if ( mesh.isSkinnedMesh === true && ! mesh.geometry.attributes.skinWeight.normalized ) {
// we normalize floating point skin weight array to fix malformed assets (see #15319)
// it's important to skip this for non-float32 data since normalizeSkinWeights assumes non-normalized inputs
@@ -2986,7 +2908,7 @@ THREE.GLTFLoader = ( function () {
for ( var j = 0, jl = outputArray.length; j < jl; j ++ ) {
- scaled[j] = outputArray[j] * scale;
+ scaled[ j ] = outputArray[ j ] * scale;
}
@@ -3053,14 +2975,11 @@ THREE.GLTFLoader = ( function () {
return ( function () {
- // .isBone isn't in glTF spec. See .markDefs
- if ( nodeDef.isBone === true ) {
-
- return Promise.resolve( new THREE.Bone() );
+ var pending = [];
- } else if ( nodeDef.mesh !== undefined ) {
+ if ( nodeDef.mesh !== undefined ) {
- return parser.getDependency( 'mesh', nodeDef.mesh ).then( function ( mesh ) {
+ pending.push( parser.getDependency( 'mesh', nodeDef.mesh ).then( function ( mesh ) {
var node;
@@ -3106,25 +3025,58 @@ THREE.GLTFLoader = ( function () {
return node;
- } );
+ } ) );
- } else if ( nodeDef.camera !== undefined ) {
+ }
- return parser.getDependency( 'camera', nodeDef.camera );
+ if ( nodeDef.camera !== undefined ) {
- } else if ( nodeDef.extensions
+ pending.push( parser.getDependency( 'camera', nodeDef.camera ) );
+
+ }
+
+ if ( nodeDef.extensions
&& nodeDef.extensions[ EXTENSIONS.KHR_LIGHTS_PUNCTUAL ]
&& nodeDef.extensions[ EXTENSIONS.KHR_LIGHTS_PUNCTUAL ].light !== undefined ) {
- return parser.getDependency( 'light', nodeDef.extensions[ EXTENSIONS.KHR_LIGHTS_PUNCTUAL ].light );
+ pending.push( parser.getDependency( 'light', nodeDef.extensions[ EXTENSIONS.KHR_LIGHTS_PUNCTUAL ].light ) );
+
+ }
+
+ return Promise.all( pending );
+
+ }() ).then( function ( objects ) {
+
+ var node;
+
+ // .isBone isn't in glTF spec. See .markDefs
+ if ( nodeDef.isBone === true ) {
+
+ node = new THREE.Bone();
+
+ } else if ( objects.length > 1 ) {
+
+ node = new THREE.Group();
+
+ } else if ( objects.length === 1 ) {
+
+ node = objects[ 0 ];
} else {
- return Promise.resolve( new THREE.Object3D() );
+ node = new THREE.Object3D();
}
- }() ).then( function ( node ) {
+ if ( node !== objects[ 0 ] ) {
+
+ for ( var i = 0, il = objects.length; i < il; i ++ ) {
+
+ node.add( objects[ i ] );
+
+ }
+
+ }
if ( nodeDef.name !== undefined ) {
@@ -3208,11 +3160,9 @@ THREE.GLTFLoader = ( function () {
} ).then( function ( jointNodes ) {
- var meshes = node.isGroup === true ? node.children : [ node ];
+ node.traverse( function ( mesh ) {
- for ( var i = 0, il = meshes.length; i < il; i ++ ) {
-
- var mesh = meshes[ i ];
+ if ( ! mesh.isMesh ) return;
var bones = [];
var boneInverses = [];
@@ -3245,7 +3195,7 @@ THREE.GLTFLoader = ( function () {
mesh.bind( new THREE.Skeleton( bones, boneInverses ), mesh.matrixWorld );
- }
+ } );
return node;
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/demo/babylon.MESHOPT_compression.js b/3rdparty/bgfx/3rdparty/meshoptimizer/demo/babylon.MESHOPT_compression.js
index 83e6906a1a3..f6120ba835e 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/demo/babylon.MESHOPT_compression.js
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/demo/babylon.MESHOPT_compression.js
@@ -17,14 +17,14 @@ var MESHOPT_compression = /** @class */ (function () {
/** @hidden */
MESHOPT_compression.prototype.loadBufferViewAsync = function (context, bufferView) {
if (bufferView.extensions && bufferView.extensions[NAME]) {
- if (bufferView._decoded) {
- return bufferView._decoded;
+ var extensionDef = bufferView.extensions[NAME];
+ if (extensionDef._decoded) {
+ return extensionDef._decoded;
}
- var view = this._loader.loadBufferViewAsync(context, bufferView);
+ var view = this._loader.loadBufferViewAsync(context, extensionDef);
var decoder = this._decoder;
- bufferView._decoded = Promise.all([view, decoder.ready]).then(function (res) {
+ extensionDef._decoded = Promise.all([view, decoder.ready]).then(function (res) {
var source = res[0];
- var extensionDef = bufferView.extensions[NAME];
var count = extensionDef.count;
var stride = extensionDef.byteStride;
var result = new Uint8Array(new ArrayBuffer(count * stride));
@@ -40,7 +40,7 @@ var MESHOPT_compression = /** @class */ (function () {
}
return Promise.resolve(result);
});
- return bufferView._decoded;
+ return extensionDef._decoded;
} else {
return null;
}
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/demo/demo.html b/3rdparty/bgfx/3rdparty/meshoptimizer/demo/demo.html
index 902b8368eeb..2ce3fd3ede7 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/demo/demo.html
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/demo/demo.html
@@ -32,23 +32,21 @@
<script>
var canvas = document.getElementById("renderCanvas");
- BABYLON.GLTF2.GLTFLoader.RegisterExtension("MESHOPT_compression", (loader) => new MESHOPT_compression(loader, MeshoptDecoder));
+ BABYLON.GLTF2.GLTFLoader.RegisterExtension("MESHOPT_compression", (loader) => new MESHOPT_compression(loader, MeshoptDecoder));
var createScene = function () {
var scene = new BABYLON.Scene(engine);
-
- var light = new BABYLON.HemisphericLight();
-
+
var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 10, BABYLON.Vector3.Zero(), scene);
camera.attachControl(canvas, false);
-
+
BABYLON.SceneLoader.Append("", "pirate.glb", scene, function (newMeshes) {
scene.activeCamera = null;
scene.createDefaultCameraOrLight(true);
scene.activeCamera.attachControl(canvas, false);
scene.activeCamera.alpha = Math.PI / 2;
});
-
+
return scene;
}
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/demo/index.html b/3rdparty/bgfx/3rdparty/meshoptimizer/demo/index.html
index cdc21c0a3a0..4cadd46faa5 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/demo/index.html
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/demo/index.html
@@ -30,7 +30,7 @@
<a href="https://github.com/zeux/meshoptimizer" target="_blank" rel="noopener">meshoptimizer</a>
</div>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/105/three.min.js"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/109/three.min.js"></script>
<script src="../js/meshopt_decoder.js"></script>
<script src="GLTFLoader.js"></script>
@@ -71,8 +71,8 @@
console.log(e);
};
- var loader = new THREE.GLTFLoader()
- loader.setMeshoptDecoder(MeshoptDecoder)
+ var loader = new THREE.GLTFLoader();
+ loader.setMeshoptDecoder(MeshoptDecoder);
loader.load('pirate.glb', function (gltf) {
var bbox = new THREE.Box3().setFromObject(gltf.scene);
var scale = 2 / (bbox.max.y - bbox.min.y);
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/demo/main.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/demo/main.cpp
index 9b3bd0c5c0a..009bc98ff77 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/demo/main.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/demo/main.cpp
@@ -1016,7 +1016,13 @@ void processDev(const char* path)
if (!loadMesh(mesh, path))
return;
- simplifyPoints(mesh);
+ Mesh copy = mesh;
+ meshopt_optimizeVertexCache(&copy.indices[0], &copy.indices[0], copy.indices.size(), copy.vertices.size());
+ meshopt_optimizeVertexFetch(&copy.vertices[0], &copy.indices[0], copy.indices.size(), &copy.vertices[0], copy.vertices.size(), sizeof(Vertex));
+
+ encodeIndex(copy);
+ encodeVertex<PackedVertex>(copy, "");
+ encodeVertex<PackedVertexOct>(copy, "O");
}
int main(int argc, char** argv)
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/demo/pirate.glb b/3rdparty/bgfx/3rdparty/meshoptimizer/demo/pirate.glb
index 357fe553f01..eaf3397c0c7 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/demo/pirate.glb
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/demo/pirate.glb
Binary files differ
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/demo/tests.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/demo/tests.cpp
index 2e14fda5a7f..ffab4c02354 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/demo/tests.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/demo/tests.cpp
@@ -1,6 +1,7 @@
#include "../src/meshoptimizer.h"
#include <assert.h>
+#include <stdlib.h>
#include <string.h>
#include <vector>
@@ -261,6 +262,100 @@ static void clusterBoundsDegenerate()
assert(bounds2.center[2] - bounds2.radius <= 0 && bounds2.center[2] + bounds2.radius >= 1);
}
+static size_t allocCount;
+static size_t freeCount;
+
+static void* customAlloc(size_t size)
+{
+ allocCount++;
+
+ return malloc(size);
+}
+
+static void customFree(void* ptr)
+{
+ freeCount++;
+
+ free(ptr);
+}
+
+static void customAllocator()
+{
+ meshopt_setAllocator(customAlloc, customFree);
+
+ assert(allocCount == 0 && freeCount == 0);
+
+ float vb[] = {1, 0, 0, 0, 1, 0, 0, 0, 1};
+ unsigned int ib[] = {0, 1, 2};
+ unsigned short ibs[] = {0, 1, 2};
+
+ // meshopt_computeClusterBounds doesn't allocate
+ meshopt_computeClusterBounds(ib, 3, vb, 3, 12);
+ assert(allocCount == 0 && freeCount == 0);
+
+ // ... unless IndexAdapter is used
+ meshopt_computeClusterBounds(ibs, 3, vb, 3, 12);
+ assert(allocCount == 1 && freeCount == 1);
+
+ // meshopt_optimizeVertexFetch allocates internal remap table and temporary storage for in-place remaps
+ meshopt_optimizeVertexFetch(vb, ib, 3, vb, 3, 12);
+ assert(allocCount == 3 && freeCount == 3);
+
+ // ... plus one for IndexAdapter
+ meshopt_optimizeVertexFetch(vb, ibs, 3, vb, 3, 12);
+ assert(allocCount == 6 && freeCount == 6);
+
+ meshopt_setAllocator(operator new, operator delete);
+
+ // customAlloc & customFree should not get called anymore
+ meshopt_optimizeVertexFetch(vb, ib, 3, vb, 3, 12);
+ assert(allocCount == 6 && freeCount == 6);
+}
+
+static void emptyMesh()
+{
+ meshopt_optimizeVertexCache(0, 0, 0, 0);
+ meshopt_optimizeVertexCacheFifo(0, 0, 0, 0, 16);
+ meshopt_optimizeOverdraw(0, 0, 0, 0, 0, 12, 1.f);
+}
+
+static void simplifyStuck()
+{
+ // tetrahedron can't be simplified due to collapse error restrictions
+ float vb1[] = {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1};
+ unsigned int ib1[] = {0, 1, 2, 0, 2, 3, 0, 3, 1, 2, 1, 3};
+
+ assert(meshopt_simplify(ib1, ib1, 12, vb1, 4, 12, 6, 1e-3f) == 12);
+
+ // 5-vertex strip can't be simplified due to topology restriction since middle triangle has flipped winding
+ float vb2[] = {0, 0, 0, 1, 0, 0, 2, 0, 0, 0.5f, 1, 0, 1.5f, 1, 0};
+ unsigned int ib2[] = {0, 1, 3, 3, 1, 4, 1, 2, 4}; // ok
+ unsigned int ib3[] = {0, 1, 3, 1, 3, 4, 1, 2, 4}; // flipped
+
+ assert(meshopt_simplify(ib2, ib2, 9, vb2, 5, 12, 6, 1e-3f) == 6);
+ assert(meshopt_simplify(ib3, ib3, 9, vb2, 5, 12, 6, 1e-3f) == 9);
+}
+
+static void simplifySloppyStuck()
+{
+ const float vb[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
+ const unsigned int ib[] = {0, 1, 2, 0, 1, 2};
+
+ // simplifying down to 0 triangles results in 0 immediately
+ assert(meshopt_simplifySloppy(0, ib, 3, vb, 3, 12, 0) == 0);
+
+ // simplifying down to 2 triangles given that all triangles are degenerate results in 0 as well
+ assert(meshopt_simplifySloppy(0, ib, 6, vb, 3, 12, 6) == 0);
+}
+
+static void simplifyPointsStuck()
+{
+ const float vb[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+ // simplifying down to 0 points results in 0 immediately
+ assert(meshopt_simplifyPoints(0, vb, 3, 12, 0) == 0);
+}
+
void runTests()
{
decodeIndexV0();
@@ -277,4 +372,12 @@ void runTests()
decodeVertexRejectMalformedHeaders();
clusterBoundsDegenerate();
+
+ customAllocator();
+
+ emptyMesh();
+
+ simplifyStuck();
+ simplifySloppyStuck();
+ simplifyPointsStuck();
}
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/js/meshopt_decoder.js b/3rdparty/bgfx/3rdparty/meshoptimizer/js/meshopt_decoder.js
index 9f8c981fc09..aab8b431890 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/js/meshopt_decoder.js
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/js/meshopt_decoder.js
@@ -2,48 +2,37 @@
// Copyright (C) 2016-2019, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
var MeshoptDecoder = (function() {
"use strict";
- var wasm = "AGFzbQEAAAABGARgA39/fwF/YAAAYAV/f39/fwF/YAF/AAIrAgNlbnYVZW1zY3JpcHRlbl9tZW1jcHlfYmlnAAADZW52Bm1lbW9yeQIAAQMGBQADAgIBBggBfwFBgMwBCwdOAxFfX3dhc21fY2FsbF9jdG9ycwAFGm1lc2hvcHRfZGVjb2RlVmVydGV4QnVmZmVyAAQZbWVzaG9wdF9kZWNvZGVJbmRleEJ1ZmZlcgADCuMjBYMEAQN/IAJBgMAATwRAIAAgASACEAAaIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAvGAgECfyAAQYABaiIBQX9qQf8BOgAAIABB/wE6AAAgAUF+akH/AToAACAAQf8BOgABIAFBfWpB/wE6AAAgAEH/AToAAiABQXxqQf8BOgAAIABB/wE6AAMgAEEAIABrQQNxIgFqIgBBfzYCACAAQYABIAFrQXxxIgJqIgFBfGpBfzYCAAJAIAJBCUkNACAAQX82AgggAEF/NgIEIAFBeGpBfzYCACABQXRqQX82AgAgAkEZSQ0AIABBfzYCGCAAQX82AhQgAEF/NgIQIABBfzYCDCABQXBqQX82AgAgAUFsakF/NgIAIAFBaGpBfzYCACABQWRqQX82AgAgAiAAQQRxQRhyIgJrIgFBIEkNACAAIAJqIQADQCAAQn83AxggAEJ/NwMQIABCfzcDCCAAQn83AwAgAEEgaiEAIAFBYGoiAUEfSw0ACwsLwhABEH8jAEHAAWsiCCQAQX4hDwJAIAFBA24iBkERaiAESw0AQX8hDyADLQAAQeABRw0AIAhBQGsQAiAIQn83AzggCEJ/NwMwIAhCfzcDKCAIQn83AyAgCEJ/NwMYIAhCfzcDECAIQn83AwggCEJ/NwMAIAMgBGpBcGohEyADQQFqIhQgBmohByABBEBBfiEPIAJBfmoiEEECSyERQQAhA0EAIQQDQCAHIBNLDQICfyAULQAAIgJB7wFNBEAgCEFAayACQQR2QX9zIARqQQ9xQQN0aiIFKAIEIQYgBSgCACEFIAJBD3EiCkEPRwRAIAggAkF/cyADakEPcUECdGooAgAgCSAKGyECIApFIQoCQCARDQACQAJAIBBBAWsOAgIBAAsgACANQQF0aiILIAU7AQAgCyAGOwECIAsgAjsBBAwBCyAAIA1BAnRqIgsgBTYCACALIAI2AgggCyAGNgIECyAJIApqIQkgCEFAayAEQQN0aiILIAY2AgQgCyACNgIAIAggA0ECdGogAjYCACAIQUBrIARBAWpBD3EiBEEDdGoiBiAFNgIAIAYgAjYCBCAEQQFqIQQgAyAKagwCCyAHLAAAIgpB/wFxIQICfyAHQQFqIApBf0oNABogAkH/AHEgBywAASIKQf8AcUEHdHIhAiAHQQJqIApBf0oNABogBywAAiIKQf8AcUEOdCACciECIAdBA2ogCkF/Sg0AGiAHLAADIgpB/wBxQRV0IAJyIQIgB0EEaiAKQX9KDQAaIActAARBHHQgAnIhAiAHQQVqCyEHQQAgAkEBcWsgAkEBdnMgDGohDAJAIBENAAJAAkAgEEEBaw4CAgEACyAAIA1BAXRqIgIgBTsBACACIAY7AQIgAiAMOwEEDAELIAAgDUECdGoiAiAFNgIAIAIgDDYCCCACIAY2AgQLIAhBQGsgBEEDdGoiAiAGNgIEIAIgDDYCACAIIANBAnRqIAw2AgAgCEFAayAEQQFqQQ9xIgJBA3RqIgQgBTYCACAEIAw2AgQgAkEBaiEEIANBAWoMAQsgAkH9AU0EQCAIIAMgEyACQQ9xai0AACIGQQR2IgVrQQ9xQQJ0aigCACAJQQFqIgogBRshAiAIIAMgBmtBD3FBAnRqKAIAIAogBUUiC2oiDiAGQQ9xIgUbIQYgBUUhBQJAIBENAAJAAkAgEEEBaw4CAgEACyAAIA1BAXRqIgogCTsBACAKIAI7AQIgCiAGOwEEDAELIAAgDUECdGoiCiAJNgIAIAogBjYCCCAKIAI2AgQLIAggA0ECdGogCTYCACAIQUBrIARBA3RqIgogCTYCBCAKIAI2AgAgCCADQQFqIgNBD3FBAnRqIAI2AgAgCEFAayAEQQFqQQ9xQQN0aiIKIAY2AgAgCiACNgIEIAggAyALakEPcSICQQJ0aiAGNgIAIAhBQGsgBEECakEPcSIDQQN0aiIEIAk2AgAgBCAGNgIEIANBAWohBCAFIA5qIQkgAiAFagwBCyAJIAJB/gFGIgtqIQIgBy0AACIFQQ9xIQ4CQCAFQQR2IhJFBEAgAkEBaiEGDAELIAIhBiAIIAMgEmtBD3FBAnRqKAIAIQILAkAgDkUEQCAGQQFqIQoMAQsgBiEKIAggAyAFa0EPcUECdGooAgAhBgsCQCALBEAgB0EBaiELDAELIAcsAAEiBUH/AXEhCQJ/IAdBAmogBUF/Sg0AGiAJQf8AcSAHLAACIgVB/wBxQQd0ciEJIAdBA2ogBUF/Sg0AGiAHLAADIgVB/wBxQQ50IAlyIQkgB0EEaiAFQX9KDQAaIAcsAAQiBUH/AHFBFXQgCXIhCSAHQQVqIAVBf0oNABogBy0ABUEcdCAJciEJIAdBBmoLIQtBACAJQQFxayAJQQF2cyAMaiIMIQkLAkAgEkEPRwRAIAshBQwBCyALLAAAIgVB/wFxIQICfyALQQFqIAVBf0oNABogAkH/AHEgCywAASIFQf8AcUEHdHIhAiALQQJqIAVBf0oNABogCywAAiIFQf8AcUEOdCACciECIAtBA2ogBUF/Sg0AGiALLAADIgVB/wBxQRV0IAJyIQIgC0EEaiAFQX9KDQAaIAstAARBHHQgAnIhAiALQQVqCyEFQQAgAkEBcWsgAkEBdnMgDGoiDCECCwJAIA5BD0cEQCAFIQcMAQsgBSwAACIHQf8BcSEGAn8gBUEBaiAHQX9KDQAaIAZB/wBxIAUsAAEiB0H/AHFBB3RyIQYgBUECaiAHQX9KDQAaIAUsAAIiB0H/AHFBDnQgBnIhBiAFQQNqIAdBf0oNABogBSwAAyIHQf8AcUEVdCAGciEGIAVBBGogB0F/Sg0AGiAFLQAEQRx0IAZyIQYgBUEFagshB0EAIAZBAXFrIAZBAXZzIAxqIgwhBgsCQCARDQACQAJAIBBBAWsOAgIBAAsgACANQQF0aiIFIAk7AQAgBSACOwECIAUgBjsBBAwBCyAAIA1BAnRqIgUgCTYCACAFIAY2AgggBSACNgIECyAIQUBrIARBA3RqIgUgCTYCBCAFIAI2AgAgCCADQQJ0aiAJNgIAIAhBQGsgBEEBakEPcUEDdGoiBSAGNgIAIAUgAjYCBCAIIANBAWoiA0EPcUECdGogAjYCACAIQUBrIARBAmpBD3FBA3RqIgIgCTYCACACIAY2AgQgCCADIBJFIBJBD0ZyaiICQQ9xQQJ0aiAGNgIAIARBA2ohBCAKIQkgAiAORSAOQQ9GcmoLIQMgFEEBaiEUIARBD3EhBCADQQ9xIQMgDUEDaiINIAFJDQALC0EAQX0gByATRhshDwsgCEHAAWokACAPC8sMAQ9/IwBBgMQAayIQJAACf0F+IAJBAWogBEsNABpBfyADLQAAQaABRw0AGiAQIAMgBGoiDyACayACEAEhC0GAwAAgAm5B8P8AcSIEQYACIARBgAJJGyERIANBAWohCQJAA0AgDCABTw0BIBEgASAMayAMIBFqIAFJGyENAkACQCACRQRAIAkhBAwBCyANQQ9qIgNBcHEhEiADQQR2QQNqQQJ2IRNBACEOIAkhCgNAIA8gCmsgE0kEQEEAIQkMAwsgCiATaiEEQQAhCUEAIQMgEgRAA0AgDyAEa0EgSQ0EIAtBgMIAaiADaiEIAkACQAJAAkACQCAKIANBBnZqLQAAIANBA3ZBBnF2QQNxQQFrDgMBAgMACyAIQgA3AwAgCEIANwMIDAMLIAggBC0ABCAELQAAIgZBBnYiBSAFQQNGIgUbOgAAIAggBEEEaiAFaiIFLQAAIAZBBHZBA3EiByAHQQNGIgcbOgABIAggBSAHaiIFLQAAIAZBAnZBA3EiByAHQQNGIgcbOgACIAggBSAHaiIFLQAAIAZBA3EiBiAGQQNGIgYbOgADIAggBSAGaiIFLQAAIAQtAAEiBkEGdiIHIAdBA0YiBxs6AAQgCCAFIAdqIgUtAAAgBkEEdkEDcSIHIAdBA0YiBxs6AAUgCCAFIAdqIgUtAAAgBkECdkEDcSIHIAdBA0YiBxs6AAYgCCAFIAdqIgUtAAAgBkEDcSIGIAZBA0YiBhs6AAcgCCAFIAZqIgUtAAAgBC0AAiIGQQZ2IgcgB0EDRiIHGzoACCAIIAUgB2oiBS0AACAGQQR2QQNxIgcgB0EDRiIHGzoACSAIIAUgB2oiBS0AACAGQQJ2QQNxIgcgB0EDRiIHGzoACiAIIAUgB2oiBS0AACAGQQNxIgYgBkEDRiIGGzoACyAIIAUgBmoiBi0AACAELQADIgRBBnYiBSAFQQNGIgUbOgAMIAggBSAGaiIGLQAAIARBBHZBA3EiBSAFQQNGIgUbOgANIAggBSAGaiIGLQAAIARBAnZBA3EiBSAFQQNGIgUbOgAOIAggBSAGaiIILQAAIARBA3EiBCAEQQNGIgQbOgAPIAQgCGohBAwCCyAIIAQtAAggBC0AACIGQQR2IgUgBUEPRiIFGzoAACAIIARBCGogBWoiBS0AACAGQQ9xIgYgBkEPRiIGGzoAASAIIAUgBmoiBi0AACAELQABIgVBBHYiByAHQQ9GIgcbOgACIAggBiAHaiIGLQAAIAVBD3EiBSAFQQ9GIgUbOgADIAggBSAGaiIGLQAAIAQtAAIiBUEEdiIHIAdBD0YiBxs6AAQgCCAGIAdqIgYtAAAgBUEPcSIFIAVBD0YiBRs6AAUgCCAFIAZqIgYtAAAgBC0AAyIFQQR2IgcgB0EPRiIHGzoABiAIIAYgB2oiBi0AACAFQQ9xIgUgBUEPRiIFGzoAByAIIAUgBmoiBi0AACAELQAEIgVBBHYiByAHQQ9GIgcbOgAIIAggBiAHaiIGLQAAIAVBD3EiBSAFQQ9GIgUbOgAJIAggBSAGaiIGLQAAIAQtAAUiBUEEdiIHIAdBD0YiBxs6AAogCCAGIAdqIgYtAAAgBUEPcSIFIAVBD0YiBRs6AAsgCCAFIAZqIgYtAAAgBC0ABiIFQQR2IgcgB0EPRiIHGzoADCAIIAYgB2oiBi0AACAFQQ9xIgUgBUEPRiIFGzoADSAIIAUgBmoiBi0AACAELQAHIgRBBHYiBSAFQQ9GIgUbOgAOIAggBSAGaiIILQAAIARBD3EiBCAEQQ9GIgQbOgAPIAQgCGohBAwBCyAIIAQpAAA3AAAgCCAEKQAINwAIIARBEGohBAsgA0EQaiIDIBJJDQALCyAERQ0CIA0EQCALIA5qLQAAIQogDiEDA0AgC0GAAmogA2ogCiALQYDCAGogCWotAAAiCkEBdkEAIApBAXFrc2oiCjoAACACIANqIQMgCUEBaiIJIA1HDQALCyAEIQogDkEBaiIOIAJHDQALCyAAIAIgDGxqIAtBgAJqIAIgDWwQARogCyALQYACaiANQX9qIAJsaiACEAEaIAQhCQsgDUEAIAkbIAxqIQwgCQ0AC0F+DAELQQBBfSAPIAlrIAJBICACQSBLG0YbCyEJIBBBgMQAaiQAIAkLAwABCw==";
+ var wasm = "AGFzbQEAAAABIwZgAX8AYAAAYAV/f39/fwF/YAN/f38Bf2ABfwF/YAN/f38AAicBA2Vudh9lbXNjcmlwdGVuX25vdGlmeV9tZW1vcnlfZ3Jvd3RoAAADCQgDAQQEBQACAgUDAQABBggBfwFBgMwBCwdeBQZtZW1vcnkCABFfX3dhc21fY2FsbF9jdG9ycwACGm1lc2hvcHRfZGVjb2RlVmVydGV4QnVmZmVyAAgZbWVzaG9wdF9kZWNvZGVJbmRleEJ1ZmZlcgAHBHNicmsAAwrCJAiCBAEDfyACQYDAAE8EQCAAIAEgAhAFIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsDAAELOwECfz8AIQECQEGADCgCACICIABqIgAgAUEQdE0NACAAEAQNAEGACEEwNgIAQX8PC0GADCAANgIAIAILIwAgAD8AQRB0a0H//wNqQRB2QABBf0YEQEEADwtBABAAQQELOwEBfyACBEADQCAAIAEgAkGAICACQYAgSRsiAxABIQAgAUGAIGohASAAQYAgaiEAIAIgA2siAg0ACwsLxgIBAn8gAEGAAWoiAUF/akH/AToAACAAQf8BOgAAIAFBfmpB/wE6AAAgAEH/AToAASABQX1qQf8BOgAAIABB/wE6AAIgAUF8akH/AToAACAAQf8BOgADIABBACAAa0EDcSIBaiIAQX82AgAgAEGAASABa0F8cSICaiIBQXxqQX82AgACQCACQQlJDQAgAEF/NgIIIABBfzYCBCABQXhqQX82AgAgAUF0akF/NgIAIAJBGUkNACAAQX82AhggAEF/NgIUIABBfzYCECAAQX82AgwgAUFwakF/NgIAIAFBbGpBfzYCACABQWhqQX82AgAgAUFkakF/NgIAIAIgAEEEcUEYciICayIBQSBJDQAgACACaiEAA0AgAEJ/NwMYIABCfzcDECAAQn83AwggAEJ/NwMAIABBIGohACABQWBqIgFBH0sNAAsLC4YQAQ5/IwBBwAFrIgkkAAJ/QX4gAUEDbiIGQRFqIARLDQAaQX8gAy0AAEHgAUcNABogCUFAaxAGIAlCfzcDOCAJQn83AzAgCUJ/NwMoIAlCfzcDICAJQn83AxggCUJ/NwMQIAlCfzcDCCAJQn83AwAgAyAEakFwaiERIANBAWoiEiAGaiELIAEEQCACQQJHIQ9BACEDQQAhAkEAIQQDQEF+IAsgEUsNAhoCfyASLQAAIgpB7wFNBEAgCUFAayAKQQR2QX9zIAxqQQ9xQQN0aiIGKAIEIQUgBigCACENIApBD3EiBkEPRwRAIAkgCkF/cyAEakEPcUECdGooAgAgAyAGGyEIIAZFIQoCQCAPRQRAIAAgAkEBdGoiBiANOwEAIAYgBTsBAiAGIAg7AQQMAQsgACACQQJ0aiIGIA02AgAgBiAINgIIIAYgBTYCBAsgAyAKaiEDIAlBQGsgDEEDdGoiBiAFNgIEIAYgCDYCACAJIARBAnRqIAg2AgAgCUFAayAMQQFqQQ9xIgVBA3RqIgYgDTYCACAGIAg2AgQgBCAKaiEEIAVBAWoMAgsgCywAACIGQf8BcSEHAn8gC0EBaiAGQX9KDQAaIAdB/wBxIAssAAEiBkH/AHFBB3RyIQcgC0ECaiAGQX9KDQAaIAssAAIiBkH/AHFBDnQgB3IhByALQQNqIAZBf0oNABogCywAAyIGQf8AcUEVdCAHciEHIAtBBGogBkF/Sg0AGiALLQAEQRx0IAdyIQcgC0EFagshC0EAIAdBAXFrIAdBAXZzIA5qIQ4CQCAPRQRAIAAgAkEBdGoiBiANOwEAIAYgBTsBAiAGIA47AQQMAQsgACACQQJ0aiIGIA02AgAgBiAONgIIIAYgBTYCBAsgCUFAayAMQQN0aiIGIAU2AgQgBiAONgIAIAkgBEECdGogDjYCACAJQUBrIAxBAWpBD3EiBUEDdGoiBiANNgIAIAYgDjYCBCAEQQFqIQQgBUEBagwBCyAKQf0BTQRAIAkgBCARIApBD3FqLQAAIghBBHYiBWtBD3FBAnRqKAIAIANBAWoiBiAFGyENIAkgBCAIa0EPcUECdGooAgAgBiAFRSIFaiIKIAhBD3EiBhshByAGRSEIAkAgD0UEQCAAIAJBAXRqIgYgAzsBACAGIA07AQIgBiAHOwEEDAELIAAgAkECdGoiBiADNgIAIAYgBzYCCCAGIA02AgQLIAkgBEECdGogAzYCACAJQUBrIAxBA3RqIgYgAzYCBCAGIA02AgAgCSAEQQFqIgZBD3FBAnRqIA02AgAgCUFAayAMQQFqQQ9xQQN0aiIEIAc2AgAgBCANNgIEIAkgBSAGakEPcSIFQQJ0aiAHNgIAIAlBQGsgDEECakEPcSIGQQN0aiIEIAM2AgAgBCAHNgIEIAUgCGohBCAIIApqIQMgBkEBagwBCyADIApB/gFGIgVqIQcgCy0AACIIQQ9xIRACQCAIQQR2Ig1FBEAgB0EBaiEKDAELIAchCiAJIAQgDWtBD3FBAnRqKAIAIQcLAkAgEEUEQCAKQQFqIQYMAQsgCiEGIAkgBCAIa0EPcUECdGooAgAhCgsCQCAFBEAgC0EBaiEIDAELIAssAAEiBUH/AXEhAwJ/IAtBAmogBUF/Sg0AGiADQf8AcSALLAACIgVB/wBxQQd0ciEDIAtBA2ogBUF/Sg0AGiALLAADIgVB/wBxQQ50IANyIQMgC0EEaiAFQX9KDQAaIAssAAQiBUH/AHFBFXQgA3IhAyALQQVqIAVBf0oNABogCy0ABUEcdCADciEDIAtBBmoLIQhBACADQQFxayADQQF2cyAOaiIOIQMLAkAgDUEPRwRAIAghBQwBCyAILAAAIgVB/wFxIQcCfyAIQQFqIAVBf0oNABogB0H/AHEgCCwAASIFQf8AcUEHdHIhByAIQQJqIAVBf0oNABogCCwAAiIFQf8AcUEOdCAHciEHIAhBA2ogBUF/Sg0AGiAILAADIgVB/wBxQRV0IAdyIQcgCEEEaiAFQX9KDQAaIAgtAARBHHQgB3IhByAIQQVqCyEFQQAgB0EBcWsgB0EBdnMgDmoiDiEHCwJAIBBBD0cEQCAFIQsMAQsgBSwAACIIQf8BcSEKAn8gBUEBaiAIQX9KDQAaIApB/wBxIAUsAAEiCEH/AHFBB3RyIQogBUECaiAIQX9KDQAaIAUsAAIiCEH/AHFBDnQgCnIhCiAFQQNqIAhBf0oNABogBSwAAyIIQf8AcUEVdCAKciEKIAVBBGogCEF/Sg0AGiAFLQAEQRx0IApyIQogBUEFagshC0EAIApBAXFrIApBAXZzIA5qIg4hCgsCQCAPRQRAIAAgAkEBdGoiBSADOwEAIAUgBzsBAiAFIAo7AQQMAQsgACACQQJ0aiIFIAM2AgAgBSAKNgIIIAUgBzYCBAsgCUFAayAMQQN0aiIFIAM2AgQgBSAHNgIAIAkgBEECdGogAzYCACAJQUBrIAxBAWpBD3FBA3RqIgUgCjYCACAFIAc2AgQgCSAEQQFqIgVBD3FBAnRqIAc2AgAgCUFAayAMQQJqQQ9xQQN0aiIEIAM2AgAgBCAKNgIEIAkgBSANRSANQQ9GcmoiA0EPcUECdGogCjYCACADIBBFIBBBD0ZyaiEEIAYhAyAMQQNqCyEMIBJBAWohEiAMQQ9xIQwgBEEPcSEEIAJBA2oiAiABSQ0ACwtBAEF9IAsgEUYbCyEMIAlBwAFqJAAgDAvLDAEPfyMAQYDEAGsiECQAAn9BfiACQQFqIARLDQAaQX8gAy0AAEGgAUcNABogECADIARqIg8gAmsgAhABIQtBgMAAIAJuQfD/AHEiBEGAAiAEQYACSRshESADQQFqIQkCQANAIAwgAU8NASARIAEgDGsgDCARaiABSRshDQJAAkAgAkUEQCAJIQQMAQsgDUEPaiIDQXBxIRIgA0EEdkEDakECdiETQQAhDiAJIQoDQCAPIAprIBNJBEBBACEJDAMLIAogE2ohBEEAIQlBACEDIBIEQANAIA8gBGtBIEkNBCALQYDCAGogA2ohCAJAAkACQAJAAkAgCiADQQZ2ai0AACADQQN2QQZxdkEDcUEBaw4DAQIDAAsgCEIANwMAIAhCADcDCAwDCyAIIAQtAAQgBC0AACIGQQZ2IgUgBUEDRiIFGzoAACAIIARBBGogBWoiBS0AACAGQQR2QQNxIgcgB0EDRiIHGzoAASAIIAUgB2oiBS0AACAGQQJ2QQNxIgcgB0EDRiIHGzoAAiAIIAUgB2oiBS0AACAGQQNxIgYgBkEDRiIGGzoAAyAIIAUgBmoiBS0AACAELQABIgZBBnYiByAHQQNGIgcbOgAEIAggBSAHaiIFLQAAIAZBBHZBA3EiByAHQQNGIgcbOgAFIAggBSAHaiIFLQAAIAZBAnZBA3EiByAHQQNGIgcbOgAGIAggBSAHaiIFLQAAIAZBA3EiBiAGQQNGIgYbOgAHIAggBSAGaiIFLQAAIAQtAAIiBkEGdiIHIAdBA0YiBxs6AAggCCAFIAdqIgUtAAAgBkEEdkEDcSIHIAdBA0YiBxs6AAkgCCAFIAdqIgUtAAAgBkECdkEDcSIHIAdBA0YiBxs6AAogCCAFIAdqIgUtAAAgBkEDcSIGIAZBA0YiBhs6AAsgCCAFIAZqIgYtAAAgBC0AAyIEQQZ2IgUgBUEDRiIFGzoADCAIIAUgBmoiBi0AACAEQQR2QQNxIgUgBUEDRiIFGzoADSAIIAUgBmoiBi0AACAEQQJ2QQNxIgUgBUEDRiIFGzoADiAIIAUgBmoiCC0AACAEQQNxIgQgBEEDRiIEGzoADyAEIAhqIQQMAgsgCCAELQAIIAQtAAAiBkEEdiIFIAVBD0YiBRs6AAAgCCAEQQhqIAVqIgUtAAAgBkEPcSIGIAZBD0YiBhs6AAEgCCAFIAZqIgYtAAAgBC0AASIFQQR2IgcgB0EPRiIHGzoAAiAIIAYgB2oiBi0AACAFQQ9xIgUgBUEPRiIFGzoAAyAIIAUgBmoiBi0AACAELQACIgVBBHYiByAHQQ9GIgcbOgAEIAggBiAHaiIGLQAAIAVBD3EiBSAFQQ9GIgUbOgAFIAggBSAGaiIGLQAAIAQtAAMiBUEEdiIHIAdBD0YiBxs6AAYgCCAGIAdqIgYtAAAgBUEPcSIFIAVBD0YiBRs6AAcgCCAFIAZqIgYtAAAgBC0ABCIFQQR2IgcgB0EPRiIHGzoACCAIIAYgB2oiBi0AACAFQQ9xIgUgBUEPRiIFGzoACSAIIAUgBmoiBi0AACAELQAFIgVBBHYiByAHQQ9GIgcbOgAKIAggBiAHaiIGLQAAIAVBD3EiBSAFQQ9GIgUbOgALIAggBSAGaiIGLQAAIAQtAAYiBUEEdiIHIAdBD0YiBxs6AAwgCCAGIAdqIgYtAAAgBUEPcSIFIAVBD0YiBRs6AA0gCCAFIAZqIgYtAAAgBC0AByIEQQR2IgUgBUEPRiIFGzoADiAIIAUgBmoiCC0AACAEQQ9xIgQgBEEPRiIEGzoADyAEIAhqIQQMAQsgCCAEKQAANwAAIAggBCkACDcACCAEQRBqIQQLIANBEGoiAyASSQ0ACwsgBEUNAiANBEAgCyAOai0AACEKIA4hAwNAIAtBgAJqIANqIAogC0GAwgBqIAlqLQAAIgpBAXZBACAKQQFxa3NqIgo6AAAgAiADaiEDIAlBAWoiCSANRw0ACwsgBCEKIA5BAWoiDiACRw0ACwsgACACIAxsaiALQYACaiACIA1sEAEaIAsgC0GAAmogDUF/aiACbGogAhABGiAEIQkLIA1BACAJGyAMaiEMIAkNAAtBfgwBC0EAQX0gDyAJayACQSAgAkEgSxtGGwshCSAQQYDEAGokACAJCwsJAQBBgAwLAsBm";
- var memory = new WebAssembly.Memory({
- initial: 1
- });
- var heap = new Uint8Array(memory.buffer);
- var brk = 32768; // stack top
+ var instance, heap;
- var sbrk = function(size) {
- var old = brk;
- brk += size;
- if (brk > heap.length) {
- memory.grow(Math.ceil((brk - heap.length) / 65536));
- heap = new Uint8Array(memory.buffer);
+ var env = {
+ emscripten_notify_memory_growth: function(index) {
+ heap = new Uint8Array(instance.exports.memory.buffer);
}
- return old;
};
- var imports = {
- env: {
- memory: memory,
- emscripten_memcpy_big: function(d, s, n) {
- heap.set(heap.subarray(s, s + n), d);
- },
- }
- };
-
- var instance = {};
var promise =
- (typeof fetch === 'function'
- ? fetch('data:application/octet-stream;base64,' + wasm)
- .then(response => response.arrayBuffer())
- : Promise.resolve(Buffer.from(wasm, 'base64').buffer))
- .then(bytes => WebAssembly.instantiate(bytes, imports))
- .then(result => instance = result.instance);
+ (typeof fetch === 'function' ?
+ fetch('data:application/octet-stream;base64,' + wasm)
+ .then(response => response.arrayBuffer()) :
+ Promise.resolve(Buffer.from(wasm, 'base64').buffer))
+ .then(bytes => WebAssembly.instantiate(bytes, { env }))
+ .then(function(result) {
+ instance = result.instance;
+ if (instance.exports.__wasm_call_ctors) {
+ instance.exports.__wasm_call_ctors();
+ }
+ env.emscripten_notify_memory_growth(0);
+ });
- var decode = function(fun, target, count, size, source) {
+ function decode(fun, target, count, size, source) {
+ var sbrk = instance.exports.sbrk;
var tp = sbrk(count * size);
var sp = sbrk(source.length);
heap.set(source, sp);
var res = fun(tp, count, size, sp, source.length);
- target.set(heap.subarray(tp, tp + count * size), 0);
+ target.set(heap.subarray(tp, tp + count * size));
sbrk(tp - sbrk(0));
if (res != 0) {
throw new Error("Malformed buffer data: " + res);
@@ -53,12 +42,12 @@ var MeshoptDecoder = (function() {
return {
ready: promise,
decodeVertexBuffer: function(target, count, size, source) {
- decode(instance.exports["meshopt_decodeVertexBuffer"], target, count, size, source);
+ decode(instance.exports.meshopt_decodeVertexBuffer, target, count, size, source);
},
decodeIndexBuffer: function(target, count, size, source) {
- decode(instance.exports["meshopt_decodeIndexBuffer"], target, count, size, source);
+ decode(instance.exports.meshopt_decodeIndexBuffer, target, count, size, source);
}
- }
+ };
})();
if (typeof exports === 'object' && typeof module === 'object')
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/src/indexcodec.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/src/indexcodec.cpp
index 1a62e1446fb..bf3e50ff8c8 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/indexcodec.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/indexcodec.cpp
@@ -161,9 +161,6 @@ static void writeTriangle(void* destination, size_t offset, size_t index_size, u
static_cast<unsigned short*>(destination)[offset + 2] = (unsigned short)(c);
}
else
-#ifdef __EMSCRIPTEN__
- if (index_size == 4) // work around Edge (ChakraCore) bug - without this compiler assumes index_size==2
-#endif
{
static_cast<unsigned int*>(destination)[offset + 0] = a;
static_cast<unsigned int*>(destination)[offset + 1] = b;
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/src/meshoptimizer.h b/3rdparty/bgfx/3rdparty/meshoptimizer/src/meshoptimizer.h
index daadee4bc40..da7fc0ca1d3 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/meshoptimizer.h
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/meshoptimizer.h
@@ -1,5 +1,5 @@
/**
- * meshoptimizer - version 0.11
+ * meshoptimizer - version 0.12
*
* Copyright (C) 2016-2019, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Report bugs and download new versions at https://github.com/zeux/meshoptimizer
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/src/simplifier.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/src/simplifier.cpp
index 400c9ccdeec..dd0ff9b07c0 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/simplifier.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/simplifier.cpp
@@ -1443,6 +1443,9 @@ size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_pos
size_t target_cell_count = target_vertex_count;
+ if (target_cell_count == 0)
+ return 0;
+
meshopt_Allocator allocator;
Vector3* vertex_positions = allocator.allocate<Vector3>(vertex_count);
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexcodec.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexcodec.cpp
index f89f05c074e..44c0c8787d2 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexcodec.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexcodec.cpp
@@ -12,7 +12,12 @@
#define SIMD_SSE
#endif
-#if !defined(SIMD_SSE) && defined(_MSC_VER) && !defined(__clang__) && (defined(_M_IX86) || defined(_M_X64))
+#if defined(__AVX512VBMI2__) && defined(__AVX512VBMI__) && defined(__AVX512VL__) && defined(__POPCNT__)
+#undef SIMD_SSE
+#define SIMD_AVX
+#endif
+
+#if !defined(SIMD_SSE) && !defined(SIMD_AVX) && defined(_MSC_VER) && !defined(__clang__) && (defined(_M_IX86) || defined(_M_X64))
#define SIMD_SSE
#define SIMD_FALLBACK
#include <intrin.h> // __cpuid
@@ -22,10 +27,19 @@
#define SIMD_NEON
#endif
+// WebAssembly SIMD implementation requires a few bleeding edge intrinsics that are only available in Chrome Canary
+#if defined(__wasm_simd128__) && defined(__wasm_unimplemented_simd128__)
+#define SIMD_WASM
+#endif
+
#ifdef SIMD_SSE
#include <tmmintrin.h>
#endif
+#ifdef SIMD_AVX
+#include <immintrin.h>
+#endif
+
#ifdef SIMD_NEON
#if defined(_MSC_VER) && defined(_M_ARM64)
#include <arm64_neon.h>
@@ -34,6 +48,10 @@
#endif
#endif
+#ifdef SIMD_WASM
+#include <wasm_simd128.h>
+#endif
+
#ifndef TRACE
#define TRACE 0
#endif
@@ -42,6 +60,14 @@
#include <stdio.h>
#endif
+#ifdef SIMD_WASM
+#define wasm_v32x4_splat(v, i) wasm_v8x16_shuffle(v, v, 4 * i, 4 * i + 1, 4 * i + 2, 4 * i + 3, 4 * i, 4 * i + 1, 4 * i + 2, 4 * i + 3, 4 * i, 4 * i + 1, 4 * i + 2, 4 * i + 3, 4 * i, 4 * i + 1, 4 * i + 2, 4 * i + 3)
+#define wasm_unpacklo_v8x16(a, b) wasm_v8x16_shuffle(a, b, 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23)
+#define wasm_unpackhi_v8x16(a, b) wasm_v8x16_shuffle(a, b, 8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31)
+#define wasm_unpacklo_v16x8(a, b) wasm_v8x16_shuffle(a, b, 0, 1, 16, 17, 2, 3, 18, 19, 4, 5, 20, 21, 6, 7, 22, 23)
+#define wasm_unpackhi_v16x8(a, b) wasm_v8x16_shuffle(a, b, 8, 9, 24, 25, 10, 11, 26, 27, 12, 13, 28, 29, 14, 15, 30, 31)
+#endif
+
namespace meshopt
{
@@ -267,7 +293,7 @@ static unsigned char* encodeVertexBlock(unsigned char* data, unsigned char* data
return data;
}
-#if defined(SIMD_FALLBACK) || (!defined(SIMD_SSE) && !defined(SIMD_NEON))
+#if defined(SIMD_FALLBACK) || (!defined(SIMD_SSE) && !defined(SIMD_NEON) && !defined(SIMD_AVX))
static const unsigned char* decodeBytesGroup(const unsigned char* data, unsigned char* buffer, int bitslog2)
{
#define READ() byte = *data++
@@ -309,7 +335,7 @@ static const unsigned char* decodeBytesGroup(const unsigned char* data, unsigned
memcpy(buffer, data, kByteGroupSize);
return data + kByteGroupSize;
default:
- assert(!"Unexpected bit length"); // This can never happen since bitslog2 is a 2-bit value
+ assert(!"Unexpected bit length"); // unreachable since bitslog2 is a 2-bit value
return data;
}
@@ -384,7 +410,7 @@ static const unsigned char* decodeVertexBlock(const unsigned char* data, const u
}
#endif
-#if defined(SIMD_SSE) || defined(SIMD_NEON)
+#if defined(SIMD_SSE) || defined(SIMD_NEON) || defined(SIMD_WASM)
static unsigned char kDecodeBytesGroupShuffle[256][8];
static unsigned char kDecodeBytesGroupCount[256];
@@ -424,27 +450,6 @@ static __m128i decodeShuffleMask(unsigned char mask0, unsigned char mask1)
return _mm_unpacklo_epi64(sm0, sm1r);
}
-static void transpose8(__m128i& x0, __m128i& x1, __m128i& x2, __m128i& x3)
-{
- __m128i t0 = _mm_unpacklo_epi8(x0, x1);
- __m128i t1 = _mm_unpackhi_epi8(x0, x1);
- __m128i t2 = _mm_unpacklo_epi8(x2, x3);
- __m128i t3 = _mm_unpackhi_epi8(x2, x3);
-
- x0 = _mm_unpacklo_epi16(t0, t2);
- x1 = _mm_unpackhi_epi16(t0, t2);
- x2 = _mm_unpacklo_epi16(t1, t3);
- x3 = _mm_unpackhi_epi16(t1, t3);
-}
-
-static __m128i unzigzag8(__m128i v)
-{
- __m128i xl = _mm_sub_epi8(_mm_setzero_si128(), _mm_and_si128(v, _mm_set1_epi8(1)));
- __m128i xr = _mm_and_si128(_mm_srli_epi16(v, 1), _mm_set1_epi8(127));
-
- return _mm_xor_si128(xl, xr);
-}
-
static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsigned char* buffer, int bitslog2)
{
switch (bitslog2)
@@ -511,9 +516,66 @@ static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi
case 3:
{
- __m128i rest = _mm_loadu_si128(reinterpret_cast<const __m128i*>(data));
+ __m128i result = _mm_loadu_si128(reinterpret_cast<const __m128i*>(data));
+
+ _mm_storeu_si128(reinterpret_cast<__m128i*>(buffer), result);
+
+ return data + 16;
+ }
+
+ default:
+ assert(!"Unexpected bit length"); // unreachable since bitslog2 is a 2-bit value
+ return data;
+ }
+}
+#endif
+
+#ifdef SIMD_AVX
+static const __m128i decodeBytesGroupConfig[] = {
+ _mm_set1_epi8(3),
+ _mm_set1_epi8(15),
+ _mm_setr_epi8(6, 4, 2, 0, 14, 12, 10, 8, 22, 20, 18, 16, 30, 28, 26, 24),
+ _mm_setr_epi8(4, 0, 12, 8, 20, 16, 28, 24, 36, 32, 44, 40, 52, 48, 60, 56),
+};
+
+static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsigned char* buffer, int bitslog2)
+{
+ switch (bitslog2)
+ {
+ case 0:
+ {
+ __m128i result = _mm_setzero_si128();
+
+ _mm_storeu_si128(reinterpret_cast<__m128i*>(buffer), result);
+
+ return data;
+ }
+
+ case 1:
+ case 2:
+ {
+ const unsigned char* skip = data + (bitslog2 << 2);
- __m128i result = rest;
+ __m128i selb = _mm_loadl_epi64(reinterpret_cast<const __m128i*>(data));
+ __m128i rest = _mm_loadu_si128(reinterpret_cast<const __m128i*>(skip));
+
+ __m128i sent = decodeBytesGroupConfig[bitslog2 - 1];
+ __m128i ctrl = decodeBytesGroupConfig[bitslog2 + 1];
+
+ __m128i selw = _mm_shuffle_epi32(selb, 0x44);
+ __m128i sel = _mm_and_si128(sent, _mm_multishift_epi64_epi8(ctrl, selw));
+ __mmask16 mask16 = _mm_cmp_epi8_mask(sel, sent, _MM_CMPINT_EQ);
+
+ __m128i result = _mm_mask_expand_epi8(sel, mask16, rest);
+
+ _mm_storeu_si128(reinterpret_cast<__m128i*>(buffer), result);
+
+ return skip + _mm_popcnt_u32(mask16);
+ }
+
+ case 3:
+ {
+ __m128i result = _mm_loadu_si128(reinterpret_cast<const __m128i*>(data));
_mm_storeu_si128(reinterpret_cast<__m128i*>(buffer), result);
@@ -521,7 +583,7 @@ static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi
}
default:
- assert(!"Unexpected bit length"); // This can never happen since bitslog2 is a 2-bit value
+ assert(!"Unexpected bit length"); // unreachable since bitslog2 is a 2-bit value
return data;
}
}
@@ -561,28 +623,6 @@ static void neonMoveMask(uint8x16_t mask, unsigned char& mask0, unsigned char& m
#endif
}
-static void transpose8(uint8x16_t& x0, uint8x16_t& x1, uint8x16_t& x2, uint8x16_t& x3)
-{
- uint8x16x2_t t01 = vzipq_u8(x0, x1);
- uint8x16x2_t t23 = vzipq_u8(x2, x3);
-
- uint16x8x2_t x01 = vzipq_u16(vreinterpretq_u16_u8(t01.val[0]), vreinterpretq_u16_u8(t23.val[0]));
- uint16x8x2_t x23 = vzipq_u16(vreinterpretq_u16_u8(t01.val[1]), vreinterpretq_u16_u8(t23.val[1]));
-
- x0 = vreinterpretq_u8_u16(x01.val[0]);
- x1 = vreinterpretq_u8_u16(x01.val[1]);
- x2 = vreinterpretq_u8_u16(x23.val[0]);
- x3 = vreinterpretq_u8_u16(x23.val[1]);
-}
-
-static uint8x16_t unzigzag8(uint8x16_t v)
-{
- uint8x16_t xl = vreinterpretq_u8_s8(vnegq_s8(vreinterpretq_s8_u8(vandq_u8(v, vdupq_n_u8(1)))));
- uint8x16_t xr = vshrq_n_u8(v, 1);
-
- return veorq_u8(xl, xr);
-}
-
static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsigned char* buffer, int bitslog2)
{
switch (bitslog2)
@@ -639,9 +679,7 @@ static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi
case 3:
{
- uint8x16_t rest = vld1q_u8(data);
-
- uint8x16_t result = rest;
+ uint8x16_t result = vld1q_u8(data);
vst1q_u8(buffer, result);
@@ -649,13 +687,211 @@ static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi
}
default:
- assert(!"Unexpected bit length"); // This can never happen since bitslog2 is a 2-bit value
+ assert(!"Unexpected bit length"); // unreachable since bitslog2 is a 2-bit value
return data;
}
}
#endif
-#if defined(SIMD_SSE) || defined(SIMD_NEON)
+#ifdef SIMD_WASM
+static v128_t decodeShuffleMask(unsigned char mask0, unsigned char mask1)
+{
+ // TODO: 8b buffer overrun - should we use splat or extend buffers?
+ v128_t sm0 = wasm_v128_load(&kDecodeBytesGroupShuffle[mask0]);
+ v128_t sm1 = wasm_v128_load(&kDecodeBytesGroupShuffle[mask1]);
+
+ // TODO: we should use v8x16_load_splat
+ v128_t sm1off = wasm_v128_load(&kDecodeBytesGroupCount[mask0]);
+ sm1off = wasm_v8x16_shuffle(sm1off, sm1off, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ v128_t sm1r = wasm_i8x16_add(sm1, sm1off);
+
+ return wasm_v8x16_shuffle(sm0, sm1r, 0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22, 23);
+}
+
+static void wasmMoveMask(v128_t mask, unsigned char& mask0, unsigned char& mask1)
+{
+ uint64_t mbits = 0x8040201008040201ull;
+
+ uint64_t m0_8 = wasm_i64x2_extract_lane(mask, 0) & mbits;
+ uint64_t m1_8 = wasm_i64x2_extract_lane(mask, 1) & mbits;
+
+ uint32_t m0_4 = m0_8 | (m0_8 >> 32);
+ uint32_t m1_4 = m1_8 | (m1_8 >> 32);
+
+ uint16_t m0_2 = m0_4 | (m0_4 >> 16);
+ uint16_t m1_2 = m1_4 | (m1_4 >> 16);
+
+ mask0 = m0_2 | (m0_2 >> 8);
+ mask1 = m1_2 | (m1_2 >> 8);
+}
+
+static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsigned char* buffer, int bitslog2)
+{
+ unsigned char byte, enc, encv;
+ const unsigned char* data_var;
+
+ switch (bitslog2)
+ {
+ case 0:
+ {
+ v128_t result = wasm_i8x16_splat(0);
+
+ wasm_v128_store(buffer, result);
+
+ return data;
+ }
+
+ case 1:
+ {
+ // TODO: test 4b load splat
+ v128_t sel2 = wasm_v128_load(data);
+ v128_t rest = wasm_v128_load(data + 4);
+
+ v128_t sel22 = wasm_unpacklo_v8x16(wasm_i16x8_shr(sel2, 4), sel2);
+ v128_t sel2222 = wasm_unpacklo_v8x16(wasm_i16x8_shr(sel22, 2), sel22);
+ v128_t sel = wasm_v128_and(sel2222, wasm_i8x16_splat(3));
+
+ v128_t mask = wasm_i8x16_eq(sel, wasm_i8x16_splat(3));
+
+ if (!wasm_i8x16_any_true(mask))
+ {
+ wasm_v128_store(buffer, sel);
+
+ return data + 4;
+ }
+
+ unsigned char mask0, mask1;
+ wasmMoveMask(mask, mask0, mask1);
+
+ v128_t shuf = decodeShuffleMask(mask0, mask1);
+
+ // TODO: test or/andnot
+ v128_t result = wasm_v128_bitselect(wasm_v8x16_swizzle(rest, shuf), sel, mask);
+
+ wasm_v128_store(buffer, result);
+
+ return data + 4 + kDecodeBytesGroupCount[mask0] + kDecodeBytesGroupCount[mask1];
+ }
+
+ case 2:
+ {
+ // TODO: test 8b load splat
+ v128_t sel4 = wasm_v128_load(data);
+ v128_t rest = wasm_v128_load(data + 8);
+
+ v128_t sel44 = wasm_unpacklo_v8x16(wasm_i16x8_shr(sel4, 4), sel4);
+ v128_t sel = wasm_v128_and(sel44, wasm_i8x16_splat(15));
+
+ v128_t mask = wasm_i8x16_eq(sel, wasm_i8x16_splat(15));
+
+ if (!wasm_i8x16_any_true(mask))
+ {
+ wasm_v128_store(buffer, sel);
+
+ return data + 8;
+ }
+
+ unsigned char mask0, mask1;
+ wasmMoveMask(mask, mask0, mask1);
+
+ v128_t shuf = decodeShuffleMask(mask0, mask1);
+
+ // TODO: test or/andnot
+ v128_t result = wasm_v128_bitselect(wasm_v8x16_swizzle(rest, shuf), sel, mask);
+
+ wasm_v128_store(buffer, result);
+
+ return data + 8 + kDecodeBytesGroupCount[mask0] + kDecodeBytesGroupCount[mask1];
+ }
+
+ case 3:
+ {
+ v128_t result = wasm_v128_load(data);
+
+ wasm_v128_store(buffer, result);
+
+ return data + 16;
+ }
+
+ default:
+ assert(!"Unexpected bit length"); // unreachable since bitslog2 is a 2-bit value
+ return data;
+ }
+}
+#endif
+
+#if defined(SIMD_SSE) || defined(SIMD_AVX)
+static void transpose8(__m128i& x0, __m128i& x1, __m128i& x2, __m128i& x3)
+{
+ __m128i t0 = _mm_unpacklo_epi8(x0, x1);
+ __m128i t1 = _mm_unpackhi_epi8(x0, x1);
+ __m128i t2 = _mm_unpacklo_epi8(x2, x3);
+ __m128i t3 = _mm_unpackhi_epi8(x2, x3);
+
+ x0 = _mm_unpacklo_epi16(t0, t2);
+ x1 = _mm_unpackhi_epi16(t0, t2);
+ x2 = _mm_unpacklo_epi16(t1, t3);
+ x3 = _mm_unpackhi_epi16(t1, t3);
+}
+
+static __m128i unzigzag8(__m128i v)
+{
+ __m128i xl = _mm_sub_epi8(_mm_setzero_si128(), _mm_and_si128(v, _mm_set1_epi8(1)));
+ __m128i xr = _mm_and_si128(_mm_srli_epi16(v, 1), _mm_set1_epi8(127));
+
+ return _mm_xor_si128(xl, xr);
+}
+#endif
+
+#ifdef SIMD_NEON
+static void transpose8(uint8x16_t& x0, uint8x16_t& x1, uint8x16_t& x2, uint8x16_t& x3)
+{
+ uint8x16x2_t t01 = vzipq_u8(x0, x1);
+ uint8x16x2_t t23 = vzipq_u8(x2, x3);
+
+ uint16x8x2_t x01 = vzipq_u16(vreinterpretq_u16_u8(t01.val[0]), vreinterpretq_u16_u8(t23.val[0]));
+ uint16x8x2_t x23 = vzipq_u16(vreinterpretq_u16_u8(t01.val[1]), vreinterpretq_u16_u8(t23.val[1]));
+
+ x0 = vreinterpretq_u8_u16(x01.val[0]);
+ x1 = vreinterpretq_u8_u16(x01.val[1]);
+ x2 = vreinterpretq_u8_u16(x23.val[0]);
+ x3 = vreinterpretq_u8_u16(x23.val[1]);
+}
+
+static uint8x16_t unzigzag8(uint8x16_t v)
+{
+ uint8x16_t xl = vreinterpretq_u8_s8(vnegq_s8(vreinterpretq_s8_u8(vandq_u8(v, vdupq_n_u8(1)))));
+ uint8x16_t xr = vshrq_n_u8(v, 1);
+
+ return veorq_u8(xl, xr);
+}
+#endif
+
+#ifdef SIMD_WASM
+static void transpose8(v128_t& x0, v128_t& x1, v128_t& x2, v128_t& x3)
+{
+ v128_t t0 = wasm_unpacklo_v8x16(x0, x1);
+ v128_t t1 = wasm_unpackhi_v8x16(x0, x1);
+ v128_t t2 = wasm_unpacklo_v8x16(x2, x3);
+ v128_t t3 = wasm_unpackhi_v8x16(x2, x3);
+
+ x0 = wasm_unpacklo_v16x8(t0, t2);
+ x1 = wasm_unpackhi_v16x8(t0, t2);
+ x2 = wasm_unpacklo_v16x8(t1, t3);
+ x3 = wasm_unpackhi_v16x8(t1, t3);
+}
+
+static v128_t unzigzag8(v128_t v)
+{
+ v128_t xl = wasm_i8x16_neg(wasm_v128_and(v, wasm_i8x16_splat(1)));
+ v128_t xr = wasm_u8x16_shr(v, 1);
+
+ return wasm_v128_xor(xl, xr);
+}
+#endif
+
+#if defined(SIMD_SSE) || defined(SIMD_AVX) || defined(SIMD_NEON) || defined(SIMD_WASM)
static const unsigned char* decodeBytesSimd(const unsigned char* data, const unsigned char* data_end, unsigned char* buffer, size_t buffer_size)
{
assert(buffer_size % kByteGroupSize == 0);
@@ -719,7 +955,7 @@ static const unsigned char* decodeVertexBlockSimd(const unsigned char* data, con
return 0;
}
-#ifdef SIMD_SSE
+#if defined(SIMD_SSE) || defined(SIMD_AVX)
#define TEMP __m128i
#define PREP() __m128i pi = _mm_cvtsi32_si128(*reinterpret_cast<const int*>(last_vertex + k))
#define LOAD(i) __m128i r##i = _mm_loadu_si128(reinterpret_cast<const __m128i*>(buffer + j + i * vertex_count_aligned))
@@ -737,6 +973,15 @@ static const unsigned char* decodeVertexBlockSimd(const unsigned char* data, con
#define SAVE(i) vst1_lane_u32(reinterpret_cast<uint32_t*>(savep), vreinterpret_u32_u8(t##i), 0), savep += vertex_size
#endif
+#ifdef SIMD_WASM
+#define TEMP v128_t
+#define PREP() v128_t pi = wasm_v128_load(last_vertex + k) // TODO: use wasm_v32x4_load_splat to avoid buffer overrun
+#define LOAD(i) v128_t r##i = wasm_v128_load(buffer + j + i * vertex_count_aligned)
+#define GRP4(i) t0 = wasm_v32x4_splat(r##i, 0), t1 = wasm_v32x4_splat(r##i, 1), t2 = wasm_v32x4_splat(r##i, 2), t3 = wasm_v32x4_splat(r##i, 3)
+#define FIXD(i) t##i = pi = wasm_i8x16_add(pi, t##i)
+#define SAVE(i) *reinterpret_cast<int*>(savep) = wasm_i32x4_extract_lane(t##i, 0), savep += vertex_size
+#endif
+
PREP();
unsigned char* savep = transposed + k;
@@ -906,14 +1151,21 @@ int meshopt_decodeVertexBuffer(void* destination, size_t vertex_count, size_t ve
int cpuinfo[4] = {};
__cpuid(cpuinfo, 1);
decode = (cpuinfo[2] & (1 << 9)) ? decodeVertexBlockSimd : decodeVertexBlock;
-#elif defined(SIMD_SSE) || defined(SIMD_NEON)
+#elif defined(SIMD_SSE) || defined(SIMD_AVX) || defined(SIMD_NEON) || defined(SIMD_WASM)
decode = decodeVertexBlockSimd;
#else
decode = decodeVertexBlock;
#endif
-#if defined(SIMD_SSE) || defined(SIMD_NEON)
+#if defined(SIMD_WASM)
+ // TODO: workaround for https://github.com/emscripten-core/emscripten/issues/9767
+ if (!gDecodeBytesGroupInitialized)
+ gDecodeBytesGroupInitialized = decodeBytesGroupBuildTables();
+#endif
+
+#if defined(SIMD_SSE) || defined(SIMD_NEON) || defined(SIMD_WASM)
assert(gDecodeBytesGroupInitialized);
+ (void)gDecodeBytesGroupInitialized;
#endif
unsigned char* vertex_data = static_cast<unsigned char*>(destination);
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/tools/cgltf.h b/3rdparty/bgfx/3rdparty/meshoptimizer/tools/cgltf.h
index 6b7ff41e28a..4ad7ef078ea 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/tools/cgltf.h
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/tools/cgltf.h
@@ -58,7 +58,16 @@
* `cgltf_node_transform_world` calls `cgltf_node_transform_local` on every ancestor in order
* to compute the root-to-node transformation.
*
- * `cgltf_accessor_read_float` reads a certain element from an accessor and converts it to
+ * `cgltf_accessor_unpack_floats` reads in the data from an accessor, applies sparse data (if any),
+ * and converts them to floating point. Assumes that `cgltf_load_buffers` has already been called.
+ * By passing null for the output pointer, users can find out how many floats are required in the
+ * output buffer.
+ *
+ * `cgltf_accessor_num_components` is a tiny utility that tells you the dimensionality of
+ * a certain accessor type. This can be used before `cgltf_accessor_unpack_floats` to help allocate
+ * the necessary amount of memory.
+ *
+ * `cgltf_accessor_read_float` reads a certain element from a non-sparse accessor and converts it to
* floating point, assuming that `cgltf_load_buffers` has already been called. The passed-in element
* size is the number of floats in the output buffer, which should be in the range [1, 16]. Returns
* false if the passed-in element_size is too small, or if the accessor is sparse.
@@ -67,7 +76,7 @@
* and only works with single-component data types.
*
* `cgltf_result cgltf_copy_extras_json(const cgltf_data*, const cgltf_extras*,
- * char* dest, cgltf_size* dest_size)` allows to retrieve the "extras" data that
+ * char* dest, cgltf_size* dest_size)` allows users to retrieve the "extras" data that
* can be attached to many glTF objects (which can be arbitrary JSON data). The
* `cgltf_extras` struct stores the offsets of the start and end of the extras JSON data
* as it appears in the complete glTF JSON data. This function copies the extras data
@@ -267,7 +276,7 @@ typedef struct cgltf_attribute
cgltf_accessor* data;
} cgltf_attribute;
-typedef struct cgltf_image
+typedef struct cgltf_image
{
char* name;
char* uri;
@@ -302,7 +311,7 @@ typedef struct cgltf_texture_transform
} cgltf_texture_transform;
typedef struct cgltf_texture_view
-{
+{
cgltf_texture* texture;
cgltf_int texcoord;
cgltf_float scale; /* equivalent to strength for occlusion_texture */
@@ -573,8 +582,7 @@ cgltf_result cgltf_load_buffers(
cgltf_result cgltf_load_buffer_base64(const cgltf_options* options, cgltf_size size, const char* base64, void** out_data);
-cgltf_result cgltf_validate(
- cgltf_data* data);
+cgltf_result cgltf_validate(cgltf_data* data);
void cgltf_free(cgltf_data* data);
@@ -584,6 +592,10 @@ void cgltf_node_transform_world(const cgltf_node* node, cgltf_float* out_matrix)
cgltf_bool cgltf_accessor_read_float(const cgltf_accessor* accessor, cgltf_size index, cgltf_float* out, cgltf_size element_size);
cgltf_size cgltf_accessor_read_index(const cgltf_accessor* accessor, cgltf_size index);
+cgltf_size cgltf_num_components(cgltf_type type);
+
+cgltf_size cgltf_accessor_unpack_floats(const cgltf_accessor* accessor, cgltf_float* out, cgltf_size float_count);
+
cgltf_result cgltf_copy_extras_json(const cgltf_data* data, const cgltf_extras* extras, char* dest, cgltf_size* dest_size);
#ifdef __cplusplus
@@ -1563,7 +1575,6 @@ static cgltf_float cgltf_component_read_float(const void* in, cgltf_component_ty
return (cgltf_float)cgltf_component_read_index(in, component_type);
}
-static cgltf_size cgltf_num_components(cgltf_type type);
static cgltf_size cgltf_component_size(cgltf_component_type component_type);
static cgltf_bool cgltf_element_read_float(const uint8_t* element, cgltf_type type, cgltf_component_type component_type, cgltf_bool normalized, cgltf_float* out, cgltf_size element_size)
@@ -1622,20 +1633,65 @@ static cgltf_bool cgltf_element_read_float(const uint8_t* element, cgltf_type ty
return 1;
}
-
cgltf_bool cgltf_accessor_read_float(const cgltf_accessor* accessor, cgltf_size index, cgltf_float* out, cgltf_size element_size)
{
- if (accessor->is_sparse || accessor->buffer_view == NULL)
+ if (accessor->is_sparse)
{
return 0;
}
-
+ if (accessor->buffer_view == NULL)
+ {
+ memset(out, 0, element_size * sizeof(cgltf_float));
+ return 1;
+ }
cgltf_size offset = accessor->offset + accessor->buffer_view->offset;
const uint8_t* element = (const uint8_t*) accessor->buffer_view->buffer->data;
element += offset + accessor->stride * index;
return cgltf_element_read_float(element, accessor->type, accessor->component_type, accessor->normalized, out, element_size);
}
+cgltf_size cgltf_accessor_unpack_floats(const cgltf_accessor* accessor, cgltf_float* out, cgltf_size float_count)
+{
+ cgltf_size floats_per_element = cgltf_num_components(accessor->type);
+ cgltf_size available_floats = accessor->count * floats_per_element;
+ if (out == NULL)
+ {
+ return available_floats;
+ }
+
+ float_count = available_floats < float_count ? available_floats : float_count;
+ cgltf_size element_count = float_count / floats_per_element;
+
+ // First pass: convert each element in the base accessor.
+ cgltf_float* dest = out;
+ cgltf_accessor dense = *accessor;
+ dense.is_sparse = 0;
+ for (cgltf_size index = 0; index < element_count; index++, dest += floats_per_element)
+ {
+ cgltf_accessor_read_float(&dense, index, dest, floats_per_element);
+ }
+
+ // Second pass: write out each element in the sparse accessor.
+ if (accessor->is_sparse)
+ {
+ const cgltf_accessor_sparse* sparse = &dense.sparse;
+ const uint8_t* index_data = (const uint8_t*) sparse->indices_buffer_view->buffer->data;
+ index_data += sparse->indices_byte_offset + sparse->indices_buffer_view->offset;
+ cgltf_size index_stride = cgltf_component_size(sparse->indices_component_type);
+ const uint8_t* reader_head = (const uint8_t*) sparse->values_buffer_view->buffer->data;
+ reader_head += sparse->values_byte_offset + sparse->values_buffer_view->offset;
+ for (cgltf_size reader_index = 0; reader_index < sparse->count; reader_index++, index_data += index_stride)
+ {
+ size_t writer_index = cgltf_component_read_index(index_data, sparse->indices_component_type);
+ float* writer_head = out + writer_index * floats_per_element;
+ cgltf_element_read_float(reader_head, dense.type, dense.component_type, dense.normalized, writer_head, floats_per_element);
+ reader_head += dense.stride;
+ }
+ }
+
+ return element_count * floats_per_element;
+}
+
cgltf_size cgltf_accessor_read_index(const cgltf_accessor* accessor, cgltf_size index)
{
if (accessor->buffer_view)
@@ -3996,7 +4052,7 @@ static int cgltf_parse_json_asset(cgltf_options* options, jsmntok_t const* token
return i;
}
-static cgltf_size cgltf_num_components(cgltf_type type) {
+cgltf_size cgltf_num_components(cgltf_type type) {
switch (type)
{
case cgltf_type_vec2:
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/tools/gltfpack.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/tools/gltfpack.cpp
index aa6c49bb0d9..e939f3f1362 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/tools/gltfpack.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/tools/gltfpack.cpp
@@ -84,6 +84,8 @@ struct Settings
bool simplify_aggressive;
bool compress;
+ bool fallback;
+
int verbose;
};
@@ -180,6 +182,30 @@ cgltf_accessor* getAccessor(const cgltf_attribute* attributes, size_t attribute_
return 0;
}
+void readAccessor(std::vector<float>& data, const cgltf_accessor* accessor)
+{
+ assert(accessor->type == cgltf_type_scalar);
+
+ data.resize(accessor->count);
+ cgltf_accessor_unpack_floats(accessor, &data[0], data.size());
+}
+
+void readAccessor(std::vector<Attr>& data, const cgltf_accessor* accessor)
+{
+ size_t components = cgltf_num_components(accessor->type);
+
+ std::vector<float> temp(accessor->count * components);
+ cgltf_accessor_unpack_floats(accessor, &temp[0], temp.size());
+
+ data.resize(accessor->count);
+
+ for (size_t i = 0; i < accessor->count; ++i)
+ {
+ for (size_t k = 0; k < components && k < 4; ++k)
+ data[i].f[k] = temp[i * components + k];
+ }
+}
+
void transformPosition(float* ptr, const float* transform)
{
float x = ptr[0] * transform[0] + ptr[1] * transform[4] + ptr[2] * transform[8] + transform[12];
@@ -291,10 +317,7 @@ void parseMeshesGltf(cgltf_data* data, std::vector<Mesh>& meshes)
}
Stream s = {attr.type, attr.index};
- s.data.resize(attr.data->count);
-
- for (size_t i = 0; i < attr.data->count; ++i)
- cgltf_accessor_read_float(attr.data, i, s.data[i].f, 4);
+ readAccessor(s.data, attr.data);
result.streams.push_back(s);
}
@@ -314,10 +337,7 @@ void parseMeshesGltf(cgltf_data* data, std::vector<Mesh>& meshes)
}
Stream s = {attr.type, attr.index, int(ti + 1)};
- s.data.resize(attr.data->count);
-
- for (size_t i = 0; i < attr.data->count; ++i)
- cgltf_accessor_read_float(attr.data, i, s.data[i].f, 4);
+ readAccessor(s.data, attr.data);
result.streams.push_back(s);
}
@@ -821,10 +841,10 @@ void reindexMesh(Mesh& mesh)
}
}
-const Stream* getPositionStream(const Mesh& mesh)
+Stream* getStream(Mesh& mesh, cgltf_attribute_type type)
{
for (size_t i = 0; i < mesh.streams.size(); ++i)
- if (mesh.streams[i].type == cgltf_attribute_type_position)
+ if (mesh.streams[i].type == type)
return &mesh.streams[i];
return 0;
@@ -835,7 +855,7 @@ void simplifyMesh(Mesh& mesh, float threshold, bool aggressive)
if (threshold >= 1)
return;
- const Stream* positions = getPositionStream(mesh);
+ const Stream* positions = getStream(mesh, cgltf_attribute_type_position);
if (!positions)
return;
@@ -883,12 +903,59 @@ void optimizeMesh(Mesh& mesh)
}
}
+struct BoneInfluence
+{
+ float i;
+ float w;
+
+ bool operator<(const BoneInfluence& other) const
+ {
+ return i < other.i;
+ }
+};
+
+void sortBoneInfluences(Mesh& mesh)
+{
+ Stream* joints = getStream(mesh, cgltf_attribute_type_joints);
+ Stream* weights = getStream(mesh, cgltf_attribute_type_weights);
+
+ if (!joints || !weights)
+ return;
+
+ size_t vertex_count = mesh.streams[0].data.size();
+
+ for (size_t i = 0; i < vertex_count; ++i)
+ {
+ Attr& ja = joints->data[i];
+ Attr& wa = weights->data[i];
+
+ BoneInfluence inf[4] = {};
+ int count = 0;
+
+ for (int k = 0; k < 4; ++k)
+ if (wa.f[k] > 0.f)
+ {
+ inf[count].i = ja.f[k];
+ inf[count].w = wa.f[k];
+ count++;
+ }
+
+ std::sort(inf, inf + count);
+
+ for (int k = 0; k < 4; ++k)
+ {
+ ja.f[k] = inf[k].i;
+ wa.f[k] = inf[k].w;
+ }
+ }
+}
+
void simplifyPointMesh(Mesh& mesh, float threshold)
{
if (threshold >= 1)
return;
- const Stream* positions = getPositionStream(mesh);
+ const Stream* positions = getStream(mesh, cgltf_attribute_type_position);
if (!positions)
return;
@@ -919,7 +986,7 @@ void simplifyPointMesh(Mesh& mesh, float threshold)
void sortPointMesh(Mesh& mesh)
{
- const Stream* positions = getPositionStream(mesh);
+ const Stream* positions = getStream(mesh, cgltf_attribute_type_position);
if (!positions)
return;
@@ -1870,13 +1937,20 @@ size_t getBufferView(std::vector<BufferView>& views, BufferView::Kind kind, int
return views.size() - 1;
}
-void writeBufferView(std::string& json, BufferView::Kind kind, size_t count, size_t stride, size_t bin_offset, size_t bin_size, int compression)
+void writeBufferView(std::string& json, BufferView::Kind kind, size_t count, size_t stride, size_t bin_offset, size_t bin_size, int compression, size_t compressed_offset, size_t compressed_size)
{
- append(json, "{\"buffer\":0");
- append(json, ",\"byteLength\":");
- append(json, bin_size);
+ assert(bin_size == count * stride);
+
+ // when compression is enabled, we store uncompressed data in buffer 1 and compressed data in buffer 0
+ // when compression is disabled, we store uncompressed data in buffer 0
+ size_t buffer = compression >= 0 ? 1 : 0;
+
+ append(json, "{\"buffer\":");
+ append(json, buffer);
append(json, ",\"byteOffset\":");
append(json, bin_offset);
+ append(json, ",\"byteLength\":");
+ append(json, bin_size);
if (kind == BufferView::Kind_Vertex)
{
append(json, ",\"byteStride\":");
@@ -1891,12 +1965,17 @@ void writeBufferView(std::string& json, BufferView::Kind kind, size_t count, siz
{
append(json, ",\"extensions\":{");
append(json, "\"MESHOPT_compression\":{");
- append(json, "\"mode\":");
+ append(json, "\"buffer\":0");
+ append(json, ",\"byteOffset\":");
+ append(json, size_t(compressed_offset));
+ append(json, ",\"byteLength\":");
+ append(json, size_t(compressed_size));
+ append(json, ",\"byteStride\":");
+ append(json, stride);
+ append(json, ",\"mode\":");
append(json, size_t(compression));
append(json, ",\"count\":");
append(json, count);
- append(json, ",\"byteStride\":");
- append(json, stride);
append(json, "}}");
}
append(json, "}");
@@ -1961,7 +2040,7 @@ float getDelta(const Attr& l, const Attr& r, cgltf_animation_path_type type)
}
}
-bool isTrackConstant(const cgltf_animation_sampler& sampler, cgltf_animation_path_type type, cgltf_node* target_node)
+bool isTrackConstant(const cgltf_animation_sampler& sampler, cgltf_animation_path_type type, cgltf_node* target_node, Attr* out_first = 0)
{
const float tolerance = 1e-3f;
@@ -1972,15 +2051,16 @@ bool isTrackConstant(const cgltf_animation_sampler& sampler, cgltf_animation_pat
assert(sampler.input->count * value_stride * components == sampler.output->count);
+ std::vector<Attr> output;
+ readAccessor(output, sampler.output);
+
for (size_t j = 0; j < components; ++j)
{
- Attr first = {};
- cgltf_accessor_read_float(sampler.output, j * value_stride + value_offset, first.f, 4);
+ Attr first = output[j * value_stride + value_offset];
for (size_t i = 1; i < sampler.input->count; ++i)
{
- Attr attr = {};
- cgltf_accessor_read_float(sampler.output, (i * components + j) * value_stride + value_offset, attr.f, 4);
+ const Attr& attr = output[(i * components + j) * value_stride + value_offset];
if (getDelta(first, attr, type) > tolerance)
return false;
@@ -1992,8 +2072,7 @@ bool isTrackConstant(const cgltf_animation_sampler& sampler, cgltf_animation_pat
{
for (int k = 0; k < 2; ++k)
{
- Attr t = {};
- cgltf_accessor_read_float(sampler.output, (i * components + j) * 3 + k * 2, t.f, 4);
+ const Attr& t = output[(i * components + j) * 3 + k * 2];
float error = fabsf(t.f[0]) + fabsf(t.f[1]) + fabsf(t.f[2]) + fabsf(t.f[3]);
@@ -2004,6 +2083,9 @@ bool isTrackConstant(const cgltf_animation_sampler& sampler, cgltf_animation_pat
}
}
+ if (out_first)
+ *out_first = output[value_offset];
+
return true;
}
@@ -2093,6 +2175,11 @@ void resampleKeyframes(std::vector<Attr>& data, const cgltf_animation_sampler& s
{
size_t components = (type == cgltf_animation_path_type_weights) ? target_node->mesh->primitives[0].targets_count : 1;
+ std::vector<float> input;
+ readAccessor(input, sampler.input);
+ std::vector<Attr> output;
+ readAccessor(output, sampler.output);
+
size_t cursor = 0;
for (int i = 0; i < frames; ++i)
@@ -2101,8 +2188,7 @@ void resampleKeyframes(std::vector<Attr>& data, const cgltf_animation_sampler& s
while (cursor + 1 < sampler.input->count)
{
- float next_time = 0;
- cgltf_accessor_read_float(sampler.input, cursor + 1, &next_time, 1);
+ float next_time = input[cursor + 1];
if (next_time > time)
break;
@@ -2112,10 +2198,8 @@ void resampleKeyframes(std::vector<Attr>& data, const cgltf_animation_sampler& s
if (cursor + 1 < sampler.input->count)
{
- float cursor_time = 0;
- float next_time = 0;
- cgltf_accessor_read_float(sampler.input, cursor + 0, &cursor_time, 1);
- cgltf_accessor_read_float(sampler.input, cursor + 1, &next_time, 1);
+ float cursor_time = input[cursor + 0];
+ float next_time = input[cursor + 1];
float range = next_time - cursor_time;
float inv_range = (range == 0.f) ? 0.f : 1.f / (next_time - cursor_time);
@@ -2127,32 +2211,25 @@ void resampleKeyframes(std::vector<Attr>& data, const cgltf_animation_sampler& s
{
case cgltf_interpolation_type_linear:
{
- Attr v0 = {};
- Attr v1 = {};
- cgltf_accessor_read_float(sampler.output, (cursor + 0) * components + j, v0.f, 4);
- cgltf_accessor_read_float(sampler.output, (cursor + 1) * components + j, v1.f, 4);
+ const Attr& v0 = output[(cursor + 0) * components + j];
+ const Attr& v1 = output[(cursor + 1) * components + j];
data.push_back(interpolateLinear(v0, v1, t, type));
}
break;
case cgltf_interpolation_type_step:
{
- Attr v = {};
- cgltf_accessor_read_float(sampler.output, cursor * components + j, v.f, 4);
+ const Attr& v = output[cursor * components + j];
data.push_back(v);
}
break;
case cgltf_interpolation_type_cubic_spline:
{
- Attr v0 = {};
- Attr b0 = {};
- Attr a1 = {};
- Attr v1 = {};
- cgltf_accessor_read_float(sampler.output, (cursor * 3 + 1) * components + j, v0.f, 4);
- cgltf_accessor_read_float(sampler.output, (cursor * 3 + 2) * components + j, b0.f, 4);
- cgltf_accessor_read_float(sampler.output, (cursor * 3 + 3) * components + j, a1.f, 4);
- cgltf_accessor_read_float(sampler.output, (cursor * 3 + 4) * components + j, v1.f, 4);
+ const Attr& v0 = output[(cursor * 3 + 1) * components + j];
+ const Attr& b0 = output[(cursor * 3 + 2) * components + j];
+ const Attr& a1 = output[(cursor * 3 + 3) * components + j];
+ const Attr& v1 = output[(cursor * 3 + 4) * components + j];
data.push_back(interpolateHermite(v0, b0, v1, a1, t, range, type));
}
break;
@@ -2168,8 +2245,7 @@ void resampleKeyframes(std::vector<Attr>& data, const cgltf_animation_sampler& s
for (size_t j = 0; j < components; ++j)
{
- Attr v = {};
- cgltf_accessor_read_float(sampler.output, offset * components + j, v.f, 4);
+ const Attr& v = output[offset * components + j];
data.push_back(v);
}
}
@@ -2193,8 +2269,15 @@ void markAnimated(cgltf_data* data, std::vector<NodeInfo>& nodes)
NodeInfo& ni = nodes[channel.target_node - data->nodes];
// mark nodes that have animation tracks that change their base transform as animated
- if (!isTrackConstant(sampler, channel.target_path, channel.target_node))
+ Attr first = {};
+ if (!isTrackConstant(sampler, channel.target_path, channel.target_node, &first))
+ {
+ ni.animated_paths |= (1 << channel.target_path);
+ }
+ else if (channel.target_path == cgltf_animation_path_type_weights)
{
+ // we currently preserve constant weight tracks because the usecase is very rare and
+ // isTrackConstant doesn't return the full set of weights to compare against
ni.animated_paths |= (1 << channel.target_path);
}
else
@@ -2212,12 +2295,10 @@ void markAnimated(cgltf_data* data, std::vector<NodeInfo>& nodes)
case cgltf_animation_path_type_scale:
memcpy(base.f, channel.target_node->scale, 3 * sizeof(float));
break;
- default:;
+ default:
+ assert(!"Unknown target path");
}
- Attr first = {};
- cgltf_accessor_read_float(sampler.output, 0, first.f, 4);
-
const float tolerance = 1e-3f;
if (getDelta(base, first, channel.target_path) > tolerance)
@@ -2896,6 +2977,53 @@ void writeLight(std::string& json, const cgltf_light& light)
append(json, "}");
}
+void finalizeBufferViews(std::string& json, std::vector<BufferView>& views, std::string& bin, std::string& fallback)
+{
+ for (size_t i = 0; i < views.size(); ++i)
+ {
+ BufferView& view = views[i];
+
+ size_t bin_offset = bin.size();
+ size_t fallback_offset = fallback.size();
+
+ size_t count = view.data.size() / view.stride;
+
+ int compression = -1;
+
+ if (view.compressed)
+ {
+ if (view.kind == BufferView::Kind_Index)
+ {
+ compressIndexStream(bin, view.data, count, view.stride);
+ compression = 1;
+ }
+ else
+ {
+ compressVertexStream(bin, view.data, count, view.stride);
+ compression = 0;
+ }
+
+ fallback += view.data;
+ }
+ else
+ {
+ bin += view.data;
+ }
+
+ size_t raw_offset = (compression >= 0) ? fallback_offset : bin_offset;
+
+ comma(json);
+ writeBufferView(json, view.kind, count, view.stride, raw_offset, view.data.size(), compression, bin_offset, bin.size() - bin_offset);
+
+ // record written bytes for statistics
+ view.bytes = bin.size() - bin_offset;
+
+ // align each bufferView by 4 bytes
+ bin.resize((bin.size() + 3) & ~3);
+ fallback.resize((fallback.size() + 3) & ~3);
+ }
+}
+
void printMeshStats(const std::vector<Mesh>& meshes, const char* name)
{
size_t triangles = 0;
@@ -2952,7 +3080,7 @@ void printAttributeStats(const std::vector<BufferView>& views, BufferView::Kind
}
}
-void process(cgltf_data* data, std::vector<Mesh>& meshes, const Settings& settings, std::string& json, std::string& bin)
+void process(cgltf_data* data, std::vector<Mesh>& meshes, const Settings& settings, std::string& json, std::string& bin, std::string& fallback)
{
if (settings.verbose)
{
@@ -3017,6 +3145,7 @@ void process(cgltf_data* data, std::vector<Mesh>& meshes, const Settings& settin
reindexMesh(mesh);
simplifyMesh(mesh, settings.simplify_threshold, settings.simplify_aggressive);
optimizeMesh(mesh);
+ sortBoneInfluences(mesh);
break;
default:
@@ -3342,7 +3471,7 @@ void process(cgltf_data* data, std::vector<Mesh>& meshes, const Settings& settin
append(json, "\"KHR_lights_punctual\"");
}
append(json, "]");
- if (settings.compress)
+ if (settings.compress && !settings.fallback)
{
append(json, ",\"extensionsRequired\":[");
// Note: ideally we should include MESHOPT_quantized_geometry in the required extension list (regardless of compression)
@@ -3353,47 +3482,13 @@ void process(cgltf_data* data, std::vector<Mesh>& meshes, const Settings& settin
append(json, "]");
}
- size_t bytes[BufferView::Kind_Count] = {};
-
if (!views.empty())
{
- append(json, ",\"bufferViews\":[");
- for (size_t i = 0; i < views.size(); ++i)
- {
- BufferView& view = views[i];
-
- size_t offset = bin.size();
- size_t count = view.data.size() / view.stride;
-
- int compression = -1;
-
- if (view.compressed)
- {
- if (view.kind == BufferView::Kind_Index)
- {
- compressIndexStream(bin, view.data, count, view.stride);
- compression = 1;
- }
- else
- {
- compressVertexStream(bin, view.data, count, view.stride);
- compression = 0;
- }
- }
- else
- {
- bin += view.data;
- }
+ std::string json_views;
+ finalizeBufferViews(json_views, views, bin, fallback);
- comma(json);
- writeBufferView(json, view.kind, count, view.stride, offset, bin.size() - offset, compression);
-
- view.bytes = bin.size() - offset;
- bytes[view.kind] += view.bytes;
-
- // align each bufferView by 4 bytes
- bin.resize((bin.size() + 3) & ~3);
- }
+ append(json, ",\"bufferViews\":[");
+ append(json, json_views);
append(json, "]");
}
if (!json_accessors.empty())
@@ -3466,6 +3561,14 @@ void process(cgltf_data* data, std::vector<Mesh>& meshes, const Settings& settin
if (settings.verbose)
{
+ size_t bytes[BufferView::Kind_Count] = {};
+
+ for (size_t i = 0; i < views.size(); ++i)
+ {
+ BufferView& view = views[i];
+ bytes[view.kind] += view.bytes;
+ }
+
printf("output: %d nodes, %d meshes (%d primitives), %d materials\n", int(node_offset), int(mesh_offset), int(meshes.size()), int(material_offset));
printf("output: JSON %d bytes, buffers %d bytes\n", int(json.size()), int(bin.size()));
printf("output: buffers: vertex %d bytes, index %d bytes, skin %d bytes, time %d bytes, keyframe %d bytes, image %d bytes\n",
@@ -3495,6 +3598,56 @@ bool requiresExtension(cgltf_data* data, const char* name)
return false;
}
+const char* getBaseName(const char* path)
+{
+ const char* slash = strrchr(path, '/');
+ const char* backslash = strrchr(path, '\\');
+
+ const char* rs = slash ? slash + 1 : path;
+ const char* bs = backslash ? backslash + 1 : path;
+
+ return std::max(rs, bs);
+}
+
+std::string getBufferSpec(const char* bin_path, size_t bin_size, const char* fallback_path, size_t fallback_size, bool fallback_ref)
+{
+ std::string json;
+ append(json, "\"buffers\":[");
+ append(json, "{");
+ if (bin_path)
+ {
+ append(json, "\"uri\":\"");
+ append(json, bin_path);
+ append(json, "\"");
+ }
+ comma(json);
+ append(json, "\"byteLength\":");
+ append(json, bin_size);
+ append(json, "}");
+ if (fallback_ref)
+ {
+ comma(json);
+ append(json, "{");
+ if (fallback_path)
+ {
+ append(json, "\"uri\":\"");
+ append(json, fallback_path);
+ append(json, "\"");
+ }
+ comma(json);
+ append(json, "\"byteLength\":");
+ append(json, fallback_size);
+ append(json, ",\"extensions\":{");
+ append(json, "\"MESHOPT_compression\":{");
+ append(json, "\"fallback\":true");
+ append(json, "}}");
+ append(json, "}");
+ }
+ append(json, "]");
+
+ return json;
+}
+
int gltfpack(const char* input, const char* output, const Settings& settings)
{
cgltf_data* data = 0;
@@ -3549,8 +3702,8 @@ int gltfpack(const char* input, const char* output, const Settings& settings)
return 2;
}
- std::string json, bin;
- process(data, meshes, settings, json, bin);
+ std::string json, bin, fallback;
+ process(data, meshes, settings, json, bin, fallback);
cgltf_free(data);
@@ -3566,41 +3719,52 @@ int gltfpack(const char* input, const char* output, const Settings& settings)
std::string binpath = output;
binpath.replace(binpath.size() - 5, 5, ".bin");
- std::string binname = binpath;
- std::string::size_type slash = binname.find_last_of("/\\");
- if (slash != std::string::npos)
- binname.erase(0, slash + 1);
+ std::string fbpath = output;
+ fbpath.replace(fbpath.size() - 5, 5, ".fallback.bin");
FILE* outjson = fopen(output, "wb");
FILE* outbin = fopen(binpath.c_str(), "wb");
- if (!outjson || !outbin)
+ FILE* outfb = settings.fallback ? fopen(fbpath.c_str(), "wb") : NULL;
+ if (!outjson || !outbin || (!outfb && settings.fallback))
{
fprintf(stderr, "Error saving %s\n", output);
return 4;
}
- fprintf(outjson, "{\"buffers\":[{\"uri\":\"%s\",\"byteLength\":%zu}],", binname.c_str(), bin.size());
+ std::string bufferspec = getBufferSpec(getBaseName(binpath.c_str()), bin.size(), settings.fallback ? getBaseName(fbpath.c_str()) : NULL, fallback.size(), settings.compress);
+
+ fprintf(outjson, "{");
+ fwrite(bufferspec.c_str(), bufferspec.size(), 1, outjson);
+ fprintf(outjson, ",");
fwrite(json.c_str(), json.size(), 1, outjson);
fprintf(outjson, "}");
fwrite(bin.c_str(), bin.size(), 1, outbin);
+ if (settings.fallback)
+ fwrite(fallback.c_str(), fallback.size(), 1, outfb);
+
fclose(outjson);
fclose(outbin);
+ if (outfb)
+ fclose(outfb);
}
else if (oext && (strcmp(oext, ".glb") == 0 || strcmp(oext, ".GLB") == 0))
{
+ std::string fbpath = output;
+ fbpath.replace(fbpath.size() - 4, 4, ".fallback.bin");
+
FILE* out = fopen(output, "wb");
- if (!out)
+ FILE* outfb = settings.fallback ? fopen(fbpath.c_str(), "wb") : NULL;
+ if (!out || (!outfb && settings.fallback))
{
fprintf(stderr, "Error saving %s\n", output);
return 4;
}
- char bufferspec[64];
- sprintf(bufferspec, "{\"buffers\":[{\"byteLength\":%zu}],", bin.size());
+ std::string bufferspec = getBufferSpec(NULL, bin.size(), settings.fallback ? getBaseName(fbpath.c_str()) : NULL, fallback.size(), settings.compress);
- json.insert(0, bufferspec);
+ json.insert(0, "{" + bufferspec + ",");
json.push_back('}');
while (json.size() % 4)
@@ -3621,7 +3785,12 @@ int gltfpack(const char* input, const char* output, const Settings& settings)
writeU32(out, 0x004E4942);
fwrite(bin.c_str(), bin.size(), 1, out);
+ if (settings.fallback)
+ fwrite(fallback.c_str(), fallback.size(), 1, outfb);
+
fclose(out);
+ if (outfb)
+ fclose(outfb);
}
else
{
@@ -3698,6 +3867,11 @@ int main(int argc, char** argv)
{
settings.compress = true;
}
+ else if (strcmp(arg, "-cf") == 0)
+ {
+ settings.compress = true;
+ settings.fallback = true;
+ }
else if (strcmp(arg, "-v") == 0)
{
settings.verbose = 1;
@@ -3749,7 +3923,8 @@ int main(int argc, char** argv)
fprintf(stderr, "-kn: keep named nodes and meshes attached to named nodes so that named nodes can be transformed externally\n");
fprintf(stderr, "-si R: simplify meshes to achieve the ratio R (default: 1; R should be between 0 and 1)\n");
fprintf(stderr, "-sa: aggressively simplify to the target ratio disregarding quality\n");
- fprintf(stderr, "-c: produce compressed glb files\n");
+ fprintf(stderr, "-c: produce compressed gltf/glb files\n");
+ fprintf(stderr, "-cf: produce compressed gltf/glb files with fallback for loaders that don't support compression\n");
fprintf(stderr, "-v: verbose output\n");
fprintf(stderr, "-h: display this help and exit\n");
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/tools/vcachetuner.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/tools/vcachetuner.cpp
index 22d32fd8926..8a4b2794f72 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/tools/vcachetuner.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/tools/vcachetuner.cpp
@@ -1,5 +1,6 @@
#include "../src/meshoptimizer.h"
#include "fast_obj.h"
+#include "../demo/miniz.h"
#include <algorithm>
#include <functional>
@@ -19,12 +20,19 @@ extern thread_local float kVertexScoreTableCache[1 + kCacheSizeMax];
extern thread_local float kVertexScoreTableLive[1 + kValenceMax];
} // namespace meshopt
-struct { int cache, warp, triangle; } profiles[] =
+struct Profile
{
- {14, 64, 128}, // AMD GCN
- {32, 32, 32}, // NVidia Pascal
- // { 16, 32, 32 }, // NVidia Kepler, Maxwell
- // { 128, 0, 0 }, // Intel
+ float weight;
+ int cache, warp, triangle; // vcache tuning parameters
+};
+
+Profile profiles[] =
+{
+ {1.f, 0, 0, 0}, // Compression
+ {1.f, 14, 64, 128}, // AMD GCN
+ {1.f, 32, 32, 32}, // NVidia Pascal
+ // {1.f, 16, 32, 32}, // NVidia Kepler, Maxwell
+ // {1.f, 128, 0, 0}, // Intel
};
const int Profile_Count = sizeof(profiles) / sizeof(profiles[0]);
@@ -69,16 +77,20 @@ struct State
struct Mesh
{
+ const char* name;
+
size_t vertex_count;
std::vector<unsigned int> indices;
- float atvr_base[Profile_Count];
+ float metric_base[Profile_Count];
};
Mesh gridmesh(unsigned int N)
{
Mesh result;
+ result.name = "grid";
+
result.vertex_count = (N + 1) * (N + 1);
result.indices.reserve(N * N * 6);
@@ -160,6 +172,8 @@ Mesh objmesh(const char* path)
Mesh result;
+ result.name = path;
+
std::vector<unsigned int> remap(total_indices);
size_t total_vertices = meshopt_generateVertexRemap(&remap[0], NULL, total_indices, &vertices[0], total_indices, sizeof(Vertex));
@@ -172,7 +186,15 @@ Mesh objmesh(const char* path)
return result;
}
-void compute_atvr(const State& state, const Mesh& mesh, float result[Profile_Count])
+template <typename T>
+size_t compress(const std::vector<T>& data)
+{
+ std::vector<unsigned char> cbuf(tdefl_compress_bound(data.size() * sizeof(T)));
+ unsigned int flags = tdefl_create_comp_flags_from_zip_params(MZ_DEFAULT_LEVEL, 15, MZ_DEFAULT_STRATEGY);
+ return tdefl_compress_mem_to_mem(&cbuf[0], cbuf.size(), &data[0], data.size() * sizeof(T), flags);
+}
+
+void compute_metric(const State& state, const Mesh& mesh, float result[Profile_Count])
{
memcpy(meshopt::kVertexScoreTableCache + 1, state.cache, kCacheSizeMax * sizeof(float));
memcpy(meshopt::kVertexScoreTableLive + 1, state.live, kValenceMax * sizeof(float));
@@ -180,9 +202,25 @@ void compute_atvr(const State& state, const Mesh& mesh, float result[Profile_Cou
std::vector<unsigned int> indices(mesh.indices.size());
meshopt_optimizeVertexCache(&indices[0], &mesh.indices[0], mesh.indices.size(), mesh.vertex_count);
+ meshopt_optimizeVertexFetch(NULL, &indices[0], indices.size(), NULL, mesh.vertex_count, 0);
for (int profile = 0; profile < Profile_Count; ++profile)
- result[profile] = meshopt_analyzeVertexCache(&indices[0], indices.size(), mesh.vertex_count, profiles[profile].cache, profiles[profile].warp, profiles[profile].triangle).atvr;
+ {
+ if (profiles[profile].cache)
+ {
+ meshopt_VertexCacheStatistics stats = meshopt_analyzeVertexCache(&indices[0], indices.size(), mesh.vertex_count, profiles[profile].cache, profiles[profile].warp, profiles[profile].triangle);
+ result[profile] = stats.atvr;
+ }
+ else
+ {
+ std::vector<unsigned char> ibuf(meshopt_encodeIndexBufferBound(indices.size(), mesh.vertex_count));
+ ibuf.resize(meshopt_encodeIndexBuffer(&ibuf[0], ibuf.size(), &indices[0], indices.size()));
+
+ size_t csize = compress(ibuf);
+
+ result[profile] = double(csize) / double(indices.size() / 3);
+ }
+ }
}
float fitness_score(const State& state, const std::vector<Mesh>& meshes)
@@ -192,13 +230,13 @@ float fitness_score(const State& state, const std::vector<Mesh>& meshes)
for (auto& mesh : meshes)
{
- float atvr[Profile_Count];
- compute_atvr(state, mesh, atvr);
+ float metric[Profile_Count];
+ compute_metric(state, mesh, metric);
for (int profile = 0; profile < Profile_Count; ++profile)
{
- result += mesh.atvr_base[profile] / atvr[profile];
- count += 1;
+ result += mesh.metric_base[profile] / metric[profile] * profiles[profile].weight;
+ count += profiles[profile].weight;
}
}
@@ -348,10 +386,32 @@ void dump_state(const State& state)
printf("\n");
}
-int main(int argc, char** argv)
+void dump_stats(const State& state, const std::vector<Mesh>& meshes)
{
- bool annealing = false;
+ float improvement[Profile_Count] = {};
+ for (size_t i = 0; i < meshes.size(); ++i)
+ {
+ float metric[Profile_Count];
+ compute_metric(state, meshes[i], metric);
+
+ printf(" %s", meshes[i].name);
+ for (int profile = 0; profile < Profile_Count; ++profile)
+ printf(" %f", metric[profile]);
+
+ for (int profile = 0; profile < Profile_Count; ++profile)
+ improvement[profile] += meshes[i].metric_base[profile] / metric[profile];
+ }
+
+ printf("; improvement");
+ for (int profile = 0; profile < Profile_Count; ++profile)
+ printf(" %f", improvement[profile] / float(meshes.size()));
+
+ printf("\n");
+}
+
+int main(int argc, char** argv)
+{
State baseline;
memcpy(baseline.cache, meshopt::kVertexScoreTableCache + 1, kCacheSizeMax * sizeof(float));
memcpy(baseline.live, meshopt::kVertexScoreTableLive + 1, kValenceMax * sizeof(float));
@@ -367,7 +427,7 @@ int main(int argc, char** argv)
for (auto& mesh : meshes)
{
- compute_atvr(baseline, mesh, mesh.atvr_base);
+ compute_metric(baseline, mesh, mesh.metric_base);
total_triangles += mesh.indices.size() / 3;
}
@@ -386,29 +446,22 @@ int main(int argc, char** argv)
printf("%d meshes, %.1fM triangles\n", int(meshes.size()), double(total_triangles) / 1e6);
- float atvr_0[Profile_Count];
- float atvr_N[Profile_Count];
- compute_atvr(baseline, meshes[0], atvr_0);
- compute_atvr(baseline, meshes.back(), atvr_N);
-
- printf("baseline: grid %f %f %s %f %f\n", atvr_0[0], atvr_0[1], argv[argc - 1], atvr_N[0], atvr_N[1]);
+ printf("baseline:");
+ dump_stats(baseline, meshes);
for (;;)
{
auto best = genN(pop, meshes);
gen++;
- compute_atvr(best.first, meshes[0], atvr_0);
- compute_atvr(best.first, meshes.back(), atvr_N);
-
- printf("%d: fitness %f; grid %f %f %s %f %f\n", int(gen), best.second, atvr_0[0], atvr_0[1], argv[argc - 1], atvr_N[0], atvr_N[1]);
-
- if (gen % 100 == 0)
+ if (gen % 10 == 0)
+ {
+ printf("%d: fitness %f;", int(gen), best.second);
+ dump_stats(best.first, meshes);
+ }
+ else
{
- char buf[128];
- sprintf(buf, "gcloud logging write vcache-log \"fitness %f; grid %f %f %s %f %f\"", best.second, atvr_0[0], atvr_0[1], argv[argc - 1], atvr_N[0], atvr_N[1]);
- int rc = system(buf);
- (void)rc;
+ printf("%d: fitness %f\n", int(gen), best.second);
}
dump_state(best.first);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/.travis.yml b/3rdparty/bgfx/3rdparty/spirv-cross/.travis.yml
index ed97f9f5b1a..575262531db 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/.travis.yml
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/.travis.yml
@@ -27,14 +27,14 @@ matrix:
- os: windows
before_install:
- choco install python3
- - export PATH="/c/Python37:/c/Python37/Scripts:$PATH"
+ - export PATH="/c/Python38:/c/Python38/Scripts:$PATH"
env:
- GENERATOR="Visual Studio 15 2017"
- ARTIFACT=vs2017-32bit
- os: windows
before_install:
- choco install python3
- - export PATH="/c/Python37:/c/Python37/Scripts:$PATH"
+ - export PATH="/c/Python38:/c/Python38/Scripts:$PATH"
env:
- GENERATOR="Visual Studio 15 2017 Win64"
- ARTIFACT=vs2017-64bit
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/CMakeLists.txt b/3rdparty/bgfx/3rdparty/spirv-cross/CMakeLists.txt
index b2b9b042725..5a9f62763f2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/CMakeLists.txt
@@ -308,7 +308,7 @@ if (SPIRV_CROSS_STATIC)
endif()
set(spirv-cross-abi-major 0)
-set(spirv-cross-abi-minor 18)
+set(spirv-cross-abi-minor 20)
set(spirv-cross-abi-patch 0)
if (SPIRV_CROSS_SHARED)
@@ -565,6 +565,16 @@ if (SPIRV_CROSS_CLI)
${spirv-cross-externals}
${CMAKE_CURRENT_SOURCE_DIR}/shaders-reflection
WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
+ add_test(NAME spirv-cross-test-ue4
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --msl --parallel
+ ${spirv-cross-externals}
+ ${CMAKE_CURRENT_SOURCE_DIR}/shaders-ue4
+ WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
+ add_test(NAME spirv-cross-test-ue4-opt
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --msl --opt --parallel
+ ${spirv-cross-externals}
+ ${CMAKE_CURRENT_SOURCE_DIR}/shaders-ue4
+ WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
endif()
elseif(NOT ${PYTHONINTERP_FOUND})
message(WARNING "Testing disabled. Could not find python3. If you have python3 installed try running "
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/gn/BUILD.gn b/3rdparty/bgfx/3rdparty/spirv-cross/gn/BUILD.gn
new file mode 100644
index 00000000000..8458c1a7039
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/gn/BUILD.gn
@@ -0,0 +1,63 @@
+# Copyright (C) 2019 Google, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+config("spirv_cross_public") {
+ include_dirs = [ ".." ]
+
+ defines = [ "SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS" ]
+}
+
+source_set("spirv_cross_sources") {
+ public_configs = [ ":spirv_cross_public" ]
+
+ sources = [
+ "../GLSL.std.450.h",
+ "../spirv.hpp",
+ "../spirv_cfg.cpp",
+ "../spirv_cfg.hpp",
+ "../spirv_common.hpp",
+ "../spirv_cross.cpp",
+ "../spirv_cross.hpp",
+ "../spirv_cross_containers.hpp",
+ "../spirv_cross_error_handling.hpp",
+ "../spirv_cross_parsed_ir.cpp",
+ "../spirv_cross_parsed_ir.hpp",
+ "../spirv_cross_util.cpp",
+ "../spirv_cross_util.hpp",
+ "../spirv_glsl.cpp",
+ "../spirv_glsl.hpp",
+ "../spirv_msl.cpp",
+ "../spirv_msl.hpp",
+ "../spirv_parser.cpp",
+ "../spirv_parser.hpp",
+ "../spirv_reflect.cpp",
+ "../spirv_reflect.hpp",
+ ]
+
+ cflags = [ "-fno-exceptions" ]
+
+ if (is_clang) {
+ cflags_cc = [
+ "-Wno-extra-semi",
+ "-Wno-ignored-qualifiers",
+ "-Wno-implicit-fallthrough",
+ "-Wno-inconsistent-missing-override",
+ "-Wno-missing-field-initializers",
+ "-Wno-newline-eof",
+ "-Wno-sign-compare",
+ "-Wno-unused-variable",
+ ]
+ }
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/main.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/main.cpp
index b05e8126429..711b0ff1915 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/main.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/main.cpp
@@ -514,6 +514,9 @@ struct CLIArguments
bool msl_domain_lower_left = false;
bool msl_argument_buffers = false;
bool msl_texture_buffer_native = false;
+ bool msl_framebuffer_fetch = false;
+ bool msl_invariant_float_math = false;
+ bool msl_emulate_cube_array = false;
bool msl_multiview = false;
bool msl_view_index_from_device_index = false;
bool msl_dispatch_base = false;
@@ -522,6 +525,7 @@ struct CLIArguments
bool vulkan_glsl_disable_ext_samplerless_texture_functions = false;
bool emit_line_directives = false;
SmallVector<uint32_t> msl_discrete_descriptor_sets;
+ SmallVector<uint32_t> msl_device_argument_buffers;
SmallVector<pair<uint32_t, uint32_t>> msl_dynamic_buffers;
SmallVector<PLSArg> pls_in;
SmallVector<PLSArg> pls_out;
@@ -597,7 +601,10 @@ static void print_help()
"\t[--msl-domain-lower-left]\n"
"\t[--msl-argument-buffers]\n"
"\t[--msl-texture-buffer-native]\n"
+ "\t[--msl-framebuffer-fetch]\n"
+ "\t[--msl-emulate-cube-array]\n"
"\t[--msl-discrete-descriptor-set <index>]\n"
+ "\t[--msl-device-argument-buffer <index>]\n"
"\t[--msl-multiview]\n"
"\t[--msl-view-index-from-device-index]\n"
"\t[--msl-dispatch-base]\n"
@@ -754,8 +761,13 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
msl_opts.msl_version = args.msl_version;
msl_opts.capture_output_to_buffer = args.msl_capture_output_to_buffer;
msl_opts.swizzle_texture_samples = args.msl_swizzle_texture_samples;
+ msl_opts.invariant_float_math = args.msl_invariant_float_math;
if (args.msl_ios)
+ {
msl_opts.platform = CompilerMSL::Options::iOS;
+ msl_opts.ios_use_framebuffer_fetch_subpasses = args.msl_framebuffer_fetch;
+ msl_opts.emulate_cube_array = args.msl_emulate_cube_array;
+ }
msl_opts.pad_fragment_output_components = args.msl_pad_fragment_output;
msl_opts.tess_domain_origin_lower_left = args.msl_domain_lower_left;
msl_opts.argument_buffers = args.msl_argument_buffers;
@@ -766,6 +778,8 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
msl_comp->set_msl_options(msl_opts);
for (auto &v : args.msl_discrete_descriptor_sets)
msl_comp->add_discrete_descriptor_set(v);
+ for (auto &v : args.msl_device_argument_buffers)
+ msl_comp->set_argument_buffer_device_address_space(v, true);
uint32_t i = 0;
for (auto &v : args.msl_dynamic_buffers)
msl_comp->add_dynamic_buffer(v.first, v.second, i++);
@@ -1086,7 +1100,12 @@ static int main_inner(int argc, char *argv[])
cbs.add("--msl-argument-buffers", [&args](CLIParser &) { args.msl_argument_buffers = true; });
cbs.add("--msl-discrete-descriptor-set",
[&args](CLIParser &parser) { args.msl_discrete_descriptor_sets.push_back(parser.next_uint()); });
+ cbs.add("--msl-device-argument-buffer",
+ [&args](CLIParser &parser) { args.msl_device_argument_buffers.push_back(parser.next_uint()); });
cbs.add("--msl-texture-buffer-native", [&args](CLIParser &) { args.msl_texture_buffer_native = true; });
+ cbs.add("--msl-framebuffer-fetch", [&args](CLIParser &) { args.msl_framebuffer_fetch = true; });
+ cbs.add("--msl-invariant-float-math", [&args](CLIParser &) { args.msl_invariant_float_math = true; });
+ cbs.add("--msl-emulate-cube-array", [&args](CLIParser &) { args.msl_emulate_cube_array = true; });
cbs.add("--msl-multiview", [&args](CLIParser &) { args.msl_multiview = true; });
cbs.add("--msl-view-index-from-device-index",
[&args](CLIParser &) { args.msl_view_index_from_device_index = true; });
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-hlsl/asm/comp/bitcast_icmp.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-hlsl/asm/comp/bitcast_icmp.asm.comp
new file mode 100644
index 00000000000..35143a486ec
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-hlsl/asm/comp/bitcast_icmp.asm.comp
@@ -0,0 +1,28 @@
+RWByteAddressBuffer _5 : register(u0);
+RWByteAddressBuffer _6 : register(u1);
+
+void comp_main()
+{
+ bool4 _31 = bool4(int(_5.Load4(16).x) < int4(_5.Load4(0)).x, int(_5.Load4(16).y) < int4(_5.Load4(0)).y, int(_5.Load4(16).z) < int4(_5.Load4(0)).z, int(_5.Load4(16).w) < int4(_5.Load4(0)).w);
+ bool4 _32 = bool4(int(_5.Load4(16).x) <= int4(_5.Load4(0)).x, int(_5.Load4(16).y) <= int4(_5.Load4(0)).y, int(_5.Load4(16).z) <= int4(_5.Load4(0)).z, int(_5.Load4(16).w) <= int4(_5.Load4(0)).w);
+ bool4 _33 = bool4(_5.Load4(16).x < uint(int4(_5.Load4(0)).x), _5.Load4(16).y < uint(int4(_5.Load4(0)).y), _5.Load4(16).z < uint(int4(_5.Load4(0)).z), _5.Load4(16).w < uint(int4(_5.Load4(0)).w));
+ bool4 _34 = bool4(_5.Load4(16).x <= uint(int4(_5.Load4(0)).x), _5.Load4(16).y <= uint(int4(_5.Load4(0)).y), _5.Load4(16).z <= uint(int4(_5.Load4(0)).z), _5.Load4(16).w <= uint(int4(_5.Load4(0)).w));
+ bool4 _35 = bool4(int(_5.Load4(16).x) > int4(_5.Load4(0)).x, int(_5.Load4(16).y) > int4(_5.Load4(0)).y, int(_5.Load4(16).z) > int4(_5.Load4(0)).z, int(_5.Load4(16).w) > int4(_5.Load4(0)).w);
+ bool4 _36 = bool4(int(_5.Load4(16).x) >= int4(_5.Load4(0)).x, int(_5.Load4(16).y) >= int4(_5.Load4(0)).y, int(_5.Load4(16).z) >= int4(_5.Load4(0)).z, int(_5.Load4(16).w) >= int4(_5.Load4(0)).w);
+ bool4 _37 = bool4(_5.Load4(16).x > uint(int4(_5.Load4(0)).x), _5.Load4(16).y > uint(int4(_5.Load4(0)).y), _5.Load4(16).z > uint(int4(_5.Load4(0)).z), _5.Load4(16).w > uint(int4(_5.Load4(0)).w));
+ bool4 _38 = bool4(_5.Load4(16).x >= uint(int4(_5.Load4(0)).x), _5.Load4(16).y >= uint(int4(_5.Load4(0)).y), _5.Load4(16).z >= uint(int4(_5.Load4(0)).z), _5.Load4(16).w >= uint(int4(_5.Load4(0)).w));
+ _6.Store4(0, uint4(_31.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _31.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _31.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _31.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+ _6.Store4(0, uint4(_32.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _32.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _32.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _32.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+ _6.Store4(0, uint4(_33.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _33.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _33.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _33.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+ _6.Store4(0, uint4(_34.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _34.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _34.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _34.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+ _6.Store4(0, uint4(_35.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _35.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _35.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _35.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+ _6.Store4(0, uint4(_36.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _36.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _36.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _36.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+ _6.Store4(0, uint4(_37.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _37.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _37.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _37.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+ _6.Store4(0, uint4(_38.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _38.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _38.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _38.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+}
+
+[numthreads(1, 1, 1)]
+void main()
+{
+ comp_main();
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-hlsl/comp/atomic-decrement.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-hlsl/comp/atomic-decrement.asm.comp
deleted file mode 100644
index b86b5327e7a..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-hlsl/comp/atomic-decrement.asm.comp
+++ /dev/null
@@ -1,22 +0,0 @@
-RWByteAddressBuffer u0_counter : register(u1);
-RWBuffer<uint> u0 : register(u0);
-
-static uint3 gl_GlobalInvocationID;
-struct SPIRV_Cross_Input
-{
- uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
-};
-
-void comp_main()
-{
- uint _29;
- u0_counter.InterlockedAdd(0, -1, _29);
- u0[uint(asint(asfloat(_29))) + 0u] = uint(int(gl_GlobalInvocationID.x)).x;
-}
-
-[numthreads(4, 1, 1)]
-void main(SPIRV_Cross_Input stage_input)
-{
- gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
- comp_main();
-}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-hlsl/comp/atomic-increment.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-hlsl/comp/atomic-increment.asm.comp
deleted file mode 100644
index f2338f22518..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-hlsl/comp/atomic-increment.asm.comp
+++ /dev/null
@@ -1,22 +0,0 @@
-RWByteAddressBuffer u0_counter : register(u1);
-RWBuffer<uint> u0 : register(u0);
-
-static uint3 gl_GlobalInvocationID;
-struct SPIRV_Cross_Input
-{
- uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
-};
-
-void comp_main()
-{
- uint _29;
- u0_counter.InterlockedAdd(0, 1, _29);
- u0[uint(asint(asfloat(_29))) + 0u] = uint(int(gl_GlobalInvocationID.x)).x;
-}
-
-[numthreads(4, 1, 1)]
-void main(SPIRV_Cross_Input stage_input)
-{
- gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
- comp_main();
-}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-decrement.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-decrement.asm.comp
index bbc9a95a9a2..3dc6fffcf8e 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-decrement.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-decrement.asm.comp
@@ -13,7 +13,8 @@ struct u0_counters
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-increment.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-increment.asm.comp
index 5710c910225..6f42bb9d2be 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-increment.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-increment.asm.comp
@@ -13,7 +13,8 @@ struct u0_counters
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/bitcast_icmp.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/bitcast_icmp.asm.comp
new file mode 100644
index 00000000000..31c71daa4b5
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/bitcast_icmp.asm.comp
@@ -0,0 +1,29 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct _3
+{
+ int4 _m0;
+ uint4 _m1;
+};
+
+struct _4
+{
+ uint4 _m0;
+ int4 _m1;
+};
+
+kernel void main0(device _3& restrict _5 [[buffer(0)]], device _4& restrict _6 [[buffer(1)]])
+{
+ _6._m0 = select(uint4(0u), uint4(1u), int4(_5._m1) < _5._m0);
+ _6._m0 = select(uint4(0u), uint4(1u), int4(_5._m1) <= _5._m0);
+ _6._m0 = select(uint4(0u), uint4(1u), _5._m1 < uint4(_5._m0));
+ _6._m0 = select(uint4(0u), uint4(1u), _5._m1 <= uint4(_5._m0));
+ _6._m0 = select(uint4(0u), uint4(1u), int4(_5._m1) > _5._m0);
+ _6._m0 = select(uint4(0u), uint4(1u), int4(_5._m1) >= _5._m0);
+ _6._m0 = select(uint4(0u), uint4(1u), _5._m1 > uint4(_5._m0));
+ _6._m0 = select(uint4(0u), uint4(1u), _5._m1 >= uint4(_5._m0));
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/buffer-write-relative-addr.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/buffer-write-relative-addr.asm.comp
index d8998bd20dd..bb51fd7b1c6 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/buffer-write-relative-addr.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/buffer-write-relative-addr.asm.comp
@@ -11,7 +11,8 @@ struct cb5_struct
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/buffer-write.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/buffer-write.asm.comp
index c4a0476c323..8c9e23aa06d 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/buffer-write.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/buffer-write.asm.comp
@@ -11,7 +11,8 @@ struct cb
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag
index 030fbb04b9a..726976631ac 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag
@@ -1,82 +1,67 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
-constant float _46[16] = { 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0 };
-constant float4 _76[4] = { float4(0.0), float4(1.0), float4(8.0), float4(5.0) };
-constant float4 _90[4] = { float4(20.0), float4(30.0), float4(50.0), float4(60.0) };
-
-struct main0_out
-{
- float FragColor [[color(0)]];
-};
-
-struct main0_in
-{
- int index [[user(locn0)]];
-};
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
+template<typename T, size_t Num>
+struct spvUnsafeArray
{
- for (uint i = 0; i < A; i++)
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const thread T& operator [] (size_t pos) const thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ device T& operator [] (size_t pos) device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const device T& operator [] (size_t pos) const device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ constexpr const constant T& operator [] (size_t pos) const constant
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ threadgroup T& operator [] (size_t pos) threadgroup
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+constant spvUnsafeArray<float, 16> _46 = spvUnsafeArray<float, 16>({ 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0 });
+constant spvUnsafeArray<float4, 4> _76 = spvUnsafeArray<float4, 4>({ float4(0.0), float4(1.0), float4(8.0), float4(5.0) });
+constant spvUnsafeArray<float4, 4> _90 = spvUnsafeArray<float4, 4>({ float4(20.0), float4(30.0), float4(50.0), float4(60.0) });
+
+struct main0_out
+{
+ float FragColor [[color(0)]];
+};
+
+struct main0_in
+{
+ int index [[user(locn0)]];
+};
fragment main0_out main0(main0_in in [[stage_in]])
{
- float4 foobar[4] = { float4(0.0), float4(1.0), float4(8.0), float4(5.0) };
- float4 baz[4] = { float4(0.0), float4(1.0), float4(8.0), float4(5.0) };
+ spvUnsafeArray<float4, 4> foobar = spvUnsafeArray<float4, 4>({ float4(0.0), float4(1.0), float4(8.0), float4(5.0) });
+ spvUnsafeArray<float4, 4> baz = spvUnsafeArray<float4, 4>({ float4(0.0), float4(1.0), float4(8.0), float4(5.0) });
main0_out out = {};
out.FragColor = _46[in.index];
if (in.index < 10)
@@ -102,7 +87,7 @@ fragment main0_out main0(main0_in in [[stage_in]])
}
int _37 = in.index & 3;
out.FragColor += foobar[_37].z;
- spvArrayCopyFromConstantToStack1(baz, _90);
+ baz = _90;
out.FragColor += baz[_37].z;
return out;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/single-function-private-lut.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/single-function-private-lut.asm.frag
index 7d1ab8658b0..4c0ea901dd3 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/single-function-private-lut.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/single-function-private-lut.asm.frag
@@ -1,17 +1,54 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct myType
{
float data;
};
-constant myType _21[5] = { myType{ 0.0 }, myType{ 1.0 }, myType{ 0.0 }, myType{ 1.0 }, myType{ 0.0 } };
-
struct main0_out
{
float4 o_color [[color(0)]];
@@ -26,6 +63,8 @@ inline Tx mod(Tx x, Ty y)
fragment main0_out main0(float4 gl_FragCoord [[position]])
{
+ spvUnsafeArray<myType, 5> _21 = spvUnsafeArray<myType, 5>({ myType{ 0.0 }, myType{ 1.0 }, myType{ 0.0 }, myType{ 1.0 }, myType{ 0.0 } });
+
main0_out out = {};
if (_21[int(mod(gl_FragCoord.x, 4.0))].data > 0.0)
{
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/storage-class-output-initializer.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/storage-class-output-initializer.asm.frag
index 1bafc6953ba..d59013daaf8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/storage-class-output-initializer.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/storage-class-output-initializer.asm.frag
@@ -1,9 +1,50 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
-constant float4 _20[2] = { float4(1.0, 2.0, 3.0, 4.0), float4(10.0) };
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+constant spvUnsafeArray<float4, 2> _20 = spvUnsafeArray<float4, 2>({ float4(1.0, 2.0, 3.0, 4.0), float4(10.0) });
struct main0_out
{
@@ -15,7 +56,7 @@ struct main0_out
fragment main0_out main0()
{
main0_out out = {};
- float4 FragColors[2] = { float4(1.0, 2.0, 3.0, 4.0), float4(10.0) };
+ spvUnsafeArray<float4, 2> FragColors = spvUnsafeArray<float4, 2>({ float4(1.0, 2.0, 3.0, 4.0), float4(10.0) });
out.FragColor = float4(5.0);
out.FragColors_0 = FragColors[0];
out.FragColors_1 = FragColors[1];
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/texture-atomics.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/texture-atomics.asm.frag
new file mode 100644
index 00000000000..ab5be649849
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/texture-atomics.asm.frag
@@ -0,0 +1,121 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+#pragma clang diagnostic ignored "-Wunused-variable"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+#include <metal_atomic>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_StructuredBuffer_v4float
+{
+ spvUnsafeArray<float4, 1> _m0;
+};
+
+struct type_Globals
+{
+ uint2 ShadowTileListGroupSize;
+};
+
+constant float3 _70 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+struct main0_in
+{
+ uint in_var_TEXCOORD0 [[user(locn0)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], const device type_StructuredBuffer_v4float& CulledObjectBoxBounds [[buffer(0)]], constant type_Globals& _Globals [[buffer(1)]], texture2d<uint> RWShadowTileNumCulledObjects [[texture(2)]], device atomic_uint* RWShadowTileNumCulledObjects_atomic [[buffer(2)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ uint2 _77 = uint2(gl_FragCoord.xy);
+ uint _78 = _77.y;
+ uint _83 = _77.x;
+ float2 _91 = float2(float(_83), float((_Globals.ShadowTileListGroupSize.y - 1u) - _78));
+ float2 _93 = float2(_Globals.ShadowTileListGroupSize);
+ float2 _96 = ((_91 / _93) * float2(2.0)) - float2(1.0);
+ float2 _100 = (((_91 + float2(1.0)) / _93) * float2(2.0)) - float2(1.0);
+ float3 _102 = float3(_100.x, _100.y, _70.z);
+ _102.z = 1.0;
+ uint _103 = in.in_var_TEXCOORD0 * 5u;
+ uint _107 = _103 + 1u;
+ if (all(CulledObjectBoxBounds._m0[_107].xy > _96.xy) && all(CulledObjectBoxBounds._m0[_103].xyz < _102))
+ {
+ float _122 = _96.x;
+ float _123 = _96.y;
+ spvUnsafeArray<float3, 8> _73;
+ _73[0] = float3(_122, _123, -1000.0);
+ float _126 = _100.x;
+ _73[1] = float3(_126, _123, -1000.0);
+ float _129 = _100.y;
+ _73[2] = float3(_122, _129, -1000.0);
+ _73[3] = float3(_126, _129, -1000.0);
+ _73[4] = float3(_122, _123, 1.0);
+ _73[5] = float3(_126, _123, 1.0);
+ _73[6] = float3(_122, _129, 1.0);
+ _73[7] = float3(_126, _129, 1.0);
+ float3 _155;
+ float3 _158;
+ _155 = float3(-500000.0);
+ _158 = float3(500000.0);
+ for (int _160 = 0; _160 < 8; )
+ {
+ float3 _166 = _73[_160] - (float3(0.5) * (CulledObjectBoxBounds._m0[_103].xyz + CulledObjectBoxBounds._m0[_107].xyz));
+ float3 _170 = float3(dot(_166, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 4u].xyz));
+ _155 = fast::max(_155, _170);
+ _158 = fast::min(_158, _170);
+ _160++;
+ continue;
+ }
+ if (all(_158 < float3(1.0)) && all(_155 > float3(-1.0)))
+ {
+ uint _179 = atomic_fetch_add_explicit((device atomic_uint*)&RWShadowTileNumCulledObjects_atomic[(_78 * _Globals.ShadowTileListGroupSize.x) + _83], 1u, memory_order_relaxed);
+ }
+ }
+ out.out_var_SV_Target0 = float4(0.0);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/texture-atomics.asm.graphics-robust-access.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/texture-atomics.asm.graphics-robust-access.frag
new file mode 100644
index 00000000000..ca5e3eadb70
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/texture-atomics.asm.graphics-robust-access.frag
@@ -0,0 +1,122 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+#pragma clang diagnostic ignored "-Wunused-variable"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+#include <metal_atomic>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_StructuredBuffer_v4float
+{
+ spvUnsafeArray<float4, 1> _m0;
+};
+
+struct type_Globals
+{
+ uint2 ShadowTileListGroupSize;
+};
+
+constant float3 _70 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+struct main0_in
+{
+ uint in_var_TEXCOORD0 [[user(locn0)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], constant uint* spvBufferSizeConstants [[buffer(25)]], const device type_StructuredBuffer_v4float& CulledObjectBoxBounds [[buffer(0)]], constant type_Globals& _Globals [[buffer(1)]], texture2d<uint> RWShadowTileNumCulledObjects [[texture(2)]], device atomic_uint* RWShadowTileNumCulledObjects_atomic [[buffer(2)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ constant uint& CulledObjectBoxBoundsBufferSize = spvBufferSizeConstants[0];
+ uint2 _77 = uint2(gl_FragCoord.xy);
+ uint _78 = _77.y;
+ uint _83 = _77.x;
+ float2 _91 = float2(float(_83), float((_Globals.ShadowTileListGroupSize.y - 1u) - _78));
+ float2 _93 = float2(_Globals.ShadowTileListGroupSize);
+ float2 _96 = ((_91 / _93) * float2(2.0)) - float2(1.0);
+ float2 _100 = (((_91 + float2(1.0)) / _93) * float2(2.0)) - float2(1.0);
+ float3 _102 = float3(_100.x, _100.y, _70.z);
+ _102.z = 1.0;
+ uint _103 = in.in_var_TEXCOORD0 * 5u;
+ uint _186 = clamp(_103 + 1u, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u);
+ if (all(CulledObjectBoxBounds._m0[_186].xy > _96.xy) && all(CulledObjectBoxBounds._m0[clamp(_103, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz < _102))
+ {
+ float _122 = _96.x;
+ float _123 = _96.y;
+ spvUnsafeArray<float3, 8> _73;
+ _73[0] = float3(_122, _123, -1000.0);
+ float _126 = _100.x;
+ _73[1] = float3(_126, _123, -1000.0);
+ float _129 = _100.y;
+ _73[2] = float3(_122, _129, -1000.0);
+ _73[3] = float3(_126, _129, -1000.0);
+ _73[4] = float3(_122, _123, 1.0);
+ _73[5] = float3(_126, _123, 1.0);
+ _73[6] = float3(_122, _129, 1.0);
+ _73[7] = float3(_126, _129, 1.0);
+ float3 _155;
+ float3 _158;
+ _155 = float3(-500000.0);
+ _158 = float3(500000.0);
+ for (int _160 = 0; _160 < 8; )
+ {
+ float3 _166 = _73[int(clamp(uint(_160), uint(0), uint(7)))] - (float3(0.5) * (CulledObjectBoxBounds._m0[clamp(_103, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz + CulledObjectBoxBounds._m0[_186].xyz));
+ float3 _170 = float3(dot(_166, CulledObjectBoxBounds._m0[clamp(_103 + 2u, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz), dot(_166, CulledObjectBoxBounds._m0[clamp(_103 + 3u, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz), dot(_166, CulledObjectBoxBounds._m0[clamp(_103 + 4u, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz));
+ _155 = fast::max(_155, _170);
+ _158 = fast::min(_158, _170);
+ _160++;
+ continue;
+ }
+ if (all(_158 < float3(1.0)) && all(_155 > float3(-1.0)))
+ {
+ uint _179 = atomic_fetch_add_explicit((device atomic_uint*)&RWShadowTileNumCulledObjects_atomic[(_78 * _Globals.ShadowTileListGroupSize.x) + _83], 1u, memory_order_relaxed);
+ }
+ }
+ out.out_var_SV_Target0 = float4(0.0);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc
index a9940940b27..f27ba84cf01 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc
@@ -1,10 +1,49 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct VertexOutput
{
float4 pos;
@@ -33,60 +72,6 @@ struct main0_in
float4 gl_Position [[attribute(1)]];
};
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
{
device main0_out* gl_out = &spvOut[gl_PrimitiveID * 3];
@@ -95,12 +80,12 @@ kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_
threadgroup_barrier(mem_flags::mem_threadgroup);
if (gl_InvocationID >= 3)
return;
- VertexOutput _223[3] = { VertexOutput{ gl_in[0].gl_Position, gl_in[0].VertexOutput_uv }, VertexOutput{ gl_in[1].gl_Position, gl_in[1].VertexOutput_uv }, VertexOutput{ gl_in[2].gl_Position, gl_in[2].VertexOutput_uv } };
- VertexOutput param[3];
- spvArrayCopyFromStackToStack1(param, _223);
+ spvUnsafeArray<VertexOutput, 3> _223 = spvUnsafeArray<VertexOutput, 3>({ VertexOutput{ gl_in[0].gl_Position, gl_in[0].VertexOutput_uv }, VertexOutput{ gl_in[1].gl_Position, gl_in[1].VertexOutput_uv }, VertexOutput{ gl_in[2].gl_Position, gl_in[2].VertexOutput_uv } });
+ spvUnsafeArray<VertexOutput, 3> param;
+ param = _223;
gl_out[gl_InvocationID].gl_Position = param[gl_InvocationID].pos;
gl_out[gl_InvocationID]._entryPointOutput.uv = param[gl_InvocationID].uv;
- threadgroup_barrier(mem_flags::mem_device);
+ threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup);
if (int(gl_InvocationID) == 0)
{
float2 _174 = float2(1.0) + gl_in[0].VertexOutput_uv;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/complex-composite-constant-array.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/complex-composite-constant-array.comp
new file mode 100644
index 00000000000..bd58c95a006
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/complex-composite-constant-array.comp
@@ -0,0 +1,59 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct SSBO
+{
+ float4x4 a;
+ uint index;
+};
+
+kernel void main0(device SSBO& _14 [[buffer(0)]])
+{
+ spvUnsafeArray<float4x4, 2> _32 = spvUnsafeArray<float4x4, 2>({ float4x4(float4(1.0, 0.0, 0.0, 0.0), float4(0.0, 1.0, 0.0, 0.0), float4(0.0, 0.0, 1.0, 0.0), float4(0.0, 0.0, 0.0, 1.0)), float4x4(float4(2.0, 0.0, 0.0, 0.0), float4(0.0, 2.0, 0.0, 0.0), float4(0.0, 0.0, 2.0, 0.0), float4(0.0, 0.0, 0.0, 2.0)) });
+
+ _14.a = _32[_14.index];
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/composite-array-initialization.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/composite-array-initialization.comp
index e7a950e57d4..6181ae69b11 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/composite-array-initialization.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/composite-array-initialization.comp
@@ -1,10 +1,49 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct Data
{
float a;
@@ -27,67 +66,13 @@ struct SSBO
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(2u, 1u, 1u);
-constant Data _25[2] = { Data{ 1.0, 2.0 }, Data{ 3.0, 4.0 } };
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
kernel void main0(device SSBO& _53 [[buffer(0)]], uint3 gl_WorkGroupID [[threadgroup_position_in_grid]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
{
- Data _31[2] = { Data{ X, 2.0 }, Data{ 3.0, 5.0 } };
- Data data2[2];
- spvArrayCopyFromStackToStack1(data2, _31);
+ spvUnsafeArray<Data, 2> _25 = spvUnsafeArray<Data, 2>({ Data{ 1.0, 2.0 }, Data{ 3.0, 4.0 } });
+
+ spvUnsafeArray<Data, 2> _31 = spvUnsafeArray<Data, 2>({ Data{ X, 2.0 }, Data{ 3.0, 5.0 } });
+ spvUnsafeArray<Data, 2> data2;
+ data2 = _31;
_53.outdata[gl_WorkGroupID.x].a = _25[gl_LocalInvocationID.x].a + data2[gl_LocalInvocationID.x].a;
_53.outdata[gl_WorkGroupID.x].b = _25[gl_LocalInvocationID.x].b + data2[gl_LocalInvocationID.x].b;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/composite-construct.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/composite-construct.comp
index 17dbb8fd8ba..09e6fc7d959 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/composite-construct.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/composite-construct.comp
@@ -1,81 +1,66 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
-struct SSBO0
-{
- float4 as[1];
-};
-
-struct SSBO1
-{
- float4 bs[1];
-};
-
-constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
+template<typename T, size_t Num>
+struct spvUnsafeArray
{
- for (uint i = 0; i < A; i++)
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const thread T& operator [] (size_t pos) const thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ device T& operator [] (size_t pos) device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const device T& operator [] (size_t pos) const device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ constexpr const constant T& operator [] (size_t pos) const constant
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ threadgroup T& operator [] (size_t pos) threadgroup
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct SSBO0
+{
+ float4 as[1];
+};
+
+struct SSBO1
+{
+ float4 bs[1];
+};
+
+constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
kernel void main0(device SSBO0& _16 [[buffer(0)]], device SSBO1& _32 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]])
{
- float4 _37[2] = { _16.as[gl_GlobalInvocationID.x], _32.bs[gl_GlobalInvocationID.x] };
- float4 values[2];
- spvArrayCopyFromStackToStack1(values, _37);
+ spvUnsafeArray<float4, 2> _37 = spvUnsafeArray<float4, 2>({ _16.as[gl_GlobalInvocationID.x], _32.bs[gl_GlobalInvocationID.x] });
+ spvUnsafeArray<float4, 2> values;
+ values = _37;
_16.as[0] = values[gl_LocalInvocationIndex];
_32.bs[1] = float4(40.0);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/inverse.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/inverse.comp
index a4ef60c4273..33aed468f73 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/inverse.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/inverse.comp
@@ -22,20 +22,23 @@ struct MatrixIn
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
// Returns the determinant of a 2x2 matrix.
-inline float spvDet2x2(float a1, float a2, float b1, float b2)
+static inline __attribute__((always_inline))
+float spvDet2x2(float a1, float a2, float b1, float b2)
{
return a1 * b2 - b1 * a2;
}
// Returns the determinant of a 3x3 matrix.
-inline float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
+static inline __attribute__((always_inline))
+float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
{
return a1 * spvDet2x2(b2, b3, c2, c3) - b1 * spvDet2x2(a2, a3, c2, c3) + c1 * spvDet2x2(a2, a3, b2, b3);
}
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
// adjoint and dividing by the determinant. The contents of the matrix are changed.
-inline float4x4 spvInverse4x4(float4x4 m)
+static inline __attribute__((always_inline))
+float4x4 spvInverse4x4(float4x4 m)
{
float4x4 adj; // The adjoint matrix (inverse after dividing by determinant)
@@ -70,7 +73,8 @@ inline float4x4 spvInverse4x4(float4x4 m)
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
// adjoint and dividing by the determinant. The contents of the matrix are changed.
-inline float3x3 spvInverse3x3(float3x3 m)
+static inline __attribute__((always_inline))
+float3x3 spvInverse3x3(float3x3 m)
{
float3x3 adj; // The adjoint matrix (inverse after dividing by determinant)
@@ -97,7 +101,8 @@ inline float3x3 spvInverse3x3(float3x3 m)
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
// adjoint and dividing by the determinant. The contents of the matrix are changed.
-inline float2x2 spvInverse2x2(float2x2 m)
+static inline __attribute__((always_inline))
+float2x2 spvInverse2x2(float2x2 m)
{
float2x2 adj; // The adjoint matrix (inverse after dividing by determinant)
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/spec-constant-work-group-size.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/spec-constant-work-group-size.comp
index bb796ab95d7..de30edec155 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/spec-constant-work-group-size.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/spec-constant-work-group-size.comp
@@ -1,8 +1,49 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
#ifndef SPIRV_CROSS_CONSTANT_ID_1
#define SPIRV_CROSS_CONSTANT_ID_1 2
#endif
@@ -27,7 +68,7 @@ constant int _32 = (1 - a);
kernel void main0(device SSBO& _17 [[buffer(0)]])
{
- int spec_const_array_size[b];
+ spvUnsafeArray<int, b> spec_const_array_size;
spec_const_array_size[a] = a;
_17.v[_30] = b + spec_const_array_size[_32];
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/storage-buffer-std140-vector-array.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/storage-buffer-std140-vector-array.comp
index 24ce280740c..ac28fc9b338 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/storage-buffer-std140-vector-array.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/storage-buffer-std140-vector-array.comp
@@ -1,8 +1,49 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct Sub
{
float4 f[2];
@@ -20,16 +61,16 @@ constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
kernel void main0(device SSBO& _27 [[buffer(0)]], uint3 gl_WorkGroupID [[threadgroup_position_in_grid]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
{
- float _155[2];
+ spvUnsafeArray<float, 2> _155;
_155[0] = _27.sub[gl_WorkGroupID.x].f[0].x;
_155[1] = _27.sub[gl_WorkGroupID.x].f[1].x;
- float2 _156[2];
+ spvUnsafeArray<float2, 2> _156;
_156[0] = _27.sub[gl_WorkGroupID.x].f2[0].xy;
_156[1] = _27.sub[gl_WorkGroupID.x].f2[1].xy;
- float3 _157[2];
+ spvUnsafeArray<float3, 2> _157;
_157[0] = _27.sub[gl_WorkGroupID.x].f3[0];
_157[1] = _27.sub[gl_WorkGroupID.x].f3[1];
- float4 _158[2];
+ spvUnsafeArray<float4, 2> _158;
_158[0] = _27.sub[gl_WorkGroupID.x].f4[0];
_158[1] = _27.sub[gl_WorkGroupID.x].f4[1];
_155[gl_GlobalInvocationID.x] += 1.0;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc
index a5e30b6de1a..01fceeb6c7b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc
@@ -1,8 +1,49 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct main0_out
{
float3 vVertex;
@@ -10,7 +51,7 @@ struct main0_out
struct main0_patchOut
{
- float3 vPatch[2];
+ spvUnsafeArray<float3, 2> vPatch;
};
struct main0_in
@@ -28,7 +69,7 @@ kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_
if (gl_InvocationID >= 4)
return;
gl_out[gl_InvocationID].vVertex = gl_in[gl_InvocationID].vInput + gl_in[gl_InvocationID ^ 1].vInput;
- threadgroup_barrier(mem_flags::mem_device);
+ threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup);
if (gl_InvocationID == 0)
{
patchOut.vPatch[0] = float3(10.0);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc
index cd4d8d80e52..e7e184a980a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc
@@ -28,10 +28,8 @@ kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_
threadgroup_barrier(mem_flags::mem_threadgroup);
if (gl_InvocationID >= 4)
return;
- Boo vInput_24;
- vInput_24.a = gl_in[gl_InvocationID].Boo_a;
- vInput_24.b = gl_in[gl_InvocationID].Boo_b;
- gl_out[gl_InvocationID].vVertex = vInput_24;
+ Boo _25 = Boo{ gl_in[gl_InvocationID].Boo_a, gl_in[gl_InvocationID].Boo_b };
+ gl_out[gl_InvocationID].vVertex = _25;
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0] = half(1.0);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1] = half(2.0);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2] = half(3.0);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/array-lut-no-loop-variable.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/array-lut-no-loop-variable.frag
index 9b757b6a31c..79f9025a78d 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/array-lut-no-loop-variable.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/array-lut-no-loop-variable.frag
@@ -1,9 +1,50 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
-constant float _17[5] = { 1.0, 2.0, 3.0, 4.0, 5.0 };
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+constant spvUnsafeArray<float, 5> _17 = spvUnsafeArray<float, 5>({ 1.0, 2.0, 3.0, 4.0, 5.0 });
struct main0_out
{
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/array-of-array-lut.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/array-of-array-lut.frag
new file mode 100644
index 00000000000..ba553824e79
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/array-of-array-lut.frag
@@ -0,0 +1,68 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+constant spvUnsafeArray<float, 3> _17 = spvUnsafeArray<float, 3>({ 1.0, 2.0, 3.0 });
+constant spvUnsafeArray<float, 3> _21 = spvUnsafeArray<float, 3>({ 4.0, 5.0, 6.0 });
+constant spvUnsafeArray<spvUnsafeArray<float, 3>, 2> _22 = spvUnsafeArray<spvUnsafeArray<float, 3>, 2>({ spvUnsafeArray<float, 3>({ 1.0, 2.0, 3.0 }), spvUnsafeArray<float, 3>({ 4.0, 5.0, 6.0 }) });
+
+struct main0_out
+{
+ float vOutput [[color(0)]];
+};
+
+struct main0_in
+{
+ int vIndex1 [[user(locn0)]];
+ int vIndex2 [[user(locn1)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]])
+{
+ main0_out out = {};
+ out.vOutput = _22[in.vIndex1][in.vIndex2];
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/buffer-read-write.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/buffer-read-write.frag
index 36b1a18098b..166d4311ba0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/buffer-read-write.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/buffer-read-write.frag
@@ -11,7 +11,8 @@ struct main0_out
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/constant-array.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/constant-array.frag
index a0b830daae3..ca7efc5341d 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/constant-array.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/constant-array.frag
@@ -1,19 +1,59 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct Foobar
{
float a;
float b;
};
-constant float4 _37[3] = { float4(1.0), float4(2.0), float4(3.0) };
-constant float4 _49[2] = { float4(1.0), float4(2.0) };
-constant float4 _54[2] = { float4(8.0), float4(10.0) };
-constant float4 _55[2][2] = { { float4(1.0), float4(2.0) }, { float4(8.0), float4(10.0) } };
-constant Foobar _75[2] = { Foobar{ 10.0, 40.0 }, Foobar{ 90.0, 70.0 } };
+constant spvUnsafeArray<float4, 3> _37 = spvUnsafeArray<float4, 3>({ float4(1.0), float4(2.0), float4(3.0) });
+constant spvUnsafeArray<float4, 2> _49 = spvUnsafeArray<float4, 2>({ float4(1.0), float4(2.0) });
+constant spvUnsafeArray<float4, 2> _54 = spvUnsafeArray<float4, 2>({ float4(8.0), float4(10.0) });
+constant spvUnsafeArray<spvUnsafeArray<float4, 2>, 2> _55 = spvUnsafeArray<spvUnsafeArray<float4, 2>, 2>({ spvUnsafeArray<float4, 2>({ float4(1.0), float4(2.0) }), spvUnsafeArray<float4, 2>({ float4(8.0), float4(10.0) }) });
struct main0_out
{
@@ -27,6 +67,8 @@ struct main0_in
fragment main0_out main0(main0_in in [[stage_in]])
{
+ spvUnsafeArray<Foobar, 2> _75 = spvUnsafeArray<Foobar, 2>({ Foobar{ 10.0, 40.0 }, Foobar{ 90.0, 70.0 } });
+
main0_out out = {};
out.FragColor = ((_37[in.index] + _55[in.index][in.index + 1]) + float4(30.0)) + float4(_75[in.index].a + _75[in.index].b);
return out;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/constant-composites.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/constant-composites.frag
index 335cbcd796c..e0fa980fb85 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/constant-composites.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/constant-composites.frag
@@ -1,16 +1,56 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct Foo
{
float a;
float b;
};
-constant float _16[4] = { 1.0, 4.0, 3.0, 2.0 };
-constant Foo _28[2] = { Foo{ 10.0, 20.0 }, Foo{ 30.0, 40.0 } };
+constant spvUnsafeArray<float, 4> _16 = spvUnsafeArray<float, 4>({ 1.0, 4.0, 3.0, 2.0 });
struct main0_out
{
@@ -24,6 +64,8 @@ struct main0_in
fragment main0_out main0(main0_in in [[stage_in]])
{
+ spvUnsafeArray<Foo, 2> _28 = spvUnsafeArray<Foo, 2>({ Foo{ 10.0, 20.0 }, Foo{ 30.0, 40.0 } });
+
main0_out out = {};
out.FragColor = float4(_16[in.line]);
out.FragColor += float4(_28[in.line].a * _28[1 - in.line].a);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/fragment-component-padding.pad-fragment.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/fragment-component-padding.pad-fragment.frag
index 53aafa5f7f2..90a6b3b9e42 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/fragment-component-padding.pad-fragment.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/fragment-component-padding.pad-fragment.frag
@@ -1,8 +1,49 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct main0_out
{
float4 FragColors_0 [[color(0)]];
@@ -19,7 +60,7 @@ struct main0_in
fragment main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
- float FragColors[2] = {};
+ spvUnsafeArray<float, 2> FragColors = {};
float2 FragColor2 = {};
float3 FragColor3 = {};
FragColors[0] = in.vColor.x;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag
new file mode 100644
index 00000000000..0c6e6f49915
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag
@@ -0,0 +1,44 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct UBO
+{
+ float4 v;
+};
+
+struct spvDescriptorSetBuffer0
+{
+ array<texture2d<float>, 10000> uSamplers [[id(0)]];
+ array<sampler, 10000> uSamplersSmplr [[id(10000)]];
+};
+
+struct spvDescriptorSetBuffer1
+{
+ constant UBO* vs [[id(0)]][10000];
+};
+
+struct spvDescriptorSetBuffer2
+{
+ texture2d<float> uSampler [[id(0)]];
+ sampler uSamplerSmplr [[id(1)]];
+};
+
+struct main0_out
+{
+ float4 FragColor [[color(0)]];
+};
+
+struct main0_in
+{
+ float2 vUV [[user(locn0)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], const device spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], const device spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]], constant spvDescriptorSetBuffer2& spvDescriptorSet2 [[buffer(2)]])
+{
+ main0_out out = {};
+ out.FragColor = (spvDescriptorSet0.uSamplers[9999].sample(spvDescriptorSet0.uSamplersSmplr[9999], in.vUV) + spvDescriptorSet1.vs[5000]->v) + spvDescriptorSet2.uSampler.sample(spvDescriptorSet2.uSamplerSmplr, in.vUV);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/lut-promotion.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/lut-promotion.frag
index 0e4c73f2ead..e24bcd6d111 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/lut-promotion.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/lut-promotion.frag
@@ -1,77 +1,62 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
-constant float _16[16] = { 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0 };
-constant float4 _60[4] = { float4(0.0), float4(1.0), float4(8.0), float4(5.0) };
-constant float4 _104[4] = { float4(20.0), float4(30.0), float4(50.0), float4(60.0) };
-
-struct main0_out
-{
- float FragColor [[color(0)]];
-};
-
-struct main0_in
-{
- int index [[user(locn0)]];
-};
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
+template<typename T, size_t Num>
+struct spvUnsafeArray
{
- for (uint i = 0; i < A; i++)
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const thread T& operator [] (size_t pos) const thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ device T& operator [] (size_t pos) device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const device T& operator [] (size_t pos) const device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ constexpr const constant T& operator [] (size_t pos) const constant
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ threadgroup T& operator [] (size_t pos) threadgroup
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+constant spvUnsafeArray<float, 16> _16 = spvUnsafeArray<float, 16>({ 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0 });
+constant spvUnsafeArray<float4, 4> _60 = spvUnsafeArray<float4, 4>({ float4(0.0), float4(1.0), float4(8.0), float4(5.0) });
+constant spvUnsafeArray<float4, 4> _104 = spvUnsafeArray<float4, 4>({ float4(20.0), float4(30.0), float4(50.0), float4(60.0) });
+
+struct main0_out
+{
+ float FragColor [[color(0)]];
+};
+
+struct main0_in
+{
+ int index [[user(locn0)]];
+};
fragment main0_out main0(main0_in in [[stage_in]])
{
@@ -94,7 +79,7 @@ fragment main0_out main0(main0_in in [[stage_in]])
{
out.FragColor += _60[in.index & 1].x;
}
- float4 foobar[4] = { float4(0.0), float4(1.0), float4(8.0), float4(5.0) };
+ spvUnsafeArray<float4, 4> foobar = spvUnsafeArray<float4, 4>({ float4(0.0), float4(1.0), float4(8.0), float4(5.0) });
if (_63)
{
foobar[1].z = 20.0;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/mrt-array.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/mrt-array.frag
index c8237e9413a..79fc0391b59 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/mrt-array.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/mrt-array.frag
@@ -1,10 +1,49 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct main0_out
{
float4 FragColor_0 [[color(0)]];
@@ -29,7 +68,7 @@ inline Tx mod(Tx x, Ty y)
fragment main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
- float4 FragColor[4] = {};
+ spvUnsafeArray<float4, 4> FragColor = {};
FragColor[0] = mod(in.vA, in.vB);
FragColor[1] = in.vA + in.vB;
FragColor[2] = in.vA - in.vB;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag
new file mode 100644
index 00000000000..4f7e9b53b24
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag
@@ -0,0 +1,23 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct main0_out
+{
+ float FragColor [[color(0)]];
+};
+
+struct main0_in
+{
+ float3 vUV [[user(locn0)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uTexture [[texture(0)]], sampler uSampler [[sampler(0)]], sampler uSamplerShadow [[sampler(1)]])
+{
+ main0_out out = {};
+ out.FragColor = float4(uTexture.sample(uSampler, in.vUV.xy)).x;
+ out.FragColor += uTexture.sample_compare(uSamplerShadow, in.vUV.xy, in.vUV.z);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/texture-cube-array.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/texture-cube-array.frag
new file mode 100644
index 00000000000..0af8a047b3f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/texture-cube-array.frag
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct main0_out
+{
+ float4 FragColor [[color(0)]];
+};
+
+struct main0_in
+{
+ float4 vUV [[user(locn0)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], texturecube<float> cubeSampler [[texture(0)]], texturecube_array<float> cubeArraySampler [[texture(1)]], texture2d_array<float> texArraySampler [[texture(2)]], sampler cubeSamplerSmplr [[sampler(0)]], sampler cubeArraySamplerSmplr [[sampler(1)]], sampler texArraySamplerSmplr [[sampler(2)]])
+{
+ main0_out out = {};
+ out.FragColor = (cubeSampler.sample(cubeSamplerSmplr, in.vUV.xyz) + cubeArraySampler.sample(cubeArraySamplerSmplr, in.vUV.xyz, uint(round(in.vUV.w)))) + texArraySampler.sample(texArraySamplerSmplr, in.vUV.xyz.xy, uint(round(in.vUV.xyz.z)));
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/texture-cube-array.ios.emulate-cube-array.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/texture-cube-array.ios.emulate-cube-array.frag
new file mode 100644
index 00000000000..217a7a9e20b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/texture-cube-array.ios.emulate-cube-array.frag
@@ -0,0 +1,58 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct main0_out
+{
+ float4 FragColor [[color(0)]];
+};
+
+struct main0_in
+{
+ float4 vUV [[user(locn0)]];
+};
+
+static inline __attribute__((always_inline))
+float3 spvCubemapTo2DArrayFace(float3 P)
+{
+ float3 Coords = abs(P.xyz);
+ float CubeFace = 0;
+ float ProjectionAxis = 0;
+ float u = 0;
+ float v = 0;
+ if (Coords.x >= Coords.y && Coords.x >= Coords.z)
+ {
+ CubeFace = P.x >= 0 ? 0 : 1;
+ ProjectionAxis = Coords.x;
+ u = P.x >= 0 ? -P.z : P.z;
+ v = -P.y;
+ }
+ else if (Coords.y >= Coords.x && Coords.y >= Coords.z)
+ {
+ CubeFace = P.y >= 0 ? 2 : 3;
+ ProjectionAxis = Coords.y;
+ u = P.x;
+ v = P.y >= 0 ? P.z : -P.z;
+ }
+ else
+ {
+ CubeFace = P.z >= 0 ? 4 : 5;
+ ProjectionAxis = Coords.z;
+ u = P.z >= 0 ? P.x : -P.x;
+ v = -P.y;
+ }
+ u = 0.5 * (u/ProjectionAxis + 1);
+ v = 0.5 * (v/ProjectionAxis + 1);
+ return float3(u, v, CubeFace);
+}
+
+fragment main0_out main0(main0_in in [[stage_in]], texturecube<float> cubeSampler [[texture(0)]], texture2d_array<float> cubeArraySampler [[texture(1)]], texture2d_array<float> texArraySampler [[texture(2)]], sampler cubeSamplerSmplr [[sampler(0)]], sampler cubeArraySamplerSmplr [[sampler(1)]], sampler texArraySamplerSmplr [[sampler(2)]])
+{
+ main0_out out = {};
+ out.FragColor = (cubeSampler.sample(cubeSamplerSmplr, in.vUV.xyz) + cubeArraySampler.sample(cubeArraySamplerSmplr, spvCubemapTo2DArrayFace(in.vUV.xyz).xy, uint(spvCubemapTo2DArrayFace(in.vUV.xyz).z) + (uint(round(in.vUV.w)) * 6u))) + texArraySampler.sample(texArraySamplerSmplr, in.vUV.xyz.xy, uint(round(in.vUV.xyz.z)));
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/load-control-point-array-of-matrix.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/load-control-point-array-of-matrix.tesc
new file mode 100644
index 00000000000..46d4b4ad588
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/load-control-point-array-of-matrix.tesc
@@ -0,0 +1,73 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct main0_out
+{
+ float4x4 vOutputs;
+};
+
+struct main0_in
+{
+ float4 vInputs_0 [[attribute(0)]];
+ float4 vInputs_1 [[attribute(1)]];
+ float4 vInputs_2 [[attribute(2)]];
+ float4 vInputs_3 [[attribute(3)]];
+};
+
+kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
+{
+ device main0_out* gl_out = &spvOut[gl_PrimitiveID * 4];
+ if (gl_InvocationID < spvIndirectParams[0])
+ gl_in[gl_InvocationID] = in;
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+ if (gl_InvocationID >= 4)
+ return;
+ spvUnsafeArray<float4x4, 32> _16 = spvUnsafeArray<float4x4, 32>({ float4x4(gl_in[0].vInputs_0, gl_in[0].vInputs_1, gl_in[0].vInputs_2, gl_in[0].vInputs_3), float4x4(gl_in[1].vInputs_0, gl_in[1].vInputs_1, gl_in[1].vInputs_2, gl_in[1].vInputs_3), float4x4(gl_in[2].vInputs_0, gl_in[2].vInputs_1, gl_in[2].vInputs_2, gl_in[2].vInputs_3), float4x4(gl_in[3].vInputs_0, gl_in[3].vInputs_1, gl_in[3].vInputs_2, gl_in[3].vInputs_3), float4x4(gl_in[4].vInputs_0, gl_in[4].vInputs_1, gl_in[4].vInputs_2, gl_in[4].vInputs_3), float4x4(gl_in[5].vInputs_0, gl_in[5].vInputs_1, gl_in[5].vInputs_2, gl_in[5].vInputs_3), float4x4(gl_in[6].vInputs_0, gl_in[6].vInputs_1, gl_in[6].vInputs_2, gl_in[6].vInputs_3), float4x4(gl_in[7].vInputs_0, gl_in[7].vInputs_1, gl_in[7].vInputs_2, gl_in[7].vInputs_3), float4x4(gl_in[8].vInputs_0, gl_in[8].vInputs_1, gl_in[8].vInputs_2, gl_in[8].vInputs_3), float4x4(gl_in[9].vInputs_0, gl_in[9].vInputs_1, gl_in[9].vInputs_2, gl_in[9].vInputs_3), float4x4(gl_in[10].vInputs_0, gl_in[10].vInputs_1, gl_in[10].vInputs_2, gl_in[10].vInputs_3), float4x4(gl_in[11].vInputs_0, gl_in[11].vInputs_1, gl_in[11].vInputs_2, gl_in[11].vInputs_3), float4x4(gl_in[12].vInputs_0, gl_in[12].vInputs_1, gl_in[12].vInputs_2, gl_in[12].vInputs_3), float4x4(gl_in[13].vInputs_0, gl_in[13].vInputs_1, gl_in[13].vInputs_2, gl_in[13].vInputs_3), float4x4(gl_in[14].vInputs_0, gl_in[14].vInputs_1, gl_in[14].vInputs_2, gl_in[14].vInputs_3), float4x4(gl_in[15].vInputs_0, gl_in[15].vInputs_1, gl_in[15].vInputs_2, gl_in[15].vInputs_3), float4x4(gl_in[16].vInputs_0, gl_in[16].vInputs_1, gl_in[16].vInputs_2, gl_in[16].vInputs_3), float4x4(gl_in[17].vInputs_0, gl_in[17].vInputs_1, gl_in[17].vInputs_2, gl_in[17].vInputs_3), float4x4(gl_in[18].vInputs_0, gl_in[18].vInputs_1, gl_in[18].vInputs_2, gl_in[18].vInputs_3), float4x4(gl_in[19].vInputs_0, gl_in[19].vInputs_1, gl_in[19].vInputs_2, gl_in[19].vInputs_3), float4x4(gl_in[20].vInputs_0, gl_in[20].vInputs_1, gl_in[20].vInputs_2, gl_in[20].vInputs_3), float4x4(gl_in[21].vInputs_0, gl_in[21].vInputs_1, gl_in[21].vInputs_2, gl_in[21].vInputs_3), float4x4(gl_in[22].vInputs_0, gl_in[22].vInputs_1, gl_in[22].vInputs_2, gl_in[22].vInputs_3), float4x4(gl_in[23].vInputs_0, gl_in[23].vInputs_1, gl_in[23].vInputs_2, gl_in[23].vInputs_3), float4x4(gl_in[24].vInputs_0, gl_in[24].vInputs_1, gl_in[24].vInputs_2, gl_in[24].vInputs_3), float4x4(gl_in[25].vInputs_0, gl_in[25].vInputs_1, gl_in[25].vInputs_2, gl_in[25].vInputs_3), float4x4(gl_in[26].vInputs_0, gl_in[26].vInputs_1, gl_in[26].vInputs_2, gl_in[26].vInputs_3), float4x4(gl_in[27].vInputs_0, gl_in[27].vInputs_1, gl_in[27].vInputs_2, gl_in[27].vInputs_3), float4x4(gl_in[28].vInputs_0, gl_in[28].vInputs_1, gl_in[28].vInputs_2, gl_in[28].vInputs_3), float4x4(gl_in[29].vInputs_0, gl_in[29].vInputs_1, gl_in[29].vInputs_2, gl_in[29].vInputs_3), float4x4(gl_in[30].vInputs_0, gl_in[30].vInputs_1, gl_in[30].vInputs_2, gl_in[30].vInputs_3), float4x4(gl_in[31].vInputs_0, gl_in[31].vInputs_1, gl_in[31].vInputs_2, gl_in[31].vInputs_3) });
+ spvUnsafeArray<float4x4, 32> tmp;
+ tmp = _16;
+ gl_out[gl_InvocationID].vOutputs = tmp[gl_InvocationID];
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/load-control-point-array-of-struct.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/load-control-point-array-of-struct.tesc
new file mode 100644
index 00000000000..fc2cec1c3f0
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/load-control-point-array-of-struct.tesc
@@ -0,0 +1,84 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct VertexData
+{
+ float4x4 a;
+ spvUnsafeArray<float4, 2> b;
+ float4 c;
+};
+
+struct main0_out
+{
+ float4 vOutputs;
+};
+
+struct main0_in
+{
+ float4 VertexData_a_0 [[attribute(0)]];
+ float4 VertexData_a_1 [[attribute(1)]];
+ float4 VertexData_a_2 [[attribute(2)]];
+ float4 VertexData_a_3 [[attribute(3)]];
+ float4 VertexData_b_0 [[attribute(4)]];
+ float4 VertexData_b_1 [[attribute(5)]];
+ float4 VertexData_c [[attribute(6)]];
+};
+
+kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
+{
+ device main0_out* gl_out = &spvOut[gl_PrimitiveID * 4];
+ if (gl_InvocationID < spvIndirectParams[0])
+ gl_in[gl_InvocationID] = in;
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+ if (gl_InvocationID >= 4)
+ return;
+ spvUnsafeArray<VertexData, 32> _19 = spvUnsafeArray<VertexData, 32>({ VertexData{ float4x4(gl_in[0].VertexData_a_0, gl_in[0].VertexData_a_1, gl_in[0].VertexData_a_2, gl_in[0].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[0].VertexData_b_0, gl_in[0].VertexData_b_1 }), gl_in[0].VertexData_c }, VertexData{ float4x4(gl_in[1].VertexData_a_0, gl_in[1].VertexData_a_1, gl_in[1].VertexData_a_2, gl_in[1].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[1].VertexData_b_0, gl_in[1].VertexData_b_1 }), gl_in[1].VertexData_c }, VertexData{ float4x4(gl_in[2].VertexData_a_0, gl_in[2].VertexData_a_1, gl_in[2].VertexData_a_2, gl_in[2].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[2].VertexData_b_0, gl_in[2].VertexData_b_1 }), gl_in[2].VertexData_c }, VertexData{ float4x4(gl_in[3].VertexData_a_0, gl_in[3].VertexData_a_1, gl_in[3].VertexData_a_2, gl_in[3].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[3].VertexData_b_0, gl_in[3].VertexData_b_1 }), gl_in[3].VertexData_c }, VertexData{ float4x4(gl_in[4].VertexData_a_0, gl_in[4].VertexData_a_1, gl_in[4].VertexData_a_2, gl_in[4].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[4].VertexData_b_0, gl_in[4].VertexData_b_1 }), gl_in[4].VertexData_c }, VertexData{ float4x4(gl_in[5].VertexData_a_0, gl_in[5].VertexData_a_1, gl_in[5].VertexData_a_2, gl_in[5].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[5].VertexData_b_0, gl_in[5].VertexData_b_1 }), gl_in[5].VertexData_c }, VertexData{ float4x4(gl_in[6].VertexData_a_0, gl_in[6].VertexData_a_1, gl_in[6].VertexData_a_2, gl_in[6].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[6].VertexData_b_0, gl_in[6].VertexData_b_1 }), gl_in[6].VertexData_c }, VertexData{ float4x4(gl_in[7].VertexData_a_0, gl_in[7].VertexData_a_1, gl_in[7].VertexData_a_2, gl_in[7].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[7].VertexData_b_0, gl_in[7].VertexData_b_1 }), gl_in[7].VertexData_c }, VertexData{ float4x4(gl_in[8].VertexData_a_0, gl_in[8].VertexData_a_1, gl_in[8].VertexData_a_2, gl_in[8].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[8].VertexData_b_0, gl_in[8].VertexData_b_1 }), gl_in[8].VertexData_c }, VertexData{ float4x4(gl_in[9].VertexData_a_0, gl_in[9].VertexData_a_1, gl_in[9].VertexData_a_2, gl_in[9].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[9].VertexData_b_0, gl_in[9].VertexData_b_1 }), gl_in[9].VertexData_c }, VertexData{ float4x4(gl_in[10].VertexData_a_0, gl_in[10].VertexData_a_1, gl_in[10].VertexData_a_2, gl_in[10].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[10].VertexData_b_0, gl_in[10].VertexData_b_1 }), gl_in[10].VertexData_c }, VertexData{ float4x4(gl_in[11].VertexData_a_0, gl_in[11].VertexData_a_1, gl_in[11].VertexData_a_2, gl_in[11].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[11].VertexData_b_0, gl_in[11].VertexData_b_1 }), gl_in[11].VertexData_c }, VertexData{ float4x4(gl_in[12].VertexData_a_0, gl_in[12].VertexData_a_1, gl_in[12].VertexData_a_2, gl_in[12].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[12].VertexData_b_0, gl_in[12].VertexData_b_1 }), gl_in[12].VertexData_c }, VertexData{ float4x4(gl_in[13].VertexData_a_0, gl_in[13].VertexData_a_1, gl_in[13].VertexData_a_2, gl_in[13].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[13].VertexData_b_0, gl_in[13].VertexData_b_1 }), gl_in[13].VertexData_c }, VertexData{ float4x4(gl_in[14].VertexData_a_0, gl_in[14].VertexData_a_1, gl_in[14].VertexData_a_2, gl_in[14].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[14].VertexData_b_0, gl_in[14].VertexData_b_1 }), gl_in[14].VertexData_c }, VertexData{ float4x4(gl_in[15].VertexData_a_0, gl_in[15].VertexData_a_1, gl_in[15].VertexData_a_2, gl_in[15].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[15].VertexData_b_0, gl_in[15].VertexData_b_1 }), gl_in[15].VertexData_c }, VertexData{ float4x4(gl_in[16].VertexData_a_0, gl_in[16].VertexData_a_1, gl_in[16].VertexData_a_2, gl_in[16].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[16].VertexData_b_0, gl_in[16].VertexData_b_1 }), gl_in[16].VertexData_c }, VertexData{ float4x4(gl_in[17].VertexData_a_0, gl_in[17].VertexData_a_1, gl_in[17].VertexData_a_2, gl_in[17].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[17].VertexData_b_0, gl_in[17].VertexData_b_1 }), gl_in[17].VertexData_c }, VertexData{ float4x4(gl_in[18].VertexData_a_0, gl_in[18].VertexData_a_1, gl_in[18].VertexData_a_2, gl_in[18].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[18].VertexData_b_0, gl_in[18].VertexData_b_1 }), gl_in[18].VertexData_c }, VertexData{ float4x4(gl_in[19].VertexData_a_0, gl_in[19].VertexData_a_1, gl_in[19].VertexData_a_2, gl_in[19].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[19].VertexData_b_0, gl_in[19].VertexData_b_1 }), gl_in[19].VertexData_c }, VertexData{ float4x4(gl_in[20].VertexData_a_0, gl_in[20].VertexData_a_1, gl_in[20].VertexData_a_2, gl_in[20].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[20].VertexData_b_0, gl_in[20].VertexData_b_1 }), gl_in[20].VertexData_c }, VertexData{ float4x4(gl_in[21].VertexData_a_0, gl_in[21].VertexData_a_1, gl_in[21].VertexData_a_2, gl_in[21].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[21].VertexData_b_0, gl_in[21].VertexData_b_1 }), gl_in[21].VertexData_c }, VertexData{ float4x4(gl_in[22].VertexData_a_0, gl_in[22].VertexData_a_1, gl_in[22].VertexData_a_2, gl_in[22].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[22].VertexData_b_0, gl_in[22].VertexData_b_1 }), gl_in[22].VertexData_c }, VertexData{ float4x4(gl_in[23].VertexData_a_0, gl_in[23].VertexData_a_1, gl_in[23].VertexData_a_2, gl_in[23].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[23].VertexData_b_0, gl_in[23].VertexData_b_1 }), gl_in[23].VertexData_c }, VertexData{ float4x4(gl_in[24].VertexData_a_0, gl_in[24].VertexData_a_1, gl_in[24].VertexData_a_2, gl_in[24].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[24].VertexData_b_0, gl_in[24].VertexData_b_1 }), gl_in[24].VertexData_c }, VertexData{ float4x4(gl_in[25].VertexData_a_0, gl_in[25].VertexData_a_1, gl_in[25].VertexData_a_2, gl_in[25].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[25].VertexData_b_0, gl_in[25].VertexData_b_1 }), gl_in[25].VertexData_c }, VertexData{ float4x4(gl_in[26].VertexData_a_0, gl_in[26].VertexData_a_1, gl_in[26].VertexData_a_2, gl_in[26].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[26].VertexData_b_0, gl_in[26].VertexData_b_1 }), gl_in[26].VertexData_c }, VertexData{ float4x4(gl_in[27].VertexData_a_0, gl_in[27].VertexData_a_1, gl_in[27].VertexData_a_2, gl_in[27].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[27].VertexData_b_0, gl_in[27].VertexData_b_1 }), gl_in[27].VertexData_c }, VertexData{ float4x4(gl_in[28].VertexData_a_0, gl_in[28].VertexData_a_1, gl_in[28].VertexData_a_2, gl_in[28].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[28].VertexData_b_0, gl_in[28].VertexData_b_1 }), gl_in[28].VertexData_c }, VertexData{ float4x4(gl_in[29].VertexData_a_0, gl_in[29].VertexData_a_1, gl_in[29].VertexData_a_2, gl_in[29].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[29].VertexData_b_0, gl_in[29].VertexData_b_1 }), gl_in[29].VertexData_c }, VertexData{ float4x4(gl_in[30].VertexData_a_0, gl_in[30].VertexData_a_1, gl_in[30].VertexData_a_2, gl_in[30].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[30].VertexData_b_0, gl_in[30].VertexData_b_1 }), gl_in[30].VertexData_c }, VertexData{ float4x4(gl_in[31].VertexData_a_0, gl_in[31].VertexData_a_1, gl_in[31].VertexData_a_2, gl_in[31].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[31].VertexData_b_0, gl_in[31].VertexData_b_1 }), gl_in[31].VertexData_c } });
+ spvUnsafeArray<VertexData, 32> tmp;
+ tmp = _19;
+ int _27 = gl_InvocationID ^ 1;
+ gl_out[gl_InvocationID].vOutputs = ((tmp[gl_InvocationID].a[1] + tmp[gl_InvocationID].b[1]) + tmp[gl_InvocationID].c) + gl_in[_27].VertexData_c;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/load-control-point-array.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/load-control-point-array.tesc
new file mode 100644
index 00000000000..d04571ae364
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/load-control-point-array.tesc
@@ -0,0 +1,70 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct main0_out
+{
+ float4 vOutputs;
+};
+
+struct main0_in
+{
+ float4 vInputs [[attribute(0)]];
+};
+
+kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
+{
+ device main0_out* gl_out = &spvOut[gl_PrimitiveID * 4];
+ if (gl_InvocationID < spvIndirectParams[0])
+ gl_in[gl_InvocationID] = in;
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+ if (gl_InvocationID >= 4)
+ return;
+ spvUnsafeArray<float4, 32> _15 = spvUnsafeArray<float4, 32>({ gl_in[0].vInputs, gl_in[1].vInputs, gl_in[2].vInputs, gl_in[3].vInputs, gl_in[4].vInputs, gl_in[5].vInputs, gl_in[6].vInputs, gl_in[7].vInputs, gl_in[8].vInputs, gl_in[9].vInputs, gl_in[10].vInputs, gl_in[11].vInputs, gl_in[12].vInputs, gl_in[13].vInputs, gl_in[14].vInputs, gl_in[15].vInputs, gl_in[16].vInputs, gl_in[17].vInputs, gl_in[18].vInputs, gl_in[19].vInputs, gl_in[20].vInputs, gl_in[21].vInputs, gl_in[22].vInputs, gl_in[23].vInputs, gl_in[24].vInputs, gl_in[25].vInputs, gl_in[26].vInputs, gl_in[27].vInputs, gl_in[28].vInputs, gl_in[29].vInputs, gl_in[30].vInputs, gl_in[31].vInputs });
+ spvUnsafeArray<float4, 32> tmp;
+ tmp = _15;
+ gl_out[gl_InvocationID].vOutputs = tmp[gl_InvocationID];
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/input-types.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/input-types.tese
index 2a936fce3aa..75f917e2645 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/input-types.tese
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/input-types.tese
@@ -65,16 +65,12 @@ struct main0_patchIn
out.gl_Position += patchIn.vColors;
out.gl_Position += vFoo.a;
out.gl_Position += vFoo.b;
- Foo vFoos_202;
- vFoos_202.a = patchIn.gl_in[0].Foo_a;
- vFoos_202.b = patchIn.gl_in[0].Foo_b;
- out.gl_Position += vFoos_202.a;
- out.gl_Position += vFoos_202.b;
- Foo vFoos_216;
- vFoos_216.a = patchIn.gl_in[1].Foo_a;
- vFoos_216.b = patchIn.gl_in[1].Foo_b;
- out.gl_Position += vFoos_216.a;
- out.gl_Position += vFoos_216.b;
+ Foo _203 = Foo{ patchIn.gl_in[0].Foo_a, patchIn.gl_in[0].Foo_b };
+ out.gl_Position += _203.a;
+ out.gl_Position += _203.b;
+ Foo _217 = Foo{ patchIn.gl_in[1].Foo_a, patchIn.gl_in[1].Foo_b };
+ out.gl_Position += _217.a;
+ out.gl_Position += _217.b;
return out;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/load-control-point-array-of-matrix.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/load-control-point-array-of-matrix.tese
new file mode 100644
index 00000000000..e4bbeb7ede9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/load-control-point-array-of-matrix.tese
@@ -0,0 +1,85 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct main0_out
+{
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 vInputs_0 [[attribute(0)]];
+ float4 vInputs_1 [[attribute(1)]];
+ float4 vInputs_2 [[attribute(2)]];
+ float4 vInputs_3 [[attribute(3)]];
+};
+
+struct main0_patchIn
+{
+ float4 vBoo_0 [[attribute(4)]];
+ float4 vBoo_1 [[attribute(5)]];
+ float4 vBoo_2 [[attribute(6)]];
+ float4 vBoo_3 [[attribute(7)]];
+ int vIndex [[attribute(8)]];
+ patch_control_point<main0_in> gl_in;
+};
+
+[[ patch(quad, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 4> vBoo = {};
+ vBoo[0] = patchIn.vBoo_0;
+ vBoo[1] = patchIn.vBoo_1;
+ vBoo[2] = patchIn.vBoo_2;
+ vBoo[3] = patchIn.vBoo_3;
+ float4x4 _57 = float4x4(patchIn.gl_in[0u].vInputs_0, patchIn.gl_in[0u].vInputs_1, patchIn.gl_in[0u].vInputs_2, patchIn.gl_in[0u].vInputs_3);
+ float4x4 _59 = float4x4(patchIn.gl_in[1u].vInputs_0, patchIn.gl_in[1u].vInputs_1, patchIn.gl_in[1u].vInputs_2, patchIn.gl_in[1u].vInputs_3);
+ float4x4 _47 = _57;
+ float4x4 _48 = _59;
+ out.gl_Position = (_47[patchIn.vIndex] + _48[patchIn.vIndex]) + vBoo[patchIn.vIndex];
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/load-control-point-array.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/load-control-point-array.tese
new file mode 100644
index 00000000000..54d7419f5a3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/load-control-point-array.tese
@@ -0,0 +1,78 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct main0_out
+{
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 vInputs [[attribute(0)]];
+};
+
+struct main0_patchIn
+{
+ float4 vBoo_0 [[attribute(1)]];
+ float4 vBoo_1 [[attribute(2)]];
+ float4 vBoo_2 [[attribute(3)]];
+ float4 vBoo_3 [[attribute(4)]];
+ int vIndex [[attribute(5)]];
+ patch_control_point<main0_in> gl_in;
+};
+
+[[ patch(quad, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 4> vBoo = {};
+ vBoo[0] = patchIn.vBoo_0;
+ vBoo[1] = patchIn.vBoo_1;
+ vBoo[2] = patchIn.vBoo_2;
+ vBoo[3] = patchIn.vBoo_3;
+ out.gl_Position = (patchIn.gl_in[0u].vInputs + patchIn.gl_in[1u].vInputs) + vBoo[patchIn.vIndex];
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/triangle-tess-level.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/triangle-tess-level.tese
index 975e6298518..6930e1479d6 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/triangle-tess-level.tese
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/tese/triangle-tess-level.tese
@@ -1,8 +1,49 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct main0_out
{
float4 gl_Position [[position]];
@@ -16,8 +57,8 @@ struct main0_patchIn
[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], float3 gl_TessCoord [[position_in_patch]])
{
main0_out out = {};
- float gl_TessLevelInner[2] = {};
- float gl_TessLevelOuter[4] = {};
+ spvUnsafeArray<float, 2> gl_TessLevelInner = {};
+ spvUnsafeArray<float, 4> gl_TessLevelOuter = {};
gl_TessLevelInner[0] = patchIn.gl_TessLevel.w;
gl_TessLevelOuter[0] = patchIn.gl_TessLevel.x;
gl_TessLevelOuter[1] = patchIn.gl_TessLevel.y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/float-math.invariant-float-math.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/float-math.invariant-float-math.vert
new file mode 100644
index 00000000000..05e09e2d18c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/float-math.invariant-float-math.vert
@@ -0,0 +1,137 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct Matrices
+{
+ float4x4 vpMatrix;
+ float4x4 wMatrix;
+ float4x3 wMatrix4x3;
+ float3x4 wMatrix3x4;
+};
+
+struct main0_out
+{
+ float3 OutNormal [[user(locn0)]];
+ float4 OutWorldPos_0 [[user(locn1)]];
+ float4 OutWorldPos_1 [[user(locn2)]];
+ float4 OutWorldPos_2 [[user(locn3)]];
+ float4 OutWorldPos_3 [[user(locn4)]];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float3 InPos [[attribute(0)]];
+ float3 InNormal [[attribute(1)]];
+};
+
+template<typename T>
+T spvFMul(T l, T r)
+{
+ return fma(l, r, T(0));
+}
+
+template<typename T, int Cols, int Rows>
+vec<T, Cols> spvFMulVectorMatrix(vec<T, Rows> v, matrix<T, Cols, Rows> m)
+{
+ vec<T, Cols> res = vec<T, Cols>(0);
+ for (uint i = Rows; i > 0; --i)
+ {
+ vec<T, Cols> tmp(0);
+ for (uint j = 0; j < Cols; ++j)
+ {
+ tmp[j] = m[j][i - 1];
+ }
+ res = fma(tmp, vec<T, Cols>(v[i - 1]), res);
+ }
+ return res;
+}
+
+template<typename T, int Cols, int Rows>
+vec<T, Rows> spvFMulMatrixVector(matrix<T, Cols, Rows> m, vec<T, Cols> v)
+{
+ vec<T, Rows> res = vec<T, Rows>(0);
+ for (uint i = Cols; i > 0; --i)
+ {
+ res = fma(m[i - 1], vec<T, Rows>(v[i - 1]), res);
+ }
+ return res;
+}
+
+template<typename T, int LCols, int LRows, int RCols, int RRows>
+matrix<T, RCols, LRows> spvFMulMatrixMatrix(matrix<T, LCols, LRows> l, matrix<T, RCols, RRows> r)
+{
+ matrix<T, RCols, LRows> res;
+ for (uint i = 0; i < RCols; i++)
+ {
+ vec<T, RCols> tmp(0);
+ for (uint j = 0; j < LCols; j++)
+ {
+ tmp = fma(vec<T, RCols>(r[i][j]), l[j], tmp);
+ }
+ res[i] = tmp;
+ }
+ return res;
+}
+
+vertex main0_out main0(main0_in in [[stage_in]], constant Matrices& _22 [[buffer(0)]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 4> OutWorldPos = {};
+ float4 _37 = float4(in.InPos, 1.0);
+ out.gl_Position = spvFMulMatrixVector(spvFMulMatrixMatrix(_22.vpMatrix, _22.wMatrix), _37);
+ OutWorldPos[0] = spvFMulMatrixVector(_22.wMatrix, _37);
+ OutWorldPos[1] = spvFMulVectorMatrix(_37, _22.wMatrix);
+ OutWorldPos[2] = spvFMulMatrixVector(_22.wMatrix3x4, in.InPos);
+ OutWorldPos[3] = spvFMulVectorMatrix(in.InPos, _22.wMatrix4x3);
+ out.OutNormal = spvFMulMatrixVector(_22.wMatrix, float4(in.InNormal, 0.0)).xyz;
+ out.OutWorldPos_0 = OutWorldPos[0];
+ out.OutWorldPos_1 = OutWorldPos[1];
+ out.OutWorldPos_2 = OutWorldPos[2];
+ out.OutWorldPos_3 = OutWorldPos[3];
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/float-math.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/float-math.vert
new file mode 100644
index 00000000000..da468c24c9b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/float-math.vert
@@ -0,0 +1,88 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct Matrices
+{
+ float4x4 vpMatrix;
+ float4x4 wMatrix;
+ float4x3 wMatrix4x3;
+ float3x4 wMatrix3x4;
+};
+
+struct main0_out
+{
+ float3 OutNormal [[user(locn0)]];
+ float4 OutWorldPos_0 [[user(locn1)]];
+ float4 OutWorldPos_1 [[user(locn2)]];
+ float4 OutWorldPos_2 [[user(locn3)]];
+ float4 OutWorldPos_3 [[user(locn4)]];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float3 InPos [[attribute(0)]];
+ float3 InNormal [[attribute(1)]];
+};
+
+vertex main0_out main0(main0_in in [[stage_in]], constant Matrices& _22 [[buffer(0)]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 4> OutWorldPos = {};
+ float4 _37 = float4(in.InPos, 1.0);
+ out.gl_Position = (_22.vpMatrix * _22.wMatrix) * _37;
+ OutWorldPos[0] = _22.wMatrix * _37;
+ OutWorldPos[1] = _37 * _22.wMatrix;
+ OutWorldPos[2] = _22.wMatrix3x4 * in.InPos;
+ OutWorldPos[3] = in.InPos * _22.wMatrix4x3;
+ out.OutNormal = (_22.wMatrix * float4(in.InNormal, 0.0)).xyz;
+ out.OutWorldPos_0 = OutWorldPos[0];
+ out.OutWorldPos_1 = OutWorldPos[1];
+ out.OutWorldPos_2 = OutWorldPos[2];
+ out.OutWorldPos_3 = OutWorldPos[3];
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/functions.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/functions.vert
index 7a598d48ad8..73eaa8b7517 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/functions.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/functions.vert
@@ -59,20 +59,23 @@ inline T spvFindSMSB(T x)
}
// Returns the determinant of a 2x2 matrix.
-inline float spvDet2x2(float a1, float a2, float b1, float b2)
+static inline __attribute__((always_inline))
+float spvDet2x2(float a1, float a2, float b1, float b2)
{
return a1 * b2 - b1 * a2;
}
// Returns the determinant of a 3x3 matrix.
-inline float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
+static inline __attribute__((always_inline))
+float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
{
return a1 * spvDet2x2(b2, b3, c2, c3) - b1 * spvDet2x2(a2, a3, c2, c3) + c1 * spvDet2x2(a2, a3, b2, b3);
}
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
// adjoint and dividing by the determinant. The contents of the matrix are changed.
-inline float4x4 spvInverse4x4(float4x4 m)
+static inline __attribute__((always_inline))
+float4x4 spvInverse4x4(float4x4 m)
{
float4x4 adj; // The adjoint matrix (inverse after dividing by determinant)
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/in_out_array_mat.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/in_out_array_mat.vert
index 0d6976e2606..7a74f49a49e 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/in_out_array_mat.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/in_out_array_mat.vert
@@ -1,8 +1,49 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct UBO
{
float4x4 projection;
@@ -40,7 +81,7 @@ vertex main0_out main0(main0_in in [[stage_in]], constant UBO& ubo [[buffer(0)]]
{
main0_out out = {};
float4x4 outTransModel = {};
- float4 colors[3] = {};
+ spvUnsafeArray<float4, 3> colors = {};
float4x4 inViewMat = {};
colors[0] = in.colors_0;
colors[1] = in.colors_1;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/interface-block-block-composites.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/interface-block-block-composites.frag
index 90d732cc52b..4b27f4a3d56 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/interface-block-block-composites.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/interface-block-block-composites.frag
@@ -1,13 +1,54 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct Vert
{
float3x3 wMatrix;
float4 wTmp;
- float arr[4];
+ spvUnsafeArray<float, 4> arr;
};
struct main0_out
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/interface-block-block-composites.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/interface-block-block-composites.vert
index 3d97ae6dcff..69f271a83cb 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/interface-block-block-composites.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/interface-block-block-composites.vert
@@ -1,11 +1,52 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct Vert
{
- float arr[3];
+ spvUnsafeArray<float, 3> arr;
float3x3 wMatrix;
float4 wTmp;
};
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/texture_buffer.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/texture_buffer.vert
index 677a2f8fdd6..3b3d92b5654 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/texture_buffer.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/texture_buffer.vert
@@ -11,7 +11,8 @@ struct main0_out
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag
index 23c554940b8..67895e3e92c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag
@@ -1,8 +1,49 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct main0_out
{
float4 FragColor [[color(0)]];
@@ -20,7 +61,7 @@ struct main0_in
fragment main0_out main0(main0_in in [[stage_in]], constant uint* spvViewMask [[buffer(24)]], texture2d<float> uTex [[texture(0)]], sampler uTexSmplr [[sampler(0)]], uint gl_ViewIndex [[render_target_array_index]])
{
main0_out out = {};
- float2 vTex[4] = {};
+ spvUnsafeArray<float2, 4> vTex = {};
vTex[0] = in.vTex_0;
vTex[1] = in.vTex_1;
vTex[2] = in.vTex_2;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag
new file mode 100644
index 00000000000..090d0b99b44
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag
@@ -0,0 +1,366 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_844;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_860;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_876;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_892;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_908;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_956;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_972;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_988;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1004;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1660;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1676;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1692;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2012;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2084;
+ float PrePadding_View_2088;
+ float PrePadding_View_2092;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2164;
+ float PrePadding_View_2168;
+ float PrePadding_View_2172;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2204;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2348;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2488;
+ float PrePadding_View_2492;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2648;
+ float PrePadding_View_2652;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2828;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2844;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2860;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2876;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_2892;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_MobileDirectionalLight
+{
+ float4 MobileDirectionalLight_DirectionalLightColor;
+ float4 MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition;
+ float4 MobileDirectionalLight_DirectionalLightShadowSize;
+ float4 MobileDirectionalLight_DirectionalLightDistanceFadeMAD;
+ float4 MobileDirectionalLight_DirectionalLightShadowDistances;
+ float4x4 MobileDirectionalLight_DirectionalLightScreenToShadow[4];
+};
+
+struct type_Globals
+{
+ int NumDynamicPointLights;
+ float4 LightPositionAndInvRadius[4];
+ float4 LightColorAndFalloffExponent[4];
+ float4 MobileReflectionParams;
+};
+
+constant float3 _136 = {};
+constant float4 _137 = {};
+constant float _138 = {};
+constant float3 _573 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+struct main0_in
+{
+ float2 in_var_TEXCOORD0 [[user(locn0)]];
+ float4 in_var_TEXCOORD7 [[user(locn1)]];
+ float4 in_var_TEXCOORD8 [[user(locn2)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_MobileDirectionalLight& MobileDirectionalLight [[buffer(1)]], constant type_Globals& _Globals [[buffer(2)]], texture2d<float> MobileDirectionalLight_DirectionalLightShadowTexture [[texture(0)]], texture2d<float> Material_Texture2D_0 [[texture(1)]], texture2d<float> Material_Texture2D_1 [[texture(2)]], texturecube<float> ReflectionCubemap [[texture(3)]], sampler MobileDirectionalLight_DirectionalLightShadowSampler [[sampler(0)]], sampler Material_Texture2D_0Sampler [[sampler(1)]], sampler Material_Texture2D_1Sampler [[sampler(2)]], sampler ReflectionCubemapSampler [[sampler(3)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ float4 _177 = float4((((gl_FragCoord.xy - View.View_ViewRectMin.xy) * View.View_ViewSizeAndInvSize.zw) - float2(0.5)) * float2(2.0, -2.0), _138, 1.0) * float4(gl_FragCoord.w);
+ float3 _181 = normalize(-in.in_var_TEXCOORD8.xyz);
+ float2 _190 = (Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (in.in_var_TEXCOORD0 * float2(10.0))).xy * float2(2.0)) - float2(1.0);
+ float3 _206 = normalize(float3x3(float3(1.0, 0.0, 0.0), float3(0.0, 1.0, 0.0), float3(0.0, 0.0, 1.0)) * (((float4(_190, sqrt(fast::clamp(1.0 - dot(_190, _190), 0.0, 1.0)), 1.0).xyz * float3(0.300000011920928955078125, 0.300000011920928955078125, 1.0)) * float3(View.View_NormalOverrideParameter.w)) + View.View_NormalOverrideParameter.xyz));
+ float _208 = dot(_206, _181);
+ float _219 = mix(0.4000000059604644775390625, 1.0, Material_Texture2D_1.sample(Material_Texture2D_1Sampler, (in.in_var_TEXCOORD0 * float2(20.0))).x);
+ float4 _223 = Material_Texture2D_1.sample(Material_Texture2D_1Sampler, (in.in_var_TEXCOORD0 * float2(5.0)));
+ float _224 = _177.w;
+ float _228 = fast::min(fast::max((_224 - 24.0) * 0.000666666659526526927947998046875, 0.0), 1.0);
+ float _229 = _223.y;
+ float4 _233 = Material_Texture2D_1.sample(Material_Texture2D_1Sampler, (in.in_var_TEXCOORD0 * float2(0.5)));
+ float _235 = _233.y;
+ float _253 = fast::clamp((fast::min(fast::max(mix(0.0, 0.5, _235) + mix(mix(0.699999988079071044921875, 1.0, _229), 1.0, _228), 0.0), 1.0) * View.View_RoughnessOverrideParameter.y) + View.View_RoughnessOverrideParameter.x, 0.119999997317790985107421875, 1.0);
+ float2 _257 = (float2(_253) * float2(-1.0, -0.0274999998509883880615234375)) + float2(1.0, 0.0425000004470348358154296875);
+ float _258 = _257.x;
+ float3 _270 = (fast::clamp(float3(mix(_219, 1.0 - _219, mix(_229, 1.0, _228)) * (mix(0.2949999868869781494140625, 0.660000026226043701171875, mix(_235 + mix(_229, 0.0, _228), 0.5, 0.5)) * 0.5)), float3(0.0), float3(1.0)) * float3(View.View_DiffuseOverrideParameter.w)) + View.View_DiffuseOverrideParameter.xyz;
+ float3 _275 = float3(((fast::min(_258 * _258, exp2((-9.27999973297119140625) * fast::max(_208, 0.0))) * _258) + _257.y) * View.View_SpecularOverrideParameter.w) + View.View_SpecularOverrideParameter.xyz;
+ float _276 = _275.x;
+ float4 _303;
+ int _286 = 0;
+ for (;;)
+ {
+ if (_286 < 2)
+ {
+ if (_224 < MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowDistances[uint(_286)])
+ {
+ _303 = MobileDirectionalLight.MobileDirectionalLight_DirectionalLightScreenToShadow[_286] * float4(_177.xy, _224, 1.0);
+ break;
+ }
+ _286++;
+ continue;
+ }
+ else
+ {
+ _303 = float4(0.0);
+ break;
+ }
+ }
+ float _423;
+ if (_303.z > 0.0)
+ {
+ float2 _311 = _303.xy * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.xy;
+ float2 _312 = fract(_311);
+ float2 _313 = floor(_311);
+ float3 _320 = _573;
+ _320.x = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(-0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _326 = _320;
+ _326.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5, -0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _332 = _326;
+ _332.z = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(1.5, -0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _335 = float3(MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.w);
+ float3 _337 = float3((fast::min(_303.z, 0.999989986419677734375) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.w) - 1.0);
+ float3 _339 = fast::clamp((_332 * _335) - _337, float3(0.0), float3(1.0));
+ float3 _345 = _573;
+ _345.x = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(-0.5, 0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _351 = _345;
+ _351.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _357 = _351;
+ _357.z = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(1.5, 0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _360 = fast::clamp((_357 * _335) - _337, float3(0.0), float3(1.0));
+ float3 _366 = _573;
+ _366.x = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(-0.5, 1.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _372 = _366;
+ _372.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5, 1.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _378 = _372;
+ _378.z = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(1.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _381 = fast::clamp((_378 * _335) - _337, float3(0.0), float3(1.0));
+ float _383 = _312.x;
+ float _384 = 1.0 - _383;
+ float3 _399 = _136;
+ _399.x = ((_339.x * _384) + _339.y) + (_339.z * _383);
+ float3 _403 = _399;
+ _403.y = ((_360.x * _384) + _360.y) + (_360.z * _383);
+ float3 _407 = _403;
+ _407.z = ((_381.x * _384) + _381.y) + (_381.z * _383);
+ float _408 = _312.y;
+ float _420 = fast::clamp((_224 * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDistanceFadeMAD.x) + MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDistanceFadeMAD.y, 0.0, 1.0);
+ _423 = mix(fast::clamp(0.25 * dot(_407, float3(1.0 - _408, 1.0, _408)), 0.0, 1.0), 1.0, _420 * _420);
+ }
+ else
+ {
+ _423 = 1.0;
+ }
+ float3 _429 = normalize(_181 + MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.xyz);
+ float _439 = (_253 * 0.25) + 0.25;
+ float3 _440 = cross(_206, _429);
+ float _442 = _253 * _253;
+ float _443 = fast::max(0.0, dot(_206, _429)) * _442;
+ float _446 = _442 / (dot(_440, _440) + (_443 * _443));
+ bool _458 = float(_Globals.MobileReflectionParams.w > 0.0) != 0.0;
+ float4 _468 = ReflectionCubemap.sample(ReflectionCubemapSampler, ((-_181) + ((_206 * float3(_208)) * float3(2.0))), level(((_458 ? _Globals.MobileReflectionParams.w : View.View_ReflectionCubemapMaxMip) - 1.0) - (1.0 - (1.2000000476837158203125 * log2(_253)))));
+ float3 _481;
+ if (_458)
+ {
+ _481 = _468.xyz * View.View_SkyLightColor.xyz;
+ }
+ else
+ {
+ float3 _476 = _468.xyz * float3(_468.w * 16.0);
+ _481 = _476 * _476;
+ }
+ float3 _484 = float3(_276);
+ float3 _488;
+ _488 = ((float3(_423 * fast::max(0.0, dot(_206, MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.xyz))) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightColor.xyz) * (_270 + float3(_276 * (_439 * fast::min(_446 * _446, 65504.0))))) + (_481 * _484);
+ float3 _507;
+ float _509;
+ float _511;
+ float _537;
+ int _491 = 0;
+ for (;;)
+ {
+ if (_491 < _Globals.NumDynamicPointLights)
+ {
+ float3 _501 = _Globals.LightPositionAndInvRadius[_491].xyz - (in.in_var_TEXCOORD8.xyz - float3(View.View_PreViewTranslation));
+ float _502 = dot(_501, _501);
+ float3 _505 = _501 * float3(rsqrt(_502));
+ _507 = normalize(_181 + _505);
+ _509 = fast::max(0.0, dot(_206, _505));
+ _511 = fast::max(0.0, dot(_206, _507));
+ if (_Globals.LightColorAndFalloffExponent[_491].w == 0.0)
+ {
+ float _531 = _502 * (_Globals.LightPositionAndInvRadius[_491].w * _Globals.LightPositionAndInvRadius[_491].w);
+ float _534 = fast::clamp(1.0 - (_531 * _531), 0.0, 1.0);
+ _537 = (1.0 / (_502 + 1.0)) * (_534 * _534);
+ }
+ else
+ {
+ float3 _521 = _501 * float3(_Globals.LightPositionAndInvRadius[_491].w);
+ _537 = pow(1.0 - fast::clamp(dot(_521, _521), 0.0, 1.0), _Globals.LightColorAndFalloffExponent[_491].w);
+ }
+ float3 _544 = cross(_206, _507);
+ float _546 = _511 * _442;
+ float _549 = _442 / (dot(_544, _544) + (_546 * _546));
+ _488 += fast::min(float3(65000.0), ((float3(_537 * _509) * _Globals.LightColorAndFalloffExponent[_491].xyz) * float3(0.3183098733425140380859375)) * (_270 + float3(_276 * (_439 * fast::min(_549 * _549, 65504.0)))));
+ _491++;
+ continue;
+ }
+ else
+ {
+ break;
+ }
+ }
+ float3 _567 = (mix(_488, _270 + _484, float3(View.View_UnlitViewmodeMask)) * float3(in.in_var_TEXCOORD7.w)) + in.in_var_TEXCOORD7.xyz;
+ float4 _571 = float4(_567.x, _567.y, _567.z, _137.w);
+ _571.w = fast::min(in.in_var_TEXCOORD8.w, 65500.0);
+ out.out_var_SV_Target0 = _571;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/array-copy-error.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/array-copy-error.asm.frag
new file mode 100644
index 00000000000..e43b7bd3796
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/array-copy-error.asm.frag
@@ -0,0 +1,356 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_ClipToWorld;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_908;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_924;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_940;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_956;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_972;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_1020;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_1036;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_1052;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1068;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1724;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1740;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1756;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2076;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2148;
+ float PrePadding_View_2152;
+ float PrePadding_View_2156;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2228;
+ float PrePadding_View_2232;
+ float PrePadding_View_2236;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2268;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2412;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ float View_AtmosphericFogSunDiscHalfApexAngleRadian;
+ float PrePadding_View_2492;
+ float4 View_AtmosphericFogSunDiscLuminance;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ uint PrePadding_View_2520;
+ uint PrePadding_View_2524;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2584;
+ float PrePadding_View_2588;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2744;
+ float PrePadding_View_2748;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float PrePadding_View_2908;
+ int2 View_CursorPosition;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ float PrePadding_View_2924;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2940;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2956;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2972;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2988;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_3004;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_PrimitiveDither
+{
+ float PrimitiveDither_LODFactor;
+};
+
+struct type_PrimitiveFade
+{
+ float2 PrimitiveFade_FadeTimeScaleBias;
+};
+
+struct type_Material
+{
+ float4 Material_VectorExpressions[9];
+ float4 Material_ScalarExpressions[3];
+};
+
+constant float _98 = {};
+constant float _103 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+ float gl_FragDepth [[depth(less)]];
+};
+
+struct main0_in
+{
+ float4 in_var_TEXCOORD6 [[user(locn0)]];
+ float4 in_var_TEXCOORD7 [[user(locn1)]];
+ float4 in_var_TEXCOORD10_centroid [[user(locn2)]];
+ float4 in_var_TEXCOORD11_centroid [[user(locn3)]];
+ float4 in_var_TEXCOORD0_0 [[user(locn4)]];
+};
+
+static inline __attribute__((always_inline))
+void _353()
+{
+ discard_fragment();
+}
+
+fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_PrimitiveDither& PrimitiveDither [[buffer(1)]], constant type_PrimitiveFade& PrimitiveFade [[buffer(2)]], constant type_Material& Material [[buffer(3)]], texture2d<float> Material_Texture2D_0 [[texture(0)]], texture2d<float> Material_Texture2D_3 [[texture(1)]], sampler Material_Texture2D_0Sampler [[sampler(0)]], sampler Material_Texture2D_3Sampler [[sampler(1)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 1> in_var_TEXCOORD0 = {};
+ in_var_TEXCOORD0[0] = in.in_var_TEXCOORD0_0;
+ float2 _135 = gl_FragCoord.xy - View.View_ViewRectMin.xy;
+ float4 _140 = float4(_103, _103, gl_FragCoord.z, 1.0) * float4(gl_FragCoord.w);
+ float4 _144 = View.View_SVPositionToTranslatedWorld * float4(gl_FragCoord.xyz, 1.0);
+ float3 _148 = _144.xyz / float3(_144.w);
+ float3 _149 = _148 - float3(View.View_PreViewTranslation);
+ float3 _151 = normalize(-_148);
+ float3 _152 = _151 * float3x3(in.in_var_TEXCOORD10_centroid.xyz, cross(in.in_var_TEXCOORD11_centroid.xyz, in.in_var_TEXCOORD10_centroid.xyz) * float3(in.in_var_TEXCOORD11_centroid.w), in.in_var_TEXCOORD11_centroid.xyz);
+ float _170 = mix(Material.Material_ScalarExpressions[0].y, Material.Material_ScalarExpressions[0].z, fast::min(fast::max(abs(dot(_151, in.in_var_TEXCOORD11_centroid.xyz)), 0.0), 1.0));
+ float _172 = 1.0 / _170;
+ float2 _174 = (float2(Material.Material_ScalarExpressions[0].x) * ((_152.xy * float2(-1.0)) / float2(_152.z))) * float2(_172);
+ float _180_copy;
+ float2 _183;
+ _183 = float2(0.0);
+ float _188;
+ float _211;
+ float2 _212;
+ float _180 = 1.0;
+ int _185 = 0;
+ float _187 = 1.0;
+ float _189 = 1.0;
+ for (;;)
+ {
+ if (float(_185) < (floor(_170) + 2.0))
+ {
+ _188 = Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y) + _183), gradient2d(dfdx(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y)), dfdy(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y)))).y;
+ if (_180 < _188)
+ {
+ float _201 = _188 - _180;
+ float _203 = _201 / ((_189 - _187) + _201);
+ _211 = (_189 * _203) + (_180 * (1.0 - _203));
+ _212 = _183 - (float2(_203) * _174);
+ break;
+ }
+ _180_copy = _180;
+ _180 -= _172;
+ _183 += _174;
+ _185++;
+ _187 = _188;
+ _189 = _180_copy;
+ continue;
+ }
+ else
+ {
+ _211 = _98;
+ _212 = _183;
+ break;
+ }
+ }
+ float4 _218 = Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y) + _212.xy), bias(View.View_MaterialTextureMipBias));
+ float2 _229 = _135 + float2(View.View_TemporalAAParams.x);
+ float _237 = float((uint(_229.x) + (2u * uint(_229.y))) % 5u);
+ float2 _238 = _135 * float2(0.015625);
+ float4 _242 = Material_Texture2D_3.sample(Material_Texture2D_3Sampler, _238, bias(View.View_MaterialTextureMipBias));
+ float4 _254 = Material_Texture2D_3.sample(Material_Texture2D_3Sampler, _238, bias(View.View_MaterialTextureMipBias));
+ float3 _272 = float3(_212, (1.0 - _211) * Material.Material_ScalarExpressions[0].x);
+ float2 _275 = dfdx(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y));
+ float2 _276 = abs(_275);
+ float3 _279 = dfdx(_149);
+ float2 _283 = dfdy(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y));
+ float2 _284 = abs(_283);
+ float3 _287 = dfdy(_149);
+ if (PrimitiveDither.PrimitiveDither_LODFactor != 0.0)
+ {
+ if (abs(PrimitiveDither.PrimitiveDither_LODFactor) > 0.001000000047497451305389404296875)
+ {
+ float _317 = fract(cos(dot(floor(gl_FragCoord.xy), float2(347.834503173828125, 3343.28369140625))) * 1000.0);
+ if ((float((PrimitiveDither.PrimitiveDither_LODFactor < 0.0) ? ((PrimitiveDither.PrimitiveDither_LODFactor + 1.0) > _317) : (PrimitiveDither.PrimitiveDither_LODFactor < _317)) - 0.001000000047497451305389404296875) < 0.0)
+ {
+ _353();
+ }
+ }
+ }
+ if ((((_218.z + ((fast::min(fast::max(1.0 - (_218.x * Material.Material_ScalarExpressions[2].y), 0.0), 1.0) + ((_237 + (_242.x * Material.Material_ScalarExpressions[2].z)) * 0.16666667163372039794921875)) + (-0.5))) * ((fast::clamp((View.View_RealTime * PrimitiveFade.PrimitiveFade_FadeTimeScaleBias.x) + PrimitiveFade.PrimitiveFade_FadeTimeScaleBias.y, 0.0, 1.0) + ((_237 + _254.x) * 0.16666667163372039794921875)) + (-0.5))) - 0.33329999446868896484375) < 0.0)
+ {
+ _353();
+ }
+ float2 _351 = ((((in.in_var_TEXCOORD6.xy / float2(in.in_var_TEXCOORD6.w)) - View.View_TemporalAAJitter.xy) - ((in.in_var_TEXCOORD7.xy / float2(in.in_var_TEXCOORD7.w)) - View.View_TemporalAAJitter.zw)) * float2(0.2495000064373016357421875)) + float2(0.49999237060546875);
+ out.gl_FragDepth = fast::min(_140.z / (_140.w + (sqrt(dot(_272, _272)) / (fast::max(sqrt(dot(_276, _276)) / sqrt(dot(_279, _279)), sqrt(dot(_284, _284)) / sqrt(dot(_287, _287))) / abs(dot(float3x3(View.View_ViewToTranslatedWorld[0].xyz, View.View_ViewToTranslatedWorld[1].xyz, View.View_ViewToTranslatedWorld[2].xyz) * float3(0.0, 0.0, 1.0), _151))))), gl_FragCoord.z);
+ out.out_var_SV_Target0 = float4(_351.x, _351.y, float2(0.0).x, float2(0.0).y);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/depth-compare.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/depth-compare.asm.frag
new file mode 100644
index 00000000000..7f593efeef8
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/depth-compare.asm.frag
@@ -0,0 +1,314 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_844;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_860;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_876;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_892;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_908;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_956;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_972;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_988;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1004;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1660;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1676;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1692;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2012;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2084;
+ float PrePadding_View_2088;
+ float PrePadding_View_2092;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2164;
+ float PrePadding_View_2168;
+ float PrePadding_View_2172;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2204;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2348;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2488;
+ float PrePadding_View_2492;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2648;
+ float PrePadding_View_2652;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2828;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2844;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2860;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2876;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_2892;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_Globals
+{
+ float3 SoftTransitionScale;
+ float4x4 ShadowViewProjectionMatrices[6];
+ float InvShadowmapResolution;
+ float ShadowFadeFraction;
+ float ShadowSharpen;
+ float4 LightPositionAndInvRadius;
+ float2 ProjectionDepthBiasParameters;
+ float4 PointLightDepthBiasAndProjParameters;
+};
+
+constant float4 _453 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_Globals& _Globals [[buffer(1)]], texture2d<float> SceneTexturesStruct_SceneDepthTexture [[texture(0)]], texture2d<float> SceneTexturesStruct_GBufferATexture [[texture(1)]], texture2d<float> SceneTexturesStruct_GBufferBTexture [[texture(2)]], texture2d<float> SceneTexturesStruct_GBufferDTexture [[texture(3)]], depthcube<float> ShadowDepthCubeTexture [[texture(4)]], texture2d<float> SSProfilesTexture [[texture(5)]], sampler SceneTexturesStruct_SceneDepthTextureSampler [[sampler(0)]], sampler SceneTexturesStruct_GBufferATextureSampler [[sampler(1)]], sampler SceneTexturesStruct_GBufferBTextureSampler [[sampler(2)]], sampler SceneTexturesStruct_GBufferDTextureSampler [[sampler(3)]], sampler ShadowDepthTextureSampler [[sampler(4)]], sampler ShadowDepthCubeTextureSampler [[sampler(5)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ float2 _114 = gl_FragCoord.xy * View.View_BufferSizeAndInvSize.zw;
+ float4 _118 = SceneTexturesStruct_SceneDepthTexture.sample(SceneTexturesStruct_SceneDepthTextureSampler, _114, level(0.0));
+ float _119 = _118.x;
+ float _133 = ((_119 * View.View_InvDeviceZToWorldZTransform.x) + View.View_InvDeviceZToWorldZTransform.y) + (1.0 / ((_119 * View.View_InvDeviceZToWorldZTransform.z) - View.View_InvDeviceZToWorldZTransform.w));
+ float4 _147 = View.View_ScreenToWorld * float4(((_114 - View.View_ScreenPositionScaleBias.wz) / View.View_ScreenPositionScaleBias.xy) * float2(_133), _133, 1.0);
+ float3 _148 = _147.xyz;
+ float3 _152 = _Globals.LightPositionAndInvRadius.xyz - _148;
+ float _158 = length(_152);
+ bool _160 = (_158 * _Globals.LightPositionAndInvRadius.w) < 1.0;
+ float _207;
+ if (_160)
+ {
+ float3 _165 = abs(_152);
+ float _166 = _165.x;
+ float _167 = _165.y;
+ float _168 = _165.z;
+ float _170 = fast::max(_166, fast::max(_167, _168));
+ int _189;
+ if (_170 == _166)
+ {
+ _189 = (_166 == _152.x) ? 0 : 1;
+ }
+ else
+ {
+ int _185;
+ if (_170 == _167)
+ {
+ _185 = (_167 == _152.y) ? 2 : 3;
+ }
+ else
+ {
+ _185 = (_168 == _152.z) ? 4 : 5;
+ }
+ _189 = _185;
+ }
+ float4 _196 = _Globals.ShadowViewProjectionMatrices[_189] * float4(_147.xyz, 1.0);
+ float _198 = _196.w;
+ _207 = ShadowDepthCubeTexture.sample_compare(ShadowDepthCubeTextureSampler, (_152 / float3(_158)), (_196.z / _198) + ((-_Globals.PointLightDepthBiasAndProjParameters.x) / _198), level(0.0));
+ }
+ else
+ {
+ _207 = 1.0;
+ }
+ float _213 = fast::clamp(((_207 - 0.5) * _Globals.ShadowSharpen) + 0.5, 0.0, 1.0);
+ float _218 = sqrt(mix(1.0, _213 * _213, _Globals.ShadowFadeFraction));
+ float4 _219 = _453;
+ _219.z = _218;
+ float3 _236 = normalize((SceneTexturesStruct_GBufferATexture.sample(SceneTexturesStruct_GBufferATextureSampler, _114, level(0.0)).xyz * float3(2.0)) - float3(1.0));
+ uint _240 = uint(round(SceneTexturesStruct_GBufferBTexture.sample(SceneTexturesStruct_GBufferBTextureSampler, _114, level(0.0)).w * 255.0));
+ bool _248 = (_240 & 15u) == 5u;
+ float _448;
+ if (_248)
+ {
+ float4 _260 = SSProfilesTexture.read(uint2(int3(1, int(uint((select(float4(0.0), SceneTexturesStruct_GBufferDTexture.sample(SceneTexturesStruct_GBufferDTextureSampler, _114, level(0.0)), bool4(!(((_240 & 4294967280u) & 16u) != 0u))).x * 255.0) + 0.5)), 0).xy), 0);
+ float _263 = _260.y * 0.5;
+ float _274 = pow(fast::clamp(dot(-(_152 * float3(rsqrt(dot(_152, _152)))), _236), 0.0, 1.0), 1.0);
+ float _445;
+ if (_160)
+ {
+ float3 _278 = _152 / float3(_158);
+ float3 _280 = normalize(cross(_278, float3(0.0, 0.0, 1.0)));
+ float3 _284 = float3(_Globals.InvShadowmapResolution);
+ float3 _285 = _280 * _284;
+ float3 _286 = cross(_280, _278) * _284;
+ float3 _287 = abs(_278);
+ float _288 = _287.x;
+ float _289 = _287.y;
+ float _290 = _287.z;
+ float _292 = fast::max(_288, fast::max(_289, _290));
+ int _311;
+ if (_292 == _288)
+ {
+ _311 = (_288 == _278.x) ? 0 : 1;
+ }
+ else
+ {
+ int _307;
+ if (_292 == _289)
+ {
+ _307 = (_289 == _278.y) ? 2 : 3;
+ }
+ else
+ {
+ _307 = (_290 == _278.z) ? 4 : 5;
+ }
+ _311 = _307;
+ }
+ float4 _318 = _Globals.ShadowViewProjectionMatrices[_311] * float4(_148 - (_236 * float3(_263)), 1.0);
+ float _323 = _260.x * (10.0 / _Globals.LightPositionAndInvRadius.w);
+ float _329 = (1.0 / (((_318.z / _318.w) * _Globals.PointLightDepthBiasAndProjParameters.z) - _Globals.PointLightDepthBiasAndProjParameters.w)) * _Globals.LightPositionAndInvRadius.w;
+ float _342 = (_329 - ((1.0 / ((float4(ShadowDepthCubeTexture.sample(ShadowDepthTextureSampler, (_278 + (_286 * float3(2.5))), level(0.0))).x * _Globals.PointLightDepthBiasAndProjParameters.z) - _Globals.PointLightDepthBiasAndProjParameters.w)) * _Globals.LightPositionAndInvRadius.w)) * _323;
+ float _364 = (_329 - ((1.0 / ((float4(ShadowDepthCubeTexture.sample(ShadowDepthTextureSampler, ((_278 + (_285 * float3(2.3776409626007080078125))) + (_286 * float3(0.77254199981689453125))), level(0.0))).x * _Globals.PointLightDepthBiasAndProjParameters.z) - _Globals.PointLightDepthBiasAndProjParameters.w)) * _Globals.LightPositionAndInvRadius.w)) * _323;
+ float _387 = (_329 - ((1.0 / ((float4(ShadowDepthCubeTexture.sample(ShadowDepthTextureSampler, ((_278 + (_285 * float3(1.46946299076080322265625))) + (_286 * float3(-2.0225429534912109375))), level(0.0))).x * _Globals.PointLightDepthBiasAndProjParameters.z) - _Globals.PointLightDepthBiasAndProjParameters.w)) * _Globals.LightPositionAndInvRadius.w)) * _323;
+ float _410 = (_329 - ((1.0 / ((float4(ShadowDepthCubeTexture.sample(ShadowDepthTextureSampler, ((_278 + (_285 * float3(-1.46946299076080322265625))) + (_286 * float3(-2.02254199981689453125))), level(0.0))).x * _Globals.PointLightDepthBiasAndProjParameters.z) - _Globals.PointLightDepthBiasAndProjParameters.w)) * _Globals.LightPositionAndInvRadius.w)) * _323;
+ float _433 = (_329 - ((1.0 / ((float4(ShadowDepthCubeTexture.sample(ShadowDepthTextureSampler, ((_278 + (_285 * float3(-2.3776409626007080078125))) + (_286 * float3(0.772543013095855712890625))), level(0.0))).x * _Globals.PointLightDepthBiasAndProjParameters.z) - _Globals.PointLightDepthBiasAndProjParameters.w)) * _Globals.LightPositionAndInvRadius.w)) * _323;
+ _445 = (((((fast::clamp(abs((_342 > 0.0) ? (_342 + _263) : fast::max(0.0, (_342 * _274) + _263)), 0.1500000059604644775390625, 5.0) + 0.25) + (fast::clamp(abs((_364 > 0.0) ? (_364 + _263) : fast::max(0.0, (_364 * _274) + _263)), 0.1500000059604644775390625, 5.0) + 0.25)) + (fast::clamp(abs((_387 > 0.0) ? (_387 + _263) : fast::max(0.0, (_387 * _274) + _263)), 0.1500000059604644775390625, 5.0) + 0.25)) + (fast::clamp(abs((_410 > 0.0) ? (_410 + _263) : fast::max(0.0, (_410 * _274) + _263)), 0.1500000059604644775390625, 5.0) + 0.25)) + (fast::clamp(abs((_433 > 0.0) ? (_433 + _263) : fast::max(0.0, (_433 * _274) + _263)), 0.1500000059604644775390625, 5.0) + 0.25)) * 0.20000000298023223876953125;
+ }
+ else
+ {
+ _445 = 1.0;
+ }
+ _448 = 1.0 - (_445 * 0.20000000298023223876953125);
+ }
+ else
+ {
+ _448 = 1.0;
+ }
+ float4 _451 = float4(float3(1.0).x, float3(1.0).y, _219.z, float3(1.0).z);
+ _451.w = _248 ? sqrt(_448) : _218;
+ out.out_var_SV_Target0 = _451;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/global-constant-arrays.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/global-constant-arrays.asm.frag
new file mode 100644
index 00000000000..165b511b3fb
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/global-constant-arrays.asm.frag
@@ -0,0 +1,1364 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_Globals
+{
+ float4 MappingPolynomial;
+ float3 InverseGamma;
+ float4 ColorMatrixR_ColorCurveCd1;
+ float4 ColorMatrixG_ColorCurveCd3Cm3;
+ float4 ColorMatrixB_ColorCurveCm2;
+ float4 ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3;
+ float4 ColorCurve_Ch1_Ch2;
+ float4 ColorShadow_Luma;
+ float4 ColorShadow_Tint1;
+ float4 ColorShadow_Tint2;
+ float FilmSlope;
+ float FilmToe;
+ float FilmShoulder;
+ float FilmBlackClip;
+ float FilmWhiteClip;
+ packed_float3 ColorScale;
+ float4 OverlayColor;
+ float WhiteTemp;
+ float WhiteTint;
+ float4 ColorSaturation;
+ float4 ColorContrast;
+ float4 ColorGamma;
+ float4 ColorGain;
+ float4 ColorOffset;
+ float4 ColorSaturationShadows;
+ float4 ColorContrastShadows;
+ float4 ColorGammaShadows;
+ float4 ColorGainShadows;
+ float4 ColorOffsetShadows;
+ float4 ColorSaturationMidtones;
+ float4 ColorContrastMidtones;
+ float4 ColorGammaMidtones;
+ float4 ColorGainMidtones;
+ float4 ColorOffsetMidtones;
+ float4 ColorSaturationHighlights;
+ float4 ColorContrastHighlights;
+ float4 ColorGammaHighlights;
+ float4 ColorGainHighlights;
+ float4 ColorOffsetHighlights;
+ float ColorCorrectionShadowsMax;
+ float ColorCorrectionHighlightsMin;
+ uint OutputDevice;
+ uint OutputGamut;
+ float BlueCorrection;
+ float ExpandGamut;
+};
+
+constant spvUnsafeArray<float, 6> _475 = spvUnsafeArray<float, 6>({ -4.0, -4.0, -3.1573765277862548828125, -0.485249996185302734375, 1.84773242473602294921875, 1.84773242473602294921875 });
+constant spvUnsafeArray<float, 6> _476 = spvUnsafeArray<float, 6>({ -0.718548238277435302734375, 2.0810306072235107421875, 3.66812419891357421875, 4.0, 4.0, 4.0 });
+constant spvUnsafeArray<float, 10> _479 = spvUnsafeArray<float, 10>({ -4.97062206268310546875, -3.0293781757354736328125, -2.1261999607086181640625, -1.5104999542236328125, -1.0578000545501708984375, -0.4668000042438507080078125, 0.11937999725341796875, 0.7088134288787841796875, 1.2911865711212158203125, 1.2911865711212158203125 });
+constant spvUnsafeArray<float, 10> _480 = spvUnsafeArray<float, 10>({ 0.80891323089599609375, 1.19108676910400390625, 1.5683000087738037109375, 1.94830000400543212890625, 2.308300018310546875, 2.63840007781982421875, 2.85949993133544921875, 2.9872608184814453125, 3.0127391815185546875, 3.0127391815185546875 });
+constant spvUnsafeArray<float, 10> _482 = spvUnsafeArray<float, 10>({ -2.3010299205780029296875, -2.3010299205780029296875, -1.9312000274658203125, -1.5204999446868896484375, -1.0578000545501708984375, -0.4668000042438507080078125, 0.11937999725341796875, 0.7088134288787841796875, 1.2911865711212158203125, 1.2911865711212158203125 });
+constant spvUnsafeArray<float, 10> _483 = spvUnsafeArray<float, 10>({ 0.801995217800140380859375, 1.19800484180450439453125, 1.5943000316619873046875, 1.99730002880096435546875, 2.3782999515533447265625, 2.7683999538421630859375, 3.0515000820159912109375, 3.2746293544769287109375, 3.32743072509765625, 3.32743072509765625 });
+
+constant float3 _391 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+struct main0_in
+{
+ float2 in_var_TEXCOORD0 [[user(locn0), center_no_perspective]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globals [[buffer(0)]], uint gl_Layer [[render_target_array_index]])
+{
+ main0_out out = {};
+ float3x3 _546 = float3x3(float3(0.41245639324188232421875, 0.3575761020183563232421875, 0.180437505245208740234375), float3(0.21267290413379669189453125, 0.715152204036712646484375, 0.072175003588199615478515625), float3(0.01933390088379383087158203125, 0.119191996753215789794921875, 0.950304090976715087890625)) * float3x3(float3(1.01303005218505859375, 0.0061053098179399967193603515625, -0.014971000142395496368408203125), float3(0.0076982299797236919403076171875, 0.99816501140594482421875, -0.005032029934227466583251953125), float3(-0.0028413101099431514739990234375, 0.0046851597726345062255859375, 0.92450702190399169921875));
+ float3x3 _547 = _546 * float3x3(float3(1.6410233974456787109375, -0.324803292751312255859375, -0.23642469942569732666015625), float3(-0.663662850856781005859375, 1.6153316497802734375, 0.016756348311901092529296875), float3(0.01172189414501190185546875, -0.008284442126750946044921875, 0.98839485645294189453125));
+ float3x3 _548 = float3x3(float3(0.662454187870025634765625, 0.1340042054653167724609375, 0.1561876833438873291015625), float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625), float3(-0.0055746496655046939849853515625, 0.0040607335977256298065185546875, 1.01033914089202880859375)) * float3x3(float3(0.98722398281097412109375, -0.0061132698319852352142333984375, 0.01595330052077770233154296875), float3(-0.007598360069096088409423828125, 1.00186002254486083984375, 0.0053300200961530208587646484375), float3(0.003072570078074932098388671875, -0.0050959498621523380279541015625, 1.0816800594329833984375));
+ float3x3 _549 = _548 * float3x3(float3(3.2409698963165283203125, -1.53738319873809814453125, -0.4986107647418975830078125), float3(-0.96924364566802978515625, 1.875967502593994140625, 0.0415550582110881805419921875), float3(0.055630080401897430419921875, -0.2039769589900970458984375, 1.05697154998779296875));
+ float3x3 _550 = float3x3(float3(0.952552378177642822265625, 0.0, 9.25), float3(0.3439664542675018310546875, 0.728166103363037109375, -0.07213254272937774658203125), float3(0.0, 0.0, 1.00882518291473388671875)) * float3x3(float3(1.6410233974456787109375, -0.324803292751312255859375, -0.23642469942569732666015625), float3(-0.663662850856781005859375, 1.6153316497802734375, 0.016756348311901092529296875), float3(0.01172189414501190185546875, -0.008284442126750946044921875, 0.98839485645294189453125));
+ float3x3 _551 = float3x3(float3(0.662454187870025634765625, 0.1340042054653167724609375, 0.1561876833438873291015625), float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625), float3(-0.0055746496655046939849853515625, 0.0040607335977256298065185546875, 1.01033914089202880859375)) * float3x3(float3(1.04981100559234619140625, 0.0, -9.74845024757087230682373046875e-05), float3(-0.49590301513671875, 1.37331306934356689453125, 0.09824003279209136962890625), float3(0.0, 0.0, 0.991252005100250244140625));
+ float3x3 _576;
+ for (;;)
+ {
+ if (_Globals.OutputGamut == 1u)
+ {
+ _576 = _548 * float3x3(float3(2.493396282196044921875, -0.931345880031585693359375, -0.4026944935321807861328125), float3(-0.829486787319183349609375, 1.76265966892242431640625, 0.02362460084259510040283203125), float3(0.0358506999909877777099609375, -0.076182700693607330322265625, 0.957014024257659912109375));
+ break;
+ }
+ else
+ {
+ if (_Globals.OutputGamut == 2u)
+ {
+ _576 = _548 * float3x3(float3(1.71660840511322021484375, -0.3556621074676513671875, -0.253360092639923095703125), float3(-0.666682898998260498046875, 1.61647760868072509765625, 0.01576850004494190216064453125), float3(0.017642199993133544921875, -0.04277630150318145751953125, 0.94222867488861083984375));
+ break;
+ }
+ else
+ {
+ if (_Globals.OutputGamut == 3u)
+ {
+ _576 = float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625));
+ break;
+ }
+ else
+ {
+ if (_Globals.OutputGamut == 4u)
+ {
+ _576 = float3x3(float3(1.0, 0.0, 0.0), float3(0.0, 1.0, 0.0), float3(0.0, 0.0, 1.0));
+ break;
+ }
+ else
+ {
+ _576 = _549;
+ break;
+ }
+ }
+ }
+ }
+ }
+ float3 _577 = float4((in.in_var_TEXCOORD0 - float2(0.015625)) * float2(1.03225803375244140625), float(gl_Layer) * 0.0322580635547637939453125, 0.0).xyz;
+ float3 _599;
+ if (_Globals.OutputDevice >= 3u)
+ {
+ float3 _591 = pow(_577, float3(0.0126833133399486541748046875));
+ _599 = pow(fast::max(float3(0.0), _591 - float3(0.8359375)) / (float3(18.8515625) - (float3(18.6875) * _591)), float3(6.277394771575927734375)) * float3(10000.0);
+ }
+ else
+ {
+ _599 = (exp2((_577 - float3(0.434017598628997802734375)) * float3(14.0)) * float3(0.180000007152557373046875)) - (exp2(float3(-6.0762462615966796875)) * float3(0.180000007152557373046875));
+ }
+ float _602 = _Globals.WhiteTemp * 1.00055634975433349609375;
+ float _616 = (_602 <= 7000.0) ? (0.24406300485134124755859375 + ((99.1100006103515625 + ((2967800.0 - (4604438528.0 / _Globals.WhiteTemp)) / _602)) / _602)) : (0.23703999817371368408203125 + ((247.4799957275390625 + ((1901800.0 - (2005284352.0 / _Globals.WhiteTemp)) / _602)) / _602));
+ float _633 = ((0.860117733478546142578125 + (0.00015411825734190642833709716796875 * _Globals.WhiteTemp)) + ((1.2864121856637211749330163002014e-07 * _Globals.WhiteTemp) * _Globals.WhiteTemp)) / ((1.0 + (0.0008424202096648514270782470703125 * _Globals.WhiteTemp)) + ((7.0814513719597016461193561553955e-07 * _Globals.WhiteTemp) * _Globals.WhiteTemp));
+ float _644 = ((0.317398726940155029296875 + (4.25 * _Globals.WhiteTemp)) + ((4.2048167614439080352894961833954e-08 * _Globals.WhiteTemp) * _Globals.WhiteTemp)) / ((1.0 - (2.8974181986995972692966461181641e-05 * _Globals.WhiteTemp)) + ((1.6145605741257895715534687042236e-07 * _Globals.WhiteTemp) * _Globals.WhiteTemp));
+ float _649 = ((2.0 * _633) - (8.0 * _644)) + 4.0;
+ float2 _653 = float2((3.0 * _633) / _649, (2.0 * _644) / _649);
+ float2 _660 = normalize(float2(_633, _644));
+ float _665 = _633 + (((-_660.y) * _Globals.WhiteTint) * 0.0500000007450580596923828125);
+ float _669 = _644 + ((_660.x * _Globals.WhiteTint) * 0.0500000007450580596923828125);
+ float _674 = ((2.0 * _665) - (8.0 * _669)) + 4.0;
+ float2 _680 = select(float2(_616, ((((-3.0) * _616) * _616) + (2.86999988555908203125 * _616)) - 0.2750000059604644775390625), _653, bool2(_Globals.WhiteTemp < 4000.0)) + (float2((3.0 * _665) / _674, (2.0 * _669) / _674) - _653);
+ float _681 = _680.x;
+ float _682 = _680.y;
+ float _683 = fast::max(_682, 1.0000000133514319600180897396058e-10);
+ float3 _685 = _391;
+ _685.x = _681 / _683;
+ float3 _686 = _685;
+ _686.y = 1.0;
+ float3 _690 = _686;
+ _690.z = ((1.0 - _681) - _682) / _683;
+ float3 _693 = _391;
+ _693.x = 0.950455963611602783203125;
+ float3 _694 = _693;
+ _694.y = 1.0;
+ float3 _696 = _694;
+ _696.z = 1.0890576839447021484375;
+ float3 _697 = _690 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ float3 _698 = _696 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ float3 _717 = (_599 * ((float3x3(float3(0.41245639324188232421875, 0.3575761020183563232421875, 0.180437505245208740234375), float3(0.21267290413379669189453125, 0.715152204036712646484375, 0.072175003588199615478515625), float3(0.01933390088379383087158203125, 0.119191996753215789794921875, 0.950304090976715087890625)) * ((float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875)) * float3x3(float3(_698.x / _697.x, 0.0, 0.0), float3(0.0, _698.y / _697.y, 0.0), float3(0.0, 0.0, _698.z / _697.z))) * float3x3(float3(0.986992895603179931640625, -0.14705429971218109130859375, 0.15996269881725311279296875), float3(0.4323053061962127685546875, 0.518360316753387451171875, 0.049291200935840606689453125), float3(-0.00852870009839534759521484375, 0.0400427989661693572998046875, 0.968486726284027099609375)))) * float3x3(float3(3.2409698963165283203125, -1.53738319873809814453125, -0.4986107647418975830078125), float3(-0.96924364566802978515625, 1.875967502593994140625, 0.0415550582110881805419921875), float3(0.055630080401897430419921875, -0.2039769589900970458984375, 1.05697154998779296875)))) * _547;
+ float3 _745;
+ if (_Globals.ColorShadow_Tint2.w != 0.0)
+ {
+ float _724 = dot(_717, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625));
+ float3 _727 = (_717 / float3(_724)) - float3(1.0);
+ _745 = mix(_717, _717 * (_549 * (float3x3(float3(0.544169127941131591796875, 0.23959259688854217529296875, 0.16669429838657379150390625), float3(0.23946559429168701171875, 0.702153027057647705078125, 0.058381401002407073974609375), float3(-0.0023439000360667705535888671875, 0.0361833982169628143310546875, 1.05521833896636962890625)) * float3x3(float3(1.6410233974456787109375, -0.324803292751312255859375, -0.23642469942569732666015625), float3(-0.663662850856781005859375, 1.6153316497802734375, 0.016756348311901092529296875), float3(0.01172189414501190185546875, -0.008284442126750946044921875, 0.98839485645294189453125)))), float3((1.0 - exp2((-4.0) * dot(_727, _727))) * (1.0 - exp2((((-4.0) * _Globals.ExpandGamut) * _724) * _724))));
+ }
+ else
+ {
+ _745 = _717;
+ }
+ float _746 = dot(_745, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625));
+ float4 _751 = _Globals.ColorSaturationShadows * _Globals.ColorSaturation;
+ float4 _756 = _Globals.ColorContrastShadows * _Globals.ColorContrast;
+ float4 _761 = _Globals.ColorGammaShadows * _Globals.ColorGamma;
+ float4 _766 = _Globals.ColorGainShadows * _Globals.ColorGain;
+ float4 _771 = _Globals.ColorOffsetShadows + _Globals.ColorOffset;
+ float3 _772 = float3(_746);
+ float _804 = smoothstep(0.0, _Globals.ColorCorrectionShadowsMax, _746);
+ float4 _808 = _Globals.ColorSaturationHighlights * _Globals.ColorSaturation;
+ float4 _811 = _Globals.ColorContrastHighlights * _Globals.ColorContrast;
+ float4 _814 = _Globals.ColorGammaHighlights * _Globals.ColorGamma;
+ float4 _817 = _Globals.ColorGainHighlights * _Globals.ColorGain;
+ float4 _820 = _Globals.ColorOffsetHighlights + _Globals.ColorOffset;
+ float _852 = smoothstep(_Globals.ColorCorrectionHighlightsMin, 1.0, _746);
+ float4 _855 = _Globals.ColorSaturationMidtones * _Globals.ColorSaturation;
+ float4 _858 = _Globals.ColorContrastMidtones * _Globals.ColorContrast;
+ float4 _861 = _Globals.ColorGammaMidtones * _Globals.ColorGamma;
+ float4 _864 = _Globals.ColorGainMidtones * _Globals.ColorGain;
+ float4 _867 = _Globals.ColorOffsetMidtones + _Globals.ColorOffset;
+ float3 _905 = ((((pow(pow(fast::max(float3(0.0), mix(_772, _745, _751.xyz * float3(_751.w))) * float3(5.5555553436279296875), _756.xyz * float3(_756.w)) * float3(0.180000007152557373046875), float3(1.0) / (_761.xyz * float3(_761.w))) * (_766.xyz * float3(_766.w))) + (_771.xyz + float3(_771.w))) * float3(1.0 - _804)) + (((pow(pow(fast::max(float3(0.0), mix(_772, _745, _855.xyz * float3(_855.w))) * float3(5.5555553436279296875), _858.xyz * float3(_858.w)) * float3(0.180000007152557373046875), float3(1.0) / (_861.xyz * float3(_861.w))) * (_864.xyz * float3(_864.w))) + (_867.xyz + float3(_867.w))) * float3(_804 - _852))) + (((pow(pow(fast::max(float3(0.0), mix(_772, _745, _808.xyz * float3(_808.w))) * float3(5.5555553436279296875), _811.xyz * float3(_811.w)) * float3(0.180000007152557373046875), float3(1.0) / (_814.xyz * float3(_814.w))) * (_817.xyz * float3(_817.w))) + (_820.xyz + float3(_820.w))) * float3(_852));
+ float3 _906 = _905 * _549;
+ float3 _914 = float3(_Globals.BlueCorrection);
+ float3 _916 = mix(_905, _905 * ((_551 * float3x3(float3(0.940437257289886474609375, -0.01830687932670116424560546875, 0.07786960899829864501953125), float3(0.008378696627914905548095703125, 0.82866001129150390625, 0.162961304187774658203125), float3(0.0005471261101774871349334716796875, -0.00088337459601461887359619140625, 1.00033628940582275390625))) * _550), _914) * _551;
+ float _917 = _916.x;
+ float _918 = _916.y;
+ float _920 = _916.z;
+ float _923 = fast::max(fast::max(_917, _918), _920);
+ float _928 = (fast::max(_923, 1.0000000133514319600180897396058e-10) - fast::max(fast::min(fast::min(_917, _918), _920), 1.0000000133514319600180897396058e-10)) / fast::max(_923, 0.00999999977648258209228515625);
+ float _941 = ((_920 + _918) + _917) + (1.75 * sqrt(((_920 * (_920 - _918)) + (_918 * (_918 - _917))) + (_917 * (_917 - _920))));
+ float _942 = _941 * 0.3333333432674407958984375;
+ float _943 = _928 - 0.4000000059604644775390625;
+ float _948 = fast::max(1.0 - abs(_943 * 2.5), 0.0);
+ float _956 = (1.0 + (float(int(sign(_943 * 5.0))) * (1.0 - (_948 * _948)))) * 0.02500000037252902984619140625;
+ float _969;
+ if (_942 <= 0.053333334624767303466796875)
+ {
+ _969 = _956;
+ }
+ else
+ {
+ float _968;
+ if (_942 >= 0.1599999964237213134765625)
+ {
+ _968 = 0.0;
+ }
+ else
+ {
+ _968 = _956 * ((0.23999999463558197021484375 / _941) - 0.5);
+ }
+ _969 = _968;
+ }
+ float3 _972 = _916 * float3(1.0 + _969);
+ float _973 = _972.x;
+ float _974 = _972.y;
+ float _976 = _972.z;
+ float _990;
+ if ((_973 == _974) && (_974 == _976))
+ {
+ _990 = 0.0;
+ }
+ else
+ {
+ _990 = 57.2957763671875 * atan2(sqrt(3.0) * (_974 - _976), ((2.0 * _973) - _974) - _976);
+ }
+ float _995;
+ if (_990 < 0.0)
+ {
+ _995 = _990 + 360.0;
+ }
+ else
+ {
+ _995 = _990;
+ }
+ float _996 = fast::clamp(_995, 0.0, 360.0);
+ float _1001;
+ if (_996 > 180.0)
+ {
+ _1001 = _996 - 360.0;
+ }
+ else
+ {
+ _1001 = _996;
+ }
+ float _1005 = smoothstep(0.0, 1.0, 1.0 - abs(_1001 * 0.01481481455266475677490234375));
+ float3 _1012 = _972;
+ _1012.x = _973 + ((((_1005 * _1005) * _928) * (0.02999999932944774627685546875 - _973)) * 0.180000007152557373046875);
+ float3 _1014 = fast::max(float3(0.0), _1012 * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)));
+ float _1023 = (1.0 + _Globals.FilmBlackClip) - _Globals.FilmToe;
+ float _1026 = 1.0 + _Globals.FilmWhiteClip;
+ float _1029 = _1026 - _Globals.FilmShoulder;
+ float _1056;
+ if (_Globals.FilmToe > 0.800000011920928955078125)
+ {
+ _1056 = ((0.819999992847442626953125 - _Globals.FilmToe) / _Globals.FilmSlope) + (log(0.180000007152557373046875) / log(10.0));
+ }
+ else
+ {
+ float _1035 = (0.180000007152557373046875 + _Globals.FilmBlackClip) / _1023;
+ _1056 = (log(0.180000007152557373046875) / log(10.0)) - ((0.5 * log(_1035 / (2.0 - _1035))) * (_1023 / _Globals.FilmSlope));
+ }
+ float _1061 = ((1.0 - _Globals.FilmToe) / _Globals.FilmSlope) - _1056;
+ float _1063 = (_Globals.FilmShoulder / _Globals.FilmSlope) - _1061;
+ float _1065 = log(10.0);
+ float3 _1067 = log(mix(float3(dot(_1014, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1014, float3(0.959999978542327880859375))) / float3(_1065);
+ float3 _1071 = float3(_Globals.FilmSlope) * (_1067 + float3(_1061));
+ float3 _1079 = float3(_1056);
+ float3 _1080 = _1067 - _1079;
+ float3 _1092 = float3(_1063);
+ float3 _1106 = fast::clamp(_1080 / float3(_1063 - _1056), float3(0.0), float3(1.0));
+ float3 _1110 = select(_1106, float3(1.0) - _1106, bool3(_1063 < _1056));
+ float3 _1115 = mix(select(_1071, float3(-_Globals.FilmBlackClip) + (float3(2.0 * _1023) / (float3(1.0) + exp(float3(((-2.0) * _Globals.FilmSlope) / _1023) * _1080))), _1067 < _1079), select(_1071, float3(_1026) - (float3(2.0 * _1029) / (float3(1.0) + exp(float3((2.0 * _Globals.FilmSlope) / _1029) * (_1067 - _1092)))), _1067 > _1092), ((float3(3.0) - (float3(2.0) * _1110)) * _1110) * _1110);
+ float3 _1119 = fast::max(float3(0.0), mix(float3(dot(_1115, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1115, float3(0.930000007152557373046875)));
+ float3 _1189;
+ if (_Globals.ColorShadow_Tint2.w == 0.0)
+ {
+ float3 _1131 = _391;
+ _1131.x = dot(_906, _Globals.ColorMatrixR_ColorCurveCd1.xyz);
+ float3 _1136 = _1131;
+ _1136.y = dot(_906, _Globals.ColorMatrixG_ColorCurveCd3Cm3.xyz);
+ float3 _1141 = _1136;
+ _1141.z = dot(_906, _Globals.ColorMatrixB_ColorCurveCm2.xyz);
+ float3 _1157 = fast::max(float3(0.0), _1141 * (_Globals.ColorShadow_Tint1.xyz + (_Globals.ColorShadow_Tint2.xyz * float3(1.0 / (dot(_906, _Globals.ColorShadow_Luma.xyz) + 1.0)))));
+ float3 _1162 = fast::max(float3(0.0), _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx - _1157);
+ float3 _1164 = fast::max(_1157, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz);
+ _1189 = ((((_1164 * _Globals.ColorCurve_Ch1_Ch2.xxx) + _Globals.ColorCurve_Ch1_Ch2.yyy) * (float3(1.0) / (_1164 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.www))) + ((fast::clamp(_1157, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz) * _Globals.ColorMatrixB_ColorCurveCm2.www) + (((_1162 * _Globals.ColorMatrixR_ColorCurveCd1.www) * (float3(1.0) / (_1162 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.yyy))) + _Globals.ColorMatrixG_ColorCurveCd3Cm3.www))) - float3(0.00200000009499490261077880859375);
+ }
+ else
+ {
+ _1189 = fast::max(float3(0.0), mix(_1119, _1119 * ((_551 * float3x3(float3(1.06317996978759765625, 0.02339559979736804962158203125, -0.08657260239124298095703125), float3(-0.010633699595928192138671875, 1.2063200473785400390625, -0.1956900060176849365234375), float3(-0.0005908869788981974124908447265625, 0.00105247995816171169281005859375, 0.999538004398345947265625))) * _550), _914) * _549);
+ }
+ float3 _1218 = pow(fast::max(float3(0.0), mix((((float3(_Globals.MappingPolynomial.x) * (_1189 * _1189)) + (float3(_Globals.MappingPolynomial.y) * _1189)) + float3(_Globals.MappingPolynomial.z)) * float3(_Globals.ColorScale), _Globals.OverlayColor.xyz, float3(_Globals.OverlayColor.w))), float3(_Globals.InverseGamma.y));
+ float3 _3001;
+ if (_Globals.OutputDevice == 0u)
+ {
+ float _2961 = _1218.x;
+ float _2973;
+ for (;;)
+ {
+ if (_2961 < 0.00313066993840038776397705078125)
+ {
+ _2973 = _2961 * 12.9200000762939453125;
+ break;
+ }
+ _2973 = (pow(_2961, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ float _2974 = _1218.y;
+ float _2986;
+ for (;;)
+ {
+ if (_2974 < 0.00313066993840038776397705078125)
+ {
+ _2986 = _2974 * 12.9200000762939453125;
+ break;
+ }
+ _2986 = (pow(_2974, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ float _2987 = _1218.z;
+ float _2999;
+ for (;;)
+ {
+ if (_2987 < 0.00313066993840038776397705078125)
+ {
+ _2999 = _2987 * 12.9200000762939453125;
+ break;
+ }
+ _2999 = (pow(_2987, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ _3001 = float3(_2973, _2986, _2999);
+ }
+ else
+ {
+ float3 _2960;
+ if (_Globals.OutputDevice == 1u)
+ {
+ float3 _2953 = fast::max(float3(6.1035199905745685100555419921875e-05), (_1218 * _547) * _576);
+ _2960 = fast::min(_2953 * float3(4.5), (pow(fast::max(_2953, float3(0.017999999225139617919921875)), float3(0.449999988079071044921875)) * float3(1.09899997711181640625)) - float3(0.098999999463558197021484375));
+ }
+ else
+ {
+ float3 _2950;
+ if ((_Globals.OutputDevice == 3u) || (_Globals.OutputDevice == 5u))
+ {
+ float3 _2100 = (_906 * float3(1.5)) * (_546 * float3x3(float3(1.04981100559234619140625, 0.0, -9.74845024757087230682373046875e-05), float3(-0.49590301513671875, 1.37331306934356689453125, 0.09824003279209136962890625), float3(0.0, 0.0, 0.991252005100250244140625)));
+ float _2101 = _2100.x;
+ float _2102 = _2100.y;
+ float _2104 = _2100.z;
+ float _2107 = fast::max(fast::max(_2101, _2102), _2104);
+ float _2112 = (fast::max(_2107, 1.0000000133514319600180897396058e-10) - fast::max(fast::min(fast::min(_2101, _2102), _2104), 1.0000000133514319600180897396058e-10)) / fast::max(_2107, 0.00999999977648258209228515625);
+ float _2125 = ((_2104 + _2102) + _2101) + (1.75 * sqrt(((_2104 * (_2104 - _2102)) + (_2102 * (_2102 - _2101))) + (_2101 * (_2101 - _2104))));
+ float _2126 = _2125 * 0.3333333432674407958984375;
+ float _2127 = _2112 - 0.4000000059604644775390625;
+ float _2132 = fast::max(1.0 - abs(_2127 * 2.5), 0.0);
+ float _2140 = (1.0 + (float(int(sign(_2127 * 5.0))) * (1.0 - (_2132 * _2132)))) * 0.02500000037252902984619140625;
+ float _2153;
+ if (_2126 <= 0.053333334624767303466796875)
+ {
+ _2153 = _2140;
+ }
+ else
+ {
+ float _2152;
+ if (_2126 >= 0.1599999964237213134765625)
+ {
+ _2152 = 0.0;
+ }
+ else
+ {
+ _2152 = _2140 * ((0.23999999463558197021484375 / _2125) - 0.5);
+ }
+ _2153 = _2152;
+ }
+ float3 _2156 = _2100 * float3(1.0 + _2153);
+ float _2157 = _2156.x;
+ float _2158 = _2156.y;
+ float _2160 = _2156.z;
+ float _2174;
+ if ((_2157 == _2158) && (_2158 == _2160))
+ {
+ _2174 = 0.0;
+ }
+ else
+ {
+ _2174 = 57.2957763671875 * atan2(sqrt(3.0) * (_2158 - _2160), ((2.0 * _2157) - _2158) - _2160);
+ }
+ float _2179;
+ if (_2174 < 0.0)
+ {
+ _2179 = _2174 + 360.0;
+ }
+ else
+ {
+ _2179 = _2174;
+ }
+ float _2180 = fast::clamp(_2179, 0.0, 360.0);
+ float _2185;
+ if (_2180 > 180.0)
+ {
+ _2185 = _2180 - 360.0;
+ }
+ else
+ {
+ _2185 = _2180;
+ }
+ float _2235;
+ if ((_2185 > (-67.5)) && (_2185 < 67.5))
+ {
+ float _2192 = (_2185 - (-67.5)) * 0.0296296291053295135498046875;
+ int _2193 = int(_2192);
+ float _2195 = _2192 - float(_2193);
+ float _2196 = _2195 * _2195;
+ float _2197 = _2196 * _2195;
+ float _2234;
+ if (_2193 == 3)
+ {
+ _2234 = (((_2197 * (-0.16666667163372039794921875)) + (_2196 * 0.5)) + (_2195 * (-0.5))) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _2227;
+ if (_2193 == 2)
+ {
+ _2227 = ((_2197 * 0.5) + (_2196 * (-1.0))) + 0.666666686534881591796875;
+ }
+ else
+ {
+ float _2222;
+ if (_2193 == 1)
+ {
+ _2222 = (((_2197 * (-0.5)) + (_2196 * 0.5)) + (_2195 * 0.5)) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _2215;
+ if (_2193 == 0)
+ {
+ _2215 = _2197 * 0.16666667163372039794921875;
+ }
+ else
+ {
+ _2215 = 0.0;
+ }
+ _2222 = _2215;
+ }
+ _2227 = _2222;
+ }
+ _2234 = _2227;
+ }
+ _2235 = _2234;
+ }
+ else
+ {
+ _2235 = 0.0;
+ }
+ float3 _2242 = _2156;
+ _2242.x = _2157 + ((((_2235 * 1.5) * _2112) * (0.02999999932944774627685546875 - _2157)) * 0.180000007152557373046875);
+ float3 _2245 = fast::clamp(fast::clamp(_2242, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ float3 _2248 = mix(float3(dot(_2245, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _2245, float3(0.959999978542327880859375));
+ float _2249 = _2248.x;
+ float _2253 = 0.17999999225139617919921875 * exp2(18.0);
+ float _2255 = exp2(-14.0);
+ float _2258 = log((_2249 <= 0.0) ? _2255 : _2249) / _1065;
+ float _2260 = log(0.17999999225139617919921875 * exp2(-15.0)) / _1065;
+ float _2327;
+ if (_2258 <= _2260)
+ {
+ _2327 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _2267 = log(0.180000007152557373046875) / _1065;
+ float _2324;
+ if ((_2258 > _2260) && (_2258 < _2267))
+ {
+ float _2307 = (3.0 * (_2258 - _2260)) / (_2267 - _2260);
+ int _2308 = int(_2307);
+ float _2310 = _2307 - float(_2308);
+ _2324 = dot(float3(_2310 * _2310, _2310, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_2308], _475[_2308 + 1], _475[_2308 + 2]));
+ }
+ else
+ {
+ float _2275 = log(_2253) / _1065;
+ float _2303;
+ if ((_2258 >= _2267) && (_2258 < _2275))
+ {
+ float _2286 = (3.0 * (_2258 - _2267)) / (_2275 - _2267);
+ int _2287 = int(_2286);
+ float _2289 = _2286 - float(_2287);
+ _2303 = dot(float3(_2289 * _2289, _2289, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_2287], _476[_2287 + 1], _476[_2287 + 2]));
+ }
+ else
+ {
+ _2303 = log(10000.0) / _1065;
+ }
+ _2324 = _2303;
+ }
+ _2327 = _2324;
+ }
+ float3 _2329 = _391;
+ _2329.x = pow(10.0, _2327);
+ float _2330 = _2248.y;
+ float _2334 = log((_2330 <= 0.0) ? _2255 : _2330) / _1065;
+ float _2401;
+ if (_2334 <= _2260)
+ {
+ _2401 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _2341 = log(0.180000007152557373046875) / _1065;
+ float _2398;
+ if ((_2334 > _2260) && (_2334 < _2341))
+ {
+ float _2381 = (3.0 * (_2334 - _2260)) / (_2341 - _2260);
+ int _2382 = int(_2381);
+ float _2384 = _2381 - float(_2382);
+ _2398 = dot(float3(_2384 * _2384, _2384, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_2382], _475[_2382 + 1], _475[_2382 + 2]));
+ }
+ else
+ {
+ float _2349 = log(_2253) / _1065;
+ float _2377;
+ if ((_2334 >= _2341) && (_2334 < _2349))
+ {
+ float _2360 = (3.0 * (_2334 - _2341)) / (_2349 - _2341);
+ int _2361 = int(_2360);
+ float _2363 = _2360 - float(_2361);
+ _2377 = dot(float3(_2363 * _2363, _2363, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_2361], _476[_2361 + 1], _476[_2361 + 2]));
+ }
+ else
+ {
+ _2377 = log(10000.0) / _1065;
+ }
+ _2398 = _2377;
+ }
+ _2401 = _2398;
+ }
+ float3 _2403 = _2329;
+ _2403.y = pow(10.0, _2401);
+ float _2404 = _2248.z;
+ float _2408 = log((_2404 <= 0.0) ? _2255 : _2404) / _1065;
+ float _2475;
+ if (_2408 <= _2260)
+ {
+ _2475 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _2415 = log(0.180000007152557373046875) / _1065;
+ float _2472;
+ if ((_2408 > _2260) && (_2408 < _2415))
+ {
+ float _2455 = (3.0 * (_2408 - _2260)) / (_2415 - _2260);
+ int _2456 = int(_2455);
+ float _2458 = _2455 - float(_2456);
+ _2472 = dot(float3(_2458 * _2458, _2458, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_2456], _475[_2456 + 1], _475[_2456 + 2]));
+ }
+ else
+ {
+ float _2423 = log(_2253) / _1065;
+ float _2451;
+ if ((_2408 >= _2415) && (_2408 < _2423))
+ {
+ float _2434 = (3.0 * (_2408 - _2415)) / (_2423 - _2415);
+ int _2435 = int(_2434);
+ float _2437 = _2434 - float(_2435);
+ _2451 = dot(float3(_2437 * _2437, _2437, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_2435], _476[_2435 + 1], _476[_2435 + 2]));
+ }
+ else
+ {
+ _2451 = log(10000.0) / _1065;
+ }
+ _2472 = _2451;
+ }
+ _2475 = _2472;
+ }
+ float3 _2477 = _2403;
+ _2477.z = pow(10.0, _2475);
+ float3 _2479 = (_2477 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ float _2481 = 0.17999999225139617919921875 * pow(2.0, -12.0);
+ float _2485 = log((_2481 <= 0.0) ? _2255 : _2481) / _1065;
+ float _2552;
+ if (_2485 <= _2260)
+ {
+ _2552 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _2492 = log(0.180000007152557373046875) / _1065;
+ float _2549;
+ if ((_2485 > _2260) && (_2485 < _2492))
+ {
+ float _2532 = (3.0 * (_2485 - _2260)) / (_2492 - _2260);
+ int _2533 = int(_2532);
+ float _2535 = _2532 - float(_2533);
+ _2549 = dot(float3(_2535 * _2535, _2535, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_2533], _475[_2533 + 1], _475[_2533 + 2]));
+ }
+ else
+ {
+ float _2500 = log(_2253) / _1065;
+ float _2528;
+ if ((_2485 >= _2492) && (_2485 < _2500))
+ {
+ float _2511 = (3.0 * (_2485 - _2492)) / (_2500 - _2492);
+ int _2512 = int(_2511);
+ float _2514 = _2511 - float(_2512);
+ _2528 = dot(float3(_2514 * _2514, _2514, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_2512], _476[_2512 + 1], _476[_2512 + 2]));
+ }
+ else
+ {
+ _2528 = log(10000.0) / _1065;
+ }
+ _2549 = _2528;
+ }
+ _2552 = _2549;
+ }
+ float _2555 = log(0.180000007152557373046875) / _1065;
+ float _2611;
+ if (_2555 <= _2260)
+ {
+ _2611 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _2608;
+ if ((_2555 > _2260) && (_2555 < _2555))
+ {
+ _2608 = (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-0.485249996185302734375, 1.84773242473602294921875, 1.84773242473602294921875)).z;
+ }
+ else
+ {
+ float _2568 = log(_2253) / _1065;
+ float _2596;
+ if ((_2555 >= _2555) && (_2555 < _2568))
+ {
+ float _2579 = (3.0 * (_2555 - _2555)) / (_2568 - _2555);
+ int _2580 = int(_2579);
+ float _2582 = _2579 - float(_2580);
+ _2596 = dot(float3(_2582 * _2582, _2582, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_2580], _476[_2580 + 1], _476[_2580 + 2]));
+ }
+ else
+ {
+ _2596 = log(10000.0) / _1065;
+ }
+ _2608 = _2596;
+ }
+ _2611 = _2608;
+ }
+ float _2612 = pow(10.0, _2611);
+ float _2614 = 0.17999999225139617919921875 * pow(2.0, 10.0);
+ float _2618 = log((_2614 <= 0.0) ? _2255 : _2614) / _1065;
+ float _2683;
+ if (_2618 <= _2260)
+ {
+ _2683 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _2680;
+ if ((_2618 > _2260) && (_2618 < _2555))
+ {
+ float _2663 = (3.0 * (_2618 - _2260)) / (_2555 - _2260);
+ int _2664 = int(_2663);
+ float _2666 = _2663 - float(_2664);
+ _2680 = dot(float3(_2666 * _2666, _2666, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_2664], _475[_2664 + 1], _475[_2664 + 2]));
+ }
+ else
+ {
+ float _2631 = log(_2253) / _1065;
+ float _2659;
+ if ((_2618 >= _2555) && (_2618 < _2631))
+ {
+ float _2642 = (3.0 * (_2618 - _2555)) / (_2631 - _2555);
+ int _2643 = int(_2642);
+ float _2645 = _2642 - float(_2643);
+ _2659 = dot(float3(_2645 * _2645, _2645, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_2643], _476[_2643 + 1], _476[_2643 + 2]));
+ }
+ else
+ {
+ _2659 = log(10000.0) / _1065;
+ }
+ _2680 = _2659;
+ }
+ _2683 = _2680;
+ }
+ float _2684 = pow(10.0, _2683);
+ float _2685 = _2479.x;
+ float _2689 = log((_2685 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2685) / _1065;
+ float _2690 = log(pow(10.0, _2552));
+ float _2691 = _2690 / _1065;
+ float _2768;
+ if (_2689 <= _2691)
+ {
+ _2768 = (_2689 * 3.0) + ((log(9.9999997473787516355514526367188e-05) / _1065) - ((3.0 * _2690) / _1065));
+ }
+ else
+ {
+ float _2698 = log(_2612) / _1065;
+ float _2760;
+ if ((_2689 > _2691) && (_2689 < _2698))
+ {
+ float _2743 = (7.0 * (_2689 - _2691)) / (_2698 - _2691);
+ int _2744 = int(_2743);
+ float _2746 = _2743 - float(_2744);
+ _2760 = dot(float3(_2746 * _2746, _2746, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_479[_2744], _479[_2744 + 1], _479[_2744 + 2]));
+ }
+ else
+ {
+ float _2705 = log(_2684);
+ float _2706 = _2705 / _1065;
+ float _2739;
+ if ((_2689 >= _2698) && (_2689 < _2706))
+ {
+ float _2722 = (7.0 * (_2689 - _2698)) / (_2706 - _2698);
+ int _2723 = int(_2722);
+ float _2725 = _2722 - float(_2723);
+ _2739 = dot(float3(_2725 * _2725, _2725, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_480[_2723], _480[_2723 + 1], _480[_2723 + 2]));
+ }
+ else
+ {
+ _2739 = (_2689 * 0.0599999986588954925537109375) + ((log(1000.0) / _1065) - ((0.0599999986588954925537109375 * _2705) / _1065));
+ }
+ _2760 = _2739;
+ }
+ _2768 = _2760;
+ }
+ float3 _2770 = _391;
+ _2770.x = pow(10.0, _2768);
+ float _2771 = _2479.y;
+ float _2775 = log((_2771 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2771) / _1065;
+ float _2852;
+ if (_2775 <= _2691)
+ {
+ _2852 = (_2775 * 3.0) + ((log(9.9999997473787516355514526367188e-05) / _1065) - ((3.0 * _2690) / _1065));
+ }
+ else
+ {
+ float _2782 = log(_2612) / _1065;
+ float _2844;
+ if ((_2775 > _2691) && (_2775 < _2782))
+ {
+ float _2827 = (7.0 * (_2775 - _2691)) / (_2782 - _2691);
+ int _2828 = int(_2827);
+ float _2830 = _2827 - float(_2828);
+ _2844 = dot(float3(_2830 * _2830, _2830, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_479[_2828], _479[_2828 + 1], _479[_2828 + 2]));
+ }
+ else
+ {
+ float _2789 = log(_2684);
+ float _2790 = _2789 / _1065;
+ float _2823;
+ if ((_2775 >= _2782) && (_2775 < _2790))
+ {
+ float _2806 = (7.0 * (_2775 - _2782)) / (_2790 - _2782);
+ int _2807 = int(_2806);
+ float _2809 = _2806 - float(_2807);
+ _2823 = dot(float3(_2809 * _2809, _2809, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_480[_2807], _480[_2807 + 1], _480[_2807 + 2]));
+ }
+ else
+ {
+ _2823 = (_2775 * 0.0599999986588954925537109375) + ((log(1000.0) / _1065) - ((0.0599999986588954925537109375 * _2789) / _1065));
+ }
+ _2844 = _2823;
+ }
+ _2852 = _2844;
+ }
+ float3 _2854 = _2770;
+ _2854.y = pow(10.0, _2852);
+ float _2855 = _2479.z;
+ float _2859 = log((_2855 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2855) / _1065;
+ float _2936;
+ if (_2859 <= _2691)
+ {
+ _2936 = (_2859 * 3.0) + ((log(9.9999997473787516355514526367188e-05) / _1065) - ((3.0 * _2690) / _1065));
+ }
+ else
+ {
+ float _2866 = log(_2612) / _1065;
+ float _2928;
+ if ((_2859 > _2691) && (_2859 < _2866))
+ {
+ float _2911 = (7.0 * (_2859 - _2691)) / (_2866 - _2691);
+ int _2912 = int(_2911);
+ float _2914 = _2911 - float(_2912);
+ _2928 = dot(float3(_2914 * _2914, _2914, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_479[_2912], _479[_2912 + 1], _479[_2912 + 2]));
+ }
+ else
+ {
+ float _2873 = log(_2684);
+ float _2874 = _2873 / _1065;
+ float _2907;
+ if ((_2859 >= _2866) && (_2859 < _2874))
+ {
+ float _2890 = (7.0 * (_2859 - _2866)) / (_2874 - _2866);
+ int _2891 = int(_2890);
+ float _2893 = _2890 - float(_2891);
+ _2907 = dot(float3(_2893 * _2893, _2893, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_480[_2891], _480[_2891 + 1], _480[_2891 + 2]));
+ }
+ else
+ {
+ _2907 = (_2859 * 0.0599999986588954925537109375) + ((log(1000.0) / _1065) - ((0.0599999986588954925537109375 * _2873) / _1065));
+ }
+ _2928 = _2907;
+ }
+ _2936 = _2928;
+ }
+ float3 _2938 = _2854;
+ _2938.z = pow(10.0, _2936);
+ float3 _2942 = pow(((_2938 - float3(3.5073844628641381859779357910156e-05)) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _2950 = pow((float3(0.8359375) + (float3(18.8515625) * _2942)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2942))), float3(78.84375));
+ }
+ else
+ {
+ float3 _2097;
+ if ((_Globals.OutputDevice == 4u) || (_Globals.OutputDevice == 6u))
+ {
+ float3 _1263 = (_906 * float3(1.5)) * (_546 * float3x3(float3(1.04981100559234619140625, 0.0, -9.74845024757087230682373046875e-05), float3(-0.49590301513671875, 1.37331306934356689453125, 0.09824003279209136962890625), float3(0.0, 0.0, 0.991252005100250244140625)));
+ float _1264 = _1263.x;
+ float _1265 = _1263.y;
+ float _1267 = _1263.z;
+ float _1270 = fast::max(fast::max(_1264, _1265), _1267);
+ float _1275 = (fast::max(_1270, 1.0000000133514319600180897396058e-10) - fast::max(fast::min(fast::min(_1264, _1265), _1267), 1.0000000133514319600180897396058e-10)) / fast::max(_1270, 0.00999999977648258209228515625);
+ float _1288 = ((_1267 + _1265) + _1264) + (1.75 * sqrt(((_1267 * (_1267 - _1265)) + (_1265 * (_1265 - _1264))) + (_1264 * (_1264 - _1267))));
+ float _1289 = _1288 * 0.3333333432674407958984375;
+ float _1290 = _1275 - 0.4000000059604644775390625;
+ float _1295 = fast::max(1.0 - abs(_1290 * 2.5), 0.0);
+ float _1303 = (1.0 + (float(int(sign(_1290 * 5.0))) * (1.0 - (_1295 * _1295)))) * 0.02500000037252902984619140625;
+ float _1316;
+ if (_1289 <= 0.053333334624767303466796875)
+ {
+ _1316 = _1303;
+ }
+ else
+ {
+ float _1315;
+ if (_1289 >= 0.1599999964237213134765625)
+ {
+ _1315 = 0.0;
+ }
+ else
+ {
+ _1315 = _1303 * ((0.23999999463558197021484375 / _1288) - 0.5);
+ }
+ _1316 = _1315;
+ }
+ float3 _1319 = _1263 * float3(1.0 + _1316);
+ float _1320 = _1319.x;
+ float _1321 = _1319.y;
+ float _1323 = _1319.z;
+ float _1337;
+ if ((_1320 == _1321) && (_1321 == _1323))
+ {
+ _1337 = 0.0;
+ }
+ else
+ {
+ _1337 = 57.2957763671875 * atan2(sqrt(3.0) * (_1321 - _1323), ((2.0 * _1320) - _1321) - _1323);
+ }
+ float _1342;
+ if (_1337 < 0.0)
+ {
+ _1342 = _1337 + 360.0;
+ }
+ else
+ {
+ _1342 = _1337;
+ }
+ float _1343 = fast::clamp(_1342, 0.0, 360.0);
+ float _1348;
+ if (_1343 > 180.0)
+ {
+ _1348 = _1343 - 360.0;
+ }
+ else
+ {
+ _1348 = _1343;
+ }
+ float _1398;
+ if ((_1348 > (-67.5)) && (_1348 < 67.5))
+ {
+ float _1355 = (_1348 - (-67.5)) * 0.0296296291053295135498046875;
+ int _1356 = int(_1355);
+ float _1358 = _1355 - float(_1356);
+ float _1359 = _1358 * _1358;
+ float _1360 = _1359 * _1358;
+ float _1397;
+ if (_1356 == 3)
+ {
+ _1397 = (((_1360 * (-0.16666667163372039794921875)) + (_1359 * 0.5)) + (_1358 * (-0.5))) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _1390;
+ if (_1356 == 2)
+ {
+ _1390 = ((_1360 * 0.5) + (_1359 * (-1.0))) + 0.666666686534881591796875;
+ }
+ else
+ {
+ float _1385;
+ if (_1356 == 1)
+ {
+ _1385 = (((_1360 * (-0.5)) + (_1359 * 0.5)) + (_1358 * 0.5)) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _1378;
+ if (_1356 == 0)
+ {
+ _1378 = _1360 * 0.16666667163372039794921875;
+ }
+ else
+ {
+ _1378 = 0.0;
+ }
+ _1385 = _1378;
+ }
+ _1390 = _1385;
+ }
+ _1397 = _1390;
+ }
+ _1398 = _1397;
+ }
+ else
+ {
+ _1398 = 0.0;
+ }
+ float3 _1405 = _1319;
+ _1405.x = _1320 + ((((_1398 * 1.5) * _1275) * (0.02999999932944774627685546875 - _1320)) * 0.180000007152557373046875);
+ float3 _1408 = fast::clamp(fast::clamp(_1405, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ float3 _1411 = mix(float3(dot(_1408, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1408, float3(0.959999978542327880859375));
+ float _1412 = _1411.x;
+ float _1416 = 0.17999999225139617919921875 * exp2(18.0);
+ float _1418 = exp2(-14.0);
+ float _1421 = log((_1412 <= 0.0) ? _1418 : _1412) / _1065;
+ float _1423 = log(0.17999999225139617919921875 * exp2(-15.0)) / _1065;
+ float _1490;
+ if (_1421 <= _1423)
+ {
+ _1490 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _1430 = log(0.180000007152557373046875) / _1065;
+ float _1487;
+ if ((_1421 > _1423) && (_1421 < _1430))
+ {
+ float _1470 = (3.0 * (_1421 - _1423)) / (_1430 - _1423);
+ int _1471 = int(_1470);
+ float _1473 = _1470 - float(_1471);
+ _1487 = dot(float3(_1473 * _1473, _1473, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_1471], _475[_1471 + 1], _475[_1471 + 2]));
+ }
+ else
+ {
+ float _1438 = log(_1416) / _1065;
+ float _1466;
+ if ((_1421 >= _1430) && (_1421 < _1438))
+ {
+ float _1449 = (3.0 * (_1421 - _1430)) / (_1438 - _1430);
+ int _1450 = int(_1449);
+ float _1452 = _1449 - float(_1450);
+ _1466 = dot(float3(_1452 * _1452, _1452, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_1450], _476[_1450 + 1], _476[_1450 + 2]));
+ }
+ else
+ {
+ _1466 = log(10000.0) / _1065;
+ }
+ _1487 = _1466;
+ }
+ _1490 = _1487;
+ }
+ float3 _1492 = _391;
+ _1492.x = pow(10.0, _1490);
+ float _1493 = _1411.y;
+ float _1497 = log((_1493 <= 0.0) ? _1418 : _1493) / _1065;
+ float _1564;
+ if (_1497 <= _1423)
+ {
+ _1564 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _1504 = log(0.180000007152557373046875) / _1065;
+ float _1561;
+ if ((_1497 > _1423) && (_1497 < _1504))
+ {
+ float _1544 = (3.0 * (_1497 - _1423)) / (_1504 - _1423);
+ int _1545 = int(_1544);
+ float _1547 = _1544 - float(_1545);
+ _1561 = dot(float3(_1547 * _1547, _1547, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_1545], _475[_1545 + 1], _475[_1545 + 2]));
+ }
+ else
+ {
+ float _1512 = log(_1416) / _1065;
+ float _1540;
+ if ((_1497 >= _1504) && (_1497 < _1512))
+ {
+ float _1523 = (3.0 * (_1497 - _1504)) / (_1512 - _1504);
+ int _1524 = int(_1523);
+ float _1526 = _1523 - float(_1524);
+ _1540 = dot(float3(_1526 * _1526, _1526, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_1524], _476[_1524 + 1], _476[_1524 + 2]));
+ }
+ else
+ {
+ _1540 = log(10000.0) / _1065;
+ }
+ _1561 = _1540;
+ }
+ _1564 = _1561;
+ }
+ float3 _1566 = _1492;
+ _1566.y = pow(10.0, _1564);
+ float _1567 = _1411.z;
+ float _1571 = log((_1567 <= 0.0) ? _1418 : _1567) / _1065;
+ float _1638;
+ if (_1571 <= _1423)
+ {
+ _1638 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _1578 = log(0.180000007152557373046875) / _1065;
+ float _1635;
+ if ((_1571 > _1423) && (_1571 < _1578))
+ {
+ float _1618 = (3.0 * (_1571 - _1423)) / (_1578 - _1423);
+ int _1619 = int(_1618);
+ float _1621 = _1618 - float(_1619);
+ _1635 = dot(float3(_1621 * _1621, _1621, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_1619], _475[_1619 + 1], _475[_1619 + 2]));
+ }
+ else
+ {
+ float _1586 = log(_1416) / _1065;
+ float _1614;
+ if ((_1571 >= _1578) && (_1571 < _1586))
+ {
+ float _1597 = (3.0 * (_1571 - _1578)) / (_1586 - _1578);
+ int _1598 = int(_1597);
+ float _1600 = _1597 - float(_1598);
+ _1614 = dot(float3(_1600 * _1600, _1600, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_1598], _476[_1598 + 1], _476[_1598 + 2]));
+ }
+ else
+ {
+ _1614 = log(10000.0) / _1065;
+ }
+ _1635 = _1614;
+ }
+ _1638 = _1635;
+ }
+ float3 _1640 = _1566;
+ _1640.z = pow(10.0, _1638);
+ float3 _1642 = (_1640 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ float _1644 = 0.17999999225139617919921875 * pow(2.0, -12.0);
+ float _1648 = log((_1644 <= 0.0) ? _1418 : _1644) / _1065;
+ float _1715;
+ if (_1648 <= _1423)
+ {
+ _1715 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _1655 = log(0.180000007152557373046875) / _1065;
+ float _1712;
+ if ((_1648 > _1423) && (_1648 < _1655))
+ {
+ float _1695 = (3.0 * (_1648 - _1423)) / (_1655 - _1423);
+ int _1696 = int(_1695);
+ float _1698 = _1695 - float(_1696);
+ _1712 = dot(float3(_1698 * _1698, _1698, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_1696], _475[_1696 + 1], _475[_1696 + 2]));
+ }
+ else
+ {
+ float _1663 = log(_1416) / _1065;
+ float _1691;
+ if ((_1648 >= _1655) && (_1648 < _1663))
+ {
+ float _1674 = (3.0 * (_1648 - _1655)) / (_1663 - _1655);
+ int _1675 = int(_1674);
+ float _1677 = _1674 - float(_1675);
+ _1691 = dot(float3(_1677 * _1677, _1677, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_1675], _476[_1675 + 1], _476[_1675 + 2]));
+ }
+ else
+ {
+ _1691 = log(10000.0) / _1065;
+ }
+ _1712 = _1691;
+ }
+ _1715 = _1712;
+ }
+ float _1718 = log(0.180000007152557373046875) / _1065;
+ float _1774;
+ if (_1718 <= _1423)
+ {
+ _1774 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _1771;
+ if ((_1718 > _1423) && (_1718 < _1718))
+ {
+ _1771 = (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-0.485249996185302734375, 1.84773242473602294921875, 1.84773242473602294921875)).z;
+ }
+ else
+ {
+ float _1731 = log(_1416) / _1065;
+ float _1759;
+ if ((_1718 >= _1718) && (_1718 < _1731))
+ {
+ float _1742 = (3.0 * (_1718 - _1718)) / (_1731 - _1718);
+ int _1743 = int(_1742);
+ float _1745 = _1742 - float(_1743);
+ _1759 = dot(float3(_1745 * _1745, _1745, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_1743], _476[_1743 + 1], _476[_1743 + 2]));
+ }
+ else
+ {
+ _1759 = log(10000.0) / _1065;
+ }
+ _1771 = _1759;
+ }
+ _1774 = _1771;
+ }
+ float _1775 = pow(10.0, _1774);
+ float _1777 = 0.17999999225139617919921875 * pow(2.0, 11.0);
+ float _1781 = log((_1777 <= 0.0) ? _1418 : _1777) / _1065;
+ float _1846;
+ if (_1781 <= _1423)
+ {
+ _1846 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _1843;
+ if ((_1781 > _1423) && (_1781 < _1718))
+ {
+ float _1826 = (3.0 * (_1781 - _1423)) / (_1718 - _1423);
+ int _1827 = int(_1826);
+ float _1829 = _1826 - float(_1827);
+ _1843 = dot(float3(_1829 * _1829, _1829, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_1827], _475[_1827 + 1], _475[_1827 + 2]));
+ }
+ else
+ {
+ float _1794 = log(_1416) / _1065;
+ float _1822;
+ if ((_1781 >= _1718) && (_1781 < _1794))
+ {
+ float _1805 = (3.0 * (_1781 - _1718)) / (_1794 - _1718);
+ int _1806 = int(_1805);
+ float _1808 = _1805 - float(_1806);
+ _1822 = dot(float3(_1808 * _1808, _1808, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_1806], _476[_1806 + 1], _476[_1806 + 2]));
+ }
+ else
+ {
+ _1822 = log(10000.0) / _1065;
+ }
+ _1843 = _1822;
+ }
+ _1846 = _1843;
+ }
+ float _1847 = pow(10.0, _1846);
+ float _1848 = _1642.x;
+ float _1852 = log((_1848 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1848) / _1065;
+ float _1854 = log(pow(10.0, _1715)) / _1065;
+ float _1926;
+ if (_1852 <= _1854)
+ {
+ _1926 = log(0.004999999888241291046142578125) / _1065;
+ }
+ else
+ {
+ float _1861 = log(_1775) / _1065;
+ float _1923;
+ if ((_1852 > _1854) && (_1852 < _1861))
+ {
+ float _1906 = (7.0 * (_1852 - _1854)) / (_1861 - _1854);
+ int _1907 = int(_1906);
+ float _1909 = _1906 - float(_1907);
+ _1923 = dot(float3(_1909 * _1909, _1909, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_482[_1907], _482[_1907 + 1], _482[_1907 + 2]));
+ }
+ else
+ {
+ float _1868 = log(_1847);
+ float _1869 = _1868 / _1065;
+ float _1902;
+ if ((_1852 >= _1861) && (_1852 < _1869))
+ {
+ float _1885 = (7.0 * (_1852 - _1861)) / (_1869 - _1861);
+ int _1886 = int(_1885);
+ float _1888 = _1885 - float(_1886);
+ _1902 = dot(float3(_1888 * _1888, _1888, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_483[_1886], _483[_1886 + 1], _483[_1886 + 2]));
+ }
+ else
+ {
+ _1902 = (_1852 * 0.119999997317790985107421875) + ((log(2000.0) / _1065) - ((0.119999997317790985107421875 * _1868) / _1065));
+ }
+ _1923 = _1902;
+ }
+ _1926 = _1923;
+ }
+ float3 _1928 = _391;
+ _1928.x = pow(10.0, _1926);
+ float _1929 = _1642.y;
+ float _1933 = log((_1929 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1929) / _1065;
+ float _2005;
+ if (_1933 <= _1854)
+ {
+ _2005 = log(0.004999999888241291046142578125) / _1065;
+ }
+ else
+ {
+ float _1940 = log(_1775) / _1065;
+ float _2002;
+ if ((_1933 > _1854) && (_1933 < _1940))
+ {
+ float _1985 = (7.0 * (_1933 - _1854)) / (_1940 - _1854);
+ int _1986 = int(_1985);
+ float _1988 = _1985 - float(_1986);
+ _2002 = dot(float3(_1988 * _1988, _1988, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_482[_1986], _482[_1986 + 1], _482[_1986 + 2]));
+ }
+ else
+ {
+ float _1947 = log(_1847);
+ float _1948 = _1947 / _1065;
+ float _1981;
+ if ((_1933 >= _1940) && (_1933 < _1948))
+ {
+ float _1964 = (7.0 * (_1933 - _1940)) / (_1948 - _1940);
+ int _1965 = int(_1964);
+ float _1967 = _1964 - float(_1965);
+ _1981 = dot(float3(_1967 * _1967, _1967, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_483[_1965], _483[_1965 + 1], _483[_1965 + 2]));
+ }
+ else
+ {
+ _1981 = (_1933 * 0.119999997317790985107421875) + ((log(2000.0) / _1065) - ((0.119999997317790985107421875 * _1947) / _1065));
+ }
+ _2002 = _1981;
+ }
+ _2005 = _2002;
+ }
+ float3 _2007 = _1928;
+ _2007.y = pow(10.0, _2005);
+ float _2008 = _1642.z;
+ float _2012 = log((_2008 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2008) / _1065;
+ float _2084;
+ if (_2012 <= _1854)
+ {
+ _2084 = log(0.004999999888241291046142578125) / _1065;
+ }
+ else
+ {
+ float _2019 = log(_1775) / _1065;
+ float _2081;
+ if ((_2012 > _1854) && (_2012 < _2019))
+ {
+ float _2064 = (7.0 * (_2012 - _1854)) / (_2019 - _1854);
+ int _2065 = int(_2064);
+ float _2067 = _2064 - float(_2065);
+ _2081 = dot(float3(_2067 * _2067, _2067, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_482[_2065], _482[_2065 + 1], _482[_2065 + 2]));
+ }
+ else
+ {
+ float _2026 = log(_1847);
+ float _2027 = _2026 / _1065;
+ float _2060;
+ if ((_2012 >= _2019) && (_2012 < _2027))
+ {
+ float _2043 = (7.0 * (_2012 - _2019)) / (_2027 - _2019);
+ int _2044 = int(_2043);
+ float _2046 = _2043 - float(_2044);
+ _2060 = dot(float3(_2046 * _2046, _2046, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_483[_2044], _483[_2044 + 1], _483[_2044 + 2]));
+ }
+ else
+ {
+ _2060 = (_2012 * 0.119999997317790985107421875) + ((log(2000.0) / _1065) - ((0.119999997317790985107421875 * _2026) / _1065));
+ }
+ _2081 = _2060;
+ }
+ _2084 = _2081;
+ }
+ float3 _2086 = _2007;
+ _2086.z = pow(10.0, _2084);
+ float3 _2089 = pow((_2086 * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _2097 = pow((float3(0.8359375) + (float3(18.8515625) * _2089)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2089))), float3(78.84375));
+ }
+ else
+ {
+ float3 _1260;
+ if (_Globals.OutputDevice == 7u)
+ {
+ float3 _1252 = pow(((_906 * _547) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _1260 = pow((float3(0.8359375) + (float3(18.8515625) * _1252)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _1252))), float3(78.84375));
+ }
+ else
+ {
+ _1260 = pow((_1218 * _547) * _576, float3(_Globals.InverseGamma.z));
+ }
+ _2097 = _1260;
+ }
+ _2950 = _2097;
+ }
+ _2960 = _2950;
+ }
+ _3001 = _2960;
+ }
+ float3 _3002 = _3001 * float3(0.95238101482391357421875);
+ float4 _3004 = float4(_3002.x, _3002.y, _3002.z, float4(0.0).w);
+ _3004.w = 0.0;
+ out.out_var_SV_Target0 = _3004;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag
new file mode 100644
index 00000000000..feb976b8148
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag
@@ -0,0 +1,1413 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_Globals
+{
+ float4 MappingPolynomial;
+ float3 InverseGamma;
+ float4 ColorMatrixR_ColorCurveCd1;
+ float4 ColorMatrixG_ColorCurveCd3Cm3;
+ float4 ColorMatrixB_ColorCurveCm2;
+ float4 ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3;
+ float4 ColorCurve_Ch1_Ch2;
+ float4 ColorShadow_Luma;
+ float4 ColorShadow_Tint1;
+ float4 ColorShadow_Tint2;
+ float FilmSlope;
+ float FilmToe;
+ float FilmShoulder;
+ float FilmBlackClip;
+ float FilmWhiteClip;
+ float4 LUTWeights[5];
+ float3 ColorScale;
+ float4 OverlayColor;
+ float WhiteTemp;
+ float WhiteTint;
+ float4 ColorSaturation;
+ float4 ColorContrast;
+ float4 ColorGamma;
+ float4 ColorGain;
+ float4 ColorOffset;
+ float4 ColorSaturationShadows;
+ float4 ColorContrastShadows;
+ float4 ColorGammaShadows;
+ float4 ColorGainShadows;
+ float4 ColorOffsetShadows;
+ float4 ColorSaturationMidtones;
+ float4 ColorContrastMidtones;
+ float4 ColorGammaMidtones;
+ float4 ColorGainMidtones;
+ float4 ColorOffsetMidtones;
+ float4 ColorSaturationHighlights;
+ float4 ColorContrastHighlights;
+ float4 ColorGammaHighlights;
+ float4 ColorGainHighlights;
+ float4 ColorOffsetHighlights;
+ float ColorCorrectionShadowsMax;
+ float ColorCorrectionHighlightsMin;
+ uint OutputDevice;
+ uint OutputGamut;
+ float BlueCorrection;
+ float ExpandGamut;
+};
+
+constant spvUnsafeArray<float, 6> _499 = spvUnsafeArray<float, 6>({ -4.0, -4.0, -3.1573765277862548828125, -0.485249996185302734375, 1.84773242473602294921875, 1.84773242473602294921875 });
+constant spvUnsafeArray<float, 6> _500 = spvUnsafeArray<float, 6>({ -0.718548238277435302734375, 2.0810306072235107421875, 3.66812419891357421875, 4.0, 4.0, 4.0 });
+constant spvUnsafeArray<float, 10> _503 = spvUnsafeArray<float, 10>({ -4.97062206268310546875, -3.0293781757354736328125, -2.1261999607086181640625, -1.5104999542236328125, -1.0578000545501708984375, -0.4668000042438507080078125, 0.11937999725341796875, 0.7088134288787841796875, 1.2911865711212158203125, 1.2911865711212158203125 });
+constant spvUnsafeArray<float, 10> _504 = spvUnsafeArray<float, 10>({ 0.80891323089599609375, 1.19108676910400390625, 1.5683000087738037109375, 1.94830000400543212890625, 2.308300018310546875, 2.63840007781982421875, 2.85949993133544921875, 2.9872608184814453125, 3.0127391815185546875, 3.0127391815185546875 });
+constant spvUnsafeArray<float, 10> _506 = spvUnsafeArray<float, 10>({ -2.3010299205780029296875, -2.3010299205780029296875, -1.9312000274658203125, -1.5204999446868896484375, -1.0578000545501708984375, -0.4668000042438507080078125, 0.11937999725341796875, 0.7088134288787841796875, 1.2911865711212158203125, 1.2911865711212158203125 });
+constant spvUnsafeArray<float, 10> _507 = spvUnsafeArray<float, 10>({ 0.801995217800140380859375, 1.19800484180450439453125, 1.5943000316619873046875, 1.99730002880096435546875, 2.3782999515533447265625, 2.7683999538421630859375, 3.0515000820159912109375, 3.2746293544769287109375, 3.32743072509765625, 3.32743072509765625 });
+
+constant float3 _523 = {};
+constant float3 _3123 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+struct main0_in
+{
+ float2 in_var_TEXCOORD0 [[user(locn0), center_no_perspective]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globals [[buffer(0)]], texture2d<float> Texture1 [[texture(0)]], sampler Texture1Sampler [[sampler(0)]], uint gl_Layer [[render_target_array_index]])
+{
+ main0_out out = {};
+ float3x3 _572 = float3x3(float3(0.41245639324188232421875, 0.3575761020183563232421875, 0.180437505245208740234375), float3(0.21267290413379669189453125, 0.715152204036712646484375, 0.072175003588199615478515625), float3(0.01933390088379383087158203125, 0.119191996753215789794921875, 0.950304090976715087890625)) * float3x3(float3(1.01303005218505859375, 0.0061053098179399967193603515625, -0.014971000142395496368408203125), float3(0.0076982299797236919403076171875, 0.99816501140594482421875, -0.005032029934227466583251953125), float3(-0.0028413101099431514739990234375, 0.0046851597726345062255859375, 0.92450702190399169921875));
+ float3x3 _573 = _572 * float3x3(float3(1.6410233974456787109375, -0.324803292751312255859375, -0.23642469942569732666015625), float3(-0.663662850856781005859375, 1.6153316497802734375, 0.016756348311901092529296875), float3(0.01172189414501190185546875, -0.008284442126750946044921875, 0.98839485645294189453125));
+ float3x3 _574 = float3x3(float3(0.662454187870025634765625, 0.1340042054653167724609375, 0.1561876833438873291015625), float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625), float3(-0.0055746496655046939849853515625, 0.0040607335977256298065185546875, 1.01033914089202880859375)) * float3x3(float3(0.98722398281097412109375, -0.0061132698319852352142333984375, 0.01595330052077770233154296875), float3(-0.007598360069096088409423828125, 1.00186002254486083984375, 0.0053300200961530208587646484375), float3(0.003072570078074932098388671875, -0.0050959498621523380279541015625, 1.0816800594329833984375));
+ float3x3 _575 = _574 * float3x3(float3(3.2409698963165283203125, -1.53738319873809814453125, -0.4986107647418975830078125), float3(-0.96924364566802978515625, 1.875967502593994140625, 0.0415550582110881805419921875), float3(0.055630080401897430419921875, -0.2039769589900970458984375, 1.05697154998779296875));
+ float3x3 _576 = float3x3(float3(0.952552378177642822265625, 0.0, 9.25), float3(0.3439664542675018310546875, 0.728166103363037109375, -0.07213254272937774658203125), float3(0.0, 0.0, 1.00882518291473388671875)) * float3x3(float3(1.6410233974456787109375, -0.324803292751312255859375, -0.23642469942569732666015625), float3(-0.663662850856781005859375, 1.6153316497802734375, 0.016756348311901092529296875), float3(0.01172189414501190185546875, -0.008284442126750946044921875, 0.98839485645294189453125));
+ float3x3 _577 = float3x3(float3(0.662454187870025634765625, 0.1340042054653167724609375, 0.1561876833438873291015625), float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625), float3(-0.0055746496655046939849853515625, 0.0040607335977256298065185546875, 1.01033914089202880859375)) * float3x3(float3(1.04981100559234619140625, 0.0, -9.74845024757087230682373046875e-05), float3(-0.49590301513671875, 1.37331306934356689453125, 0.09824003279209136962890625), float3(0.0, 0.0, 0.991252005100250244140625));
+ float3x3 _602;
+ for (;;)
+ {
+ if (_Globals.OutputGamut == 1u)
+ {
+ _602 = _574 * float3x3(float3(2.493396282196044921875, -0.931345880031585693359375, -0.4026944935321807861328125), float3(-0.829486787319183349609375, 1.76265966892242431640625, 0.02362460084259510040283203125), float3(0.0358506999909877777099609375, -0.076182700693607330322265625, 0.957014024257659912109375));
+ break;
+ }
+ else
+ {
+ if (_Globals.OutputGamut == 2u)
+ {
+ _602 = _574 * float3x3(float3(1.71660840511322021484375, -0.3556621074676513671875, -0.253360092639923095703125), float3(-0.666682898998260498046875, 1.61647760868072509765625, 0.01576850004494190216064453125), float3(0.017642199993133544921875, -0.04277630150318145751953125, 0.94222867488861083984375));
+ break;
+ }
+ else
+ {
+ if (_Globals.OutputGamut == 3u)
+ {
+ _602 = float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625));
+ break;
+ }
+ else
+ {
+ if (_Globals.OutputGamut == 4u)
+ {
+ _602 = float3x3(float3(1.0, 0.0, 0.0), float3(0.0, 1.0, 0.0), float3(0.0, 0.0, 1.0));
+ break;
+ }
+ else
+ {
+ _602 = _575;
+ break;
+ }
+ }
+ }
+ }
+ }
+ float3 _603 = float4((in.in_var_TEXCOORD0 - float2(0.015625)) * float2(1.03225803375244140625), float(gl_Layer) * 0.0322580635547637939453125, 0.0).xyz;
+ float3 _625;
+ if (_Globals.OutputDevice >= 3u)
+ {
+ float3 _617 = pow(_603, float3(0.0126833133399486541748046875));
+ _625 = pow(fast::max(float3(0.0), _617 - float3(0.8359375)) / (float3(18.8515625) - (float3(18.6875) * _617)), float3(6.277394771575927734375)) * float3(10000.0);
+ }
+ else
+ {
+ _625 = (exp2((_603 - float3(0.434017598628997802734375)) * float3(14.0)) * float3(0.180000007152557373046875)) - (exp2(float3(-6.0762462615966796875)) * float3(0.180000007152557373046875));
+ }
+ float _628 = _Globals.WhiteTemp * 1.00055634975433349609375;
+ float _642 = (_628 <= 7000.0) ? (0.24406300485134124755859375 + ((99.1100006103515625 + ((2967800.0 - (4604438528.0 / _Globals.WhiteTemp)) / _628)) / _628)) : (0.23703999817371368408203125 + ((247.4799957275390625 + ((1901800.0 - (2005284352.0 / _Globals.WhiteTemp)) / _628)) / _628));
+ float _659 = ((0.860117733478546142578125 + (0.00015411825734190642833709716796875 * _Globals.WhiteTemp)) + ((1.2864121856637211749330163002014e-07 * _Globals.WhiteTemp) * _Globals.WhiteTemp)) / ((1.0 + (0.0008424202096648514270782470703125 * _Globals.WhiteTemp)) + ((7.0814513719597016461193561553955e-07 * _Globals.WhiteTemp) * _Globals.WhiteTemp));
+ float _670 = ((0.317398726940155029296875 + (4.25 * _Globals.WhiteTemp)) + ((4.2048167614439080352894961833954e-08 * _Globals.WhiteTemp) * _Globals.WhiteTemp)) / ((1.0 - (2.8974181986995972692966461181641e-05 * _Globals.WhiteTemp)) + ((1.6145605741257895715534687042236e-07 * _Globals.WhiteTemp) * _Globals.WhiteTemp));
+ float _675 = ((2.0 * _659) - (8.0 * _670)) + 4.0;
+ float2 _679 = float2((3.0 * _659) / _675, (2.0 * _670) / _675);
+ float2 _686 = normalize(float2(_659, _670));
+ float _691 = _659 + (((-_686.y) * _Globals.WhiteTint) * 0.0500000007450580596923828125);
+ float _695 = _670 + ((_686.x * _Globals.WhiteTint) * 0.0500000007450580596923828125);
+ float _700 = ((2.0 * _691) - (8.0 * _695)) + 4.0;
+ float2 _706 = select(float2(_642, ((((-3.0) * _642) * _642) + (2.86999988555908203125 * _642)) - 0.2750000059604644775390625), _679, bool2(_Globals.WhiteTemp < 4000.0)) + (float2((3.0 * _691) / _700, (2.0 * _695) / _700) - _679);
+ float _707 = _706.x;
+ float _708 = _706.y;
+ float _709 = fast::max(_708, 1.0000000133514319600180897396058e-10);
+ float3 _711 = _523;
+ _711.x = _707 / _709;
+ float3 _712 = _711;
+ _712.y = 1.0;
+ float3 _716 = _712;
+ _716.z = ((1.0 - _707) - _708) / _709;
+ float3 _719 = _523;
+ _719.x = 0.950455963611602783203125;
+ float3 _720 = _719;
+ _720.y = 1.0;
+ float3 _722 = _720;
+ _722.z = 1.0890576839447021484375;
+ float3 _723 = _716 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ float3 _724 = _722 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ float3 _743 = (_625 * ((float3x3(float3(0.41245639324188232421875, 0.3575761020183563232421875, 0.180437505245208740234375), float3(0.21267290413379669189453125, 0.715152204036712646484375, 0.072175003588199615478515625), float3(0.01933390088379383087158203125, 0.119191996753215789794921875, 0.950304090976715087890625)) * ((float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875)) * float3x3(float3(_724.x / _723.x, 0.0, 0.0), float3(0.0, _724.y / _723.y, 0.0), float3(0.0, 0.0, _724.z / _723.z))) * float3x3(float3(0.986992895603179931640625, -0.14705429971218109130859375, 0.15996269881725311279296875), float3(0.4323053061962127685546875, 0.518360316753387451171875, 0.049291200935840606689453125), float3(-0.00852870009839534759521484375, 0.0400427989661693572998046875, 0.968486726284027099609375)))) * float3x3(float3(3.2409698963165283203125, -1.53738319873809814453125, -0.4986107647418975830078125), float3(-0.96924364566802978515625, 1.875967502593994140625, 0.0415550582110881805419921875), float3(0.055630080401897430419921875, -0.2039769589900970458984375, 1.05697154998779296875)))) * _573;
+ float3 _771;
+ if (_Globals.ColorShadow_Tint2.w != 0.0)
+ {
+ float _750 = dot(_743, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625));
+ float3 _753 = (_743 / float3(_750)) - float3(1.0);
+ _771 = mix(_743, _743 * (_575 * (float3x3(float3(0.544169127941131591796875, 0.23959259688854217529296875, 0.16669429838657379150390625), float3(0.23946559429168701171875, 0.702153027057647705078125, 0.058381401002407073974609375), float3(-0.0023439000360667705535888671875, 0.0361833982169628143310546875, 1.05521833896636962890625)) * float3x3(float3(1.6410233974456787109375, -0.324803292751312255859375, -0.23642469942569732666015625), float3(-0.663662850856781005859375, 1.6153316497802734375, 0.016756348311901092529296875), float3(0.01172189414501190185546875, -0.008284442126750946044921875, 0.98839485645294189453125)))), float3((1.0 - exp2((-4.0) * dot(_753, _753))) * (1.0 - exp2((((-4.0) * _Globals.ExpandGamut) * _750) * _750))));
+ }
+ else
+ {
+ _771 = _743;
+ }
+ float _772 = dot(_771, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625));
+ float4 _777 = _Globals.ColorSaturationShadows * _Globals.ColorSaturation;
+ float4 _782 = _Globals.ColorContrastShadows * _Globals.ColorContrast;
+ float4 _787 = _Globals.ColorGammaShadows * _Globals.ColorGamma;
+ float4 _792 = _Globals.ColorGainShadows * _Globals.ColorGain;
+ float4 _797 = _Globals.ColorOffsetShadows + _Globals.ColorOffset;
+ float3 _798 = float3(_772);
+ float _830 = smoothstep(0.0, _Globals.ColorCorrectionShadowsMax, _772);
+ float4 _834 = _Globals.ColorSaturationHighlights * _Globals.ColorSaturation;
+ float4 _837 = _Globals.ColorContrastHighlights * _Globals.ColorContrast;
+ float4 _840 = _Globals.ColorGammaHighlights * _Globals.ColorGamma;
+ float4 _843 = _Globals.ColorGainHighlights * _Globals.ColorGain;
+ float4 _846 = _Globals.ColorOffsetHighlights + _Globals.ColorOffset;
+ float _878 = smoothstep(_Globals.ColorCorrectionHighlightsMin, 1.0, _772);
+ float4 _881 = _Globals.ColorSaturationMidtones * _Globals.ColorSaturation;
+ float4 _884 = _Globals.ColorContrastMidtones * _Globals.ColorContrast;
+ float4 _887 = _Globals.ColorGammaMidtones * _Globals.ColorGamma;
+ float4 _890 = _Globals.ColorGainMidtones * _Globals.ColorGain;
+ float4 _893 = _Globals.ColorOffsetMidtones + _Globals.ColorOffset;
+ float3 _931 = ((((pow(pow(fast::max(float3(0.0), mix(_798, _771, _777.xyz * float3(_777.w))) * float3(5.5555553436279296875), _782.xyz * float3(_782.w)) * float3(0.180000007152557373046875), float3(1.0) / (_787.xyz * float3(_787.w))) * (_792.xyz * float3(_792.w))) + (_797.xyz + float3(_797.w))) * float3(1.0 - _830)) + (((pow(pow(fast::max(float3(0.0), mix(_798, _771, _881.xyz * float3(_881.w))) * float3(5.5555553436279296875), _884.xyz * float3(_884.w)) * float3(0.180000007152557373046875), float3(1.0) / (_887.xyz * float3(_887.w))) * (_890.xyz * float3(_890.w))) + (_893.xyz + float3(_893.w))) * float3(_830 - _878))) + (((pow(pow(fast::max(float3(0.0), mix(_798, _771, _834.xyz * float3(_834.w))) * float3(5.5555553436279296875), _837.xyz * float3(_837.w)) * float3(0.180000007152557373046875), float3(1.0) / (_840.xyz * float3(_840.w))) * (_843.xyz * float3(_843.w))) + (_846.xyz + float3(_846.w))) * float3(_878));
+ float3 _932 = _931 * _575;
+ float3 _940 = float3(_Globals.BlueCorrection);
+ float3 _942 = mix(_931, _931 * ((_577 * float3x3(float3(0.940437257289886474609375, -0.01830687932670116424560546875, 0.07786960899829864501953125), float3(0.008378696627914905548095703125, 0.82866001129150390625, 0.162961304187774658203125), float3(0.0005471261101774871349334716796875, -0.00088337459601461887359619140625, 1.00033628940582275390625))) * _576), _940) * _577;
+ float _943 = _942.x;
+ float _944 = _942.y;
+ float _946 = _942.z;
+ float _949 = fast::max(fast::max(_943, _944), _946);
+ float _954 = (fast::max(_949, 1.0000000133514319600180897396058e-10) - fast::max(fast::min(fast::min(_943, _944), _946), 1.0000000133514319600180897396058e-10)) / fast::max(_949, 0.00999999977648258209228515625);
+ float _967 = ((_946 + _944) + _943) + (1.75 * sqrt(((_946 * (_946 - _944)) + (_944 * (_944 - _943))) + (_943 * (_943 - _946))));
+ float _968 = _967 * 0.3333333432674407958984375;
+ float _969 = _954 - 0.4000000059604644775390625;
+ float _974 = fast::max(1.0 - abs(_969 * 2.5), 0.0);
+ float _982 = (1.0 + (float(int(sign(_969 * 5.0))) * (1.0 - (_974 * _974)))) * 0.02500000037252902984619140625;
+ float _995;
+ if (_968 <= 0.053333334624767303466796875)
+ {
+ _995 = _982;
+ }
+ else
+ {
+ float _994;
+ if (_968 >= 0.1599999964237213134765625)
+ {
+ _994 = 0.0;
+ }
+ else
+ {
+ _994 = _982 * ((0.23999999463558197021484375 / _967) - 0.5);
+ }
+ _995 = _994;
+ }
+ float3 _998 = _942 * float3(1.0 + _995);
+ float _999 = _998.x;
+ float _1000 = _998.y;
+ float _1002 = _998.z;
+ float _1016;
+ if ((_999 == _1000) && (_1000 == _1002))
+ {
+ _1016 = 0.0;
+ }
+ else
+ {
+ _1016 = 57.2957763671875 * atan2(sqrt(3.0) * (_1000 - _1002), ((2.0 * _999) - _1000) - _1002);
+ }
+ float _1021;
+ if (_1016 < 0.0)
+ {
+ _1021 = _1016 + 360.0;
+ }
+ else
+ {
+ _1021 = _1016;
+ }
+ float _1022 = fast::clamp(_1021, 0.0, 360.0);
+ float _1027;
+ if (_1022 > 180.0)
+ {
+ _1027 = _1022 - 360.0;
+ }
+ else
+ {
+ _1027 = _1022;
+ }
+ float _1031 = smoothstep(0.0, 1.0, 1.0 - abs(_1027 * 0.01481481455266475677490234375));
+ float3 _1038 = _998;
+ _1038.x = _999 + ((((_1031 * _1031) * _954) * (0.02999999932944774627685546875 - _999)) * 0.180000007152557373046875);
+ float3 _1040 = fast::max(float3(0.0), _1038 * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)));
+ float _1049 = (1.0 + _Globals.FilmBlackClip) - _Globals.FilmToe;
+ float _1052 = 1.0 + _Globals.FilmWhiteClip;
+ float _1055 = _1052 - _Globals.FilmShoulder;
+ float _1082;
+ if (_Globals.FilmToe > 0.800000011920928955078125)
+ {
+ _1082 = ((0.819999992847442626953125 - _Globals.FilmToe) / _Globals.FilmSlope) + (log(0.180000007152557373046875) / log(10.0));
+ }
+ else
+ {
+ float _1061 = (0.180000007152557373046875 + _Globals.FilmBlackClip) / _1049;
+ _1082 = (log(0.180000007152557373046875) / log(10.0)) - ((0.5 * log(_1061 / (2.0 - _1061))) * (_1049 / _Globals.FilmSlope));
+ }
+ float _1087 = ((1.0 - _Globals.FilmToe) / _Globals.FilmSlope) - _1082;
+ float _1089 = (_Globals.FilmShoulder / _Globals.FilmSlope) - _1087;
+ float _1091 = log(10.0);
+ float3 _1093 = log(mix(float3(dot(_1040, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1040, float3(0.959999978542327880859375))) / float3(_1091);
+ float3 _1097 = float3(_Globals.FilmSlope) * (_1093 + float3(_1087));
+ float3 _1105 = float3(_1082);
+ float3 _1106 = _1093 - _1105;
+ float3 _1118 = float3(_1089);
+ float3 _1132 = fast::clamp(_1106 / float3(_1089 - _1082), float3(0.0), float3(1.0));
+ float3 _1136 = select(_1132, float3(1.0) - _1132, bool3(_1089 < _1082));
+ float3 _1141 = mix(select(_1097, float3(-_Globals.FilmBlackClip) + (float3(2.0 * _1049) / (float3(1.0) + exp(float3(((-2.0) * _Globals.FilmSlope) / _1049) * _1106))), _1093 < _1105), select(_1097, float3(_1052) - (float3(2.0 * _1055) / (float3(1.0) + exp(float3((2.0 * _Globals.FilmSlope) / _1055) * (_1093 - _1118)))), _1093 > _1118), ((float3(3.0) - (float3(2.0) * _1136)) * _1136) * _1136);
+ float3 _1145 = fast::max(float3(0.0), mix(float3(dot(_1141, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1141, float3(0.930000007152557373046875)));
+ float3 _1215;
+ if (_Globals.ColorShadow_Tint2.w == 0.0)
+ {
+ float3 _1157 = _3123;
+ _1157.x = dot(_932, _Globals.ColorMatrixR_ColorCurveCd1.xyz);
+ float3 _1162 = _1157;
+ _1162.y = dot(_932, _Globals.ColorMatrixG_ColorCurveCd3Cm3.xyz);
+ float3 _1167 = _1162;
+ _1167.z = dot(_932, _Globals.ColorMatrixB_ColorCurveCm2.xyz);
+ float3 _1183 = fast::max(float3(0.0), _1167 * (_Globals.ColorShadow_Tint1.xyz + (_Globals.ColorShadow_Tint2.xyz * float3(1.0 / (dot(_932, _Globals.ColorShadow_Luma.xyz) + 1.0)))));
+ float3 _1188 = fast::max(float3(0.0), _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx - _1183);
+ float3 _1190 = fast::max(_1183, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz);
+ _1215 = ((((_1190 * _Globals.ColorCurve_Ch1_Ch2.xxx) + _Globals.ColorCurve_Ch1_Ch2.yyy) * (float3(1.0) / (_1190 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.www))) + ((fast::clamp(_1183, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz) * _Globals.ColorMatrixB_ColorCurveCm2.www) + (((_1188 * _Globals.ColorMatrixR_ColorCurveCd1.www) * (float3(1.0) / (_1188 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.yyy))) + _Globals.ColorMatrixG_ColorCurveCd3Cm3.www))) - float3(0.00200000009499490261077880859375);
+ }
+ else
+ {
+ _1215 = fast::max(float3(0.0), mix(_1145, _1145 * ((_577 * float3x3(float3(1.06317996978759765625, 0.02339559979736804962158203125, -0.08657260239124298095703125), float3(-0.010633699595928192138671875, 1.2063200473785400390625, -0.1956900060176849365234375), float3(-0.0005908869788981974124908447265625, 0.00105247995816171169281005859375, 0.999538004398345947265625))) * _576), _940) * _575);
+ }
+ float3 _1216 = fast::clamp(_1215, float3(0.0), float3(1.0));
+ float _1217 = _1216.x;
+ float _1229;
+ for (;;)
+ {
+ if (_1217 < 0.00313066993840038776397705078125)
+ {
+ _1229 = _1217 * 12.9200000762939453125;
+ break;
+ }
+ _1229 = (pow(_1217, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ float _1230 = _1216.y;
+ float _1242;
+ for (;;)
+ {
+ if (_1230 < 0.00313066993840038776397705078125)
+ {
+ _1242 = _1230 * 12.9200000762939453125;
+ break;
+ }
+ _1242 = (pow(_1230, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ float _1243 = _1216.z;
+ float _1255;
+ for (;;)
+ {
+ if (_1243 < 0.00313066993840038776397705078125)
+ {
+ _1255 = _1243 * 12.9200000762939453125;
+ break;
+ }
+ _1255 = (pow(_1243, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ float3 _1256 = float3(_1229, _1242, _1255);
+ float3 _1258 = (_1256 * float3(0.9375)) + float3(0.03125);
+ float _1270 = (_1258.z * 16.0) - 0.5;
+ float _1271 = floor(_1270);
+ float _1275 = (_1258.x + _1271) * 0.0625;
+ float _1276 = _1258.y;
+ float4 _1279 = Texture1.sample(Texture1Sampler, float2(_1275, _1276));
+ float4 _1283 = Texture1.sample(Texture1Sampler, float2(_1275 + 0.0625, _1276));
+ float3 _1289 = fast::max(float3(6.1035199905745685100555419921875e-05), (float3(_Globals.LUTWeights[0].x) * _1256) + (float3(_Globals.LUTWeights[1].x) * mix(_1279, _1283, float4(_1270 - _1271)).xyz));
+ float3 _1295 = select(_1289 * float3(0.077399380505084991455078125), pow((_1289 * float3(0.94786727428436279296875)) + float3(0.0521326996386051177978515625), float3(2.400000095367431640625)), _1289 > float3(0.040449999272823333740234375));
+ float3 _1324 = pow(fast::max(float3(0.0), mix((((float3(_Globals.MappingPolynomial.x) * (_1295 * _1295)) + (float3(_Globals.MappingPolynomial.y) * _1295)) + float3(_Globals.MappingPolynomial.z)) * _Globals.ColorScale, _Globals.OverlayColor.xyz, float3(_Globals.OverlayColor.w))), float3(_Globals.InverseGamma.y));
+ float3 _3103;
+ if (_Globals.OutputDevice == 0u)
+ {
+ float _3063 = _1324.x;
+ float _3075;
+ for (;;)
+ {
+ if (_3063 < 0.00313066993840038776397705078125)
+ {
+ _3075 = _3063 * 12.9200000762939453125;
+ break;
+ }
+ _3075 = (pow(_3063, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ float _3076 = _1324.y;
+ float _3088;
+ for (;;)
+ {
+ if (_3076 < 0.00313066993840038776397705078125)
+ {
+ _3088 = _3076 * 12.9200000762939453125;
+ break;
+ }
+ _3088 = (pow(_3076, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ float _3089 = _1324.z;
+ float _3101;
+ for (;;)
+ {
+ if (_3089 < 0.00313066993840038776397705078125)
+ {
+ _3101 = _3089 * 12.9200000762939453125;
+ break;
+ }
+ _3101 = (pow(_3089, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ _3103 = float3(_3075, _3088, _3101);
+ }
+ else
+ {
+ float3 _3062;
+ if (_Globals.OutputDevice == 1u)
+ {
+ float3 _3055 = fast::max(float3(6.1035199905745685100555419921875e-05), (_1324 * _573) * _602);
+ _3062 = fast::min(_3055 * float3(4.5), (pow(fast::max(_3055, float3(0.017999999225139617919921875)), float3(0.449999988079071044921875)) * float3(1.09899997711181640625)) - float3(0.098999999463558197021484375));
+ }
+ else
+ {
+ float3 _3052;
+ if ((_Globals.OutputDevice == 3u) || (_Globals.OutputDevice == 5u))
+ {
+ float3 _2204 = (_932 * float3(1.5)) * (_572 * float3x3(float3(1.04981100559234619140625, 0.0, -9.74845024757087230682373046875e-05), float3(-0.49590301513671875, 1.37331306934356689453125, 0.09824003279209136962890625), float3(0.0, 0.0, 0.991252005100250244140625)));
+ float _2205 = _2204.x;
+ float _2206 = _2204.y;
+ float _2208 = _2204.z;
+ float _2211 = fast::max(fast::max(_2205, _2206), _2208);
+ float _2216 = (fast::max(_2211, 1.0000000133514319600180897396058e-10) - fast::max(fast::min(fast::min(_2205, _2206), _2208), 1.0000000133514319600180897396058e-10)) / fast::max(_2211, 0.00999999977648258209228515625);
+ float _2229 = ((_2208 + _2206) + _2205) + (1.75 * sqrt(((_2208 * (_2208 - _2206)) + (_2206 * (_2206 - _2205))) + (_2205 * (_2205 - _2208))));
+ float _2230 = _2229 * 0.3333333432674407958984375;
+ float _2231 = _2216 - 0.4000000059604644775390625;
+ float _2236 = fast::max(1.0 - abs(_2231 * 2.5), 0.0);
+ float _2244 = (1.0 + (float(int(sign(_2231 * 5.0))) * (1.0 - (_2236 * _2236)))) * 0.02500000037252902984619140625;
+ float _2257;
+ if (_2230 <= 0.053333334624767303466796875)
+ {
+ _2257 = _2244;
+ }
+ else
+ {
+ float _2256;
+ if (_2230 >= 0.1599999964237213134765625)
+ {
+ _2256 = 0.0;
+ }
+ else
+ {
+ _2256 = _2244 * ((0.23999999463558197021484375 / _2229) - 0.5);
+ }
+ _2257 = _2256;
+ }
+ float3 _2260 = _2204 * float3(1.0 + _2257);
+ float _2261 = _2260.x;
+ float _2262 = _2260.y;
+ float _2264 = _2260.z;
+ float _2278;
+ if ((_2261 == _2262) && (_2262 == _2264))
+ {
+ _2278 = 0.0;
+ }
+ else
+ {
+ _2278 = 57.2957763671875 * atan2(sqrt(3.0) * (_2262 - _2264), ((2.0 * _2261) - _2262) - _2264);
+ }
+ float _2283;
+ if (_2278 < 0.0)
+ {
+ _2283 = _2278 + 360.0;
+ }
+ else
+ {
+ _2283 = _2278;
+ }
+ float _2284 = fast::clamp(_2283, 0.0, 360.0);
+ float _2289;
+ if (_2284 > 180.0)
+ {
+ _2289 = _2284 - 360.0;
+ }
+ else
+ {
+ _2289 = _2284;
+ }
+ float _2339;
+ if ((_2289 > (-67.5)) && (_2289 < 67.5))
+ {
+ float _2296 = (_2289 - (-67.5)) * 0.0296296291053295135498046875;
+ int _2297 = int(_2296);
+ float _2299 = _2296 - float(_2297);
+ float _2300 = _2299 * _2299;
+ float _2301 = _2300 * _2299;
+ float _2338;
+ if (_2297 == 3)
+ {
+ _2338 = (((_2301 * (-0.16666667163372039794921875)) + (_2300 * 0.5)) + (_2299 * (-0.5))) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _2331;
+ if (_2297 == 2)
+ {
+ _2331 = ((_2301 * 0.5) + (_2300 * (-1.0))) + 0.666666686534881591796875;
+ }
+ else
+ {
+ float _2326;
+ if (_2297 == 1)
+ {
+ _2326 = (((_2301 * (-0.5)) + (_2300 * 0.5)) + (_2299 * 0.5)) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _2319;
+ if (_2297 == 0)
+ {
+ _2319 = _2301 * 0.16666667163372039794921875;
+ }
+ else
+ {
+ _2319 = 0.0;
+ }
+ _2326 = _2319;
+ }
+ _2331 = _2326;
+ }
+ _2338 = _2331;
+ }
+ _2339 = _2338;
+ }
+ else
+ {
+ _2339 = 0.0;
+ }
+ float3 _2346 = _2260;
+ _2346.x = _2261 + ((((_2339 * 1.5) * _2216) * (0.02999999932944774627685546875 - _2261)) * 0.180000007152557373046875);
+ float3 _2349 = fast::clamp(fast::clamp(_2346, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ float3 _2352 = mix(float3(dot(_2349, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _2349, float3(0.959999978542327880859375));
+ float _2353 = _2352.x;
+ float _2357 = 0.17999999225139617919921875 * exp2(18.0);
+ float _2359 = exp2(-14.0);
+ float _2362 = log((_2353 <= 0.0) ? _2359 : _2353) / _1091;
+ float _2364 = log(0.17999999225139617919921875 * exp2(-15.0)) / _1091;
+ float _2431;
+ if (_2362 <= _2364)
+ {
+ _2431 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _2371 = log(0.180000007152557373046875) / _1091;
+ float _2428;
+ if ((_2362 > _2364) && (_2362 < _2371))
+ {
+ float _2411 = (3.0 * (_2362 - _2364)) / (_2371 - _2364);
+ int _2412 = int(_2411);
+ float _2414 = _2411 - float(_2412);
+ _2428 = dot(float3(_2414 * _2414, _2414, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_2412], _499[_2412 + 1], _499[_2412 + 2]));
+ }
+ else
+ {
+ float _2379 = log(_2357) / _1091;
+ float _2407;
+ if ((_2362 >= _2371) && (_2362 < _2379))
+ {
+ float _2390 = (3.0 * (_2362 - _2371)) / (_2379 - _2371);
+ int _2391 = int(_2390);
+ float _2393 = _2390 - float(_2391);
+ _2407 = dot(float3(_2393 * _2393, _2393, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_2391], _500[_2391 + 1], _500[_2391 + 2]));
+ }
+ else
+ {
+ _2407 = log(10000.0) / _1091;
+ }
+ _2428 = _2407;
+ }
+ _2431 = _2428;
+ }
+ float3 _2433 = _523;
+ _2433.x = pow(10.0, _2431);
+ float _2434 = _2352.y;
+ float _2438 = log((_2434 <= 0.0) ? _2359 : _2434) / _1091;
+ float _2505;
+ if (_2438 <= _2364)
+ {
+ _2505 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _2445 = log(0.180000007152557373046875) / _1091;
+ float _2502;
+ if ((_2438 > _2364) && (_2438 < _2445))
+ {
+ float _2485 = (3.0 * (_2438 - _2364)) / (_2445 - _2364);
+ int _2486 = int(_2485);
+ float _2488 = _2485 - float(_2486);
+ _2502 = dot(float3(_2488 * _2488, _2488, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_2486], _499[_2486 + 1], _499[_2486 + 2]));
+ }
+ else
+ {
+ float _2453 = log(_2357) / _1091;
+ float _2481;
+ if ((_2438 >= _2445) && (_2438 < _2453))
+ {
+ float _2464 = (3.0 * (_2438 - _2445)) / (_2453 - _2445);
+ int _2465 = int(_2464);
+ float _2467 = _2464 - float(_2465);
+ _2481 = dot(float3(_2467 * _2467, _2467, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_2465], _500[_2465 + 1], _500[_2465 + 2]));
+ }
+ else
+ {
+ _2481 = log(10000.0) / _1091;
+ }
+ _2502 = _2481;
+ }
+ _2505 = _2502;
+ }
+ float3 _2507 = _2433;
+ _2507.y = pow(10.0, _2505);
+ float _2508 = _2352.z;
+ float _2512 = log((_2508 <= 0.0) ? _2359 : _2508) / _1091;
+ float _2579;
+ if (_2512 <= _2364)
+ {
+ _2579 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _2519 = log(0.180000007152557373046875) / _1091;
+ float _2576;
+ if ((_2512 > _2364) && (_2512 < _2519))
+ {
+ float _2559 = (3.0 * (_2512 - _2364)) / (_2519 - _2364);
+ int _2560 = int(_2559);
+ float _2562 = _2559 - float(_2560);
+ _2576 = dot(float3(_2562 * _2562, _2562, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_2560], _499[_2560 + 1], _499[_2560 + 2]));
+ }
+ else
+ {
+ float _2527 = log(_2357) / _1091;
+ float _2555;
+ if ((_2512 >= _2519) && (_2512 < _2527))
+ {
+ float _2538 = (3.0 * (_2512 - _2519)) / (_2527 - _2519);
+ int _2539 = int(_2538);
+ float _2541 = _2538 - float(_2539);
+ _2555 = dot(float3(_2541 * _2541, _2541, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_2539], _500[_2539 + 1], _500[_2539 + 2]));
+ }
+ else
+ {
+ _2555 = log(10000.0) / _1091;
+ }
+ _2576 = _2555;
+ }
+ _2579 = _2576;
+ }
+ float3 _2581 = _2507;
+ _2581.z = pow(10.0, _2579);
+ float3 _2583 = (_2581 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ float _2585 = 0.17999999225139617919921875 * pow(2.0, -12.0);
+ float _2589 = log((_2585 <= 0.0) ? _2359 : _2585) / _1091;
+ float _2656;
+ if (_2589 <= _2364)
+ {
+ _2656 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _2596 = log(0.180000007152557373046875) / _1091;
+ float _2653;
+ if ((_2589 > _2364) && (_2589 < _2596))
+ {
+ float _2636 = (3.0 * (_2589 - _2364)) / (_2596 - _2364);
+ int _2637 = int(_2636);
+ float _2639 = _2636 - float(_2637);
+ _2653 = dot(float3(_2639 * _2639, _2639, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_2637], _499[_2637 + 1], _499[_2637 + 2]));
+ }
+ else
+ {
+ float _2604 = log(_2357) / _1091;
+ float _2632;
+ if ((_2589 >= _2596) && (_2589 < _2604))
+ {
+ float _2615 = (3.0 * (_2589 - _2596)) / (_2604 - _2596);
+ int _2616 = int(_2615);
+ float _2618 = _2615 - float(_2616);
+ _2632 = dot(float3(_2618 * _2618, _2618, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_2616], _500[_2616 + 1], _500[_2616 + 2]));
+ }
+ else
+ {
+ _2632 = log(10000.0) / _1091;
+ }
+ _2653 = _2632;
+ }
+ _2656 = _2653;
+ }
+ float _2659 = log(0.180000007152557373046875) / _1091;
+ float _2713;
+ if (_2659 <= _2364)
+ {
+ _2713 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _2710;
+ if ((_2659 > _2364) && (_2659 < _2659))
+ {
+ _2710 = (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-0.485249996185302734375, 1.84773242473602294921875, 1.84773242473602294921875)).z;
+ }
+ else
+ {
+ float _2672 = log(_2357) / _1091;
+ float _2700;
+ if ((_2659 >= _2659) && (_2659 < _2672))
+ {
+ float _2683 = (3.0 * (_2659 - _2659)) / (_2672 - _2659);
+ int _2684 = int(_2683);
+ float _2686 = _2683 - float(_2684);
+ _2700 = dot(float3(_2686 * _2686, _2686, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_2684], _500[_2684 + 1], _500[_2684 + 2]));
+ }
+ else
+ {
+ _2700 = log(10000.0) / _1091;
+ }
+ _2710 = _2700;
+ }
+ _2713 = _2710;
+ }
+ float _2714 = pow(10.0, _2713);
+ float _2716 = 0.17999999225139617919921875 * pow(2.0, 10.0);
+ float _2720 = log((_2716 <= 0.0) ? _2359 : _2716) / _1091;
+ float _2785;
+ if (_2720 <= _2364)
+ {
+ _2785 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _2782;
+ if ((_2720 > _2364) && (_2720 < _2659))
+ {
+ float _2765 = (3.0 * (_2720 - _2364)) / (_2659 - _2364);
+ int _2766 = int(_2765);
+ float _2768 = _2765 - float(_2766);
+ _2782 = dot(float3(_2768 * _2768, _2768, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_2766], _499[_2766 + 1], _499[_2766 + 2]));
+ }
+ else
+ {
+ float _2733 = log(_2357) / _1091;
+ float _2761;
+ if ((_2720 >= _2659) && (_2720 < _2733))
+ {
+ float _2744 = (3.0 * (_2720 - _2659)) / (_2733 - _2659);
+ int _2745 = int(_2744);
+ float _2747 = _2744 - float(_2745);
+ _2761 = dot(float3(_2747 * _2747, _2747, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_2745], _500[_2745 + 1], _500[_2745 + 2]));
+ }
+ else
+ {
+ _2761 = log(10000.0) / _1091;
+ }
+ _2782 = _2761;
+ }
+ _2785 = _2782;
+ }
+ float _2786 = pow(10.0, _2785);
+ float _2787 = _2583.x;
+ float _2791 = log((_2787 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2787) / _1091;
+ float _2792 = log(pow(10.0, _2656));
+ float _2793 = _2792 / _1091;
+ float _2870;
+ if (_2791 <= _2793)
+ {
+ _2870 = (_2791 * 3.0) + ((log(9.9999997473787516355514526367188e-05) / _1091) - ((3.0 * _2792) / _1091));
+ }
+ else
+ {
+ float _2800 = log(_2714) / _1091;
+ float _2862;
+ if ((_2791 > _2793) && (_2791 < _2800))
+ {
+ float _2845 = (7.0 * (_2791 - _2793)) / (_2800 - _2793);
+ int _2846 = int(_2845);
+ float _2848 = _2845 - float(_2846);
+ _2862 = dot(float3(_2848 * _2848, _2848, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_503[_2846], _503[_2846 + 1], _503[_2846 + 2]));
+ }
+ else
+ {
+ float _2807 = log(_2786);
+ float _2808 = _2807 / _1091;
+ float _2841;
+ if ((_2791 >= _2800) && (_2791 < _2808))
+ {
+ float _2824 = (7.0 * (_2791 - _2800)) / (_2808 - _2800);
+ int _2825 = int(_2824);
+ float _2827 = _2824 - float(_2825);
+ _2841 = dot(float3(_2827 * _2827, _2827, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_504[_2825], _504[_2825 + 1], _504[_2825 + 2]));
+ }
+ else
+ {
+ _2841 = (_2791 * 0.0599999986588954925537109375) + ((log(1000.0) / _1091) - ((0.0599999986588954925537109375 * _2807) / _1091));
+ }
+ _2862 = _2841;
+ }
+ _2870 = _2862;
+ }
+ float3 _2872 = _523;
+ _2872.x = pow(10.0, _2870);
+ float _2873 = _2583.y;
+ float _2877 = log((_2873 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2873) / _1091;
+ float _2954;
+ if (_2877 <= _2793)
+ {
+ _2954 = (_2877 * 3.0) + ((log(9.9999997473787516355514526367188e-05) / _1091) - ((3.0 * _2792) / _1091));
+ }
+ else
+ {
+ float _2884 = log(_2714) / _1091;
+ float _2946;
+ if ((_2877 > _2793) && (_2877 < _2884))
+ {
+ float _2929 = (7.0 * (_2877 - _2793)) / (_2884 - _2793);
+ int _2930 = int(_2929);
+ float _2932 = _2929 - float(_2930);
+ _2946 = dot(float3(_2932 * _2932, _2932, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_503[_2930], _503[_2930 + 1], _503[_2930 + 2]));
+ }
+ else
+ {
+ float _2891 = log(_2786);
+ float _2892 = _2891 / _1091;
+ float _2925;
+ if ((_2877 >= _2884) && (_2877 < _2892))
+ {
+ float _2908 = (7.0 * (_2877 - _2884)) / (_2892 - _2884);
+ int _2909 = int(_2908);
+ float _2911 = _2908 - float(_2909);
+ _2925 = dot(float3(_2911 * _2911, _2911, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_504[_2909], _504[_2909 + 1], _504[_2909 + 2]));
+ }
+ else
+ {
+ _2925 = (_2877 * 0.0599999986588954925537109375) + ((log(1000.0) / _1091) - ((0.0599999986588954925537109375 * _2891) / _1091));
+ }
+ _2946 = _2925;
+ }
+ _2954 = _2946;
+ }
+ float3 _2956 = _2872;
+ _2956.y = pow(10.0, _2954);
+ float _2957 = _2583.z;
+ float _2961 = log((_2957 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2957) / _1091;
+ float _3038;
+ if (_2961 <= _2793)
+ {
+ _3038 = (_2961 * 3.0) + ((log(9.9999997473787516355514526367188e-05) / _1091) - ((3.0 * _2792) / _1091));
+ }
+ else
+ {
+ float _2968 = log(_2714) / _1091;
+ float _3030;
+ if ((_2961 > _2793) && (_2961 < _2968))
+ {
+ float _3013 = (7.0 * (_2961 - _2793)) / (_2968 - _2793);
+ int _3014 = int(_3013);
+ float _3016 = _3013 - float(_3014);
+ _3030 = dot(float3(_3016 * _3016, _3016, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_503[_3014], _503[_3014 + 1], _503[_3014 + 2]));
+ }
+ else
+ {
+ float _2975 = log(_2786);
+ float _2976 = _2975 / _1091;
+ float _3009;
+ if ((_2961 >= _2968) && (_2961 < _2976))
+ {
+ float _2992 = (7.0 * (_2961 - _2968)) / (_2976 - _2968);
+ int _2993 = int(_2992);
+ float _2995 = _2992 - float(_2993);
+ _3009 = dot(float3(_2995 * _2995, _2995, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_504[_2993], _504[_2993 + 1], _504[_2993 + 2]));
+ }
+ else
+ {
+ _3009 = (_2961 * 0.0599999986588954925537109375) + ((log(1000.0) / _1091) - ((0.0599999986588954925537109375 * _2975) / _1091));
+ }
+ _3030 = _3009;
+ }
+ _3038 = _3030;
+ }
+ float3 _3040 = _2956;
+ _3040.z = pow(10.0, _3038);
+ float3 _3044 = pow(((_3040 - float3(3.5073844628641381859779357910156e-05)) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _3052 = pow((float3(0.8359375) + (float3(18.8515625) * _3044)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _3044))), float3(78.84375));
+ }
+ else
+ {
+ float3 _2201;
+ if ((_Globals.OutputDevice == 4u) || (_Globals.OutputDevice == 6u))
+ {
+ float3 _1369 = (_932 * float3(1.5)) * (_572 * float3x3(float3(1.04981100559234619140625, 0.0, -9.74845024757087230682373046875e-05), float3(-0.49590301513671875, 1.37331306934356689453125, 0.09824003279209136962890625), float3(0.0, 0.0, 0.991252005100250244140625)));
+ float _1370 = _1369.x;
+ float _1371 = _1369.y;
+ float _1373 = _1369.z;
+ float _1376 = fast::max(fast::max(_1370, _1371), _1373);
+ float _1381 = (fast::max(_1376, 1.0000000133514319600180897396058e-10) - fast::max(fast::min(fast::min(_1370, _1371), _1373), 1.0000000133514319600180897396058e-10)) / fast::max(_1376, 0.00999999977648258209228515625);
+ float _1394 = ((_1373 + _1371) + _1370) + (1.75 * sqrt(((_1373 * (_1373 - _1371)) + (_1371 * (_1371 - _1370))) + (_1370 * (_1370 - _1373))));
+ float _1395 = _1394 * 0.3333333432674407958984375;
+ float _1396 = _1381 - 0.4000000059604644775390625;
+ float _1401 = fast::max(1.0 - abs(_1396 * 2.5), 0.0);
+ float _1409 = (1.0 + (float(int(sign(_1396 * 5.0))) * (1.0 - (_1401 * _1401)))) * 0.02500000037252902984619140625;
+ float _1422;
+ if (_1395 <= 0.053333334624767303466796875)
+ {
+ _1422 = _1409;
+ }
+ else
+ {
+ float _1421;
+ if (_1395 >= 0.1599999964237213134765625)
+ {
+ _1421 = 0.0;
+ }
+ else
+ {
+ _1421 = _1409 * ((0.23999999463558197021484375 / _1394) - 0.5);
+ }
+ _1422 = _1421;
+ }
+ float3 _1425 = _1369 * float3(1.0 + _1422);
+ float _1426 = _1425.x;
+ float _1427 = _1425.y;
+ float _1429 = _1425.z;
+ float _1443;
+ if ((_1426 == _1427) && (_1427 == _1429))
+ {
+ _1443 = 0.0;
+ }
+ else
+ {
+ _1443 = 57.2957763671875 * atan2(sqrt(3.0) * (_1427 - _1429), ((2.0 * _1426) - _1427) - _1429);
+ }
+ float _1448;
+ if (_1443 < 0.0)
+ {
+ _1448 = _1443 + 360.0;
+ }
+ else
+ {
+ _1448 = _1443;
+ }
+ float _1449 = fast::clamp(_1448, 0.0, 360.0);
+ float _1454;
+ if (_1449 > 180.0)
+ {
+ _1454 = _1449 - 360.0;
+ }
+ else
+ {
+ _1454 = _1449;
+ }
+ float _1504;
+ if ((_1454 > (-67.5)) && (_1454 < 67.5))
+ {
+ float _1461 = (_1454 - (-67.5)) * 0.0296296291053295135498046875;
+ int _1462 = int(_1461);
+ float _1464 = _1461 - float(_1462);
+ float _1465 = _1464 * _1464;
+ float _1466 = _1465 * _1464;
+ float _1503;
+ if (_1462 == 3)
+ {
+ _1503 = (((_1466 * (-0.16666667163372039794921875)) + (_1465 * 0.5)) + (_1464 * (-0.5))) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _1496;
+ if (_1462 == 2)
+ {
+ _1496 = ((_1466 * 0.5) + (_1465 * (-1.0))) + 0.666666686534881591796875;
+ }
+ else
+ {
+ float _1491;
+ if (_1462 == 1)
+ {
+ _1491 = (((_1466 * (-0.5)) + (_1465 * 0.5)) + (_1464 * 0.5)) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _1484;
+ if (_1462 == 0)
+ {
+ _1484 = _1466 * 0.16666667163372039794921875;
+ }
+ else
+ {
+ _1484 = 0.0;
+ }
+ _1491 = _1484;
+ }
+ _1496 = _1491;
+ }
+ _1503 = _1496;
+ }
+ _1504 = _1503;
+ }
+ else
+ {
+ _1504 = 0.0;
+ }
+ float3 _1511 = _1425;
+ _1511.x = _1426 + ((((_1504 * 1.5) * _1381) * (0.02999999932944774627685546875 - _1426)) * 0.180000007152557373046875);
+ float3 _1514 = fast::clamp(fast::clamp(_1511, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ float3 _1517 = mix(float3(dot(_1514, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1514, float3(0.959999978542327880859375));
+ float _1518 = _1517.x;
+ float _1522 = 0.17999999225139617919921875 * exp2(18.0);
+ float _1524 = exp2(-14.0);
+ float _1527 = log((_1518 <= 0.0) ? _1524 : _1518) / _1091;
+ float _1529 = log(0.17999999225139617919921875 * exp2(-15.0)) / _1091;
+ float _1596;
+ if (_1527 <= _1529)
+ {
+ _1596 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _1536 = log(0.180000007152557373046875) / _1091;
+ float _1593;
+ if ((_1527 > _1529) && (_1527 < _1536))
+ {
+ float _1576 = (3.0 * (_1527 - _1529)) / (_1536 - _1529);
+ int _1577 = int(_1576);
+ float _1579 = _1576 - float(_1577);
+ _1593 = dot(float3(_1579 * _1579, _1579, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_1577], _499[_1577 + 1], _499[_1577 + 2]));
+ }
+ else
+ {
+ float _1544 = log(_1522) / _1091;
+ float _1572;
+ if ((_1527 >= _1536) && (_1527 < _1544))
+ {
+ float _1555 = (3.0 * (_1527 - _1536)) / (_1544 - _1536);
+ int _1556 = int(_1555);
+ float _1558 = _1555 - float(_1556);
+ _1572 = dot(float3(_1558 * _1558, _1558, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_1556], _500[_1556 + 1], _500[_1556 + 2]));
+ }
+ else
+ {
+ _1572 = log(10000.0) / _1091;
+ }
+ _1593 = _1572;
+ }
+ _1596 = _1593;
+ }
+ float3 _1598 = _523;
+ _1598.x = pow(10.0, _1596);
+ float _1599 = _1517.y;
+ float _1603 = log((_1599 <= 0.0) ? _1524 : _1599) / _1091;
+ float _1670;
+ if (_1603 <= _1529)
+ {
+ _1670 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _1610 = log(0.180000007152557373046875) / _1091;
+ float _1667;
+ if ((_1603 > _1529) && (_1603 < _1610))
+ {
+ float _1650 = (3.0 * (_1603 - _1529)) / (_1610 - _1529);
+ int _1651 = int(_1650);
+ float _1653 = _1650 - float(_1651);
+ _1667 = dot(float3(_1653 * _1653, _1653, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_1651], _499[_1651 + 1], _499[_1651 + 2]));
+ }
+ else
+ {
+ float _1618 = log(_1522) / _1091;
+ float _1646;
+ if ((_1603 >= _1610) && (_1603 < _1618))
+ {
+ float _1629 = (3.0 * (_1603 - _1610)) / (_1618 - _1610);
+ int _1630 = int(_1629);
+ float _1632 = _1629 - float(_1630);
+ _1646 = dot(float3(_1632 * _1632, _1632, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_1630], _500[_1630 + 1], _500[_1630 + 2]));
+ }
+ else
+ {
+ _1646 = log(10000.0) / _1091;
+ }
+ _1667 = _1646;
+ }
+ _1670 = _1667;
+ }
+ float3 _1672 = _1598;
+ _1672.y = pow(10.0, _1670);
+ float _1673 = _1517.z;
+ float _1677 = log((_1673 <= 0.0) ? _1524 : _1673) / _1091;
+ float _1744;
+ if (_1677 <= _1529)
+ {
+ _1744 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _1684 = log(0.180000007152557373046875) / _1091;
+ float _1741;
+ if ((_1677 > _1529) && (_1677 < _1684))
+ {
+ float _1724 = (3.0 * (_1677 - _1529)) / (_1684 - _1529);
+ int _1725 = int(_1724);
+ float _1727 = _1724 - float(_1725);
+ _1741 = dot(float3(_1727 * _1727, _1727, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_1725], _499[_1725 + 1], _499[_1725 + 2]));
+ }
+ else
+ {
+ float _1692 = log(_1522) / _1091;
+ float _1720;
+ if ((_1677 >= _1684) && (_1677 < _1692))
+ {
+ float _1703 = (3.0 * (_1677 - _1684)) / (_1692 - _1684);
+ int _1704 = int(_1703);
+ float _1706 = _1703 - float(_1704);
+ _1720 = dot(float3(_1706 * _1706, _1706, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_1704], _500[_1704 + 1], _500[_1704 + 2]));
+ }
+ else
+ {
+ _1720 = log(10000.0) / _1091;
+ }
+ _1741 = _1720;
+ }
+ _1744 = _1741;
+ }
+ float3 _1746 = _1672;
+ _1746.z = pow(10.0, _1744);
+ float3 _1748 = (_1746 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ float _1750 = 0.17999999225139617919921875 * pow(2.0, -12.0);
+ float _1754 = log((_1750 <= 0.0) ? _1524 : _1750) / _1091;
+ float _1821;
+ if (_1754 <= _1529)
+ {
+ _1821 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _1761 = log(0.180000007152557373046875) / _1091;
+ float _1818;
+ if ((_1754 > _1529) && (_1754 < _1761))
+ {
+ float _1801 = (3.0 * (_1754 - _1529)) / (_1761 - _1529);
+ int _1802 = int(_1801);
+ float _1804 = _1801 - float(_1802);
+ _1818 = dot(float3(_1804 * _1804, _1804, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_1802], _499[_1802 + 1], _499[_1802 + 2]));
+ }
+ else
+ {
+ float _1769 = log(_1522) / _1091;
+ float _1797;
+ if ((_1754 >= _1761) && (_1754 < _1769))
+ {
+ float _1780 = (3.0 * (_1754 - _1761)) / (_1769 - _1761);
+ int _1781 = int(_1780);
+ float _1783 = _1780 - float(_1781);
+ _1797 = dot(float3(_1783 * _1783, _1783, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_1781], _500[_1781 + 1], _500[_1781 + 2]));
+ }
+ else
+ {
+ _1797 = log(10000.0) / _1091;
+ }
+ _1818 = _1797;
+ }
+ _1821 = _1818;
+ }
+ float _1824 = log(0.180000007152557373046875) / _1091;
+ float _1878;
+ if (_1824 <= _1529)
+ {
+ _1878 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _1875;
+ if ((_1824 > _1529) && (_1824 < _1824))
+ {
+ _1875 = (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-0.485249996185302734375, 1.84773242473602294921875, 1.84773242473602294921875)).z;
+ }
+ else
+ {
+ float _1837 = log(_1522) / _1091;
+ float _1865;
+ if ((_1824 >= _1824) && (_1824 < _1837))
+ {
+ float _1848 = (3.0 * (_1824 - _1824)) / (_1837 - _1824);
+ int _1849 = int(_1848);
+ float _1851 = _1848 - float(_1849);
+ _1865 = dot(float3(_1851 * _1851, _1851, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_1849], _500[_1849 + 1], _500[_1849 + 2]));
+ }
+ else
+ {
+ _1865 = log(10000.0) / _1091;
+ }
+ _1875 = _1865;
+ }
+ _1878 = _1875;
+ }
+ float _1879 = pow(10.0, _1878);
+ float _1881 = 0.17999999225139617919921875 * pow(2.0, 11.0);
+ float _1885 = log((_1881 <= 0.0) ? _1524 : _1881) / _1091;
+ float _1950;
+ if (_1885 <= _1529)
+ {
+ _1950 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _1947;
+ if ((_1885 > _1529) && (_1885 < _1824))
+ {
+ float _1930 = (3.0 * (_1885 - _1529)) / (_1824 - _1529);
+ int _1931 = int(_1930);
+ float _1933 = _1930 - float(_1931);
+ _1947 = dot(float3(_1933 * _1933, _1933, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_1931], _499[_1931 + 1], _499[_1931 + 2]));
+ }
+ else
+ {
+ float _1898 = log(_1522) / _1091;
+ float _1926;
+ if ((_1885 >= _1824) && (_1885 < _1898))
+ {
+ float _1909 = (3.0 * (_1885 - _1824)) / (_1898 - _1824);
+ int _1910 = int(_1909);
+ float _1912 = _1909 - float(_1910);
+ _1926 = dot(float3(_1912 * _1912, _1912, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_1910], _500[_1910 + 1], _500[_1910 + 2]));
+ }
+ else
+ {
+ _1926 = log(10000.0) / _1091;
+ }
+ _1947 = _1926;
+ }
+ _1950 = _1947;
+ }
+ float _1951 = pow(10.0, _1950);
+ float _1952 = _1748.x;
+ float _1956 = log((_1952 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1952) / _1091;
+ float _1958 = log(pow(10.0, _1821)) / _1091;
+ float _2030;
+ if (_1956 <= _1958)
+ {
+ _2030 = log(0.004999999888241291046142578125) / _1091;
+ }
+ else
+ {
+ float _1965 = log(_1879) / _1091;
+ float _2027;
+ if ((_1956 > _1958) && (_1956 < _1965))
+ {
+ float _2010 = (7.0 * (_1956 - _1958)) / (_1965 - _1958);
+ int _2011 = int(_2010);
+ float _2013 = _2010 - float(_2011);
+ _2027 = dot(float3(_2013 * _2013, _2013, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_506[_2011], _506[_2011 + 1], _506[_2011 + 2]));
+ }
+ else
+ {
+ float _1972 = log(_1951);
+ float _1973 = _1972 / _1091;
+ float _2006;
+ if ((_1956 >= _1965) && (_1956 < _1973))
+ {
+ float _1989 = (7.0 * (_1956 - _1965)) / (_1973 - _1965);
+ int _1990 = int(_1989);
+ float _1992 = _1989 - float(_1990);
+ _2006 = dot(float3(_1992 * _1992, _1992, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_507[_1990], _507[_1990 + 1], _507[_1990 + 2]));
+ }
+ else
+ {
+ _2006 = (_1956 * 0.119999997317790985107421875) + ((log(2000.0) / _1091) - ((0.119999997317790985107421875 * _1972) / _1091));
+ }
+ _2027 = _2006;
+ }
+ _2030 = _2027;
+ }
+ float3 _2032 = _523;
+ _2032.x = pow(10.0, _2030);
+ float _2033 = _1748.y;
+ float _2037 = log((_2033 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2033) / _1091;
+ float _2109;
+ if (_2037 <= _1958)
+ {
+ _2109 = log(0.004999999888241291046142578125) / _1091;
+ }
+ else
+ {
+ float _2044 = log(_1879) / _1091;
+ float _2106;
+ if ((_2037 > _1958) && (_2037 < _2044))
+ {
+ float _2089 = (7.0 * (_2037 - _1958)) / (_2044 - _1958);
+ int _2090 = int(_2089);
+ float _2092 = _2089 - float(_2090);
+ _2106 = dot(float3(_2092 * _2092, _2092, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_506[_2090], _506[_2090 + 1], _506[_2090 + 2]));
+ }
+ else
+ {
+ float _2051 = log(_1951);
+ float _2052 = _2051 / _1091;
+ float _2085;
+ if ((_2037 >= _2044) && (_2037 < _2052))
+ {
+ float _2068 = (7.0 * (_2037 - _2044)) / (_2052 - _2044);
+ int _2069 = int(_2068);
+ float _2071 = _2068 - float(_2069);
+ _2085 = dot(float3(_2071 * _2071, _2071, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_507[_2069], _507[_2069 + 1], _507[_2069 + 2]));
+ }
+ else
+ {
+ _2085 = (_2037 * 0.119999997317790985107421875) + ((log(2000.0) / _1091) - ((0.119999997317790985107421875 * _2051) / _1091));
+ }
+ _2106 = _2085;
+ }
+ _2109 = _2106;
+ }
+ float3 _2111 = _2032;
+ _2111.y = pow(10.0, _2109);
+ float _2112 = _1748.z;
+ float _2116 = log((_2112 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2112) / _1091;
+ float _2188;
+ if (_2116 <= _1958)
+ {
+ _2188 = log(0.004999999888241291046142578125) / _1091;
+ }
+ else
+ {
+ float _2123 = log(_1879) / _1091;
+ float _2185;
+ if ((_2116 > _1958) && (_2116 < _2123))
+ {
+ float _2168 = (7.0 * (_2116 - _1958)) / (_2123 - _1958);
+ int _2169 = int(_2168);
+ float _2171 = _2168 - float(_2169);
+ _2185 = dot(float3(_2171 * _2171, _2171, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_506[_2169], _506[_2169 + 1], _506[_2169 + 2]));
+ }
+ else
+ {
+ float _2130 = log(_1951);
+ float _2131 = _2130 / _1091;
+ float _2164;
+ if ((_2116 >= _2123) && (_2116 < _2131))
+ {
+ float _2147 = (7.0 * (_2116 - _2123)) / (_2131 - _2123);
+ int _2148 = int(_2147);
+ float _2150 = _2147 - float(_2148);
+ _2164 = dot(float3(_2150 * _2150, _2150, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_507[_2148], _507[_2148 + 1], _507[_2148 + 2]));
+ }
+ else
+ {
+ _2164 = (_2116 * 0.119999997317790985107421875) + ((log(2000.0) / _1091) - ((0.119999997317790985107421875 * _2130) / _1091));
+ }
+ _2185 = _2164;
+ }
+ _2188 = _2185;
+ }
+ float3 _2190 = _2111;
+ _2190.z = pow(10.0, _2188);
+ float3 _2193 = pow((_2190 * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _2201 = pow((float3(0.8359375) + (float3(18.8515625) * _2193)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2193))), float3(78.84375));
+ }
+ else
+ {
+ float3 _1366;
+ if (_Globals.OutputDevice == 7u)
+ {
+ float3 _1358 = pow(((_932 * _573) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _1366 = pow((float3(0.8359375) + (float3(18.8515625) * _1358)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _1358))), float3(78.84375));
+ }
+ else
+ {
+ _1366 = pow((_1324 * _573) * _602, float3(_Globals.InverseGamma.z));
+ }
+ _2201 = _1366;
+ }
+ _3052 = _2201;
+ }
+ _3062 = _3052;
+ }
+ _3103 = _3062;
+ }
+ float3 _3104 = _3103 * float3(0.95238101482391357421875);
+ float4 _3106 = float4(_3104.x, _3104.y, _3104.z, float4(0.0).w);
+ _3106.w = 0.0;
+ out.out_var_SV_Target0 = _3106;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag
new file mode 100644
index 00000000000..e43b7bd3796
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag
@@ -0,0 +1,356 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_ClipToWorld;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_908;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_924;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_940;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_956;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_972;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_1020;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_1036;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_1052;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1068;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1724;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1740;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1756;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2076;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2148;
+ float PrePadding_View_2152;
+ float PrePadding_View_2156;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2228;
+ float PrePadding_View_2232;
+ float PrePadding_View_2236;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2268;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2412;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ float View_AtmosphericFogSunDiscHalfApexAngleRadian;
+ float PrePadding_View_2492;
+ float4 View_AtmosphericFogSunDiscLuminance;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ uint PrePadding_View_2520;
+ uint PrePadding_View_2524;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2584;
+ float PrePadding_View_2588;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2744;
+ float PrePadding_View_2748;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float PrePadding_View_2908;
+ int2 View_CursorPosition;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ float PrePadding_View_2924;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2940;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2956;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2972;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2988;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_3004;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_PrimitiveDither
+{
+ float PrimitiveDither_LODFactor;
+};
+
+struct type_PrimitiveFade
+{
+ float2 PrimitiveFade_FadeTimeScaleBias;
+};
+
+struct type_Material
+{
+ float4 Material_VectorExpressions[9];
+ float4 Material_ScalarExpressions[3];
+};
+
+constant float _98 = {};
+constant float _103 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+ float gl_FragDepth [[depth(less)]];
+};
+
+struct main0_in
+{
+ float4 in_var_TEXCOORD6 [[user(locn0)]];
+ float4 in_var_TEXCOORD7 [[user(locn1)]];
+ float4 in_var_TEXCOORD10_centroid [[user(locn2)]];
+ float4 in_var_TEXCOORD11_centroid [[user(locn3)]];
+ float4 in_var_TEXCOORD0_0 [[user(locn4)]];
+};
+
+static inline __attribute__((always_inline))
+void _353()
+{
+ discard_fragment();
+}
+
+fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_PrimitiveDither& PrimitiveDither [[buffer(1)]], constant type_PrimitiveFade& PrimitiveFade [[buffer(2)]], constant type_Material& Material [[buffer(3)]], texture2d<float> Material_Texture2D_0 [[texture(0)]], texture2d<float> Material_Texture2D_3 [[texture(1)]], sampler Material_Texture2D_0Sampler [[sampler(0)]], sampler Material_Texture2D_3Sampler [[sampler(1)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 1> in_var_TEXCOORD0 = {};
+ in_var_TEXCOORD0[0] = in.in_var_TEXCOORD0_0;
+ float2 _135 = gl_FragCoord.xy - View.View_ViewRectMin.xy;
+ float4 _140 = float4(_103, _103, gl_FragCoord.z, 1.0) * float4(gl_FragCoord.w);
+ float4 _144 = View.View_SVPositionToTranslatedWorld * float4(gl_FragCoord.xyz, 1.0);
+ float3 _148 = _144.xyz / float3(_144.w);
+ float3 _149 = _148 - float3(View.View_PreViewTranslation);
+ float3 _151 = normalize(-_148);
+ float3 _152 = _151 * float3x3(in.in_var_TEXCOORD10_centroid.xyz, cross(in.in_var_TEXCOORD11_centroid.xyz, in.in_var_TEXCOORD10_centroid.xyz) * float3(in.in_var_TEXCOORD11_centroid.w), in.in_var_TEXCOORD11_centroid.xyz);
+ float _170 = mix(Material.Material_ScalarExpressions[0].y, Material.Material_ScalarExpressions[0].z, fast::min(fast::max(abs(dot(_151, in.in_var_TEXCOORD11_centroid.xyz)), 0.0), 1.0));
+ float _172 = 1.0 / _170;
+ float2 _174 = (float2(Material.Material_ScalarExpressions[0].x) * ((_152.xy * float2(-1.0)) / float2(_152.z))) * float2(_172);
+ float _180_copy;
+ float2 _183;
+ _183 = float2(0.0);
+ float _188;
+ float _211;
+ float2 _212;
+ float _180 = 1.0;
+ int _185 = 0;
+ float _187 = 1.0;
+ float _189 = 1.0;
+ for (;;)
+ {
+ if (float(_185) < (floor(_170) + 2.0))
+ {
+ _188 = Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y) + _183), gradient2d(dfdx(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y)), dfdy(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y)))).y;
+ if (_180 < _188)
+ {
+ float _201 = _188 - _180;
+ float _203 = _201 / ((_189 - _187) + _201);
+ _211 = (_189 * _203) + (_180 * (1.0 - _203));
+ _212 = _183 - (float2(_203) * _174);
+ break;
+ }
+ _180_copy = _180;
+ _180 -= _172;
+ _183 += _174;
+ _185++;
+ _187 = _188;
+ _189 = _180_copy;
+ continue;
+ }
+ else
+ {
+ _211 = _98;
+ _212 = _183;
+ break;
+ }
+ }
+ float4 _218 = Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y) + _212.xy), bias(View.View_MaterialTextureMipBias));
+ float2 _229 = _135 + float2(View.View_TemporalAAParams.x);
+ float _237 = float((uint(_229.x) + (2u * uint(_229.y))) % 5u);
+ float2 _238 = _135 * float2(0.015625);
+ float4 _242 = Material_Texture2D_3.sample(Material_Texture2D_3Sampler, _238, bias(View.View_MaterialTextureMipBias));
+ float4 _254 = Material_Texture2D_3.sample(Material_Texture2D_3Sampler, _238, bias(View.View_MaterialTextureMipBias));
+ float3 _272 = float3(_212, (1.0 - _211) * Material.Material_ScalarExpressions[0].x);
+ float2 _275 = dfdx(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y));
+ float2 _276 = abs(_275);
+ float3 _279 = dfdx(_149);
+ float2 _283 = dfdy(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y));
+ float2 _284 = abs(_283);
+ float3 _287 = dfdy(_149);
+ if (PrimitiveDither.PrimitiveDither_LODFactor != 0.0)
+ {
+ if (abs(PrimitiveDither.PrimitiveDither_LODFactor) > 0.001000000047497451305389404296875)
+ {
+ float _317 = fract(cos(dot(floor(gl_FragCoord.xy), float2(347.834503173828125, 3343.28369140625))) * 1000.0);
+ if ((float((PrimitiveDither.PrimitiveDither_LODFactor < 0.0) ? ((PrimitiveDither.PrimitiveDither_LODFactor + 1.0) > _317) : (PrimitiveDither.PrimitiveDither_LODFactor < _317)) - 0.001000000047497451305389404296875) < 0.0)
+ {
+ _353();
+ }
+ }
+ }
+ if ((((_218.z + ((fast::min(fast::max(1.0 - (_218.x * Material.Material_ScalarExpressions[2].y), 0.0), 1.0) + ((_237 + (_242.x * Material.Material_ScalarExpressions[2].z)) * 0.16666667163372039794921875)) + (-0.5))) * ((fast::clamp((View.View_RealTime * PrimitiveFade.PrimitiveFade_FadeTimeScaleBias.x) + PrimitiveFade.PrimitiveFade_FadeTimeScaleBias.y, 0.0, 1.0) + ((_237 + _254.x) * 0.16666667163372039794921875)) + (-0.5))) - 0.33329999446868896484375) < 0.0)
+ {
+ _353();
+ }
+ float2 _351 = ((((in.in_var_TEXCOORD6.xy / float2(in.in_var_TEXCOORD6.w)) - View.View_TemporalAAJitter.xy) - ((in.in_var_TEXCOORD7.xy / float2(in.in_var_TEXCOORD7.w)) - View.View_TemporalAAJitter.zw)) * float2(0.2495000064373016357421875)) + float2(0.49999237060546875);
+ out.gl_FragDepth = fast::min(_140.z / (_140.w + (sqrt(dot(_272, _272)) / (fast::max(sqrt(dot(_276, _276)) / sqrt(dot(_279, _279)), sqrt(dot(_284, _284)) / sqrt(dot(_287, _287))) / abs(dot(float3x3(View.View_ViewToTranslatedWorld[0].xyz, View.View_ViewToTranslatedWorld[1].xyz, View.View_ViewToTranslatedWorld[2].xyz) * float3(0.0, 0.0, 1.0), _151))))), gl_FragCoord.z);
+ out.out_var_SV_Target0 = float4(_351.x, _351.y, float2(0.0).x, float2(0.0).y);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag
new file mode 100644
index 00000000000..dd54893a24b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag
@@ -0,0 +1,503 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_844;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_860;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_876;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_892;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_908;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_956;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_972;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_988;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1004;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1660;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1676;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1692;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2012;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2084;
+ float PrePadding_View_2088;
+ float PrePadding_View_2092;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2164;
+ float PrePadding_View_2168;
+ float PrePadding_View_2172;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2204;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2348;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2488;
+ float PrePadding_View_2492;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2648;
+ float PrePadding_View_2652;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2828;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2844;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2860;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2876;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_2892;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_StructuredBuffer_v4float
+{
+ float4 _m0[1];
+};
+
+struct type_TranslucentBasePass
+{
+ uint TranslucentBasePass_Shared_Forward_NumLocalLights;
+ uint TranslucentBasePass_Shared_Forward_NumReflectionCaptures;
+ uint TranslucentBasePass_Shared_Forward_HasDirectionalLight;
+ uint TranslucentBasePass_Shared_Forward_NumGridCells;
+ packed_int3 TranslucentBasePass_Shared_Forward_CulledGridSize;
+ uint TranslucentBasePass_Shared_Forward_MaxCulledLightsPerCell;
+ uint TranslucentBasePass_Shared_Forward_LightGridPixelSizeShift;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_36;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_40;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_44;
+ packed_float3 TranslucentBasePass_Shared_Forward_LightGridZParams;
+ float PrePadding_TranslucentBasePass_Shared_Forward_60;
+ packed_float3 TranslucentBasePass_Shared_Forward_DirectionalLightDirection;
+ float PrePadding_TranslucentBasePass_Shared_Forward_76;
+ packed_float3 TranslucentBasePass_Shared_Forward_DirectionalLightColor;
+ float TranslucentBasePass_Shared_Forward_DirectionalLightVolumetricScatteringIntensity;
+ uint TranslucentBasePass_Shared_Forward_DirectionalLightShadowMapChannelMask;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_100;
+ float2 TranslucentBasePass_Shared_Forward_DirectionalLightDistanceFadeMAD;
+ uint TranslucentBasePass_Shared_Forward_NumDirectionalLightCascades;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_116;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_120;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_124;
+ float4 TranslucentBasePass_Shared_Forward_CascadeEndDepths;
+ float4x4 TranslucentBasePass_Shared_Forward_DirectionalLightWorldToShadowMatrix[4];
+ float4 TranslucentBasePass_Shared_Forward_DirectionalLightShadowmapMinMax[4];
+ float4 TranslucentBasePass_Shared_Forward_DirectionalLightShadowmapAtlasBufferSize;
+ float TranslucentBasePass_Shared_Forward_DirectionalLightDepthBias;
+ uint TranslucentBasePass_Shared_Forward_DirectionalLightUseStaticShadowing;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_488;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_492;
+ float4 TranslucentBasePass_Shared_Forward_DirectionalLightStaticShadowBufferSize;
+ float4x4 TranslucentBasePass_Shared_Forward_DirectionalLightWorldToStaticShadow;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_576;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_580;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_584;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_588;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_592;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_596;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_600;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_604;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_608;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_612;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_616;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_620;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_624;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_628;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_632;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_636;
+ uint TranslucentBasePass_Shared_ForwardISR_NumLocalLights;
+ uint TranslucentBasePass_Shared_ForwardISR_NumReflectionCaptures;
+ uint TranslucentBasePass_Shared_ForwardISR_HasDirectionalLight;
+ uint TranslucentBasePass_Shared_ForwardISR_NumGridCells;
+ packed_int3 TranslucentBasePass_Shared_ForwardISR_CulledGridSize;
+ uint TranslucentBasePass_Shared_ForwardISR_MaxCulledLightsPerCell;
+ uint TranslucentBasePass_Shared_ForwardISR_LightGridPixelSizeShift;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_676;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_680;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_684;
+ packed_float3 TranslucentBasePass_Shared_ForwardISR_LightGridZParams;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_700;
+ packed_float3 TranslucentBasePass_Shared_ForwardISR_DirectionalLightDirection;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_716;
+ packed_float3 TranslucentBasePass_Shared_ForwardISR_DirectionalLightColor;
+ float TranslucentBasePass_Shared_ForwardISR_DirectionalLightVolumetricScatteringIntensity;
+ uint TranslucentBasePass_Shared_ForwardISR_DirectionalLightShadowMapChannelMask;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_740;
+ float2 TranslucentBasePass_Shared_ForwardISR_DirectionalLightDistanceFadeMAD;
+ uint TranslucentBasePass_Shared_ForwardISR_NumDirectionalLightCascades;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_756;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_760;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_764;
+ float4 TranslucentBasePass_Shared_ForwardISR_CascadeEndDepths;
+ float4x4 TranslucentBasePass_Shared_ForwardISR_DirectionalLightWorldToShadowMatrix[4];
+ float4 TranslucentBasePass_Shared_ForwardISR_DirectionalLightShadowmapMinMax[4];
+ float4 TranslucentBasePass_Shared_ForwardISR_DirectionalLightShadowmapAtlasBufferSize;
+ float TranslucentBasePass_Shared_ForwardISR_DirectionalLightDepthBias;
+ uint TranslucentBasePass_Shared_ForwardISR_DirectionalLightUseStaticShadowing;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_1128;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_1132;
+ float4 TranslucentBasePass_Shared_ForwardISR_DirectionalLightStaticShadowBufferSize;
+ float4x4 TranslucentBasePass_Shared_ForwardISR_DirectionalLightWorldToStaticShadow;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1216;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1220;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1224;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1228;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1232;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1236;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1240;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1244;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1248;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1252;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1256;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1260;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1264;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1268;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1272;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1276;
+ float4 TranslucentBasePass_Shared_Reflection_SkyLightParameters;
+ float TranslucentBasePass_Shared_Reflection_SkyLightCubemapBrightness;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1300;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1304;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1308;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1312;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1316;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1320;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1324;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1328;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1332;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1336;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1340;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1344;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1348;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1352;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1356;
+ float4 TranslucentBasePass_Shared_PlanarReflection_ReflectionPlane;
+ float4 TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionOrigin;
+ float4 TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionXAxis;
+ float4 TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionYAxis;
+ float3x4 TranslucentBasePass_Shared_PlanarReflection_InverseTransposeMirrorMatrix;
+ packed_float3 TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionParameters;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1484;
+ float2 TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionParameters2;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1496;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1500;
+ float4x4 TranslucentBasePass_Shared_PlanarReflection_ProjectionWithExtraFOV[2];
+ float4 TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionScreenScaleBias[2];
+ float2 TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionScreenBound;
+ uint TranslucentBasePass_Shared_PlanarReflection_bIsStereo;
+ float PrePadding_TranslucentBasePass_Shared_Fog_1676;
+ float PrePadding_TranslucentBasePass_Shared_Fog_1680;
+ float PrePadding_TranslucentBasePass_Shared_Fog_1684;
+ float PrePadding_TranslucentBasePass_Shared_Fog_1688;
+ float PrePadding_TranslucentBasePass_Shared_Fog_1692;
+ float4 TranslucentBasePass_Shared_Fog_ExponentialFogParameters;
+ float4 TranslucentBasePass_Shared_Fog_ExponentialFogParameters2;
+ float4 TranslucentBasePass_Shared_Fog_ExponentialFogColorParameter;
+ float4 TranslucentBasePass_Shared_Fog_ExponentialFogParameters3;
+ float4 TranslucentBasePass_Shared_Fog_InscatteringLightDirection;
+ float4 TranslucentBasePass_Shared_Fog_DirectionalInscatteringColor;
+ float2 TranslucentBasePass_Shared_Fog_SinCosInscatteringColorCubemapRotation;
+ float PrePadding_TranslucentBasePass_Shared_Fog_1800;
+ float PrePadding_TranslucentBasePass_Shared_Fog_1804;
+ packed_float3 TranslucentBasePass_Shared_Fog_FogInscatteringTextureParameters;
+ float TranslucentBasePass_Shared_Fog_ApplyVolumetricFog;
+ float PrePadding_TranslucentBasePass_1824;
+ float PrePadding_TranslucentBasePass_1828;
+ float PrePadding_TranslucentBasePass_1832;
+ float PrePadding_TranslucentBasePass_1836;
+ float PrePadding_TranslucentBasePass_1840;
+ float PrePadding_TranslucentBasePass_1844;
+ float PrePadding_TranslucentBasePass_1848;
+ float PrePadding_TranslucentBasePass_1852;
+ float PrePadding_TranslucentBasePass_1856;
+ float PrePadding_TranslucentBasePass_1860;
+ float PrePadding_TranslucentBasePass_1864;
+ float PrePadding_TranslucentBasePass_1868;
+ float PrePadding_TranslucentBasePass_1872;
+ float PrePadding_TranslucentBasePass_1876;
+ float PrePadding_TranslucentBasePass_1880;
+ float PrePadding_TranslucentBasePass_1884;
+ float PrePadding_TranslucentBasePass_1888;
+ float PrePadding_TranslucentBasePass_1892;
+ float PrePadding_TranslucentBasePass_1896;
+ float PrePadding_TranslucentBasePass_1900;
+ float PrePadding_TranslucentBasePass_1904;
+ float PrePadding_TranslucentBasePass_1908;
+ float PrePadding_TranslucentBasePass_1912;
+ float PrePadding_TranslucentBasePass_1916;
+ float PrePadding_TranslucentBasePass_1920;
+ float PrePadding_TranslucentBasePass_1924;
+ float PrePadding_TranslucentBasePass_1928;
+ float PrePadding_TranslucentBasePass_1932;
+ float PrePadding_TranslucentBasePass_1936;
+ float PrePadding_TranslucentBasePass_1940;
+ float PrePadding_TranslucentBasePass_1944;
+ float PrePadding_TranslucentBasePass_1948;
+ float PrePadding_TranslucentBasePass_1952;
+ float PrePadding_TranslucentBasePass_1956;
+ float PrePadding_TranslucentBasePass_1960;
+ float PrePadding_TranslucentBasePass_1964;
+ float PrePadding_TranslucentBasePass_1968;
+ float PrePadding_TranslucentBasePass_1972;
+ float PrePadding_TranslucentBasePass_1976;
+ float PrePadding_TranslucentBasePass_1980;
+ float PrePadding_TranslucentBasePass_1984;
+ float PrePadding_TranslucentBasePass_1988;
+ float PrePadding_TranslucentBasePass_1992;
+ float PrePadding_TranslucentBasePass_1996;
+ float PrePadding_TranslucentBasePass_2000;
+ float PrePadding_TranslucentBasePass_2004;
+ float PrePadding_TranslucentBasePass_2008;
+ float PrePadding_TranslucentBasePass_2012;
+ float PrePadding_TranslucentBasePass_2016;
+ float PrePadding_TranslucentBasePass_2020;
+ float PrePadding_TranslucentBasePass_2024;
+ float PrePadding_TranslucentBasePass_2028;
+ float PrePadding_TranslucentBasePass_2032;
+ float PrePadding_TranslucentBasePass_2036;
+ float PrePadding_TranslucentBasePass_2040;
+ float PrePadding_TranslucentBasePass_2044;
+ float PrePadding_TranslucentBasePass_2048;
+ float PrePadding_TranslucentBasePass_2052;
+ float PrePadding_TranslucentBasePass_2056;
+ float PrePadding_TranslucentBasePass_2060;
+ float PrePadding_TranslucentBasePass_2064;
+ float PrePadding_TranslucentBasePass_2068;
+ float PrePadding_TranslucentBasePass_2072;
+ float PrePadding_TranslucentBasePass_2076;
+ float PrePadding_TranslucentBasePass_2080;
+ float PrePadding_TranslucentBasePass_2084;
+ float PrePadding_TranslucentBasePass_2088;
+ float PrePadding_TranslucentBasePass_2092;
+ float PrePadding_TranslucentBasePass_2096;
+ float PrePadding_TranslucentBasePass_2100;
+ float PrePadding_TranslucentBasePass_2104;
+ float PrePadding_TranslucentBasePass_2108;
+ float PrePadding_TranslucentBasePass_2112;
+ float PrePadding_TranslucentBasePass_2116;
+ float PrePadding_TranslucentBasePass_2120;
+ float PrePadding_TranslucentBasePass_2124;
+ float PrePadding_TranslucentBasePass_2128;
+ float PrePadding_TranslucentBasePass_2132;
+ float PrePadding_TranslucentBasePass_2136;
+ float PrePadding_TranslucentBasePass_2140;
+ float4 TranslucentBasePass_HZBUvFactorAndInvFactor;
+ float4 TranslucentBasePass_PrevScreenPositionScaleBias;
+ float TranslucentBasePass_PrevSceneColorPreExposureInv;
+};
+
+struct type_Material
+{
+ float4 Material_VectorExpressions[2];
+ float4 Material_ScalarExpressions[1];
+};
+
+constant float _108 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+ uint gl_SampleMask [[sample_mask]];
+};
+
+struct main0_in
+{
+ float4 in_var_TEXCOORD10_centroid [[user(locn0)]];
+ float4 in_var_TEXCOORD11_centroid [[user(locn1)]];
+ uint in_var_PRIMITIVE_ID [[user(locn2)]];
+ float4 in_var_TEXCOORD7 [[user(locn3)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], const device type_StructuredBuffer_v4float& View_PrimitiveSceneData [[buffer(1)]], constant type_TranslucentBasePass& TranslucentBasePass [[buffer(2)]], constant type_Material& Material [[buffer(3)]], texture3d<float> TranslucentBasePass_Shared_Fog_IntegratedLightScattering [[texture(0)]], sampler View_SharedBilinearClampedSampler [[sampler(0)]], float4 gl_FragCoord [[position]], uint gl_SampleMaskIn [[sample_mask]])
+{
+ main0_out out = {};
+ float4 _137 = View.View_SVPositionToTranslatedWorld * float4(gl_FragCoord.xyz, 1.0);
+ float3 _142 = (_137.xyz / float3(_137.w)) - float3(View.View_PreViewTranslation);
+ bool _165 = TranslucentBasePass.TranslucentBasePass_Shared_Fog_ApplyVolumetricFog > 0.0;
+ float4 _215;
+ if (_165)
+ {
+ float4 _172 = View.View_WorldToClip * float4(_142, 1.0);
+ float _173 = _172.w;
+ float4 _202;
+ if (_165)
+ {
+ _202 = TranslucentBasePass_Shared_Fog_IntegratedLightScattering.sample(View_SharedBilinearClampedSampler, float3(((_172.xy / float2(_173)).xy * float2(0.5, -0.5)) + float2(0.5), (log2((_173 * View.View_VolumetricFogGridZParams[0]) + View.View_VolumetricFogGridZParams[1]) * View.View_VolumetricFogGridZParams[2]) * View.View_VolumetricFogInvGridSize[2]), level(0.0));
+ }
+ else
+ {
+ _202 = float4(0.0, 0.0, 0.0, 1.0);
+ }
+ _215 = float4(_202.xyz + (in.in_var_TEXCOORD7.xyz * float3(_202.w)), _202.w * in.in_var_TEXCOORD7.w);
+ }
+ else
+ {
+ _215 = in.in_var_TEXCOORD7;
+ }
+ float3 _216 = fast::max(Material.Material_VectorExpressions[1].xyz * float3(((1.0 + dot(float3(-1.0, -1.5, 3.0) / float3(sqrt(12.25)), normalize(float3x3(in.in_var_TEXCOORD10_centroid.xyz, cross(in.in_var_TEXCOORD11_centroid.xyz, in.in_var_TEXCOORD10_centroid.xyz) * float3(in.in_var_TEXCOORD11_centroid.w), in.in_var_TEXCOORD11_centroid.xyz) * normalize((float3(0.0, 0.0, 1.0) * float3(View.View_NormalOverrideParameter.w)) + View.View_NormalOverrideParameter.xyz)))) * 0.5) + 0.20000000298023223876953125), float3(0.0));
+ float3 _246;
+ if (View.View_OutOfBoundsMask > 0.0)
+ {
+ uint _222 = in.in_var_PRIMITIVE_ID * 26u;
+ float3 _245;
+ if (any(abs(_142 - View_PrimitiveSceneData._m0[_222 + 5u].xyz) > (View_PrimitiveSceneData._m0[_222 + 19u].xyz + float3(1.0))))
+ {
+ _245 = mix(float3(1.0, 1.0, 0.0), float3(0.0, 1.0, 1.0), select(float3(0.0), float3(1.0), float3(fract(dot(_142, float3(0.57700002193450927734375)) * 0.00200000009499490261077880859375)) > float3(0.5)));
+ }
+ else
+ {
+ _245 = _216;
+ }
+ _246 = _245;
+ }
+ else
+ {
+ _246 = _216;
+ }
+ float4 _256 = float4((_246 * float3(_215.w)) + _215.xyz, _108);
+ _256.w = 1.0;
+ float4 _268;
+ uint _269;
+ if (View.View_NumSceneColorMSAASamples > 1)
+ {
+ _268 = _256 * float4(float(View.View_NumSceneColorMSAASamples) * 0.25);
+ _269 = gl_SampleMaskIn & 15u;
+ }
+ else
+ {
+ _268 = _256;
+ _269 = gl_SampleMaskIn;
+ }
+ out.out_var_SV_Target0 = _268;
+ out.gl_SampleMask = _269;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag
new file mode 100644
index 00000000000..02cfc882943
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag
@@ -0,0 +1,213 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_844;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_860;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_876;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_892;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_908;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_956;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_972;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_988;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1004;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1660;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1676;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1692;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2012;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2084;
+ float PrePadding_View_2088;
+ float PrePadding_View_2092;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2164;
+ float PrePadding_View_2168;
+ float PrePadding_View_2172;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2204;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2348;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2488;
+ float PrePadding_View_2492;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2648;
+ float PrePadding_View_2652;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2828;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2844;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2860;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2876;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_2892;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_Globals
+{
+ float3 SoftTransitionScale;
+ float4 ShadowBufferSize;
+ float ShadowFadeFraction;
+ float ShadowSharpen;
+ float4 LightPositionAndInvRadius;
+ float4x4 ScreenToShadowMatrix;
+ float2 ProjectionDepthBiasParameters;
+ float4 ModulatedShadowColor;
+ float4 ShadowTileOffsetAndSize;
+};
+
+constant float4 _58 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_Globals& _Globals [[buffer(1)]], float4 _gl_LastFragData [[color(0)]], texture2d<float> ShadowDepthTexture [[texture(1)]], sampler ShadowDepthTextureSampler [[sampler(0)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ float4 _67 = _gl_LastFragData;
+ float _68 = _67.w;
+ float4 _82 = _Globals.ScreenToShadowMatrix * float4((((gl_FragCoord.xy * View.View_BufferSizeAndInvSize.zw) - View.View_ScreenPositionScaleBias.wz) / View.View_ScreenPositionScaleBias.xy) * float2(_68), _68, 1.0);
+ float _118 = fast::clamp(((fast::clamp((ShadowDepthTexture.sample(ShadowDepthTextureSampler, (((_82.xyz / float3(_82.w)).xy * _Globals.ShadowTileOffsetAndSize.zw).xy + _Globals.ShadowTileOffsetAndSize.xy).xy, level(0.0)).xxx * float3(_Globals.SoftTransitionScale.z)) - float3((fast::min(_82.z, 0.999989986419677734375) * _Globals.SoftTransitionScale.z) - 1.0), float3(0.0), float3(1.0)).x - 0.5) * _Globals.ShadowSharpen) + 0.5, 0.0, 1.0);
+ float3 _127 = mix(_Globals.ModulatedShadowColor.xyz, float3(1.0), float3(mix(1.0, _118 * _118, _Globals.ShadowFadeFraction)));
+ float4 _129 = float4(_127.x, _127.y, _127.z, _58.w);
+ _129.w = 0.0;
+ out.out_var_SV_Target0 = _129;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.frag
new file mode 100644
index 00000000000..a416259d877
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.frag
@@ -0,0 +1,121 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+#pragma clang diagnostic ignored "-Wunused-variable"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+#include <metal_atomic>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_StructuredBuffer_v4float
+{
+ float4 _m0[1];
+};
+
+struct type_Globals
+{
+ uint2 ShadowTileListGroupSize;
+};
+
+constant float3 _70 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+struct main0_in
+{
+ uint in_var_TEXCOORD0 [[user(locn0)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], const device type_StructuredBuffer_v4float& CulledObjectBoxBounds [[buffer(0)]], constant type_Globals& _Globals [[buffer(1)]], texture2d<uint> RWShadowTileNumCulledObjects [[texture(2)]], device atomic_uint* RWShadowTileNumCulledObjects_atomic [[buffer(2)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ uint2 _77 = uint2(gl_FragCoord.xy);
+ uint _78 = _77.y;
+ uint _83 = _77.x;
+ float2 _91 = float2(float(_83), float((_Globals.ShadowTileListGroupSize.y - 1u) - _78));
+ float2 _93 = float2(_Globals.ShadowTileListGroupSize);
+ float2 _96 = ((_91 / _93) * float2(2.0)) - float2(1.0);
+ float2 _100 = (((_91 + float2(1.0)) / _93) * float2(2.0)) - float2(1.0);
+ float3 _102 = float3(_100.x, _100.y, _70.z);
+ _102.z = 1.0;
+ uint _103 = in.in_var_TEXCOORD0 * 5u;
+ uint _107 = _103 + 1u;
+ if (all(CulledObjectBoxBounds._m0[_107].xy > _96.xy) && all(CulledObjectBoxBounds._m0[_103].xyz < _102))
+ {
+ float _122 = _96.x;
+ float _123 = _96.y;
+ spvUnsafeArray<float3, 8> _73;
+ _73[0] = float3(_122, _123, -1000.0);
+ float _126 = _100.x;
+ _73[1] = float3(_126, _123, -1000.0);
+ float _129 = _100.y;
+ _73[2] = float3(_122, _129, -1000.0);
+ _73[3] = float3(_126, _129, -1000.0);
+ _73[4] = float3(_122, _123, 1.0);
+ _73[5] = float3(_126, _123, 1.0);
+ _73[6] = float3(_122, _129, 1.0);
+ _73[7] = float3(_126, _129, 1.0);
+ float3 _155;
+ float3 _158;
+ _155 = float3(-500000.0);
+ _158 = float3(500000.0);
+ for (int _160 = 0; _160 < 8; )
+ {
+ float3 _166 = _73[_160] - (float3(0.5) * (CulledObjectBoxBounds._m0[_103].xyz + CulledObjectBoxBounds._m0[_107].xyz));
+ float3 _170 = float3(dot(_166, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 4u].xyz));
+ _155 = fast::max(_155, _170);
+ _158 = fast::min(_158, _170);
+ _160++;
+ continue;
+ }
+ if (all(_158 < float3(1.0)) && all(_155 > float3(-1.0)))
+ {
+ uint _179 = atomic_fetch_add_explicit((device atomic_uint*)&RWShadowTileNumCulledObjects_atomic[(_78 * _Globals.ShadowTileListGroupSize.x) + _83], 1u, memory_order_relaxed);
+ }
+ }
+ out.out_var_SV_Target0 = float4(0.0);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag
new file mode 100644
index 00000000000..85e27bd1ec2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag
@@ -0,0 +1,122 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+#pragma clang diagnostic ignored "-Wunused-variable"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+#include <metal_atomic>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_StructuredBuffer_v4float
+{
+ float4 _m0[1];
+};
+
+struct type_Globals
+{
+ uint2 ShadowTileListGroupSize;
+};
+
+constant float3 _70 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+struct main0_in
+{
+ uint in_var_TEXCOORD0 [[user(locn0)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], constant uint* spvBufferSizeConstants [[buffer(25)]], const device type_StructuredBuffer_v4float& CulledObjectBoxBounds [[buffer(0)]], constant type_Globals& _Globals [[buffer(1)]], texture2d<uint> RWShadowTileNumCulledObjects [[texture(2)]], device atomic_uint* RWShadowTileNumCulledObjects_atomic [[buffer(2)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ constant uint& CulledObjectBoxBoundsBufferSize = spvBufferSizeConstants[0];
+ uint2 _77 = uint2(gl_FragCoord.xy);
+ uint _78 = _77.y;
+ uint _83 = _77.x;
+ float2 _91 = float2(float(_83), float((_Globals.ShadowTileListGroupSize.y - 1u) - _78));
+ float2 _93 = float2(_Globals.ShadowTileListGroupSize);
+ float2 _96 = ((_91 / _93) * float2(2.0)) - float2(1.0);
+ float2 _100 = (((_91 + float2(1.0)) / _93) * float2(2.0)) - float2(1.0);
+ float3 _102 = float3(_100.x, _100.y, _70.z);
+ _102.z = 1.0;
+ uint _103 = in.in_var_TEXCOORD0 * 5u;
+ uint _186 = clamp(_103 + 1u, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u);
+ if (all(CulledObjectBoxBounds._m0[_186].xy > _96.xy) && all(CulledObjectBoxBounds._m0[clamp(_103, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz < _102))
+ {
+ float _122 = _96.x;
+ float _123 = _96.y;
+ spvUnsafeArray<float3, 8> _73;
+ _73[0] = float3(_122, _123, -1000.0);
+ float _126 = _100.x;
+ _73[1] = float3(_126, _123, -1000.0);
+ float _129 = _100.y;
+ _73[2] = float3(_122, _129, -1000.0);
+ _73[3] = float3(_126, _129, -1000.0);
+ _73[4] = float3(_122, _123, 1.0);
+ _73[5] = float3(_126, _123, 1.0);
+ _73[6] = float3(_122, _129, 1.0);
+ _73[7] = float3(_126, _129, 1.0);
+ float3 _155;
+ float3 _158;
+ _155 = float3(-500000.0);
+ _158 = float3(500000.0);
+ for (int _160 = 0; _160 < 8; )
+ {
+ float3 _166 = _73[int(clamp(uint(_160), uint(0), uint(7)))] - (float3(0.5) * (CulledObjectBoxBounds._m0[clamp(_103, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz + CulledObjectBoxBounds._m0[_186].xyz));
+ float3 _170 = float3(dot(_166, CulledObjectBoxBounds._m0[clamp(_103 + 2u, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz), dot(_166, CulledObjectBoxBounds._m0[clamp(_103 + 3u, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz), dot(_166, CulledObjectBoxBounds._m0[clamp(_103 + 4u, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz));
+ _155 = fast::max(_155, _170);
+ _158 = fast::min(_158, _170);
+ _160++;
+ continue;
+ }
+ if (all(_158 < float3(1.0)) && all(_155 > float3(-1.0)))
+ {
+ uint _179 = atomic_fetch_add_explicit((device atomic_uint*)&RWShadowTileNumCulledObjects_atomic[(_78 * _Globals.ShadowTileListGroupSize.x) + _83], 1u, memory_order_relaxed);
+ }
+ }
+ out.out_var_SV_Target0 = float4(0.0);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/hs-incorrect-base-type.asm.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/hs-incorrect-base-type.asm.tesc
new file mode 100644
index 00000000000..47a957663b8
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/hs-incorrect-base-type.asm.tesc
@@ -0,0 +1,399 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct FVertexFactoryInterpolantsVSToPS
+{
+ float4 TangentToWorld0;
+ float4 TangentToWorld2;
+ float4 Color;
+ spvUnsafeArray<float4, 1> TexCoords;
+ float4 LightMapCoordinate;
+ uint PrimitiveId;
+ uint LightmapDataIndex;
+};
+
+struct FVertexFactoryInterpolantsVSToDS
+{
+ FVertexFactoryInterpolantsVSToPS InterpolantsVSToPS;
+};
+
+struct FSharedBasePassInterpolants
+{
+};
+struct FBasePassInterpolantsVSToDS
+{
+ FSharedBasePassInterpolants _m0;
+};
+
+struct FBasePassVSToDS
+{
+ FVertexFactoryInterpolantsVSToDS FactoryInterpolants;
+ FBasePassInterpolantsVSToDS BasePassInterpolants;
+ float4 Position;
+};
+
+struct FPNTessellationHSToDS
+{
+ FBasePassVSToDS PassSpecificData;
+ spvUnsafeArray<float4, 3> WorldPosition;
+ float3 DisplacementScale;
+ float TessellationMultiplier;
+ float WorldDisplacementMultiplier;
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_844;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_860;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_876;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_892;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_908;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_956;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_972;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_988;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1004;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1660;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1676;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1692;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2012;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2084;
+ float PrePadding_View_2088;
+ float PrePadding_View_2092;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2164;
+ float PrePadding_View_2168;
+ float PrePadding_View_2172;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2204;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2348;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2488;
+ float PrePadding_View_2492;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2648;
+ float PrePadding_View_2652;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2828;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2844;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2860;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2876;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_2892;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_StructuredBuffer_v4float
+{
+ float4 _m0[1];
+};
+
+constant float4 _600 = {};
+
+struct main0_out
+{
+ float4 out_var_COLOR0;
+ uint out_var_LIGHTMAP_ID;
+ float3 out_var_PN_DisplacementScales;
+ spvUnsafeArray<float4, 3> out_var_PN_POSITION;
+ float out_var_PN_TessellationMultiplier;
+ float out_var_PN_WorldDisplacementMultiplier;
+ uint out_var_PRIMITIVE_ID;
+ spvUnsafeArray<float4, 1> out_var_TEXCOORD0;
+ float4 out_var_TEXCOORD10_centroid;
+ float4 out_var_TEXCOORD11_centroid;
+ float4 out_var_TEXCOORD4;
+ float4 out_var_VS_To_DS_Position;
+};
+
+struct main0_patchOut
+{
+ float4 out_var_PN_POSITION9;
+};
+
+struct main0_in
+{
+ float4 in_var_TEXCOORD10_centroid [[attribute(0)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(1)]];
+ float4 in_var_COLOR0 [[attribute(2)]];
+ float4 in_var_TEXCOORD0_0 [[attribute(3)]];
+ float4 in_var_TEXCOORD4 [[attribute(4)]];
+ uint in_var_PRIMITIVE_ID [[attribute(5)]];
+ uint in_var_LIGHTMAP_ID [[attribute(6)]];
+ float4 in_var_VS_To_DS_Position [[attribute(7)]];
+};
+
+kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], const device type_StructuredBuffer_v4float& View_PrimitiveSceneData [[buffer(1)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
+{
+ threadgroup FPNTessellationHSToDS temp_var_hullMainRetVal[3];
+ device main0_out* gl_out = &spvOut[gl_PrimitiveID * 3];
+ device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID];
+ if (gl_InvocationID < spvIndirectParams[0])
+ gl_in[gl_InvocationID] = in;
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+ if (gl_InvocationID >= 3)
+ return;
+ spvUnsafeArray<float4, 12> _144 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD10_centroid, gl_in[1].in_var_TEXCOORD10_centroid, gl_in[2].in_var_TEXCOORD10_centroid, gl_in[3].in_var_TEXCOORD10_centroid, gl_in[4].in_var_TEXCOORD10_centroid, gl_in[5].in_var_TEXCOORD10_centroid, gl_in[6].in_var_TEXCOORD10_centroid, gl_in[7].in_var_TEXCOORD10_centroid, gl_in[8].in_var_TEXCOORD10_centroid, gl_in[9].in_var_TEXCOORD10_centroid, gl_in[10].in_var_TEXCOORD10_centroid, gl_in[11].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 12> _145 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD11_centroid, gl_in[1].in_var_TEXCOORD11_centroid, gl_in[2].in_var_TEXCOORD11_centroid, gl_in[3].in_var_TEXCOORD11_centroid, gl_in[4].in_var_TEXCOORD11_centroid, gl_in[5].in_var_TEXCOORD11_centroid, gl_in[6].in_var_TEXCOORD11_centroid, gl_in[7].in_var_TEXCOORD11_centroid, gl_in[8].in_var_TEXCOORD11_centroid, gl_in[9].in_var_TEXCOORD11_centroid, gl_in[10].in_var_TEXCOORD11_centroid, gl_in[11].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<float4, 12> _146 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_COLOR0, gl_in[1].in_var_COLOR0, gl_in[2].in_var_COLOR0, gl_in[3].in_var_COLOR0, gl_in[4].in_var_COLOR0, gl_in[5].in_var_COLOR0, gl_in[6].in_var_COLOR0, gl_in[7].in_var_COLOR0, gl_in[8].in_var_COLOR0, gl_in[9].in_var_COLOR0, gl_in[10].in_var_COLOR0, gl_in[11].in_var_COLOR0 });
+ spvUnsafeArray<spvUnsafeArray<float4, 1>, 12> _147 = spvUnsafeArray<spvUnsafeArray<float4, 1>, 12>({ spvUnsafeArray<float4, 1>({ gl_in[0].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[1].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[2].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[3].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[4].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[5].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[6].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[7].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[8].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[9].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[10].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[11].in_var_TEXCOORD0_0 }) });
+ spvUnsafeArray<float4, 12> _148 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD4, gl_in[1].in_var_TEXCOORD4, gl_in[2].in_var_TEXCOORD4, gl_in[3].in_var_TEXCOORD4, gl_in[4].in_var_TEXCOORD4, gl_in[5].in_var_TEXCOORD4, gl_in[6].in_var_TEXCOORD4, gl_in[7].in_var_TEXCOORD4, gl_in[8].in_var_TEXCOORD4, gl_in[9].in_var_TEXCOORD4, gl_in[10].in_var_TEXCOORD4, gl_in[11].in_var_TEXCOORD4 });
+ spvUnsafeArray<uint, 12> _149 = spvUnsafeArray<uint, 12>({ gl_in[0].in_var_PRIMITIVE_ID, gl_in[1].in_var_PRIMITIVE_ID, gl_in[2].in_var_PRIMITIVE_ID, gl_in[3].in_var_PRIMITIVE_ID, gl_in[4].in_var_PRIMITIVE_ID, gl_in[5].in_var_PRIMITIVE_ID, gl_in[6].in_var_PRIMITIVE_ID, gl_in[7].in_var_PRIMITIVE_ID, gl_in[8].in_var_PRIMITIVE_ID, gl_in[9].in_var_PRIMITIVE_ID, gl_in[10].in_var_PRIMITIVE_ID, gl_in[11].in_var_PRIMITIVE_ID });
+ spvUnsafeArray<uint, 12> _150 = spvUnsafeArray<uint, 12>({ gl_in[0].in_var_LIGHTMAP_ID, gl_in[1].in_var_LIGHTMAP_ID, gl_in[2].in_var_LIGHTMAP_ID, gl_in[3].in_var_LIGHTMAP_ID, gl_in[4].in_var_LIGHTMAP_ID, gl_in[5].in_var_LIGHTMAP_ID, gl_in[6].in_var_LIGHTMAP_ID, gl_in[7].in_var_LIGHTMAP_ID, gl_in[8].in_var_LIGHTMAP_ID, gl_in[9].in_var_LIGHTMAP_ID, gl_in[10].in_var_LIGHTMAP_ID, gl_in[11].in_var_LIGHTMAP_ID });
+ spvUnsafeArray<float4, 12> _259 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_VS_To_DS_Position, gl_in[1].in_var_VS_To_DS_Position, gl_in[2].in_var_VS_To_DS_Position, gl_in[3].in_var_VS_To_DS_Position, gl_in[4].in_var_VS_To_DS_Position, gl_in[5].in_var_VS_To_DS_Position, gl_in[6].in_var_VS_To_DS_Position, gl_in[7].in_var_VS_To_DS_Position, gl_in[8].in_var_VS_To_DS_Position, gl_in[9].in_var_VS_To_DS_Position, gl_in[10].in_var_VS_To_DS_Position, gl_in[11].in_var_VS_To_DS_Position });
+ spvUnsafeArray<FBasePassVSToDS, 12> _284 = spvUnsafeArray<FBasePassVSToDS, 12>({ FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[0], _145[0], _146[0], _147[0], _148[0], _149[0], _150[0] } }, FBasePassInterpolantsVSToDS{ { } }, _259[0] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[1], _145[1], _146[1], _147[1], _148[1], _149[1], _150[1] } }, FBasePassInterpolantsVSToDS{ { } }, _259[1] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[2], _145[2], _146[2], _147[2], _148[2], _149[2], _150[2] } }, FBasePassInterpolantsVSToDS{ { } }, _259[2] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[3], _145[3], _146[3], _147[3], _148[3], _149[3], _150[3] } }, FBasePassInterpolantsVSToDS{ { } }, _259[3] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[4], _145[4], _146[4], _147[4], _148[4], _149[4], _150[4] } }, FBasePassInterpolantsVSToDS{ { } }, _259[4] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[5], _145[5], _146[5], _147[5], _148[5], _149[5], _150[5] } }, FBasePassInterpolantsVSToDS{ { } }, _259[5] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[6], _145[6], _146[6], _147[6], _148[6], _149[6], _150[6] } }, FBasePassInterpolantsVSToDS{ { } }, _259[6] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[7], _145[7], _146[7], _147[7], _148[7], _149[7], _150[7] } }, FBasePassInterpolantsVSToDS{ { } }, _259[7] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[8], _145[8], _146[8], _147[8], _148[8], _149[8], _150[8] } }, FBasePassInterpolantsVSToDS{ { } }, _259[8] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[9], _145[9], _146[9], _147[9], _148[9], _149[9], _150[9] } }, FBasePassInterpolantsVSToDS{ { } }, _259[9] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[10], _145[10], _146[10], _147[10], _148[10], _149[10], _150[10] } }, FBasePassInterpolantsVSToDS{ { } }, _259[10] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[11], _145[11], _146[11], _147[11], _148[11], _149[11], _150[11] } }, FBasePassInterpolantsVSToDS{ { } }, _259[11] } });
+ spvUnsafeArray<FBasePassVSToDS, 12> param_var_I;
+ param_var_I = _284;
+ float4 _301 = float4(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float3 _310 = View_PrimitiveSceneData._m0[(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.PrimitiveId * 26u) + 22u].xyz * float3x3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz, cross(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz) * float3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.w), param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz);
+ uint _313 = (gl_InvocationID < 2u) ? (gl_InvocationID + 1u) : 0u;
+ uint _314 = 2u * gl_InvocationID;
+ uint _315 = 3u + _314;
+ uint _316 = _314 + 4u;
+ float4 _328 = float4(param_var_I[_313].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float4 _336 = float4(param_var_I[_315].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float4 _344 = float4(param_var_I[_316].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ spvUnsafeArray<float4, 3> _392 = spvUnsafeArray<float4, 3>({ param_var_I[gl_InvocationID].Position, (((((float4(2.0) * param_var_I[gl_InvocationID].Position) + param_var_I[_313].Position) - (float4(dot(param_var_I[_313].Position - param_var_I[gl_InvocationID].Position, _301)) * _301)) * float4(0.3333333432674407958984375)) + ((((float4(2.0) * param_var_I[_315].Position) + param_var_I[_316].Position) - (float4(dot(param_var_I[_316].Position - param_var_I[_315].Position, _336)) * _336)) * float4(0.3333333432674407958984375))) * float4(0.5), (((((float4(2.0) * param_var_I[_313].Position) + param_var_I[gl_InvocationID].Position) - (float4(dot(param_var_I[gl_InvocationID].Position - param_var_I[_313].Position, _328)) * _328)) * float4(0.3333333432674407958984375)) + ((((float4(2.0) * param_var_I[_316].Position) + param_var_I[_315].Position) - (float4(dot(param_var_I[_315].Position - param_var_I[_316].Position, _344)) * _344)) * float4(0.3333333432674407958984375))) * float4(0.5) });
+ gl_out[gl_InvocationID].out_var_TEXCOORD10_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ gl_out[gl_InvocationID].out_var_TEXCOORD11_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ gl_out[gl_InvocationID].out_var_COLOR0 = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.Color;
+ gl_out[gl_InvocationID].out_var_TEXCOORD0 = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TexCoords;
+ gl_out[gl_InvocationID].out_var_TEXCOORD4 = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.LightMapCoordinate;
+ gl_out[gl_InvocationID].out_var_PRIMITIVE_ID = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.PrimitiveId;
+ gl_out[gl_InvocationID].out_var_LIGHTMAP_ID = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.LightmapDataIndex;
+ gl_out[gl_InvocationID].out_var_VS_To_DS_Position = param_var_I[gl_InvocationID].Position;
+ gl_out[gl_InvocationID].out_var_PN_POSITION = _392;
+ gl_out[gl_InvocationID].out_var_PN_DisplacementScales = _310;
+ gl_out[gl_InvocationID].out_var_PN_TessellationMultiplier = 1.0;
+ gl_out[gl_InvocationID].out_var_PN_WorldDisplacementMultiplier = 1.0;
+ temp_var_hullMainRetVal[gl_InvocationID] = FPNTessellationHSToDS{ param_var_I[gl_InvocationID], _392, _310, 1.0, 1.0 };
+ threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup);
+ if (gl_InvocationID == 0u)
+ {
+ float4 _450 = (((((temp_var_hullMainRetVal[0u].WorldPosition[1] + temp_var_hullMainRetVal[0u].WorldPosition[2]) + temp_var_hullMainRetVal[1u].WorldPosition[1]) + temp_var_hullMainRetVal[1u].WorldPosition[2]) + temp_var_hullMainRetVal[2u].WorldPosition[1]) + temp_var_hullMainRetVal[2u].WorldPosition[2]) * float4(0.16666667163372039794921875);
+ float4 _463 = _600;
+ _463.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _469 = _463;
+ _469.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ float4 _474 = _469;
+ _474.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ float4 _481 = _474;
+ _481.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _589;
+ for (;;)
+ {
+ float4 _489 = View.View_ViewToClip * float4(0.0);
+ float4 _494 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[0u].WorldPosition[0].xyz, 1.0);
+ float3 _495 = _494.xyz;
+ float3 _496 = _489.xyz;
+ float _498 = _494.w;
+ float _499 = _489.w;
+ float4 _516 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[1u].WorldPosition[0].xyz, 1.0);
+ float3 _517 = _516.xyz;
+ float _519 = _516.w;
+ float4 _537 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[2u].WorldPosition[0].xyz, 1.0);
+ float3 _538 = _537.xyz;
+ float _540 = _537.w;
+ if (any((((select(int3(0), int3(1), (_495 - _496) < float3(_498 + _499)) + (int3(2) * select(int3(0), int3(1), (_495 + _496) > float3((-_498) - _499)))) | (select(int3(0), int3(1), (_517 - _496) < float3(_519 + _499)) + (int3(2) * select(int3(0), int3(1), (_517 + _496) > float3((-_519) - _499))))) | (select(int3(0), int3(1), (_538 - _496) < float3(_540 + _499)) + (int3(2) * select(int3(0), int3(1), (_538 + _496) > float3((-_540) - _499))))) != int3(3)))
+ {
+ _589 = float4(0.0);
+ break;
+ }
+ float3 _558 = temp_var_hullMainRetVal[0u].WorldPosition[0].xyz - temp_var_hullMainRetVal[1u].WorldPosition[0].xyz;
+ float3 _559 = temp_var_hullMainRetVal[1u].WorldPosition[0].xyz - temp_var_hullMainRetVal[2u].WorldPosition[0].xyz;
+ float3 _560 = temp_var_hullMainRetVal[2u].WorldPosition[0].xyz - temp_var_hullMainRetVal[0u].WorldPosition[0].xyz;
+ float3 _563 = (float3(0.5) * (temp_var_hullMainRetVal[0u].WorldPosition[0].xyz + temp_var_hullMainRetVal[1u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float3 _566 = (float3(0.5) * (temp_var_hullMainRetVal[1u].WorldPosition[0].xyz + temp_var_hullMainRetVal[2u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float3 _569 = (float3(0.5) * (temp_var_hullMainRetVal[2u].WorldPosition[0].xyz + temp_var_hullMainRetVal[0u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float _573 = sqrt(dot(_559, _559) / dot(_566, _566));
+ float _577 = sqrt(dot(_560, _560) / dot(_569, _569));
+ float _581 = sqrt(dot(_558, _558) / dot(_563, _563));
+ float4 _586 = float4(_573, _577, _581, 1.0);
+ _586.w = 0.333000004291534423828125 * ((_573 + _577) + _581);
+ _589 = float4(View.View_AdaptiveTessellationFactor) * _586;
+ break;
+ }
+ float4 _591 = fast::clamp(_481 * _589, float4(1.0), float4(15.0));
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_591.x);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_591.y);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_591.z);
+ spvTessLevel[gl_PrimitiveID].insideTessellationFactor = half(_591.w);
+ patchOut.out_var_PN_POSITION9 = _450 + ((_450 - (((temp_var_hullMainRetVal[2u].WorldPosition[0] + temp_var_hullMainRetVal[1u].WorldPosition[0]) + temp_var_hullMainRetVal[0u].WorldPosition[0]) * float4(0.3333333432674407958984375))) * float4(0.5));
+ }
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/hs-input-array-access.asm.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/hs-input-array-access.asm.tesc
new file mode 100644
index 00000000000..f41095a31e2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/hs-input-array-access.asm.tesc
@@ -0,0 +1,467 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct FVertexFactoryInterpolantsVSToPS
+{
+ float4 TangentToWorld0;
+ float4 TangentToWorld2;
+};
+
+struct FVertexFactoryInterpolantsVSToDS
+{
+ FVertexFactoryInterpolantsVSToPS InterpolantsVSToPS;
+};
+
+struct FHitProxyVSToDS
+{
+ FVertexFactoryInterpolantsVSToDS FactoryInterpolants;
+ float4 Position;
+ uint VertexID;
+};
+
+struct FHullShaderConstantDominantVertexData
+{
+ float2 UV;
+ float4 Normal;
+ float3 Tangent;
+};
+
+struct FHullShaderConstantDominantEdgeData
+{
+ float2 UV0;
+ float2 UV1;
+ float4 Normal0;
+ float4 Normal1;
+ float3 Tangent0;
+ float3 Tangent1;
+};
+
+struct FPNTessellationHSToDS
+{
+ FHitProxyVSToDS PassSpecificData;
+ spvUnsafeArray<float4, 3> WorldPosition;
+ float3 DisplacementScale;
+ float TessellationMultiplier;
+ float WorldDisplacementMultiplier;
+ FHullShaderConstantDominantVertexData DominantVertex;
+ FHullShaderConstantDominantEdgeData DominantEdge;
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_ClipToWorld;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_908;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_924;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_940;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_956;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_972;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_1020;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_1036;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_1052;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1068;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1724;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1740;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1756;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2076;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2148;
+ float PrePadding_View_2152;
+ float PrePadding_View_2156;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2228;
+ float PrePadding_View_2232;
+ float PrePadding_View_2236;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2268;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2412;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ float View_AtmosphericFogSunDiscHalfApexAngleRadian;
+ float PrePadding_View_2492;
+ float4 View_AtmosphericFogSunDiscLuminance;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ uint PrePadding_View_2520;
+ uint PrePadding_View_2524;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2584;
+ float PrePadding_View_2588;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2744;
+ float PrePadding_View_2748;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float PrePadding_View_2908;
+ int2 View_CursorPosition;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ float PrePadding_View_2924;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2940;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2956;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2972;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2988;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_3004;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_Primitive
+{
+ float4x4 Primitive_LocalToWorld;
+ float4 Primitive_InvNonUniformScaleAndDeterminantSign;
+ float4 Primitive_ObjectWorldPositionAndRadius;
+ float4x4 Primitive_WorldToLocal;
+ float4x4 Primitive_PreviousLocalToWorld;
+ float4x4 Primitive_PreviousWorldToLocal;
+ packed_float3 Primitive_ActorWorldPosition;
+ float Primitive_UseSingleSampleShadowFromStationaryLights;
+ packed_float3 Primitive_ObjectBounds;
+ float Primitive_LpvBiasMultiplier;
+ float Primitive_DecalReceiverMask;
+ float Primitive_PerObjectGBufferData;
+ float Primitive_UseVolumetricLightmapShadowFromStationaryLights;
+ float Primitive_DrawsVelocity;
+ float4 Primitive_ObjectOrientation;
+ float4 Primitive_NonUniformScale;
+ packed_float3 Primitive_LocalObjectBoundsMin;
+ uint Primitive_LightingChannelMask;
+ packed_float3 Primitive_LocalObjectBoundsMax;
+ uint Primitive_LightmapDataIndex;
+ packed_float3 Primitive_PreSkinnedLocalBounds;
+ int Primitive_SingleCaptureIndex;
+ uint Primitive_OutputVelocity;
+ uint PrePadding_Primitive_420;
+ uint PrePadding_Primitive_424;
+ uint PrePadding_Primitive_428;
+ float4 Primitive_CustomPrimitiveData[4];
+};
+
+constant float4 _611 = {};
+
+struct main0_out
+{
+ float3 out_var_PN_DisplacementScales;
+ float2 out_var_PN_DominantEdge;
+ float2 out_var_PN_DominantEdge1;
+ float4 out_var_PN_DominantEdge2;
+ float4 out_var_PN_DominantEdge3;
+ float3 out_var_PN_DominantEdge4;
+ float3 out_var_PN_DominantEdge5;
+ float2 out_var_PN_DominantVertex;
+ float4 out_var_PN_DominantVertex1;
+ float3 out_var_PN_DominantVertex2;
+ spvUnsafeArray<float4, 3> out_var_PN_POSITION;
+ float out_var_PN_TessellationMultiplier;
+ float out_var_PN_WorldDisplacementMultiplier;
+ float4 out_var_TEXCOORD10_centroid;
+ float4 out_var_TEXCOORD11_centroid;
+ float4 out_var_VS_To_DS_Position;
+ uint out_var_VS_To_DS_VertexID;
+};
+
+struct main0_patchOut
+{
+ float4 out_var_PN_POSITION9;
+};
+
+struct main0_in
+{
+ float4 in_var_TEXCOORD10_centroid [[attribute(0)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(1)]];
+ float4 in_var_VS_To_DS_Position [[attribute(2)]];
+ uint in_var_VS_To_DS_VertexID [[attribute(3)]];
+};
+
+kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_Primitive& Primitive [[buffer(1)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
+{
+ threadgroup FPNTessellationHSToDS temp_var_hullMainRetVal[3];
+ device main0_out* gl_out = &spvOut[gl_PrimitiveID * 3];
+ device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID];
+ if (gl_InvocationID < spvIndirectParams[0])
+ gl_in[gl_InvocationID] = in;
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+ if (gl_InvocationID >= 3)
+ return;
+ spvUnsafeArray<float4, 12> _142 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD10_centroid, gl_in[1].in_var_TEXCOORD10_centroid, gl_in[2].in_var_TEXCOORD10_centroid, gl_in[3].in_var_TEXCOORD10_centroid, gl_in[4].in_var_TEXCOORD10_centroid, gl_in[5].in_var_TEXCOORD10_centroid, gl_in[6].in_var_TEXCOORD10_centroid, gl_in[7].in_var_TEXCOORD10_centroid, gl_in[8].in_var_TEXCOORD10_centroid, gl_in[9].in_var_TEXCOORD10_centroid, gl_in[10].in_var_TEXCOORD10_centroid, gl_in[11].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 12> _143 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD11_centroid, gl_in[1].in_var_TEXCOORD11_centroid, gl_in[2].in_var_TEXCOORD11_centroid, gl_in[3].in_var_TEXCOORD11_centroid, gl_in[4].in_var_TEXCOORD11_centroid, gl_in[5].in_var_TEXCOORD11_centroid, gl_in[6].in_var_TEXCOORD11_centroid, gl_in[7].in_var_TEXCOORD11_centroid, gl_in[8].in_var_TEXCOORD11_centroid, gl_in[9].in_var_TEXCOORD11_centroid, gl_in[10].in_var_TEXCOORD11_centroid, gl_in[11].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<float4, 12> _192 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_VS_To_DS_Position, gl_in[1].in_var_VS_To_DS_Position, gl_in[2].in_var_VS_To_DS_Position, gl_in[3].in_var_VS_To_DS_Position, gl_in[4].in_var_VS_To_DS_Position, gl_in[5].in_var_VS_To_DS_Position, gl_in[6].in_var_VS_To_DS_Position, gl_in[7].in_var_VS_To_DS_Position, gl_in[8].in_var_VS_To_DS_Position, gl_in[9].in_var_VS_To_DS_Position, gl_in[10].in_var_VS_To_DS_Position, gl_in[11].in_var_VS_To_DS_Position });
+ spvUnsafeArray<uint, 12> _193 = spvUnsafeArray<uint, 12>({ gl_in[0].in_var_VS_To_DS_VertexID, gl_in[1].in_var_VS_To_DS_VertexID, gl_in[2].in_var_VS_To_DS_VertexID, gl_in[3].in_var_VS_To_DS_VertexID, gl_in[4].in_var_VS_To_DS_VertexID, gl_in[5].in_var_VS_To_DS_VertexID, gl_in[6].in_var_VS_To_DS_VertexID, gl_in[7].in_var_VS_To_DS_VertexID, gl_in[8].in_var_VS_To_DS_VertexID, gl_in[9].in_var_VS_To_DS_VertexID, gl_in[10].in_var_VS_To_DS_VertexID, gl_in[11].in_var_VS_To_DS_VertexID });
+ spvUnsafeArray<FHitProxyVSToDS, 12> _230 = spvUnsafeArray<FHitProxyVSToDS, 12>({ FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[0], _143[0] } }, _192[0], _193[0] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[1], _143[1] } }, _192[1], _193[1] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[2], _143[2] } }, _192[2], _193[2] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[3], _143[3] } }, _192[3], _193[3] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[4], _143[4] } }, _192[4], _193[4] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[5], _143[5] } }, _192[5], _193[5] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[6], _143[6] } }, _192[6], _193[6] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[7], _143[7] } }, _192[7], _193[7] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[8], _143[8] } }, _192[8], _193[8] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[9], _143[9] } }, _192[9], _193[9] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[10], _143[10] } }, _192[10], _193[10] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[11], _143[11] } }, _192[11], _193[11] } });
+ spvUnsafeArray<FHitProxyVSToDS, 12> param_var_I;
+ param_var_I = _230;
+ float4 _247 = float4(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float3 _251 = Primitive.Primitive_NonUniformScale.xyz * float3x3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz, cross(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz) * float3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.w), param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz);
+ uint _254 = (gl_InvocationID < 2u) ? (gl_InvocationID + 1u) : 0u;
+ uint _255 = 2u * gl_InvocationID;
+ uint _256 = 3u + _255;
+ uint _257 = _255 + 4u;
+ uint _264 = (_254 < 2u) ? (_254 + 1u) : 0u;
+ uint _265 = 2u * _254;
+ uint _266 = 3u + _265;
+ uint _267 = _265 + 4u;
+ float4 _279 = float4(param_var_I[9u + gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float4 _315;
+ float4 _316;
+ float4 _317;
+ float4 _318;
+ if ((param_var_I[_266].VertexID < param_var_I[_254].VertexID) || ((param_var_I[_266].VertexID == param_var_I[_254].VertexID) && (param_var_I[_267].VertexID < param_var_I[_264].VertexID)))
+ {
+ _315 = param_var_I[_267].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ _316 = param_var_I[_267].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ _317 = param_var_I[_266].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ _318 = param_var_I[_266].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ }
+ else
+ {
+ _315 = param_var_I[_264].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ _316 = param_var_I[_264].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ _317 = param_var_I[_254].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ _318 = param_var_I[_254].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ }
+ float4 _324 = float4(_318.xyz, 0.0);
+ float4 _328 = float4(_316.xyz, 0.0);
+ float4 _336 = float4(param_var_I[_254].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float4 _344 = float4(param_var_I[_256].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float4 _352 = float4(param_var_I[_257].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ spvUnsafeArray<float4, 3> _402 = spvUnsafeArray<float4, 3>({ param_var_I[gl_InvocationID].Position, (((((float4(2.0) * param_var_I[gl_InvocationID].Position) + param_var_I[_254].Position) - (float4(dot(param_var_I[_254].Position - param_var_I[gl_InvocationID].Position, _247)) * _247)) * float4(0.3333333432674407958984375)) + ((((float4(2.0) * param_var_I[_256].Position) + param_var_I[_257].Position) - (float4(dot(param_var_I[_257].Position - param_var_I[_256].Position, _344)) * _344)) * float4(0.3333333432674407958984375))) * float4(0.5), (((((float4(2.0) * param_var_I[_254].Position) + param_var_I[gl_InvocationID].Position) - (float4(dot(param_var_I[gl_InvocationID].Position - param_var_I[_254].Position, _336)) * _336)) * float4(0.3333333432674407958984375)) + ((((float4(2.0) * param_var_I[_257].Position) + param_var_I[_256].Position) - (float4(dot(param_var_I[_256].Position - param_var_I[_257].Position, _352)) * _352)) * float4(0.3333333432674407958984375))) * float4(0.5) });
+ gl_out[gl_InvocationID].out_var_TEXCOORD10_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ gl_out[gl_InvocationID].out_var_TEXCOORD11_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ gl_out[gl_InvocationID].out_var_VS_To_DS_Position = param_var_I[gl_InvocationID].Position;
+ gl_out[gl_InvocationID].out_var_VS_To_DS_VertexID = param_var_I[gl_InvocationID].VertexID;
+ gl_out[gl_InvocationID].out_var_PN_POSITION = _402;
+ gl_out[gl_InvocationID].out_var_PN_DisplacementScales = _251;
+ gl_out[gl_InvocationID].out_var_PN_TessellationMultiplier = 1.0;
+ gl_out[gl_InvocationID].out_var_PN_WorldDisplacementMultiplier = 1.0;
+ gl_out[gl_InvocationID].out_var_PN_DominantVertex = float2(0.0);
+ gl_out[gl_InvocationID].out_var_PN_DominantVertex1 = _279;
+ gl_out[gl_InvocationID].out_var_PN_DominantVertex2 = param_var_I[9u + gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz;
+ gl_out[gl_InvocationID].out_var_PN_DominantEdge = float2(0.0);
+ gl_out[gl_InvocationID].out_var_PN_DominantEdge1 = float2(0.0);
+ gl_out[gl_InvocationID].out_var_PN_DominantEdge2 = _324;
+ gl_out[gl_InvocationID].out_var_PN_DominantEdge3 = _328;
+ gl_out[gl_InvocationID].out_var_PN_DominantEdge4 = _317.xyz;
+ gl_out[gl_InvocationID].out_var_PN_DominantEdge5 = _315.xyz;
+ temp_var_hullMainRetVal[gl_InvocationID] = FPNTessellationHSToDS{ param_var_I[gl_InvocationID], _402, _251, 1.0, 1.0, FHullShaderConstantDominantVertexData{ float2(0.0), _279, param_var_I[9u + gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz }, FHullShaderConstantDominantEdgeData{ float2(0.0), float2(0.0), _324, _328, _317.xyz, _315.xyz } };
+ threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup);
+ if (gl_InvocationID == 0u)
+ {
+ float4 _461 = (((((temp_var_hullMainRetVal[0u].WorldPosition[1] + temp_var_hullMainRetVal[0u].WorldPosition[2]) + temp_var_hullMainRetVal[1u].WorldPosition[1]) + temp_var_hullMainRetVal[1u].WorldPosition[2]) + temp_var_hullMainRetVal[2u].WorldPosition[1]) + temp_var_hullMainRetVal[2u].WorldPosition[2]) * float4(0.16666667163372039794921875);
+ float4 _474 = _611;
+ _474.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _480 = _474;
+ _480.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ float4 _485 = _480;
+ _485.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ float4 _492 = _485;
+ _492.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _600;
+ for (;;)
+ {
+ float4 _500 = View.View_ViewToClip * float4(0.0);
+ float4 _505 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[0u].WorldPosition[0].xyz, 1.0);
+ float3 _506 = _505.xyz;
+ float3 _507 = _500.xyz;
+ float _509 = _505.w;
+ float _510 = _500.w;
+ float4 _527 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[1u].WorldPosition[0].xyz, 1.0);
+ float3 _528 = _527.xyz;
+ float _530 = _527.w;
+ float4 _548 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[2u].WorldPosition[0].xyz, 1.0);
+ float3 _549 = _548.xyz;
+ float _551 = _548.w;
+ if (any((((select(int3(0), int3(1), (_506 - _507) < float3(_509 + _510)) + (int3(2) * select(int3(0), int3(1), (_506 + _507) > float3((-_509) - _510)))) | (select(int3(0), int3(1), (_528 - _507) < float3(_530 + _510)) + (int3(2) * select(int3(0), int3(1), (_528 + _507) > float3((-_530) - _510))))) | (select(int3(0), int3(1), (_549 - _507) < float3(_551 + _510)) + (int3(2) * select(int3(0), int3(1), (_549 + _507) > float3((-_551) - _510))))) != int3(3)))
+ {
+ _600 = float4(0.0);
+ break;
+ }
+ float3 _569 = temp_var_hullMainRetVal[0u].WorldPosition[0].xyz - temp_var_hullMainRetVal[1u].WorldPosition[0].xyz;
+ float3 _570 = temp_var_hullMainRetVal[1u].WorldPosition[0].xyz - temp_var_hullMainRetVal[2u].WorldPosition[0].xyz;
+ float3 _571 = temp_var_hullMainRetVal[2u].WorldPosition[0].xyz - temp_var_hullMainRetVal[0u].WorldPosition[0].xyz;
+ float3 _574 = (float3(0.5) * (temp_var_hullMainRetVal[0u].WorldPosition[0].xyz + temp_var_hullMainRetVal[1u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float3 _577 = (float3(0.5) * (temp_var_hullMainRetVal[1u].WorldPosition[0].xyz + temp_var_hullMainRetVal[2u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float3 _580 = (float3(0.5) * (temp_var_hullMainRetVal[2u].WorldPosition[0].xyz + temp_var_hullMainRetVal[0u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float _584 = sqrt(dot(_570, _570) / dot(_577, _577));
+ float _588 = sqrt(dot(_571, _571) / dot(_580, _580));
+ float _592 = sqrt(dot(_569, _569) / dot(_574, _574));
+ float4 _597 = float4(_584, _588, _592, 1.0);
+ _597.w = 0.333000004291534423828125 * ((_584 + _588) + _592);
+ _600 = float4(View.View_AdaptiveTessellationFactor) * _597;
+ break;
+ }
+ float4 _602 = fast::clamp(_492 * _600, float4(1.0), float4(15.0));
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_602.x);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_602.y);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_602.z);
+ spvTessLevel[gl_PrimitiveID].insideTessellationFactor = half(_602.w);
+ patchOut.out_var_PN_POSITION9 = _461 + ((_461 - (((temp_var_hullMainRetVal[2u].WorldPosition[0] + temp_var_hullMainRetVal[1u].WorldPosition[0]) + temp_var_hullMainRetVal[0u].WorldPosition[0]) * float4(0.3333333432674407958984375))) * float4(0.5));
+ }
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/hs-texcoord-array.asm.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/hs-texcoord-array.asm.tesc
new file mode 100644
index 00000000000..51c2a1dee4a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/hs-texcoord-array.asm.tesc
@@ -0,0 +1,411 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct FVertexFactoryInterpolantsVSToPS
+{
+ float4 TangentToWorld0;
+ float4 TangentToWorld2;
+ float4 Color;
+ spvUnsafeArray<float2, 2> TexCoords;
+};
+
+struct FVertexFactoryInterpolantsVSToDS
+{
+ FVertexFactoryInterpolantsVSToPS InterpolantsVSToPS;
+};
+
+struct FHitProxyVSToDS
+{
+ FVertexFactoryInterpolantsVSToDS FactoryInterpolants;
+ float4 Position;
+};
+
+struct FPNTessellationHSToDS
+{
+ FHitProxyVSToDS PassSpecificData;
+ spvUnsafeArray<float4, 3> WorldPosition;
+ float3 DisplacementScale;
+ float TessellationMultiplier;
+ float WorldDisplacementMultiplier;
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_ClipToWorld;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_908;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_924;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_940;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_956;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_972;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_1020;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_1036;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_1052;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1068;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1724;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1740;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1756;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2076;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2148;
+ float PrePadding_View_2152;
+ float PrePadding_View_2156;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2228;
+ float PrePadding_View_2232;
+ float PrePadding_View_2236;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2268;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2412;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ float View_AtmosphericFogSunDiscHalfApexAngleRadian;
+ float PrePadding_View_2492;
+ float4 View_AtmosphericFogSunDiscLuminance;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ uint PrePadding_View_2520;
+ uint PrePadding_View_2524;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2584;
+ float PrePadding_View_2588;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2744;
+ float PrePadding_View_2748;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float PrePadding_View_2908;
+ int2 View_CursorPosition;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ float PrePadding_View_2924;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2940;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2956;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2972;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2988;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_3004;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_Primitive
+{
+ float4x4 Primitive_LocalToWorld;
+ float4 Primitive_InvNonUniformScaleAndDeterminantSign;
+ float4 Primitive_ObjectWorldPositionAndRadius;
+ float4x4 Primitive_WorldToLocal;
+ float4x4 Primitive_PreviousLocalToWorld;
+ float4x4 Primitive_PreviousWorldToLocal;
+ packed_float3 Primitive_ActorWorldPosition;
+ float Primitive_UseSingleSampleShadowFromStationaryLights;
+ packed_float3 Primitive_ObjectBounds;
+ float Primitive_LpvBiasMultiplier;
+ float Primitive_DecalReceiverMask;
+ float Primitive_PerObjectGBufferData;
+ float Primitive_UseVolumetricLightmapShadowFromStationaryLights;
+ float Primitive_DrawsVelocity;
+ float4 Primitive_ObjectOrientation;
+ float4 Primitive_NonUniformScale;
+ packed_float3 Primitive_LocalObjectBoundsMin;
+ uint Primitive_LightingChannelMask;
+ packed_float3 Primitive_LocalObjectBoundsMax;
+ uint Primitive_LightmapDataIndex;
+ packed_float3 Primitive_PreSkinnedLocalBounds;
+ int Primitive_SingleCaptureIndex;
+ uint Primitive_OutputVelocity;
+ uint PrePadding_Primitive_420;
+ uint PrePadding_Primitive_424;
+ uint PrePadding_Primitive_428;
+ float4 Primitive_CustomPrimitiveData[4];
+};
+
+constant float4 _535 = {};
+
+struct main0_out
+{
+ float4 out_var_COLOR0;
+ float3 out_var_PN_DisplacementScales;
+ spvUnsafeArray<float4, 3> out_var_PN_POSITION;
+ float out_var_PN_TessellationMultiplier;
+ float out_var_PN_WorldDisplacementMultiplier;
+ spvUnsafeArray<float2, 2> out_var_TEXCOORD0;
+ float4 out_var_TEXCOORD10_centroid;
+ float4 out_var_TEXCOORD11_centroid;
+ float4 out_var_VS_To_DS_Position;
+};
+
+struct main0_patchOut
+{
+ float4 out_var_PN_POSITION9;
+};
+
+struct main0_in
+{
+ float4 in_var_TEXCOORD10_centroid [[attribute(0)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(1)]];
+ float4 in_var_COLOR0 [[attribute(2)]];
+ float2 in_var_TEXCOORD0_0 [[attribute(3)]];
+ float2 in_var_TEXCOORD0_1 [[attribute(4)]];
+ float4 in_var_VS_To_DS_Position [[attribute(5)]];
+};
+
+kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_Primitive& Primitive [[buffer(1)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
+{
+ threadgroup FPNTessellationHSToDS temp_var_hullMainRetVal[3];
+ device main0_out* gl_out = &spvOut[gl_PrimitiveID * 3];
+ device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID];
+ if (gl_InvocationID < spvIndirectParams[0])
+ gl_in[gl_InvocationID] = in;
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+ if (gl_InvocationID >= 3)
+ return;
+ spvUnsafeArray<float4, 12> _129 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD10_centroid, gl_in[1].in_var_TEXCOORD10_centroid, gl_in[2].in_var_TEXCOORD10_centroid, gl_in[3].in_var_TEXCOORD10_centroid, gl_in[4].in_var_TEXCOORD10_centroid, gl_in[5].in_var_TEXCOORD10_centroid, gl_in[6].in_var_TEXCOORD10_centroid, gl_in[7].in_var_TEXCOORD10_centroid, gl_in[8].in_var_TEXCOORD10_centroid, gl_in[9].in_var_TEXCOORD10_centroid, gl_in[10].in_var_TEXCOORD10_centroid, gl_in[11].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 12> _130 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD11_centroid, gl_in[1].in_var_TEXCOORD11_centroid, gl_in[2].in_var_TEXCOORD11_centroid, gl_in[3].in_var_TEXCOORD11_centroid, gl_in[4].in_var_TEXCOORD11_centroid, gl_in[5].in_var_TEXCOORD11_centroid, gl_in[6].in_var_TEXCOORD11_centroid, gl_in[7].in_var_TEXCOORD11_centroid, gl_in[8].in_var_TEXCOORD11_centroid, gl_in[9].in_var_TEXCOORD11_centroid, gl_in[10].in_var_TEXCOORD11_centroid, gl_in[11].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<float4, 12> _131 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_COLOR0, gl_in[1].in_var_COLOR0, gl_in[2].in_var_COLOR0, gl_in[3].in_var_COLOR0, gl_in[4].in_var_COLOR0, gl_in[5].in_var_COLOR0, gl_in[6].in_var_COLOR0, gl_in[7].in_var_COLOR0, gl_in[8].in_var_COLOR0, gl_in[9].in_var_COLOR0, gl_in[10].in_var_COLOR0, gl_in[11].in_var_COLOR0 });
+ spvUnsafeArray<spvUnsafeArray<float2, 2>, 12> _132 = spvUnsafeArray<spvUnsafeArray<float2, 2>, 12>({ spvUnsafeArray<float2, 2>({ gl_in[0].in_var_TEXCOORD0_0, gl_in[0].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[1].in_var_TEXCOORD0_0, gl_in[1].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[2].in_var_TEXCOORD0_0, gl_in[2].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[3].in_var_TEXCOORD0_0, gl_in[3].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[4].in_var_TEXCOORD0_0, gl_in[4].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[5].in_var_TEXCOORD0_0, gl_in[5].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[6].in_var_TEXCOORD0_0, gl_in[6].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[7].in_var_TEXCOORD0_0, gl_in[7].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[8].in_var_TEXCOORD0_0, gl_in[8].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[9].in_var_TEXCOORD0_0, gl_in[9].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[10].in_var_TEXCOORD0_0, gl_in[10].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[11].in_var_TEXCOORD0_0, gl_in[11].in_var_TEXCOORD0_1 }) });
+ spvUnsafeArray<float4, 12> _205 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_VS_To_DS_Position, gl_in[1].in_var_VS_To_DS_Position, gl_in[2].in_var_VS_To_DS_Position, gl_in[3].in_var_VS_To_DS_Position, gl_in[4].in_var_VS_To_DS_Position, gl_in[5].in_var_VS_To_DS_Position, gl_in[6].in_var_VS_To_DS_Position, gl_in[7].in_var_VS_To_DS_Position, gl_in[8].in_var_VS_To_DS_Position, gl_in[9].in_var_VS_To_DS_Position, gl_in[10].in_var_VS_To_DS_Position, gl_in[11].in_var_VS_To_DS_Position });
+ spvUnsafeArray<FHitProxyVSToDS, 12> _230 = spvUnsafeArray<FHitProxyVSToDS, 12>({ FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[0], _130[0], _131[0], _132[0] } }, _205[0] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[1], _130[1], _131[1], _132[1] } }, _205[1] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[2], _130[2], _131[2], _132[2] } }, _205[2] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[3], _130[3], _131[3], _132[3] } }, _205[3] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[4], _130[4], _131[4], _132[4] } }, _205[4] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[5], _130[5], _131[5], _132[5] } }, _205[5] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[6], _130[6], _131[6], _132[6] } }, _205[6] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[7], _130[7], _131[7], _132[7] } }, _205[7] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[8], _130[8], _131[8], _132[8] } }, _205[8] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[9], _130[9], _131[9], _132[9] } }, _205[9] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[10], _130[10], _131[10], _132[10] } }, _205[10] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[11], _130[11], _131[11], _132[11] } }, _205[11] } });
+ spvUnsafeArray<FHitProxyVSToDS, 12> param_var_I;
+ param_var_I = _230;
+ float4 _247 = float4(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float3 _251 = Primitive.Primitive_NonUniformScale.xyz * float3x3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz, cross(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz) * float3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.w), param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz);
+ uint _254 = (gl_InvocationID < 2u) ? (gl_InvocationID + 1u) : 0u;
+ uint _255 = 2u * gl_InvocationID;
+ uint _256 = 3u + _255;
+ uint _257 = _255 + 4u;
+ float4 _269 = float4(param_var_I[_254].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float4 _277 = float4(param_var_I[_256].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float4 _285 = float4(param_var_I[_257].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ spvUnsafeArray<float4, 3> _333 = spvUnsafeArray<float4, 3>({ param_var_I[gl_InvocationID].Position, (((((float4(2.0) * param_var_I[gl_InvocationID].Position) + param_var_I[_254].Position) - (float4(dot(param_var_I[_254].Position - param_var_I[gl_InvocationID].Position, _247)) * _247)) * float4(0.3333333432674407958984375)) + ((((float4(2.0) * param_var_I[_256].Position) + param_var_I[_257].Position) - (float4(dot(param_var_I[_257].Position - param_var_I[_256].Position, _277)) * _277)) * float4(0.3333333432674407958984375))) * float4(0.5), (((((float4(2.0) * param_var_I[_254].Position) + param_var_I[gl_InvocationID].Position) - (float4(dot(param_var_I[gl_InvocationID].Position - param_var_I[_254].Position, _269)) * _269)) * float4(0.3333333432674407958984375)) + ((((float4(2.0) * param_var_I[_257].Position) + param_var_I[_256].Position) - (float4(dot(param_var_I[_256].Position - param_var_I[_257].Position, _285)) * _285)) * float4(0.3333333432674407958984375))) * float4(0.5) });
+ gl_out[gl_InvocationID].out_var_TEXCOORD10_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ gl_out[gl_InvocationID].out_var_TEXCOORD11_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ gl_out[gl_InvocationID].out_var_COLOR0 = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.Color;
+ gl_out[gl_InvocationID].out_var_TEXCOORD0 = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TexCoords;
+ gl_out[gl_InvocationID].out_var_VS_To_DS_Position = param_var_I[gl_InvocationID].Position;
+ gl_out[gl_InvocationID].out_var_PN_POSITION = _333;
+ gl_out[gl_InvocationID].out_var_PN_DisplacementScales = _251;
+ gl_out[gl_InvocationID].out_var_PN_TessellationMultiplier = 1.0;
+ gl_out[gl_InvocationID].out_var_PN_WorldDisplacementMultiplier = 1.0;
+ temp_var_hullMainRetVal[gl_InvocationID] = FPNTessellationHSToDS{ param_var_I[gl_InvocationID], _333, _251, 1.0, 1.0 };
+ threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup);
+ if (gl_InvocationID == 0u)
+ {
+ float4 _385 = (((((temp_var_hullMainRetVal[0u].WorldPosition[1] + temp_var_hullMainRetVal[0u].WorldPosition[2]) + temp_var_hullMainRetVal[1u].WorldPosition[1]) + temp_var_hullMainRetVal[1u].WorldPosition[2]) + temp_var_hullMainRetVal[2u].WorldPosition[1]) + temp_var_hullMainRetVal[2u].WorldPosition[2]) * float4(0.16666667163372039794921875);
+ float4 _398 = _535;
+ _398.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _404 = _398;
+ _404.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ float4 _409 = _404;
+ _409.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ float4 _416 = _409;
+ _416.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _524;
+ for (;;)
+ {
+ float4 _424 = View.View_ViewToClip * float4(0.0);
+ float4 _429 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[0u].WorldPosition[0].xyz, 1.0);
+ float3 _430 = _429.xyz;
+ float3 _431 = _424.xyz;
+ float _433 = _429.w;
+ float _434 = _424.w;
+ float4 _451 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[1u].WorldPosition[0].xyz, 1.0);
+ float3 _452 = _451.xyz;
+ float _454 = _451.w;
+ float4 _472 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[2u].WorldPosition[0].xyz, 1.0);
+ float3 _473 = _472.xyz;
+ float _475 = _472.w;
+ if (any((((select(int3(0), int3(1), (_430 - _431) < float3(_433 + _434)) + (int3(2) * select(int3(0), int3(1), (_430 + _431) > float3((-_433) - _434)))) | (select(int3(0), int3(1), (_452 - _431) < float3(_454 + _434)) + (int3(2) * select(int3(0), int3(1), (_452 + _431) > float3((-_454) - _434))))) | (select(int3(0), int3(1), (_473 - _431) < float3(_475 + _434)) + (int3(2) * select(int3(0), int3(1), (_473 + _431) > float3((-_475) - _434))))) != int3(3)))
+ {
+ _524 = float4(0.0);
+ break;
+ }
+ float3 _493 = temp_var_hullMainRetVal[0u].WorldPosition[0].xyz - temp_var_hullMainRetVal[1u].WorldPosition[0].xyz;
+ float3 _494 = temp_var_hullMainRetVal[1u].WorldPosition[0].xyz - temp_var_hullMainRetVal[2u].WorldPosition[0].xyz;
+ float3 _495 = temp_var_hullMainRetVal[2u].WorldPosition[0].xyz - temp_var_hullMainRetVal[0u].WorldPosition[0].xyz;
+ float3 _498 = (float3(0.5) * (temp_var_hullMainRetVal[0u].WorldPosition[0].xyz + temp_var_hullMainRetVal[1u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float3 _501 = (float3(0.5) * (temp_var_hullMainRetVal[1u].WorldPosition[0].xyz + temp_var_hullMainRetVal[2u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float3 _504 = (float3(0.5) * (temp_var_hullMainRetVal[2u].WorldPosition[0].xyz + temp_var_hullMainRetVal[0u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float _508 = sqrt(dot(_494, _494) / dot(_501, _501));
+ float _512 = sqrt(dot(_495, _495) / dot(_504, _504));
+ float _516 = sqrt(dot(_493, _493) / dot(_498, _498));
+ float4 _521 = float4(_508, _512, _516, 1.0);
+ _521.w = 0.333000004291534423828125 * ((_508 + _512) + _516);
+ _524 = float4(View.View_AdaptiveTessellationFactor) * _521;
+ break;
+ }
+ float4 _526 = fast::clamp(_416 * _524, float4(1.0), float4(15.0));
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_526.x);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_526.y);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_526.z);
+ spvTessLevel[gl_PrimitiveID].insideTessellationFactor = half(_526.w);
+ patchOut.out_var_PN_POSITION9 = _385 + ((_385 - (((temp_var_hullMainRetVal[2u].WorldPosition[0] + temp_var_hullMainRetVal[1u].WorldPosition[0]) + temp_var_hullMainRetVal[0u].WorldPosition[0]) * float4(0.3333333432674407958984375))) * float4(0.5));
+ }
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.asm.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.asm.tesc
new file mode 100644
index 00000000000..13ea8bb7125
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.asm.tesc
@@ -0,0 +1,178 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct FVertexFactoryInterpolantsVSToPS
+{
+ float4 TangentToWorld0;
+ float4 TangentToWorld2;
+};
+
+struct FVertexFactoryInterpolantsVSToDS
+{
+ FVertexFactoryInterpolantsVSToPS InterpolantsVSToPS;
+};
+
+struct FSharedBasePassInterpolants
+{
+};
+struct FBasePassInterpolantsVSToDS
+{
+ FSharedBasePassInterpolants _m0;
+};
+
+struct FBasePassVSToDS
+{
+ FVertexFactoryInterpolantsVSToDS FactoryInterpolants;
+ FBasePassInterpolantsVSToDS BasePassInterpolants;
+ float4 Position;
+};
+
+struct FFlatTessellationHSToDS
+{
+ FBasePassVSToDS PassSpecificData;
+ float3 DisplacementScale;
+ float TessellationMultiplier;
+ float WorldDisplacementMultiplier;
+};
+
+struct type_Primitive
+{
+ float4x4 Primitive_LocalToWorld;
+ float4 Primitive_InvNonUniformScaleAndDeterminantSign;
+ float4 Primitive_ObjectWorldPositionAndRadius;
+ float4x4 Primitive_WorldToLocal;
+ float4x4 Primitive_PreviousLocalToWorld;
+ float4x4 Primitive_PreviousWorldToLocal;
+ packed_float3 Primitive_ActorWorldPosition;
+ float Primitive_UseSingleSampleShadowFromStationaryLights;
+ packed_float3 Primitive_ObjectBounds;
+ float Primitive_LpvBiasMultiplier;
+ float Primitive_DecalReceiverMask;
+ float Primitive_PerObjectGBufferData;
+ float Primitive_UseVolumetricLightmapShadowFromStationaryLights;
+ float Primitive_DrawsVelocity;
+ float4 Primitive_ObjectOrientation;
+ float4 Primitive_NonUniformScale;
+ packed_float3 Primitive_LocalObjectBoundsMin;
+ uint Primitive_LightingChannelMask;
+ packed_float3 Primitive_LocalObjectBoundsMax;
+ uint Primitive_LightmapDataIndex;
+ packed_float3 Primitive_PreSkinnedLocalBounds;
+ int Primitive_SingleCaptureIndex;
+ uint Primitive_OutputVelocity;
+ uint PrePadding_Primitive_420;
+ uint PrePadding_Primitive_424;
+ uint PrePadding_Primitive_428;
+ float4 Primitive_CustomPrimitiveData[4];
+};
+
+struct type_Material
+{
+ float4 Material_VectorExpressions[3];
+ float4 Material_ScalarExpressions[1];
+};
+
+constant float4 _182 = {};
+
+struct main0_out
+{
+ float3 out_var_Flat_DisplacementScales;
+ float out_var_Flat_TessellationMultiplier;
+ float out_var_Flat_WorldDisplacementMultiplier;
+ float4 out_var_TEXCOORD10_centroid;
+ float4 out_var_TEXCOORD11_centroid;
+ float4 out_var_VS_To_DS_Position;
+};
+
+struct main0_in
+{
+ float4 in_var_TEXCOORD10_centroid [[attribute(0)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(1)]];
+ float4 in_var_VS_To_DS_Position [[attribute(2)]];
+};
+
+kernel void main0(main0_in in [[stage_in]], constant type_Primitive& Primitive [[buffer(0)]], constant type_Material& Material [[buffer(1)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
+{
+ threadgroup FFlatTessellationHSToDS temp_var_hullMainRetVal[3];
+ device main0_out* gl_out = &spvOut[gl_PrimitiveID * 3];
+ if (gl_InvocationID < spvIndirectParams[0])
+ gl_in[gl_InvocationID] = in;
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+ if (gl_InvocationID >= 3)
+ return;
+ spvUnsafeArray<float4, 3> _90 = spvUnsafeArray<float4, 3>({ gl_in[0].in_var_TEXCOORD10_centroid, gl_in[1].in_var_TEXCOORD10_centroid, gl_in[2].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 3> _91 = spvUnsafeArray<float4, 3>({ gl_in[0].in_var_TEXCOORD11_centroid, gl_in[1].in_var_TEXCOORD11_centroid, gl_in[2].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<float4, 3> _104 = spvUnsafeArray<float4, 3>({ gl_in[0].in_var_VS_To_DS_Position, gl_in[1].in_var_VS_To_DS_Position, gl_in[2].in_var_VS_To_DS_Position });
+ spvUnsafeArray<FBasePassVSToDS, 3> _111 = spvUnsafeArray<FBasePassVSToDS, 3>({ FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _90[0], _91[0] } }, FBasePassInterpolantsVSToDS{ { } }, _104[0] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _90[1], _91[1] } }, FBasePassInterpolantsVSToDS{ { } }, _104[1] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _90[2], _91[2] } }, FBasePassInterpolantsVSToDS{ { } }, _104[2] } });
+ spvUnsafeArray<FBasePassVSToDS, 3> param_var_I;
+ param_var_I = _111;
+ float3 _128 = Primitive.Primitive_NonUniformScale.xyz * float3x3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz, cross(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz) * float3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.w), param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz);
+ gl_out[gl_InvocationID].out_var_TEXCOORD10_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ gl_out[gl_InvocationID].out_var_TEXCOORD11_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ gl_out[gl_InvocationID].out_var_VS_To_DS_Position = param_var_I[gl_InvocationID].Position;
+ gl_out[gl_InvocationID].out_var_Flat_DisplacementScales = _128;
+ gl_out[gl_InvocationID].out_var_Flat_TessellationMultiplier = Material.Material_ScalarExpressions[0].x;
+ gl_out[gl_InvocationID].out_var_Flat_WorldDisplacementMultiplier = 1.0;
+ temp_var_hullMainRetVal[gl_InvocationID] = FFlatTessellationHSToDS{ param_var_I[gl_InvocationID], _128, Material.Material_ScalarExpressions[0].x, 1.0 };
+ threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup);
+ if (gl_InvocationID == 0u)
+ {
+ float4 _154 = _182;
+ _154.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _160 = _154;
+ _160.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ float4 _165 = _160;
+ _165.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ float4 _172 = _165;
+ _172.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _173 = fast::clamp(_172, float4(1.0), float4(15.0));
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_173.x);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_173.y);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_173.z);
+ spvTessLevel[gl_PrimitiveID].insideTessellationFactor = half(_173.w);
+ }
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese
new file mode 100644
index 00000000000..19e402e67fd
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese
@@ -0,0 +1,419 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_ClipToWorld;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_908;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_924;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_940;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_956;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_972;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_1020;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_1036;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_1052;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1068;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1724;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1740;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1756;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2076;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2148;
+ float PrePadding_View_2152;
+ float PrePadding_View_2156;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2228;
+ float PrePadding_View_2232;
+ float PrePadding_View_2236;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2268;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2412;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ float View_AtmosphericFogSunDiscHalfApexAngleRadian;
+ float PrePadding_View_2492;
+ float4 View_AtmosphericFogSunDiscLuminance;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ uint PrePadding_View_2520;
+ uint PrePadding_View_2524;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2584;
+ float PrePadding_View_2588;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2744;
+ float PrePadding_View_2748;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float PrePadding_View_2908;
+ int2 View_CursorPosition;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ float PrePadding_View_2924;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2940;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2956;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2972;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2988;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_3004;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_ShadowDepthPass
+{
+ float PrePadding_ShadowDepthPass_LPV_0;
+ float PrePadding_ShadowDepthPass_LPV_4;
+ float PrePadding_ShadowDepthPass_LPV_8;
+ float PrePadding_ShadowDepthPass_LPV_12;
+ float PrePadding_ShadowDepthPass_LPV_16;
+ float PrePadding_ShadowDepthPass_LPV_20;
+ float PrePadding_ShadowDepthPass_LPV_24;
+ float PrePadding_ShadowDepthPass_LPV_28;
+ float PrePadding_ShadowDepthPass_LPV_32;
+ float PrePadding_ShadowDepthPass_LPV_36;
+ float PrePadding_ShadowDepthPass_LPV_40;
+ float PrePadding_ShadowDepthPass_LPV_44;
+ float PrePadding_ShadowDepthPass_LPV_48;
+ float PrePadding_ShadowDepthPass_LPV_52;
+ float PrePadding_ShadowDepthPass_LPV_56;
+ float PrePadding_ShadowDepthPass_LPV_60;
+ float PrePadding_ShadowDepthPass_LPV_64;
+ float PrePadding_ShadowDepthPass_LPV_68;
+ float PrePadding_ShadowDepthPass_LPV_72;
+ float PrePadding_ShadowDepthPass_LPV_76;
+ float PrePadding_ShadowDepthPass_LPV_80;
+ float PrePadding_ShadowDepthPass_LPV_84;
+ float PrePadding_ShadowDepthPass_LPV_88;
+ float PrePadding_ShadowDepthPass_LPV_92;
+ float PrePadding_ShadowDepthPass_LPV_96;
+ float PrePadding_ShadowDepthPass_LPV_100;
+ float PrePadding_ShadowDepthPass_LPV_104;
+ float PrePadding_ShadowDepthPass_LPV_108;
+ float PrePadding_ShadowDepthPass_LPV_112;
+ float PrePadding_ShadowDepthPass_LPV_116;
+ float PrePadding_ShadowDepthPass_LPV_120;
+ float PrePadding_ShadowDepthPass_LPV_124;
+ float PrePadding_ShadowDepthPass_LPV_128;
+ float PrePadding_ShadowDepthPass_LPV_132;
+ float PrePadding_ShadowDepthPass_LPV_136;
+ float PrePadding_ShadowDepthPass_LPV_140;
+ float PrePadding_ShadowDepthPass_LPV_144;
+ float PrePadding_ShadowDepthPass_LPV_148;
+ float PrePadding_ShadowDepthPass_LPV_152;
+ float PrePadding_ShadowDepthPass_LPV_156;
+ float PrePadding_ShadowDepthPass_LPV_160;
+ float PrePadding_ShadowDepthPass_LPV_164;
+ float PrePadding_ShadowDepthPass_LPV_168;
+ float PrePadding_ShadowDepthPass_LPV_172;
+ float PrePadding_ShadowDepthPass_LPV_176;
+ float PrePadding_ShadowDepthPass_LPV_180;
+ float PrePadding_ShadowDepthPass_LPV_184;
+ float PrePadding_ShadowDepthPass_LPV_188;
+ float PrePadding_ShadowDepthPass_LPV_192;
+ float PrePadding_ShadowDepthPass_LPV_196;
+ float PrePadding_ShadowDepthPass_LPV_200;
+ float PrePadding_ShadowDepthPass_LPV_204;
+ float PrePadding_ShadowDepthPass_LPV_208;
+ float PrePadding_ShadowDepthPass_LPV_212;
+ float PrePadding_ShadowDepthPass_LPV_216;
+ float PrePadding_ShadowDepthPass_LPV_220;
+ float PrePadding_ShadowDepthPass_LPV_224;
+ float PrePadding_ShadowDepthPass_LPV_228;
+ float PrePadding_ShadowDepthPass_LPV_232;
+ float PrePadding_ShadowDepthPass_LPV_236;
+ float PrePadding_ShadowDepthPass_LPV_240;
+ float PrePadding_ShadowDepthPass_LPV_244;
+ float PrePadding_ShadowDepthPass_LPV_248;
+ float PrePadding_ShadowDepthPass_LPV_252;
+ float PrePadding_ShadowDepthPass_LPV_256;
+ float PrePadding_ShadowDepthPass_LPV_260;
+ float PrePadding_ShadowDepthPass_LPV_264;
+ float PrePadding_ShadowDepthPass_LPV_268;
+ float4x4 ShadowDepthPass_LPV_mRsmToWorld;
+ float4 ShadowDepthPass_LPV_mLightColour;
+ float4 ShadowDepthPass_LPV_GeometryVolumeCaptureLightDirection;
+ float4 ShadowDepthPass_LPV_mEyePos;
+ packed_int3 ShadowDepthPass_LPV_mOldGridOffset;
+ int PrePadding_ShadowDepthPass_LPV_396;
+ packed_int3 ShadowDepthPass_LPV_mLpvGridOffset;
+ float ShadowDepthPass_LPV_ClearMultiplier;
+ float ShadowDepthPass_LPV_LpvScale;
+ float ShadowDepthPass_LPV_OneOverLpvScale;
+ float ShadowDepthPass_LPV_DirectionalOcclusionIntensity;
+ float ShadowDepthPass_LPV_DirectionalOcclusionRadius;
+ float ShadowDepthPass_LPV_RsmAreaIntensityMultiplier;
+ float ShadowDepthPass_LPV_RsmPixelToTexcoordMultiplier;
+ float ShadowDepthPass_LPV_SecondaryOcclusionStrength;
+ float ShadowDepthPass_LPV_SecondaryBounceStrength;
+ float ShadowDepthPass_LPV_VplInjectionBias;
+ float ShadowDepthPass_LPV_GeometryVolumeInjectionBias;
+ float ShadowDepthPass_LPV_EmissiveInjectionMultiplier;
+ int ShadowDepthPass_LPV_PropagationIndex;
+ float4x4 ShadowDepthPass_ProjectionMatrix;
+ float4x4 ShadowDepthPass_ViewMatrix;
+ float4 ShadowDepthPass_ShadowParams;
+ float ShadowDepthPass_bClampToNearPlane;
+ float PrePadding_ShadowDepthPass_612;
+ float PrePadding_ShadowDepthPass_616;
+ float PrePadding_ShadowDepthPass_620;
+ float4x4 ShadowDepthPass_ShadowViewProjectionMatrices[6];
+ float4x4 ShadowDepthPass_ShadowViewMatrices[6];
+};
+
+constant float4 _113 = {};
+
+struct main0_out
+{
+ float4 out_var_TEXCOORD10_centroid [[user(locn0)]];
+ float4 out_var_TEXCOORD11_centroid [[user(locn1)]];
+ float4 out_var_COLOR0 [[user(locn2)]];
+ float4 out_var_TEXCOORD0_0 [[user(locn3)]];
+ uint out_var_PRIMITIVE_ID [[user(locn4)]];
+ float out_var_TEXCOORD6 [[user(locn5)]];
+ float out_var_TEXCOORD8 [[user(locn6)]];
+ float3 out_var_TEXCOORD7 [[user(locn7)]];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 in_var_COLOR0 [[attribute(0)]];
+ float4 in_var_PN_POSITION_0 [[attribute(2)]];
+ float4 in_var_PN_POSITION_1 [[attribute(3)]];
+ float4 in_var_PN_POSITION_2 [[attribute(4)]];
+ float in_var_PN_WorldDisplacementMultiplier [[attribute(7)]];
+ uint in_var_PRIMITIVE_ID [[attribute(8)]];
+ float4 in_var_TEXCOORD0_0 [[attribute(9)]];
+ float4 in_var_TEXCOORD10_centroid [[attribute(10)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(11)]];
+};
+
+struct main0_patchIn
+{
+ float4 in_var_PN_POSITION9 [[attribute(5)]];
+ patch_control_point<main0_in> gl_in;
+};
+
+[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], constant type_View& View [[buffer(0)]], constant type_ShadowDepthPass& ShadowDepthPass [[buffer(1)]], texture2d<float> Material_Texture2D_3 [[texture(0)]], sampler Material_Texture2D_3Sampler [[sampler(0)]], float3 gl_TessCoord [[position_in_patch]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 1> out_var_TEXCOORD0 = {};
+ spvUnsafeArray<float4, 3> _117 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD10_centroid, patchIn.gl_in[1].in_var_TEXCOORD10_centroid, patchIn.gl_in[2].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 3> _118 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD11_centroid, patchIn.gl_in[1].in_var_TEXCOORD11_centroid, patchIn.gl_in[2].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<float4, 3> _119 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_COLOR0, patchIn.gl_in[1].in_var_COLOR0, patchIn.gl_in[2].in_var_COLOR0 });
+ spvUnsafeArray<spvUnsafeArray<float4, 1>, 3> _120 = spvUnsafeArray<spvUnsafeArray<float4, 1>, 3>({ spvUnsafeArray<float4, 1>({ patchIn.gl_in[0].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ patchIn.gl_in[1].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ patchIn.gl_in[2].in_var_TEXCOORD0_0 }) });
+ spvUnsafeArray<spvUnsafeArray<float4, 3>, 3> _135 = spvUnsafeArray<spvUnsafeArray<float4, 3>, 3>({ spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_POSITION_0, patchIn.gl_in[0].in_var_PN_POSITION_1, patchIn.gl_in[0].in_var_PN_POSITION_2 }), spvUnsafeArray<float4, 3>({ patchIn.gl_in[1].in_var_PN_POSITION_0, patchIn.gl_in[1].in_var_PN_POSITION_1, patchIn.gl_in[1].in_var_PN_POSITION_2 }), spvUnsafeArray<float4, 3>({ patchIn.gl_in[2].in_var_PN_POSITION_0, patchIn.gl_in[2].in_var_PN_POSITION_1, patchIn.gl_in[2].in_var_PN_POSITION_2 }) });
+ spvUnsafeArray<float, 3> _136 = spvUnsafeArray<float, 3>({ patchIn.gl_in[0].in_var_PN_WorldDisplacementMultiplier, patchIn.gl_in[1].in_var_PN_WorldDisplacementMultiplier, patchIn.gl_in[2].in_var_PN_WorldDisplacementMultiplier });
+ float _157 = gl_TessCoord.x * gl_TessCoord.x;
+ float _158 = gl_TessCoord.y * gl_TessCoord.y;
+ float _159 = gl_TessCoord.z * gl_TessCoord.z;
+ float4 _165 = float4(gl_TessCoord.x);
+ float4 _169 = float4(gl_TessCoord.y);
+ float4 _174 = float4(gl_TessCoord.z);
+ float4 _177 = float4(_157 * 3.0);
+ float4 _181 = float4(_158 * 3.0);
+ float4 _188 = float4(_159 * 3.0);
+ float4 _202 = ((((((((((_135[0][0] * float4(_157)) * _165) + ((_135[1][0] * float4(_158)) * _169)) + ((_135[2][0] * float4(_159)) * _174)) + ((_135[0][1] * _177) * _169)) + ((_135[0][2] * _181) * _165)) + ((_135[1][1] * _181) * _174)) + ((_135[1][2] * _188) * _169)) + ((_135[2][1] * _188) * _165)) + ((_135[2][2] * _177) * _174)) + ((((patchIn.in_var_PN_POSITION9 * float4(6.0)) * _174) * _165) * _169);
+ float3 _226 = ((_117[0].xyz * float3(gl_TessCoord.x)) + (_117[1].xyz * float3(gl_TessCoord.y))).xyz + (_117[2].xyz * float3(gl_TessCoord.z));
+ float4 _229 = ((_118[0] * _165) + (_118[1] * _169)) + (_118[2] * _174);
+ float4 _231 = ((_119[0] * _165) + (_119[1] * _169)) + (_119[2] * _174);
+ float4 _233 = ((_120[0][0] * _165) + (_120[1][0] * _169)) + (_120[2][0] * _174);
+ spvUnsafeArray<float4, 1> _234 = spvUnsafeArray<float4, 1>({ _233 });
+ float3 _236 = _229.xyz;
+ float3 _264 = _202.xyz + (((float3((Material_Texture2D_3.sample(Material_Texture2D_3Sampler, (float2(View.View_GameTime * 0.20000000298023223876953125, View.View_GameTime * (-0.699999988079071044921875)) + (_233.zw * float2(1.0, 2.0))), level(-1.0)).x * 10.0) * (1.0 - _231.x)) * _236) * float3(0.5)) * float3(((_136[0] * gl_TessCoord.x) + (_136[1] * gl_TessCoord.y)) + (_136[2] * gl_TessCoord.z)));
+ float4 _270 = ShadowDepthPass.ShadowDepthPass_ProjectionMatrix * float4(_264.x, _264.y, _264.z, _202.w);
+ float4 _281;
+ if ((ShadowDepthPass.ShadowDepthPass_bClampToNearPlane > 0.0) && (_270.z < 0.0))
+ {
+ float4 _279 = _270;
+ _279.z = 9.9999999747524270787835121154785e-07;
+ float4 _280 = _279;
+ _280.w = 1.0;
+ _281 = _280;
+ }
+ else
+ {
+ _281 = _270;
+ }
+ float _290 = abs(dot(float3(ShadowDepthPass.ShadowDepthPass_ViewMatrix[0].z, ShadowDepthPass.ShadowDepthPass_ViewMatrix[1].z, ShadowDepthPass.ShadowDepthPass_ViewMatrix[2].z), _236));
+ out.out_var_TEXCOORD10_centroid = float4(_226.x, _226.y, _226.z, _113.w);
+ out.out_var_TEXCOORD11_centroid = _229;
+ out.out_var_COLOR0 = _231;
+ out_var_TEXCOORD0 = _234;
+ out.out_var_PRIMITIVE_ID = patchIn.gl_in[0u].in_var_PRIMITIVE_ID;
+ out.out_var_TEXCOORD6 = _281.z;
+ out.out_var_TEXCOORD8 = (ShadowDepthPass.ShadowDepthPass_ShadowParams.y * fast::clamp((abs(_290) > 0.0) ? (sqrt(fast::clamp(1.0 - (_290 * _290), 0.0, 1.0)) / _290) : ShadowDepthPass.ShadowDepthPass_ShadowParams.z, 0.0, ShadowDepthPass.ShadowDepthPass_ShadowParams.z)) + ShadowDepthPass.ShadowDepthPass_ShadowParams.x;
+ out.out_var_TEXCOORD7 = _264.xyz;
+ out.gl_Position = _281;
+ out.out_var_TEXCOORD0_0 = out_var_TEXCOORD0[0];
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese
new file mode 100644
index 00000000000..d8921bb8e03
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese
@@ -0,0 +1,415 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_ClipToWorld;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_908;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_924;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_940;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_956;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_972;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_1020;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_1036;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_1052;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1068;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1724;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1740;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1756;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2076;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2148;
+ float PrePadding_View_2152;
+ float PrePadding_View_2156;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2228;
+ float PrePadding_View_2232;
+ float PrePadding_View_2236;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2268;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2412;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ float View_AtmosphericFogSunDiscHalfApexAngleRadian;
+ float PrePadding_View_2492;
+ float4 View_AtmosphericFogSunDiscLuminance;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ uint PrePadding_View_2520;
+ uint PrePadding_View_2524;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2584;
+ float PrePadding_View_2588;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2744;
+ float PrePadding_View_2748;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float PrePadding_View_2908;
+ int2 View_CursorPosition;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ float PrePadding_View_2924;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2940;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2956;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2972;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2988;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_3004;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+ float PrePadding_View_3048;
+ float PrePadding_View_3052;
+ float4x4 View_WorldToVirtualTexture;
+ float4 View_VirtualTextureParams;
+ float4 View_XRPassthroughCameraUVs[2];
+};
+
+struct type_Material
+{
+ float4 Material_VectorExpressions[5];
+ float4 Material_ScalarExpressions[2];
+};
+
+constant float4 _118 = {};
+
+struct main0_out
+{
+ float4 out_var_TEXCOORD6 [[user(locn0)]];
+ float4 out_var_TEXCOORD7 [[user(locn1)]];
+ float4 out_var_TEXCOORD10_centroid [[user(locn2)]];
+ float4 out_var_TEXCOORD11_centroid [[user(locn3)]];
+ float gl_ClipDistance [[clip_distance]] [1];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 in_var_PN_DominantEdge2 [[attribute(3)]];
+ float4 in_var_PN_DominantEdge3 [[attribute(4)]];
+ float3 in_var_PN_DominantEdge4 [[attribute(5)]];
+ float3 in_var_PN_DominantEdge5 [[attribute(6)]];
+ float4 in_var_PN_DominantVertex1 [[attribute(8)]];
+ float3 in_var_PN_DominantVertex2 [[attribute(9)]];
+ float4 in_var_PN_POSITION_0 [[attribute(10)]];
+ float4 in_var_PN_POSITION_1 [[attribute(11)]];
+ float4 in_var_PN_POSITION_2 [[attribute(12)]];
+ float in_var_PN_WorldDisplacementMultiplier [[attribute(15)]];
+ float4 in_var_TEXCOORD10_centroid [[attribute(16)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(17)]];
+ float4 in_var_TEXCOORD6 [[attribute(18)]];
+ float4 in_var_TEXCOORD8 [[attribute(19)]];
+};
+
+struct main0_patchIn
+{
+ float4 in_var_PN_POSITION9 [[attribute(13)]];
+ patch_control_point<main0_in> gl_in;
+};
+
+[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], constant type_View& View [[buffer(0)]], constant type_Material& Material [[buffer(1)]], texture3d<float> View_GlobalDistanceFieldTexture0 [[texture(0)]], texture3d<float> View_GlobalDistanceFieldTexture1 [[texture(1)]], texture3d<float> View_GlobalDistanceFieldTexture2 [[texture(2)]], texture3d<float> View_GlobalDistanceFieldTexture3 [[texture(3)]], sampler View_GlobalDistanceFieldSampler0 [[sampler(0)]], float3 gl_TessCoord [[position_in_patch]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 3> _120 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD6, patchIn.gl_in[1].in_var_TEXCOORD6, patchIn.gl_in[2].in_var_TEXCOORD6 });
+ spvUnsafeArray<float4, 3> _121 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD8, patchIn.gl_in[1].in_var_TEXCOORD8, patchIn.gl_in[2].in_var_TEXCOORD8 });
+ spvUnsafeArray<float4, 3> _128 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD10_centroid, patchIn.gl_in[1].in_var_TEXCOORD10_centroid, patchIn.gl_in[2].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 3> _129 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD11_centroid, patchIn.gl_in[1].in_var_TEXCOORD11_centroid, patchIn.gl_in[2].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<spvUnsafeArray<float4, 3>, 3> _136 = spvUnsafeArray<spvUnsafeArray<float4, 3>, 3>({ spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_POSITION_0, patchIn.gl_in[0].in_var_PN_POSITION_1, patchIn.gl_in[0].in_var_PN_POSITION_2 }), spvUnsafeArray<float4, 3>({ patchIn.gl_in[1].in_var_PN_POSITION_0, patchIn.gl_in[1].in_var_PN_POSITION_1, patchIn.gl_in[1].in_var_PN_POSITION_2 }), spvUnsafeArray<float4, 3>({ patchIn.gl_in[2].in_var_PN_POSITION_0, patchIn.gl_in[2].in_var_PN_POSITION_1, patchIn.gl_in[2].in_var_PN_POSITION_2 }) });
+ spvUnsafeArray<float, 3> _137 = spvUnsafeArray<float, 3>({ patchIn.gl_in[0].in_var_PN_WorldDisplacementMultiplier, patchIn.gl_in[1].in_var_PN_WorldDisplacementMultiplier, patchIn.gl_in[2].in_var_PN_WorldDisplacementMultiplier });
+ spvUnsafeArray<float4, 3> _138 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_DominantVertex1, patchIn.gl_in[1].in_var_PN_DominantVertex1, patchIn.gl_in[2].in_var_PN_DominantVertex1 });
+ spvUnsafeArray<float3, 3> _139 = spvUnsafeArray<float3, 3>({ patchIn.gl_in[0].in_var_PN_DominantVertex2, patchIn.gl_in[1].in_var_PN_DominantVertex2, patchIn.gl_in[2].in_var_PN_DominantVertex2 });
+ spvUnsafeArray<float4, 3> _146 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_DominantEdge2, patchIn.gl_in[1].in_var_PN_DominantEdge2, patchIn.gl_in[2].in_var_PN_DominantEdge2 });
+ spvUnsafeArray<float4, 3> _147 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_DominantEdge3, patchIn.gl_in[1].in_var_PN_DominantEdge3, patchIn.gl_in[2].in_var_PN_DominantEdge3 });
+ spvUnsafeArray<float3, 3> _148 = spvUnsafeArray<float3, 3>({ patchIn.gl_in[0].in_var_PN_DominantEdge4, patchIn.gl_in[1].in_var_PN_DominantEdge4, patchIn.gl_in[2].in_var_PN_DominantEdge4 });
+ spvUnsafeArray<float3, 3> _149 = spvUnsafeArray<float3, 3>({ patchIn.gl_in[0].in_var_PN_DominantEdge5, patchIn.gl_in[1].in_var_PN_DominantEdge5, patchIn.gl_in[2].in_var_PN_DominantEdge5 });
+ float _190 = gl_TessCoord.x * gl_TessCoord.x;
+ float _191 = gl_TessCoord.y * gl_TessCoord.y;
+ float _192 = gl_TessCoord.z * gl_TessCoord.z;
+ float4 _198 = float4(gl_TessCoord.x);
+ float4 _202 = float4(gl_TessCoord.y);
+ float4 _207 = float4(gl_TessCoord.z);
+ float4 _210 = float4(_190 * 3.0);
+ float4 _214 = float4(_191 * 3.0);
+ float4 _221 = float4(_192 * 3.0);
+ float4 _235 = ((((((((((_136[0][0] * float4(_190)) * _198) + ((_136[1][0] * float4(_191)) * _202)) + ((_136[2][0] * float4(_192)) * _207)) + ((_136[0][1] * _210) * _202)) + ((_136[0][2] * _214) * _198)) + ((_136[1][1] * _214) * _207)) + ((_136[1][2] * _221) * _202)) + ((_136[2][1] * _221) * _198)) + ((_136[2][2] * _210) * _207)) + ((((patchIn.in_var_PN_POSITION9 * float4(6.0)) * _207) * _198) * _202);
+ float3 _237 = float3(gl_TessCoord.x);
+ float3 _240 = float3(gl_TessCoord.y);
+ float3 _254 = float3(gl_TessCoord.z);
+ float3 _256 = ((_128[0].xyz * _237) + (_128[1].xyz * _240)).xyz + (_128[2].xyz * _254);
+ float4 _259 = ((_129[0] * _198) + (_129[1] * _202)) + (_129[2] * _207);
+ float3 _264 = _235.xyz;
+ float3 _265 = _256.xyz;
+ float3 _266 = _259.xyz;
+ float3 _272 = _264 + float3(View.View_WorldCameraOrigin);
+ float _279 = float(int(gl_TessCoord.x == 0.0));
+ float _282 = float(int(gl_TessCoord.y == 0.0));
+ float _285 = float(int(gl_TessCoord.z == 0.0));
+ float _286 = _279 + _282;
+ float _287 = _286 + _285;
+ float4 _387;
+ float3 _388;
+ if (float(int(_287 == 2.0)) == 1.0)
+ {
+ float _363 = float(int((_282 + _285) == 2.0));
+ float _367 = float(int((_285 + _279) == 2.0));
+ float _370 = float(int(_286 == 2.0));
+ _387 = ((float4(_363) * _138[0]) + (float4(_367) * _138[1])) + (float4(_370) * _138[2]);
+ _388 = ((float3(_363) * _139[0]) + (float3(_367) * _139[1])) + (float3(_370) * _139[2]);
+ }
+ else
+ {
+ float4 _358;
+ float3 _359;
+ if (float(int(_287 == 1.0)) != 0.0)
+ {
+ float4 _304 = float4(_279);
+ float4 _306 = float4(_282);
+ float4 _309 = float4(_285);
+ float4 _311 = ((_304 * _146[0]) + (_306 * _146[1])) + (_309 * _146[2]);
+ float4 _316 = ((_304 * _147[0]) + (_306 * _147[1])) + (_309 * _147[2]);
+ float3 _331 = float3(_279);
+ float3 _333 = float3(_282);
+ float3 _336 = float3(_285);
+ float3 _338 = ((_331 * _148[0]) + (_333 * _148[1])) + (_336 * _148[2]);
+ float3 _343 = ((_331 * _149[0]) + (_333 * _149[1])) + (_336 * _149[2]);
+ _358 = ((_304 * ((_202 * _311) + (_207 * _316))) + (_306 * ((_207 * _311) + (_198 * _316)))) + (_309 * ((_198 * _311) + (_202 * _316)));
+ _359 = ((_331 * ((_240 * _338) + (_254 * _343))) + (_333 * ((_254 * _338) + (_237 * _343)))) + (_336 * ((_237 * _338) + (_240 * _343)));
+ }
+ else
+ {
+ _358 = float4(_259.xyz, 0.0);
+ _359 = _265;
+ }
+ _387 = _358;
+ _388 = _359;
+ }
+ float3x3 _398;
+ if (float(int(_287 == 0.0)) == 0.0)
+ {
+ _398 = float3x3(_388, cross(_387.xyz, _388) * float3(_387.w), _387.xyz);
+ }
+ else
+ {
+ _398 = float3x3(_265, cross(_266, _265) * float3(_259.w), _266);
+ }
+ float3 _411 = fast::min(fast::max((_272 - View.View_GlobalVolumeCenterAndExtent[0].xyz) + View.View_GlobalVolumeCenterAndExtent[0].www, float3(0.0)), fast::max((View.View_GlobalVolumeCenterAndExtent[0].xyz + View.View_GlobalVolumeCenterAndExtent[0].www) - _272, float3(0.0)));
+ float _547;
+ if (fast::min(_411.x, fast::min(_411.y, _411.z)) > (View.View_GlobalVolumeCenterAndExtent[0].w * View.View_GlobalVolumeTexelSize))
+ {
+ _547 = View_GlobalDistanceFieldTexture0.sample(View_GlobalDistanceFieldSampler0, ((_272 * View.View_GlobalVolumeWorldToUVAddAndMul[0u].www) + View.View_GlobalVolumeWorldToUVAddAndMul[0u].xyz), level(0.0)).x;
+ }
+ else
+ {
+ float3 _436 = fast::min(fast::max((_272 - View.View_GlobalVolumeCenterAndExtent[1].xyz) + View.View_GlobalVolumeCenterAndExtent[1].www, float3(0.0)), fast::max((View.View_GlobalVolumeCenterAndExtent[1].xyz + View.View_GlobalVolumeCenterAndExtent[1].www) - _272, float3(0.0)));
+ float _535;
+ if (fast::min(_436.x, fast::min(_436.y, _436.z)) > (View.View_GlobalVolumeCenterAndExtent[1].w * View.View_GlobalVolumeTexelSize))
+ {
+ _535 = View_GlobalDistanceFieldTexture1.sample(View_GlobalDistanceFieldSampler0, ((_272 * View.View_GlobalVolumeWorldToUVAddAndMul[1u].www) + View.View_GlobalVolumeWorldToUVAddAndMul[1u].xyz), level(0.0)).x;
+ }
+ else
+ {
+ float3 _459 = fast::min(fast::max((_272 - View.View_GlobalVolumeCenterAndExtent[2].xyz) + View.View_GlobalVolumeCenterAndExtent[2].www, float3(0.0)), fast::max((View.View_GlobalVolumeCenterAndExtent[2].xyz + View.View_GlobalVolumeCenterAndExtent[2].www) - _272, float3(0.0)));
+ float3 _475 = fast::min(fast::max((_272 - View.View_GlobalVolumeCenterAndExtent[3].xyz) + View.View_GlobalVolumeCenterAndExtent[3].www, float3(0.0)), fast::max((View.View_GlobalVolumeCenterAndExtent[3].xyz + View.View_GlobalVolumeCenterAndExtent[3].www) - _272, float3(0.0)));
+ float _480 = fast::min(_475.x, fast::min(_475.y, _475.z));
+ float _523;
+ if (fast::min(_459.x, fast::min(_459.y, _459.z)) > (View.View_GlobalVolumeCenterAndExtent[2].w * View.View_GlobalVolumeTexelSize))
+ {
+ _523 = View_GlobalDistanceFieldTexture2.sample(View_GlobalDistanceFieldSampler0, ((_272 * View.View_GlobalVolumeWorldToUVAddAndMul[2u].www) + View.View_GlobalVolumeWorldToUVAddAndMul[2u].xyz), level(0.0)).x;
+ }
+ else
+ {
+ float _511;
+ if (_480 > (View.View_GlobalVolumeCenterAndExtent[3].w * View.View_GlobalVolumeTexelSize))
+ {
+ _511 = mix(View.View_MaxGlobalDistance, View_GlobalDistanceFieldTexture3.sample(View_GlobalDistanceFieldSampler0, ((_272 * View.View_GlobalVolumeWorldToUVAddAndMul[3u].www) + View.View_GlobalVolumeWorldToUVAddAndMul[3u].xyz), level(0.0)).x, fast::clamp((_480 * 10.0) * View.View_GlobalVolumeWorldToUVAddAndMul[3].w, 0.0, 1.0));
+ }
+ else
+ {
+ _511 = View.View_MaxGlobalDistance;
+ }
+ _523 = _511;
+ }
+ _535 = _523;
+ }
+ _547 = _535;
+ }
+ float3 _565 = _264 + ((_398[2] * float3(fast::min(_547 + Material.Material_ScalarExpressions[0].z, 0.0) * Material.Material_ScalarExpressions[0].w)) * float3(((_137[0] * gl_TessCoord.x) + (_137[1] * gl_TessCoord.y)) + (_137[2] * gl_TessCoord.z)));
+ float4 _574 = View.View_TranslatedWorldToClip * float4(_565.x, _565.y, _565.z, _235.w);
+ float4 _579 = _574;
+ _579.z = _574.z + (0.001000000047497451305389404296875 * _574.w);
+ out.gl_Position = _579;
+ out.out_var_TEXCOORD6 = ((_120[0] * _198) + (_120[1] * _202)) + (_120[2] * _207);
+ out.out_var_TEXCOORD7 = ((_121[0] * _198) + (_121[1] * _202)) + (_121[2] * _207);
+ out.out_var_TEXCOORD10_centroid = float4(_256.x, _256.y, _256.z, _118.w);
+ out.out_var_TEXCOORD11_centroid = _259;
+ out.gl_ClipDistance[0u] = dot(View.View_GlobalClippingPlane, float4(_565.xyz - float3(View.View_PreViewTranslation), 1.0));
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese
new file mode 100644
index 00000000000..4a872e5f7d6
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese
@@ -0,0 +1,216 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_ShadowDepthPass
+{
+ float PrePadding_ShadowDepthPass_LPV_0;
+ float PrePadding_ShadowDepthPass_LPV_4;
+ float PrePadding_ShadowDepthPass_LPV_8;
+ float PrePadding_ShadowDepthPass_LPV_12;
+ float PrePadding_ShadowDepthPass_LPV_16;
+ float PrePadding_ShadowDepthPass_LPV_20;
+ float PrePadding_ShadowDepthPass_LPV_24;
+ float PrePadding_ShadowDepthPass_LPV_28;
+ float PrePadding_ShadowDepthPass_LPV_32;
+ float PrePadding_ShadowDepthPass_LPV_36;
+ float PrePadding_ShadowDepthPass_LPV_40;
+ float PrePadding_ShadowDepthPass_LPV_44;
+ float PrePadding_ShadowDepthPass_LPV_48;
+ float PrePadding_ShadowDepthPass_LPV_52;
+ float PrePadding_ShadowDepthPass_LPV_56;
+ float PrePadding_ShadowDepthPass_LPV_60;
+ float PrePadding_ShadowDepthPass_LPV_64;
+ float PrePadding_ShadowDepthPass_LPV_68;
+ float PrePadding_ShadowDepthPass_LPV_72;
+ float PrePadding_ShadowDepthPass_LPV_76;
+ float PrePadding_ShadowDepthPass_LPV_80;
+ float PrePadding_ShadowDepthPass_LPV_84;
+ float PrePadding_ShadowDepthPass_LPV_88;
+ float PrePadding_ShadowDepthPass_LPV_92;
+ float PrePadding_ShadowDepthPass_LPV_96;
+ float PrePadding_ShadowDepthPass_LPV_100;
+ float PrePadding_ShadowDepthPass_LPV_104;
+ float PrePadding_ShadowDepthPass_LPV_108;
+ float PrePadding_ShadowDepthPass_LPV_112;
+ float PrePadding_ShadowDepthPass_LPV_116;
+ float PrePadding_ShadowDepthPass_LPV_120;
+ float PrePadding_ShadowDepthPass_LPV_124;
+ float PrePadding_ShadowDepthPass_LPV_128;
+ float PrePadding_ShadowDepthPass_LPV_132;
+ float PrePadding_ShadowDepthPass_LPV_136;
+ float PrePadding_ShadowDepthPass_LPV_140;
+ float PrePadding_ShadowDepthPass_LPV_144;
+ float PrePadding_ShadowDepthPass_LPV_148;
+ float PrePadding_ShadowDepthPass_LPV_152;
+ float PrePadding_ShadowDepthPass_LPV_156;
+ float PrePadding_ShadowDepthPass_LPV_160;
+ float PrePadding_ShadowDepthPass_LPV_164;
+ float PrePadding_ShadowDepthPass_LPV_168;
+ float PrePadding_ShadowDepthPass_LPV_172;
+ float PrePadding_ShadowDepthPass_LPV_176;
+ float PrePadding_ShadowDepthPass_LPV_180;
+ float PrePadding_ShadowDepthPass_LPV_184;
+ float PrePadding_ShadowDepthPass_LPV_188;
+ float PrePadding_ShadowDepthPass_LPV_192;
+ float PrePadding_ShadowDepthPass_LPV_196;
+ float PrePadding_ShadowDepthPass_LPV_200;
+ float PrePadding_ShadowDepthPass_LPV_204;
+ float PrePadding_ShadowDepthPass_LPV_208;
+ float PrePadding_ShadowDepthPass_LPV_212;
+ float PrePadding_ShadowDepthPass_LPV_216;
+ float PrePadding_ShadowDepthPass_LPV_220;
+ float PrePadding_ShadowDepthPass_LPV_224;
+ float PrePadding_ShadowDepthPass_LPV_228;
+ float PrePadding_ShadowDepthPass_LPV_232;
+ float PrePadding_ShadowDepthPass_LPV_236;
+ float PrePadding_ShadowDepthPass_LPV_240;
+ float PrePadding_ShadowDepthPass_LPV_244;
+ float PrePadding_ShadowDepthPass_LPV_248;
+ float PrePadding_ShadowDepthPass_LPV_252;
+ float PrePadding_ShadowDepthPass_LPV_256;
+ float PrePadding_ShadowDepthPass_LPV_260;
+ float PrePadding_ShadowDepthPass_LPV_264;
+ float PrePadding_ShadowDepthPass_LPV_268;
+ float4x4 ShadowDepthPass_LPV_mRsmToWorld;
+ float4 ShadowDepthPass_LPV_mLightColour;
+ float4 ShadowDepthPass_LPV_GeometryVolumeCaptureLightDirection;
+ float4 ShadowDepthPass_LPV_mEyePos;
+ packed_int3 ShadowDepthPass_LPV_mOldGridOffset;
+ int PrePadding_ShadowDepthPass_LPV_396;
+ packed_int3 ShadowDepthPass_LPV_mLpvGridOffset;
+ float ShadowDepthPass_LPV_ClearMultiplier;
+ float ShadowDepthPass_LPV_LpvScale;
+ float ShadowDepthPass_LPV_OneOverLpvScale;
+ float ShadowDepthPass_LPV_DirectionalOcclusionIntensity;
+ float ShadowDepthPass_LPV_DirectionalOcclusionRadius;
+ float ShadowDepthPass_LPV_RsmAreaIntensityMultiplier;
+ float ShadowDepthPass_LPV_RsmPixelToTexcoordMultiplier;
+ float ShadowDepthPass_LPV_SecondaryOcclusionStrength;
+ float ShadowDepthPass_LPV_SecondaryBounceStrength;
+ float ShadowDepthPass_LPV_VplInjectionBias;
+ float ShadowDepthPass_LPV_GeometryVolumeInjectionBias;
+ float ShadowDepthPass_LPV_EmissiveInjectionMultiplier;
+ int ShadowDepthPass_LPV_PropagationIndex;
+ float4x4 ShadowDepthPass_ProjectionMatrix;
+ float4x4 ShadowDepthPass_ViewMatrix;
+ float4 ShadowDepthPass_ShadowParams;
+ float ShadowDepthPass_bClampToNearPlane;
+ float PrePadding_ShadowDepthPass_612;
+ float PrePadding_ShadowDepthPass_616;
+ float PrePadding_ShadowDepthPass_620;
+ float4x4 ShadowDepthPass_ShadowViewProjectionMatrices[6];
+ float4x4 ShadowDepthPass_ShadowViewMatrices[6];
+};
+
+constant float4 _90 = {};
+
+struct main0_out
+{
+ float4 out_var_TEXCOORD10_centroid [[user(locn0)]];
+ float4 out_var_TEXCOORD11_centroid [[user(locn1)]];
+ float out_var_TEXCOORD6 [[user(locn2)]];
+ float3 out_var_TEXCOORD7 [[user(locn3)]];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 in_var_PN_POSITION_0 [[attribute(10)]];
+ float4 in_var_PN_POSITION_1 [[attribute(11)]];
+ float4 in_var_PN_POSITION_2 [[attribute(12)]];
+ float4 in_var_TEXCOORD10_centroid [[attribute(16)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(17)]];
+};
+
+struct main0_patchIn
+{
+ float4 in_var_PN_POSITION9 [[attribute(13)]];
+ patch_control_point<main0_in> gl_in;
+};
+
+[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], constant type_ShadowDepthPass& ShadowDepthPass [[buffer(0)]], float3 gl_TessCoord [[position_in_patch]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 3> _93 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD10_centroid, patchIn.gl_in[1].in_var_TEXCOORD10_centroid, patchIn.gl_in[2].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 3> _94 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD11_centroid, patchIn.gl_in[1].in_var_TEXCOORD11_centroid, patchIn.gl_in[2].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<spvUnsafeArray<float4, 3>, 3> _101 = spvUnsafeArray<spvUnsafeArray<float4, 3>, 3>({ spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_POSITION_0, patchIn.gl_in[0].in_var_PN_POSITION_1, patchIn.gl_in[0].in_var_PN_POSITION_2 }), spvUnsafeArray<float4, 3>({ patchIn.gl_in[1].in_var_PN_POSITION_0, patchIn.gl_in[1].in_var_PN_POSITION_1, patchIn.gl_in[1].in_var_PN_POSITION_2 }), spvUnsafeArray<float4, 3>({ patchIn.gl_in[2].in_var_PN_POSITION_0, patchIn.gl_in[2].in_var_PN_POSITION_1, patchIn.gl_in[2].in_var_PN_POSITION_2 }) });
+ float _119 = gl_TessCoord.x * gl_TessCoord.x;
+ float _120 = gl_TessCoord.y * gl_TessCoord.y;
+ float _121 = gl_TessCoord.z * gl_TessCoord.z;
+ float4 _127 = float4(gl_TessCoord.x);
+ float4 _131 = float4(gl_TessCoord.y);
+ float4 _136 = float4(gl_TessCoord.z);
+ float4 _139 = float4(_119 * 3.0);
+ float4 _143 = float4(_120 * 3.0);
+ float4 _150 = float4(_121 * 3.0);
+ float4 _164 = ((((((((((_101[0][0] * float4(_119)) * _127) + ((_101[1][0] * float4(_120)) * _131)) + ((_101[2][0] * float4(_121)) * _136)) + ((_101[0][1] * _139) * _131)) + ((_101[0][2] * _143) * _127)) + ((_101[1][1] * _143) * _136)) + ((_101[1][2] * _150) * _131)) + ((_101[2][1] * _150) * _127)) + ((_101[2][2] * _139) * _136)) + ((((patchIn.in_var_PN_POSITION9 * float4(6.0)) * _136) * _127) * _131);
+ float3 _179 = ((_93[0].xyz * float3(gl_TessCoord.x)) + (_93[1].xyz * float3(gl_TessCoord.y))).xyz + (_93[2].xyz * float3(gl_TessCoord.z));
+ float4 _182 = ((_94[0] * _127) + (_94[1] * _131)) + (_94[2] * _136);
+ float4 _189 = ShadowDepthPass.ShadowDepthPass_ProjectionMatrix * float4(_164.x, _164.y, _164.z, _164.w);
+ float4 _200;
+ if ((ShadowDepthPass.ShadowDepthPass_bClampToNearPlane > 0.0) && (_189.z < 0.0))
+ {
+ float4 _198 = _189;
+ _198.z = 9.9999999747524270787835121154785e-07;
+ float4 _199 = _198;
+ _199.w = 1.0;
+ _200 = _199;
+ }
+ else
+ {
+ _200 = _189;
+ }
+ float _209 = abs(dot(float3(ShadowDepthPass.ShadowDepthPass_ViewMatrix[0].z, ShadowDepthPass.ShadowDepthPass_ViewMatrix[1].z, ShadowDepthPass.ShadowDepthPass_ViewMatrix[2].z), _182.xyz));
+ float4 _234 = _200;
+ _234.z = ((_200.z * ShadowDepthPass.ShadowDepthPass_ShadowParams.w) + ((ShadowDepthPass.ShadowDepthPass_ShadowParams.y * fast::clamp((abs(_209) > 0.0) ? (sqrt(fast::clamp(1.0 - (_209 * _209), 0.0, 1.0)) / _209) : ShadowDepthPass.ShadowDepthPass_ShadowParams.z, 0.0, ShadowDepthPass.ShadowDepthPass_ShadowParams.z)) + ShadowDepthPass.ShadowDepthPass_ShadowParams.x)) * _200.w;
+ out.out_var_TEXCOORD10_centroid = float4(_179.x, _179.y, _179.z, _90.w);
+ out.out_var_TEXCOORD11_centroid = _182;
+ out.out_var_TEXCOORD6 = 0.0;
+ out.out_var_TEXCOORD7 = _164.xyz;
+ out.gl_Position = _234;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-texcoord-array.asm.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-texcoord-array.asm.tese
new file mode 100644
index 00000000000..346d7e3fc95
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-texcoord-array.asm.tese
@@ -0,0 +1,318 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_ClipToWorld;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_908;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_924;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_940;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_956;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_972;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_1020;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_1036;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_1052;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1068;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1724;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1740;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1756;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2076;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2148;
+ float PrePadding_View_2152;
+ float PrePadding_View_2156;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2228;
+ float PrePadding_View_2232;
+ float PrePadding_View_2236;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2268;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2412;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ float View_AtmosphericFogSunDiscHalfApexAngleRadian;
+ float PrePadding_View_2492;
+ float4 View_AtmosphericFogSunDiscLuminance;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ uint PrePadding_View_2520;
+ uint PrePadding_View_2524;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2584;
+ float PrePadding_View_2588;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2744;
+ float PrePadding_View_2748;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float PrePadding_View_2908;
+ int2 View_CursorPosition;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ float PrePadding_View_2924;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2940;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2956;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2972;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2988;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_3004;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+ float PrePadding_View_3048;
+ float PrePadding_View_3052;
+ float4x4 View_WorldToVirtualTexture;
+ float4 View_VirtualTextureParams;
+ float4 View_XRPassthroughCameraUVs[2];
+};
+
+constant float4 _68 = {};
+
+struct main0_out
+{
+ float4 out_var_TEXCOORD10_centroid [[user(locn0)]];
+ float4 out_var_TEXCOORD11_centroid [[user(locn1)]];
+ float4 out_var_TEXCOORD0_0 [[user(locn2)]];
+ float4 out_var_COLOR1 [[user(locn3)]];
+ float4 out_var_COLOR2 [[user(locn4)]];
+ float4 out_var_TEXCOORD6 [[user(locn5)]];
+ float3 out_var_TEXCOORD7 [[user(locn6)]];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 in_var_COLOR1 [[attribute(0)]];
+ float4 in_var_COLOR2 [[attribute(1)]];
+ float4 in_var_TEXCOORD0_0 [[attribute(5)]];
+ float4 in_var_TEXCOORD10_centroid [[attribute(6)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(7)]];
+ float3 in_var_TEXCOORD7 [[attribute(8)]];
+ float4 in_var_VS_To_DS_Position [[attribute(9)]];
+};
+
+struct main0_patchIn
+{
+ patch_control_point<main0_in> gl_in;
+};
+
+[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], constant type_View& View [[buffer(0)]], float3 gl_TessCoord [[position_in_patch]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 1> out_var_TEXCOORD0 = {};
+ spvUnsafeArray<float4, 3> _77 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD10_centroid, patchIn.gl_in[1].in_var_TEXCOORD10_centroid, patchIn.gl_in[2].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 3> _78 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD11_centroid, patchIn.gl_in[1].in_var_TEXCOORD11_centroid, patchIn.gl_in[2].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<spvUnsafeArray<float4, 1>, 3> _79 = spvUnsafeArray<spvUnsafeArray<float4, 1>, 3>({ spvUnsafeArray<float4, 1>({ patchIn.gl_in[0].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ patchIn.gl_in[1].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ patchIn.gl_in[2].in_var_TEXCOORD0_0 }) });
+ spvUnsafeArray<float4, 3> _80 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_COLOR1, patchIn.gl_in[1].in_var_COLOR1, patchIn.gl_in[2].in_var_COLOR1 });
+ spvUnsafeArray<float4, 3> _81 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_COLOR2, patchIn.gl_in[1].in_var_COLOR2, patchIn.gl_in[2].in_var_COLOR2 });
+ spvUnsafeArray<float4, 3> _97 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_VS_To_DS_Position, patchIn.gl_in[1].in_var_VS_To_DS_Position, patchIn.gl_in[2].in_var_VS_To_DS_Position });
+ spvUnsafeArray<float3, 3> _98 = spvUnsafeArray<float3, 3>({ patchIn.gl_in[0].in_var_TEXCOORD7, patchIn.gl_in[1].in_var_TEXCOORD7, patchIn.gl_in[2].in_var_TEXCOORD7 });
+ float4 _111 = float4(gl_TessCoord.x);
+ float4 _113 = float4(gl_TessCoord.y);
+ float4 _116 = float4(gl_TessCoord.z);
+ float4 _118 = ((_97[0] * _111) + (_97[1] * _113)) + (_97[2] * _116);
+ spvUnsafeArray<float4, 1> _72;
+ _72 = _79[0];
+ spvUnsafeArray<float4, 1> _71;
+ _71 = _79[1];
+ float3 _120 = float3(gl_TessCoord.x);
+ float3 _123 = float3(gl_TessCoord.y);
+ spvUnsafeArray<float4, 1> _73;
+ for (int _133 = 0; _133 < 1; )
+ {
+ _73[_133] = (_72[_133] * _111) + (_71[_133] * _113);
+ _133++;
+ continue;
+ }
+ spvUnsafeArray<float4, 1> _75;
+ _75 = _73;
+ spvUnsafeArray<float4, 1> _74;
+ _74 = _79[2];
+ float3 _155 = float3(gl_TessCoord.z);
+ float3 _157 = ((_77[0].xyz * _120) + (_77[1].xyz * _123)).xyz + (_77[2].xyz * _155);
+ spvUnsafeArray<float4, 1> _76;
+ for (int _164 = 0; _164 < 1; )
+ {
+ _76[_164] = _75[_164] + (_74[_164] * _116);
+ _164++;
+ continue;
+ }
+ float4 _181 = float4(_118.x, _118.y, _118.z, _118.w);
+ out.out_var_TEXCOORD10_centroid = float4(_157.x, _157.y, _157.z, _68.w);
+ out.out_var_TEXCOORD11_centroid = ((_78[0] * _111) + (_78[1] * _113)) + (_78[2] * _116);
+ out_var_TEXCOORD0 = _76;
+ out.out_var_COLOR1 = ((_80[0] * _111) + (_80[1] * _113)) + (_80[2] * _116);
+ out.out_var_COLOR2 = ((_81[0] * _111) + (_81[1] * _113)) + (_81[2] * _116);
+ out.out_var_TEXCOORD6 = _181;
+ out.out_var_TEXCOORD7 = ((_98[0] * _120) + (_98[1] * _123)) + (_98[2] * _155);
+ out.gl_Position = View.View_TranslatedWorldToClip * _181;
+ out.out_var_TEXCOORD0_0 = out_var_TEXCOORD0[0];
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/vert/array-missing-copies.asm.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/vert/array-missing-copies.asm.vert
new file mode 100644
index 00000000000..3d3e0e51f57
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/vert/array-missing-copies.asm.vert
@@ -0,0 +1,466 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_844;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_860;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_876;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_892;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_908;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_956;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_972;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_988;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1004;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1660;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1676;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1692;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2012;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2084;
+ float PrePadding_View_2088;
+ float PrePadding_View_2092;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2164;
+ float PrePadding_View_2168;
+ float PrePadding_View_2172;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2204;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2348;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2488;
+ float PrePadding_View_2492;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2648;
+ float PrePadding_View_2652;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2828;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2844;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2860;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2876;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_2892;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_MobileBasePass
+{
+ float4 MobileBasePass_Fog_ExponentialFogParameters;
+ float4 MobileBasePass_Fog_ExponentialFogParameters2;
+ float4 MobileBasePass_Fog_ExponentialFogColorParameter;
+ float4 MobileBasePass_Fog_ExponentialFogParameters3;
+ float4 MobileBasePass_Fog_InscatteringLightDirection;
+ float4 MobileBasePass_Fog_DirectionalInscatteringColor;
+ float2 MobileBasePass_Fog_SinCosInscatteringColorCubemapRotation;
+ float PrePadding_MobileBasePass_Fog_104;
+ float PrePadding_MobileBasePass_Fog_108;
+ packed_float3 MobileBasePass_Fog_FogInscatteringTextureParameters;
+ float MobileBasePass_Fog_ApplyVolumetricFog;
+ float PrePadding_MobileBasePass_PlanarReflection_128;
+ float PrePadding_MobileBasePass_PlanarReflection_132;
+ float PrePadding_MobileBasePass_PlanarReflection_136;
+ float PrePadding_MobileBasePass_PlanarReflection_140;
+ float PrePadding_MobileBasePass_PlanarReflection_144;
+ float PrePadding_MobileBasePass_PlanarReflection_148;
+ float PrePadding_MobileBasePass_PlanarReflection_152;
+ float PrePadding_MobileBasePass_PlanarReflection_156;
+ float4 MobileBasePass_PlanarReflection_ReflectionPlane;
+ float4 MobileBasePass_PlanarReflection_PlanarReflectionOrigin;
+ float4 MobileBasePass_PlanarReflection_PlanarReflectionXAxis;
+ float4 MobileBasePass_PlanarReflection_PlanarReflectionYAxis;
+ float3x4 MobileBasePass_PlanarReflection_InverseTransposeMirrorMatrix;
+ packed_float3 MobileBasePass_PlanarReflection_PlanarReflectionParameters;
+ float PrePadding_MobileBasePass_PlanarReflection_284;
+ float2 MobileBasePass_PlanarReflection_PlanarReflectionParameters2;
+ float PrePadding_MobileBasePass_PlanarReflection_296;
+ float PrePadding_MobileBasePass_PlanarReflection_300;
+ float4x4 MobileBasePass_PlanarReflection_ProjectionWithExtraFOV[2];
+ float4 MobileBasePass_PlanarReflection_PlanarReflectionScreenScaleBias[2];
+ float2 MobileBasePass_PlanarReflection_PlanarReflectionScreenBound;
+ uint MobileBasePass_PlanarReflection_bIsStereo;
+};
+
+struct type_Primitive
+{
+ float4x4 Primitive_LocalToWorld;
+ float4 Primitive_InvNonUniformScaleAndDeterminantSign;
+ float4 Primitive_ObjectWorldPositionAndRadius;
+ float4x4 Primitive_WorldToLocal;
+ float4x4 Primitive_PreviousLocalToWorld;
+ float4x4 Primitive_PreviousWorldToLocal;
+ packed_float3 Primitive_ActorWorldPosition;
+ float Primitive_UseSingleSampleShadowFromStationaryLights;
+ packed_float3 Primitive_ObjectBounds;
+ float Primitive_LpvBiasMultiplier;
+ float Primitive_DecalReceiverMask;
+ float Primitive_PerObjectGBufferData;
+ float Primitive_UseVolumetricLightmapShadowFromStationaryLights;
+ float Primitive_UseEditorDepthTest;
+ float4 Primitive_ObjectOrientation;
+ float4 Primitive_NonUniformScale;
+ packed_float3 Primitive_LocalObjectBoundsMin;
+ float PrePadding_Primitive_380;
+ packed_float3 Primitive_LocalObjectBoundsMax;
+ uint Primitive_LightingChannelMask;
+ uint Primitive_LightmapDataIndex;
+ int Primitive_SingleCaptureIndex;
+};
+
+struct type_LandscapeParameters
+{
+ float4 LandscapeParameters_HeightmapUVScaleBias;
+ float4 LandscapeParameters_WeightmapUVScaleBias;
+ float4 LandscapeParameters_LandscapeLightmapScaleBias;
+ float4 LandscapeParameters_SubsectionSizeVertsLayerUVPan;
+ float4 LandscapeParameters_SubsectionOffsetParams;
+ float4 LandscapeParameters_LightmapSubsectionOffsetParams;
+ float4x4 LandscapeParameters_LocalToWorldNoScaling;
+};
+
+struct type_Globals
+{
+ float4 LodBias;
+ float4 LodValues;
+ float4 SectionLods;
+ float4 NeighborSectionLod[4];
+};
+
+struct main0_out
+{
+ float2 out_var_TEXCOORD0 [[user(locn0)]];
+ float2 out_var_TEXCOORD1 [[user(locn1)]];
+ float4 out_var_TEXCOORD2 [[user(locn2)]];
+ float4 out_var_TEXCOORD3 [[user(locn3)]];
+ float4 out_var_TEXCOORD8 [[user(locn4)]];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 in_var_ATTRIBUTE0 [[attribute(0)]];
+ float4 in_var_ATTRIBUTE1_0 [[attribute(1)]];
+ float4 in_var_ATTRIBUTE1_1 [[attribute(2)]];
+};
+
+vertex main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_MobileBasePass& MobileBasePass [[buffer(1)]], constant type_Primitive& Primitive [[buffer(2)]], constant type_LandscapeParameters& LandscapeParameters [[buffer(3)]], constant type_Globals& _Globals [[buffer(4)]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 2> in_var_ATTRIBUTE1 = {};
+ in_var_ATTRIBUTE1[0] = in.in_var_ATTRIBUTE1_0;
+ in_var_ATTRIBUTE1[1] = in.in_var_ATTRIBUTE1_1;
+ spvUnsafeArray<float4, 1> _97;
+ for (int _107 = 0; _107 < 1; )
+ {
+ _97[_107] = float4(0.0);
+ _107++;
+ continue;
+ }
+ float4 _115 = in.in_var_ATTRIBUTE0 * float4(255.0);
+ float2 _116 = _115.zw;
+ float2 _119 = fract(_116 * float2(0.5)) * float2(2.0);
+ float2 _121 = (_116 - _119) * float2(0.0039215688593685626983642578125);
+ float2 _122 = _115.xy;
+ float2 _126 = _122 * float2(_Globals.LodValues.w);
+ float _127 = _126.y;
+ float _128 = _126.x;
+ float4 _132 = float4(_127, _128, 1.0 - _128, 1.0 - _127) * float4(2.0);
+ float4 _186;
+ if (_119.y > 0.5)
+ {
+ float4 _161;
+ if (_119.x > 0.5)
+ {
+ _161 = (_132 * float4(_Globals.SectionLods.w)) + ((float4(1.0) - _132) * _Globals.NeighborSectionLod[3]);
+ }
+ else
+ {
+ _161 = (_132 * float4(_Globals.SectionLods.z)) + ((float4(1.0) - _132) * _Globals.NeighborSectionLod[2]);
+ }
+ _186 = _161;
+ }
+ else
+ {
+ float4 _185;
+ if (_119.x > 0.5)
+ {
+ _185 = (_132 * float4(_Globals.SectionLods.y)) + ((float4(1.0) - _132) * _Globals.NeighborSectionLod[1]);
+ }
+ else
+ {
+ _185 = (_132 * float4(_Globals.SectionLods.x)) + ((float4(1.0) - _132) * _Globals.NeighborSectionLod[0]);
+ }
+ _186 = _185;
+ }
+ float _206;
+ if ((_128 + _127) > 1.0)
+ {
+ float _198;
+ if (_128 < _127)
+ {
+ _198 = _186.w;
+ }
+ else
+ {
+ _198 = _186.z;
+ }
+ _206 = _198;
+ }
+ else
+ {
+ float _205;
+ if (_128 < _127)
+ {
+ _205 = _186.y;
+ }
+ else
+ {
+ _205 = _186.x;
+ }
+ _206 = _205;
+ }
+ float _207 = floor(_206);
+ float _220 = _121.x;
+ float3 _235 = select(select(select(select(select(float3(0.03125, _121.yy), float3(0.0625, _220, _121.y), bool3(_207 < 5.0)), float3(0.125, in_var_ATTRIBUTE1[1].w, _220), bool3(_207 < 4.0)), float3(0.25, in_var_ATTRIBUTE1[1].zw), bool3(_207 < 3.0)), float3(0.5, in_var_ATTRIBUTE1[1].yz), bool3(_207 < 2.0)), float3(1.0, in_var_ATTRIBUTE1[1].xy), bool3(_207 < 1.0));
+ float _236 = _235.x;
+ float _245 = (((in_var_ATTRIBUTE1[0].x * 65280.0) + (in_var_ATTRIBUTE1[0].y * 255.0)) - 32768.0) * 0.0078125;
+ float _252 = (((in_var_ATTRIBUTE1[0].z * 65280.0) + (in_var_ATTRIBUTE1[0].w * 255.0)) - 32768.0) * 0.0078125;
+ float2 _257 = floor(_122 * float2(_236));
+ float2 _271 = float2((LandscapeParameters.LandscapeParameters_SubsectionSizeVertsLayerUVPan.x * _236) - 1.0, fast::max((LandscapeParameters.LandscapeParameters_SubsectionSizeVertsLayerUVPan.x * 0.5) * _236, 2.0) - 1.0) * float2(LandscapeParameters.LandscapeParameters_SubsectionSizeVertsLayerUVPan.y);
+ float3 _287 = mix(float3(_257 / float2(_271.x), mix(_245, _252, _235.y)), float3(floor(_257 * float2(0.5)) / float2(_271.y), mix(_245, _252, _235.z)), float3(_206 - _207));
+ float2 _288 = _119.xy;
+ float2 _292 = _288 * LandscapeParameters.LandscapeParameters_SubsectionOffsetParams.ww;
+ float3 _296 = _287 + float3(_292, 0.0);
+ float4 _322 = float4((((Primitive.Primitive_LocalToWorld[0u].xyz * _296.xxx) + (Primitive.Primitive_LocalToWorld[1u].xyz * _296.yyy)) + (Primitive.Primitive_LocalToWorld[2u].xyz * _296.zzz)) + (Primitive.Primitive_LocalToWorld[3u].xyz + float3(View.View_PreViewTranslation)), 1.0);
+ float2 _323 = _287.xy;
+ float4 _338 = float4(_322.x, _322.y, _322.z, _322.w);
+ float4 _339 = View.View_TranslatedWorldToClip * _338;
+ float3 _341 = _322.xyz - float3(View.View_TranslatedWorldCameraOrigin);
+ float _345 = dot(_341, _341);
+ float _346 = rsqrt(_345);
+ float _347 = _345 * _346;
+ float _354 = _341.z;
+ float _357 = fast::max(0.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters.w);
+ float _393;
+ float _394;
+ float _395;
+ float _396;
+ if (_357 > 0.0)
+ {
+ float _361 = _357 * _346;
+ float _362 = _361 * _354;
+ float _365 = View.View_WorldCameraOrigin[2] + _362;
+ _393 = (1.0 - _361) * _347;
+ _394 = MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.z * exp2(-fast::max(-127.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.y * (_365 - MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.w)));
+ _395 = MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.x * exp2(-fast::max(-127.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters.y * (_365 - MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.y)));
+ _396 = _354 - _362;
+ }
+ else
+ {
+ _393 = _347;
+ _394 = MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.x;
+ _395 = MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters.x;
+ _396 = _354;
+ }
+ float _400 = fast::max(-127.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters.y * _396);
+ float _405 = log(2.0);
+ float _407 = 0.5 * (_405 * _405);
+ float _417 = fast::max(-127.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.y * _396);
+ float _428 = (_395 * ((abs(_400) > 0.00999999977648258209228515625) ? ((1.0 - exp2(-_400)) / _400) : (_405 - (_407 * _400)))) + (_394 * ((abs(_417) > 0.00999999977648258209228515625) ? ((1.0 - exp2(-_417)) / _417) : (_405 - (_407 * _417))));
+ float3 _459;
+ if (MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.w >= 0.0)
+ {
+ _459 = (MobileBasePass.MobileBasePass_Fog_DirectionalInscatteringColor.xyz * float3(pow(fast::clamp(dot(_341 * float3(_346), MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.xyz), 0.0, 1.0), MobileBasePass.MobileBasePass_Fog_DirectionalInscatteringColor.w))) * float3(1.0 - fast::clamp(exp2(-(_428 * fast::max(_393 - MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.w, 0.0))), 0.0, 1.0));
+ }
+ else
+ {
+ _459 = float3(0.0);
+ }
+ bool _468 = (MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.w > 0.0) && (_347 > MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.w);
+ float _471 = _468 ? 1.0 : fast::max(fast::clamp(exp2(-(_428 * _393)), 0.0, 1.0), MobileBasePass.MobileBasePass_Fog_ExponentialFogColorParameter.w);
+ _97[0] = float4((MobileBasePass.MobileBasePass_Fog_ExponentialFogColorParameter.xyz * float3(1.0 - _471)) + select(_459, float3(0.0), bool3(_468)), _471);
+ float4 _482 = _338;
+ _482.w = _339.w;
+ out.out_var_TEXCOORD0 = ((_323 + LandscapeParameters.LandscapeParameters_SubsectionSizeVertsLayerUVPan.zw) + _292).xy;
+ out.out_var_TEXCOORD1 = ((_323 * LandscapeParameters.LandscapeParameters_WeightmapUVScaleBias.xy) + LandscapeParameters.LandscapeParameters_WeightmapUVScaleBias.zw) + (_288 * LandscapeParameters.LandscapeParameters_SubsectionOffsetParams.zz);
+ out.out_var_TEXCOORD2 = float4(float4(0.0).x, float4(0.0).y, _97[0].x, _97[0].y);
+ out.out_var_TEXCOORD3 = float4(float4(0.0).x, float4(0.0).y, _97[0].z, _97[0].w);
+ out.out_var_TEXCOORD8 = _482;
+ out.gl_Position = _339;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert
new file mode 100644
index 00000000000..b1298b7e683
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert
@@ -0,0 +1,122 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_Globals
+{
+ float4 ViewportSize;
+ float ScatteringScaling;
+ float CocRadiusToCircumscribedRadius;
+};
+
+struct type_StructuredBuffer_v4float
+{
+ float4 _m0[1];
+};
+
+struct main0_out
+{
+ float2 out_var_TEXCOORD0 [[user(locn0)]];
+ float4 out_var_TEXCOORD1 [[user(locn1)]];
+ float4 out_var_TEXCOORD2 [[user(locn2)]];
+ float4 out_var_TEXCOORD3 [[user(locn3)]];
+ float4 out_var_TEXCOORD4 [[user(locn4)]];
+ float4 out_var_TEXCOORD5 [[user(locn5)]];
+ float4 out_var_TEXCOORD6 [[user(locn6)]];
+ float4 gl_Position [[position]];
+};
+
+vertex main0_out main0(constant type_Globals& _Globals [[buffer(0)]], const device type_StructuredBuffer_v4float& ScatterDrawList [[buffer(1)]], uint gl_VertexIndex [[vertex_id]], uint gl_InstanceIndex [[instance_id]])
+{
+ main0_out out = {};
+ uint _66 = gl_VertexIndex / 4u;
+ uint _68 = gl_VertexIndex - (_66 * 4u);
+ uint _70 = (16u * gl_InstanceIndex) + _66;
+ float _72;
+ _72 = 0.0;
+ spvUnsafeArray<float4, 4> _61;
+ spvUnsafeArray<float, 4> _62;
+ spvUnsafeArray<float2, 4> _63;
+ float _73;
+ uint _75 = 0u;
+ for (;;)
+ {
+ if (_75 < 4u)
+ {
+ uint _82 = ((5u * _70) + _75) + 1u;
+ _61[_75] = float4(ScatterDrawList._m0[_82].xyz, 0.0);
+ _62[_75] = ScatterDrawList._m0[_82].w;
+ if (_75 == 0u)
+ {
+ _73 = _62[_75];
+ }
+ else
+ {
+ _73 = fast::max(_72, _62[_75]);
+ }
+ _63[_75].x = (-0.5) / _62[_75];
+ _63[_75].y = (0.5 * _62[_75]) + 0.5;
+ _72 = _73;
+ _75++;
+ continue;
+ }
+ else
+ {
+ break;
+ }
+ }
+ float2 _144 = float2(_Globals.ScatteringScaling) * ScatterDrawList._m0[5u * _70].xy;
+ float2 _173 = (((float2((_72 * _Globals.CocRadiusToCircumscribedRadius) + 1.0) * ((float2(float(_68 % 2u), float(_68 / 2u)) * float2(2.0)) - float2(1.0))) + _144) + float2(0.5)) * _Globals.ViewportSize.zw;
+ out.out_var_TEXCOORD0 = _144;
+ out.out_var_TEXCOORD1 = float4(_61[0].xyz, _62[0]);
+ out.out_var_TEXCOORD2 = float4(_61[1].xyz, _62[1]);
+ out.out_var_TEXCOORD3 = float4(_61[2].xyz, _62[2]);
+ out.out_var_TEXCOORD4 = float4(_61[3].xyz, _62[3]);
+ out.out_var_TEXCOORD5 = float4(_63[0].x, _63[0].y, _63[1].x, _63[1].y);
+ out.out_var_TEXCOORD6 = float4(_63[2].x, _63[2].y, _63[3].x, _63[3].y);
+ out.gl_Position = float4((_173.x * 2.0) - 1.0, 1.0 - (_173.y * 2.0), 0.0, 1.0);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/vert/texture-buffer.asm.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/vert/texture-buffer.asm.vert
new file mode 100644
index 00000000000..6384e1b9d40
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/vert/texture-buffer.asm.vert
@@ -0,0 +1,387 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_844;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_860;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_876;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_892;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_908;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_956;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_972;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_988;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1004;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1660;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1676;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1692;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2012;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2084;
+ float PrePadding_View_2088;
+ float PrePadding_View_2092;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2164;
+ float PrePadding_View_2168;
+ float PrePadding_View_2172;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2204;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2348;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2488;
+ float PrePadding_View_2492;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2648;
+ float PrePadding_View_2652;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2828;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2844;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2860;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2876;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_2892;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_Primitive
+{
+ float4x4 Primitive_LocalToWorld;
+ float4 Primitive_InvNonUniformScaleAndDeterminantSign;
+ float4 Primitive_ObjectWorldPositionAndRadius;
+ float4x4 Primitive_WorldToLocal;
+ float4x4 Primitive_PreviousLocalToWorld;
+ float4x4 Primitive_PreviousWorldToLocal;
+ packed_float3 Primitive_ActorWorldPosition;
+ float Primitive_UseSingleSampleShadowFromStationaryLights;
+ packed_float3 Primitive_ObjectBounds;
+ float Primitive_LpvBiasMultiplier;
+ float Primitive_DecalReceiverMask;
+ float Primitive_PerObjectGBufferData;
+ float Primitive_UseVolumetricLightmapShadowFromStationaryLights;
+ float Primitive_UseEditorDepthTest;
+ float4 Primitive_ObjectOrientation;
+ float4 Primitive_NonUniformScale;
+ packed_float3 Primitive_LocalObjectBoundsMin;
+ float PrePadding_Primitive_380;
+ packed_float3 Primitive_LocalObjectBoundsMax;
+ uint Primitive_LightingChannelMask;
+ uint Primitive_LightmapDataIndex;
+ int Primitive_SingleCaptureIndex;
+};
+
+struct type_MobileShadowDepthPass
+{
+ float PrePadding_MobileShadowDepthPass_0;
+ float PrePadding_MobileShadowDepthPass_4;
+ float PrePadding_MobileShadowDepthPass_8;
+ float PrePadding_MobileShadowDepthPass_12;
+ float PrePadding_MobileShadowDepthPass_16;
+ float PrePadding_MobileShadowDepthPass_20;
+ float PrePadding_MobileShadowDepthPass_24;
+ float PrePadding_MobileShadowDepthPass_28;
+ float PrePadding_MobileShadowDepthPass_32;
+ float PrePadding_MobileShadowDepthPass_36;
+ float PrePadding_MobileShadowDepthPass_40;
+ float PrePadding_MobileShadowDepthPass_44;
+ float PrePadding_MobileShadowDepthPass_48;
+ float PrePadding_MobileShadowDepthPass_52;
+ float PrePadding_MobileShadowDepthPass_56;
+ float PrePadding_MobileShadowDepthPass_60;
+ float PrePadding_MobileShadowDepthPass_64;
+ float PrePadding_MobileShadowDepthPass_68;
+ float PrePadding_MobileShadowDepthPass_72;
+ float PrePadding_MobileShadowDepthPass_76;
+ float4x4 MobileShadowDepthPass_ProjectionMatrix;
+ float2 MobileShadowDepthPass_ShadowParams;
+ float MobileShadowDepthPass_bClampToNearPlane;
+ float PrePadding_MobileShadowDepthPass_156;
+ float4x4 MobileShadowDepthPass_ShadowViewProjectionMatrices[6];
+};
+
+struct type_EmitterDynamicUniforms
+{
+ float2 EmitterDynamicUniforms_LocalToWorldScale;
+ float EmitterDynamicUniforms_EmitterInstRandom;
+ float PrePadding_EmitterDynamicUniforms_12;
+ float4 EmitterDynamicUniforms_AxisLockRight;
+ float4 EmitterDynamicUniforms_AxisLockUp;
+ float4 EmitterDynamicUniforms_DynamicColor;
+ float4 EmitterDynamicUniforms_MacroUVParameters;
+};
+
+struct type_EmitterUniforms
+{
+ float4 EmitterUniforms_ColorCurve;
+ float4 EmitterUniforms_ColorScale;
+ float4 EmitterUniforms_ColorBias;
+ float4 EmitterUniforms_MiscCurve;
+ float4 EmitterUniforms_MiscScale;
+ float4 EmitterUniforms_MiscBias;
+ float4 EmitterUniforms_SizeBySpeed;
+ float4 EmitterUniforms_SubImageSize;
+ float4 EmitterUniforms_TangentSelector;
+ packed_float3 EmitterUniforms_CameraFacingBlend;
+ float EmitterUniforms_RemoveHMDRoll;
+ float EmitterUniforms_RotationRateScale;
+ float EmitterUniforms_RotationBias;
+ float EmitterUniforms_CameraMotionBlurAmount;
+ float PrePadding_EmitterUniforms_172;
+ float2 EmitterUniforms_PivotOffset;
+};
+
+struct type_Globals
+{
+ uint ParticleIndicesOffset;
+};
+
+struct main0_out
+{
+ float out_var_TEXCOORD6 [[user(locn0)]];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float2 in_var_ATTRIBUTE0 [[attribute(0)]];
+};
+
+// Returns 2D texture coords corresponding to 1D texel buffer coords
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
+{
+ return uint2(tc % 4096, tc / 4096);
+}
+
+vertex main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_Primitive& Primitive [[buffer(1)]], constant type_MobileShadowDepthPass& MobileShadowDepthPass [[buffer(2)]], constant type_EmitterDynamicUniforms& EmitterDynamicUniforms [[buffer(3)]], constant type_EmitterUniforms& EmitterUniforms [[buffer(4)]], constant type_Globals& _Globals [[buffer(5)]], texture2d<float> ParticleIndices [[texture(0)]], texture2d<float> PositionTexture [[texture(1)]], texture2d<float> VelocityTexture [[texture(2)]], texture2d<float> AttributesTexture [[texture(3)]], texture2d<float> CurveTexture [[texture(4)]], sampler PositionTextureSampler [[sampler(0)]], sampler VelocityTextureSampler [[sampler(1)]], sampler AttributesTextureSampler [[sampler(2)]], sampler CurveTextureSampler [[sampler(3)]], uint gl_VertexIndex [[vertex_id]], uint gl_InstanceIndex [[instance_id]])
+{
+ main0_out out = {};
+ float2 _133 = ParticleIndices.read(spvTexelBufferCoord((_Globals.ParticleIndicesOffset + ((gl_InstanceIndex * 16u) + (gl_VertexIndex / 4u))))).xy;
+ float4 _137 = PositionTexture.sample(PositionTextureSampler, _133, level(0.0));
+ float4 _145 = AttributesTexture.sample(AttributesTextureSampler, _133, level(0.0));
+ float _146 = _137.w;
+ float3 _158 = float3x3(Primitive.Primitive_LocalToWorld[0].xyz, Primitive.Primitive_LocalToWorld[1].xyz, Primitive.Primitive_LocalToWorld[2].xyz) * VelocityTexture.sample(VelocityTextureSampler, _133, level(0.0)).xyz;
+ float3 _160 = normalize(_158 + float3(0.0, 0.0, 9.9999997473787516355514526367188e-05));
+ float2 _204 = ((((_145.xy + float2((_145.x < 0.5) ? 0.0 : (-0.5), (_145.y < 0.5) ? 0.0 : (-0.5))) * float2(2.0)) * (((CurveTexture.sample(CurveTextureSampler, (EmitterUniforms.EmitterUniforms_MiscCurve.xy + (EmitterUniforms.EmitterUniforms_MiscCurve.zw * float2(_146))), level(0.0)) * EmitterUniforms.EmitterUniforms_MiscScale) + EmitterUniforms.EmitterUniforms_MiscBias).xy * EmitterDynamicUniforms.EmitterDynamicUniforms_LocalToWorldScale)) * fast::min(fast::max(EmitterUniforms.EmitterUniforms_SizeBySpeed.xy * float2(length(_158)), float2(1.0)), EmitterUniforms.EmitterUniforms_SizeBySpeed.zw)) * float2(step(_146, 1.0));
+ float3 _239 = float4((((Primitive.Primitive_LocalToWorld[0u].xyz * _137.xxx) + (Primitive.Primitive_LocalToWorld[1u].xyz * _137.yyy)) + (Primitive.Primitive_LocalToWorld[2u].xyz * _137.zzz)) + (Primitive.Primitive_LocalToWorld[3u].xyz + float3(View.View_PreViewTranslation)), 1.0).xyz;
+ float3 _242 = float3(EmitterUniforms.EmitterUniforms_RemoveHMDRoll);
+ float3 _251 = mix(mix(float3(View.View_ViewRight), float3(View.View_HMDViewNoRollRight), _242), EmitterDynamicUniforms.EmitterDynamicUniforms_AxisLockRight.xyz, float3(EmitterDynamicUniforms.EmitterDynamicUniforms_AxisLockRight.w));
+ float3 _259 = mix(-mix(float3(View.View_ViewUp), float3(View.View_HMDViewNoRollUp), _242), EmitterDynamicUniforms.EmitterDynamicUniforms_AxisLockUp.xyz, float3(EmitterDynamicUniforms.EmitterDynamicUniforms_AxisLockUp.w));
+ float3 _260 = float3(View.View_TranslatedWorldCameraOrigin) - _239;
+ float _261 = dot(_260, _260);
+ float3 _265 = _260 / float3(sqrt(fast::max(_261, 0.00999999977648258209228515625)));
+ float3 _335;
+ float3 _336;
+ if (EmitterUniforms.EmitterUniforms_CameraFacingBlend[0] > 0.0)
+ {
+ float3 _279 = cross(_265, float3(0.0, 0.0, 1.0));
+ float3 _284 = _279 / float3(sqrt(fast::max(dot(_279, _279), 0.00999999977648258209228515625)));
+ float3 _286 = float3(fast::clamp((_261 * EmitterUniforms.EmitterUniforms_CameraFacingBlend[1]) - EmitterUniforms.EmitterUniforms_CameraFacingBlend[2], 0.0, 1.0));
+ _335 = normalize(mix(_251, _284, _286));
+ _336 = normalize(mix(_259, cross(_265, _284), _286));
+ }
+ else
+ {
+ float3 _333;
+ float3 _334;
+ if (EmitterUniforms.EmitterUniforms_TangentSelector.y > 0.0)
+ {
+ float3 _297 = cross(_265, _160);
+ _333 = _297 / float3(sqrt(fast::max(dot(_297, _297), 0.00999999977648258209228515625)));
+ _334 = -_160;
+ }
+ else
+ {
+ float3 _331;
+ float3 _332;
+ if (EmitterUniforms.EmitterUniforms_TangentSelector.z > 0.0)
+ {
+ float3 _310 = cross(EmitterDynamicUniforms.EmitterDynamicUniforms_AxisLockRight.xyz, _265);
+ _331 = EmitterDynamicUniforms.EmitterDynamicUniforms_AxisLockRight.xyz;
+ _332 = -(_310 / float3(sqrt(fast::max(dot(_310, _310), 0.00999999977648258209228515625))));
+ }
+ else
+ {
+ float3 _329;
+ float3 _330;
+ if (EmitterUniforms.EmitterUniforms_TangentSelector.w > 0.0)
+ {
+ float3 _322 = cross(_265, float3(0.0, 0.0, 1.0));
+ float3 _327 = _322 / float3(sqrt(fast::max(dot(_322, _322), 0.00999999977648258209228515625)));
+ _329 = _327;
+ _330 = cross(_265, _327);
+ }
+ else
+ {
+ _329 = _251;
+ _330 = _259;
+ }
+ _331 = _329;
+ _332 = _330;
+ }
+ _333 = _331;
+ _334 = _332;
+ }
+ _335 = _333;
+ _336 = _334;
+ }
+ float _339 = ((_145.z + ((_145.w * EmitterUniforms.EmitterUniforms_RotationRateScale) * _146)) * 6.283185482025146484375) + EmitterUniforms.EmitterUniforms_RotationBias;
+ float3 _342 = float3(sin(_339));
+ float3 _344 = float3(cos(_339));
+ float4 _371 = float4(_239 + ((float3(_204.x * (in.in_var_ATTRIBUTE0.x + EmitterUniforms.EmitterUniforms_PivotOffset.x)) * ((_342 * _336) + (_344 * _335))) + (float3(_204.y * (in.in_var_ATTRIBUTE0.y + EmitterUniforms.EmitterUniforms_PivotOffset.y)) * ((_344 * _336) - (_342 * _335)))), 1.0);
+ float4 _375 = MobileShadowDepthPass.MobileShadowDepthPass_ProjectionMatrix * float4(_371.x, _371.y, _371.z, _371.w);
+ float4 _386;
+ if ((MobileShadowDepthPass.MobileShadowDepthPass_bClampToNearPlane > 0.0) && (_375.z < 0.0))
+ {
+ float4 _384 = _375;
+ _384.z = 9.9999999747524270787835121154785e-07;
+ float4 _385 = _384;
+ _385.w = 1.0;
+ _386 = _385;
+ }
+ else
+ {
+ _386 = _375;
+ }
+ float4 _396 = _386;
+ _396.z = ((_386.z * MobileShadowDepthPass.MobileShadowDepthPass_ShadowParams.y) + MobileShadowDepthPass.MobileShadowDepthPass_ShadowParams.x) * _386.w;
+ out.out_var_TEXCOORD6 = 0.0;
+ out.gl_Position = _396;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/asm/comp/bitcast_icmp.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/asm/comp/bitcast_icmp.asm.comp
new file mode 100644
index 00000000000..bed3b90a7b2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/asm/comp/bitcast_icmp.asm.comp
@@ -0,0 +1,27 @@
+#version 310 es
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+
+layout(binding = 0, std430) restrict buffer _3_5
+{
+ ivec4 _m0;
+ uvec4 _m1;
+} _5;
+
+layout(binding = 1, std430) restrict buffer _4_6
+{
+ uvec4 _m0;
+ ivec4 _m1;
+} _6;
+
+void main()
+{
+ _6._m0 = mix(uvec4(0u), uvec4(1u), lessThan(ivec4(_5._m1), _5._m0));
+ _6._m0 = mix(uvec4(0u), uvec4(1u), lessThanEqual(ivec4(_5._m1), _5._m0));
+ _6._m0 = mix(uvec4(0u), uvec4(1u), lessThan(_5._m1, uvec4(_5._m0)));
+ _6._m0 = mix(uvec4(0u), uvec4(1u), lessThanEqual(_5._m1, uvec4(_5._m0)));
+ _6._m0 = mix(uvec4(0u), uvec4(1u), greaterThan(ivec4(_5._m1), _5._m0));
+ _6._m0 = mix(uvec4(0u), uvec4(1u), greaterThanEqual(ivec4(_5._m1), _5._m0));
+ _6._m0 = mix(uvec4(0u), uvec4(1u), greaterThan(_5._m1, uvec4(_5._m0)));
+ _6._m0 = mix(uvec4(0u), uvec4(1u), greaterThanEqual(_5._m1, uvec4(_5._m0)));
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/asm/comp/phi-temporary-copy-loop-variable.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/asm/comp/phi-temporary-copy-loop-variable.asm.comp
index 4f8d2ffa720..f8650b5e5c2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/asm/comp/phi-temporary-copy-loop-variable.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/asm/comp/phi-temporary-copy-loop-variable.asm.comp
@@ -5,9 +5,9 @@ layout(binding = 1, rgba32f) uniform writeonly image2D outImageTexture;
void main()
{
+ int _27_copy;
int _30;
_30 = 7;
- int _27_copy;
for (int _27 = 7; _27 >= 0; _27_copy = _27, _27--, _30 = _27_copy)
{
if (5.0 > float(_27))
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/frag/struct-type-unrelated-alias.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/frag/struct-type-unrelated-alias.frag
new file mode 100644
index 00000000000..d6fa667f3b4
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/frag/struct-type-unrelated-alias.frag
@@ -0,0 +1,9 @@
+#version 450
+
+layout(location = 0) out float FragColor;
+
+void main()
+{
+ FragColor = 30.0;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/tese/load-array-of-array.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/tese/load-array-of-array.tese
new file mode 100644
index 00000000000..e4b426d0ad6
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/opt/shaders/tese/load-array-of-array.tese
@@ -0,0 +1,10 @@
+#version 450
+layout(quads, ccw, equal_spacing) in;
+
+layout(location = 0) in vec4 vTexCoord[][1];
+
+void main()
+{
+ gl_Position = (vTexCoord[0u][0] + vTexCoord[2u][0]) + vTexCoord[3u][0];
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp
new file mode 100644
index 00000000000..dd29c5a4973
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp
@@ -0,0 +1,27 @@
+struct T
+{
+ float c;
+};
+
+struct T_1
+{
+ float b;
+};
+
+static const T _18 = { 40.0f };
+
+RWByteAddressBuffer _7 : register(u0);
+RWByteAddressBuffer _10 : register(u1);
+
+void comp_main()
+{
+ T v = _18;
+ _7.Store(40, asuint(v.c));
+ _10.Store(480, asuint(v.c));
+}
+
+[numthreads(1, 1, 1)]
+void main()
+{
+ comp_main();
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/frag/empty-struct-in-struct.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/frag/empty-struct-in-struct.asm.frag
new file mode 100644
index 00000000000..e7ffd8d6069
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/frag/empty-struct-in-struct.asm.frag
@@ -0,0 +1,37 @@
+struct EmptyStructTest
+{
+ int empty_struct_member;
+};
+
+struct EmptyStruct2Test
+{
+ EmptyStructTest _m0;
+};
+
+static const EmptyStructTest _30 = { 0 };
+static const EmptyStruct2Test _20 = { { 0 } };
+
+float GetValue(EmptyStruct2Test self)
+{
+ return 0.0f;
+}
+
+float GetValue_1(EmptyStruct2Test self)
+{
+ return 0.0f;
+}
+
+void frag_main()
+{
+ EmptyStructTest _25 = { 0 };
+ EmptyStruct2Test _26 = { _25 };
+ EmptyStruct2Test emptyStruct;
+ float value = GetValue(emptyStruct);
+ value = GetValue_1(_26);
+ value = GetValue_1(_20);
+}
+
+void main()
+{
+ frag_main();
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/frag/unordered-compare.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/frag/unordered-compare.asm.frag
new file mode 100644
index 00000000000..1143ade7165
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/frag/unordered-compare.asm.frag
@@ -0,0 +1,51 @@
+static float4 A;
+static float4 B;
+static float4 FragColor;
+
+struct SPIRV_Cross_Input
+{
+ float4 A : TEXCOORD0;
+ float4 B : TEXCOORD1;
+};
+
+struct SPIRV_Cross_Output
+{
+ float4 FragColor : SV_Target0;
+};
+
+float4 test_vector()
+{
+ bool4 le = bool4(!(A.x >= B.x), !(A.y >= B.y), !(A.z >= B.z), !(A.w >= B.w));
+ bool4 leq = bool4(!(A.x > B.x), !(A.y > B.y), !(A.z > B.z), !(A.w > B.w));
+ bool4 ge = bool4(!(A.x <= B.x), !(A.y <= B.y), !(A.z <= B.z), !(A.w <= B.w));
+ bool4 geq = bool4(!(A.x < B.x), !(A.y < B.y), !(A.z < B.z), !(A.w < B.w));
+ bool4 eq = bool4(A.x == B.x, A.y == B.y, A.z == B.z, A.w == B.w);
+ bool4 neq = bool4(A.x != B.x, A.y != B.y, A.z != B.z, A.w != B.w);
+ return ((((float4(le.x ? 1.0f.xxxx.x : 0.0f.xxxx.x, le.y ? 1.0f.xxxx.y : 0.0f.xxxx.y, le.z ? 1.0f.xxxx.z : 0.0f.xxxx.z, le.w ? 1.0f.xxxx.w : 0.0f.xxxx.w) + float4(leq.x ? 1.0f.xxxx.x : 0.0f.xxxx.x, leq.y ? 1.0f.xxxx.y : 0.0f.xxxx.y, leq.z ? 1.0f.xxxx.z : 0.0f.xxxx.z, leq.w ? 1.0f.xxxx.w : 0.0f.xxxx.w)) + float4(ge.x ? 1.0f.xxxx.x : 0.0f.xxxx.x, ge.y ? 1.0f.xxxx.y : 0.0f.xxxx.y, ge.z ? 1.0f.xxxx.z : 0.0f.xxxx.z, ge.w ? 1.0f.xxxx.w : 0.0f.xxxx.w)) + float4(geq.x ? 1.0f.xxxx.x : 0.0f.xxxx.x, geq.y ? 1.0f.xxxx.y : 0.0f.xxxx.y, geq.z ? 1.0f.xxxx.z : 0.0f.xxxx.z, geq.w ? 1.0f.xxxx.w : 0.0f.xxxx.w)) + float4(eq.x ? 1.0f.xxxx.x : 0.0f.xxxx.x, eq.y ? 1.0f.xxxx.y : 0.0f.xxxx.y, eq.z ? 1.0f.xxxx.z : 0.0f.xxxx.z, eq.w ? 1.0f.xxxx.w : 0.0f.xxxx.w)) + float4(neq.x ? 1.0f.xxxx.x : 0.0f.xxxx.x, neq.y ? 1.0f.xxxx.y : 0.0f.xxxx.y, neq.z ? 1.0f.xxxx.z : 0.0f.xxxx.z, neq.w ? 1.0f.xxxx.w : 0.0f.xxxx.w);
+}
+
+float test_scalar()
+{
+ bool le = !(A.x >= B.x);
+ bool leq = !(A.x > B.x);
+ bool ge = !(A.x <= B.x);
+ bool geq = !(A.x < B.x);
+ bool eq = A.x == B.x;
+ bool neq = A.x != B.x;
+ return ((((float(le) + float(leq)) + float(ge)) + float(geq)) + float(eq)) + float(neq);
+}
+
+void frag_main()
+{
+ FragColor = test_vector() + test_scalar().xxxx;
+}
+
+SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
+{
+ A = stage_input.A;
+ B = stage_input.B;
+ frag_main();
+ SPIRV_Cross_Output stage_output;
+ stage_output.FragColor = FragColor;
+ return stage_output;
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl/asm/comp/bitcast_icmp.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl/asm/comp/bitcast_icmp.asm.comp
new file mode 100644
index 00000000000..35143a486ec
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-hlsl/asm/comp/bitcast_icmp.asm.comp
@@ -0,0 +1,28 @@
+RWByteAddressBuffer _5 : register(u0);
+RWByteAddressBuffer _6 : register(u1);
+
+void comp_main()
+{
+ bool4 _31 = bool4(int(_5.Load4(16).x) < int4(_5.Load4(0)).x, int(_5.Load4(16).y) < int4(_5.Load4(0)).y, int(_5.Load4(16).z) < int4(_5.Load4(0)).z, int(_5.Load4(16).w) < int4(_5.Load4(0)).w);
+ bool4 _32 = bool4(int(_5.Load4(16).x) <= int4(_5.Load4(0)).x, int(_5.Load4(16).y) <= int4(_5.Load4(0)).y, int(_5.Load4(16).z) <= int4(_5.Load4(0)).z, int(_5.Load4(16).w) <= int4(_5.Load4(0)).w);
+ bool4 _33 = bool4(_5.Load4(16).x < uint(int4(_5.Load4(0)).x), _5.Load4(16).y < uint(int4(_5.Load4(0)).y), _5.Load4(16).z < uint(int4(_5.Load4(0)).z), _5.Load4(16).w < uint(int4(_5.Load4(0)).w));
+ bool4 _34 = bool4(_5.Load4(16).x <= uint(int4(_5.Load4(0)).x), _5.Load4(16).y <= uint(int4(_5.Load4(0)).y), _5.Load4(16).z <= uint(int4(_5.Load4(0)).z), _5.Load4(16).w <= uint(int4(_5.Load4(0)).w));
+ bool4 _35 = bool4(int(_5.Load4(16).x) > int4(_5.Load4(0)).x, int(_5.Load4(16).y) > int4(_5.Load4(0)).y, int(_5.Load4(16).z) > int4(_5.Load4(0)).z, int(_5.Load4(16).w) > int4(_5.Load4(0)).w);
+ bool4 _36 = bool4(int(_5.Load4(16).x) >= int4(_5.Load4(0)).x, int(_5.Load4(16).y) >= int4(_5.Load4(0)).y, int(_5.Load4(16).z) >= int4(_5.Load4(0)).z, int(_5.Load4(16).w) >= int4(_5.Load4(0)).w);
+ bool4 _37 = bool4(_5.Load4(16).x > uint(int4(_5.Load4(0)).x), _5.Load4(16).y > uint(int4(_5.Load4(0)).y), _5.Load4(16).z > uint(int4(_5.Load4(0)).z), _5.Load4(16).w > uint(int4(_5.Load4(0)).w));
+ bool4 _38 = bool4(_5.Load4(16).x >= uint(int4(_5.Load4(0)).x), _5.Load4(16).y >= uint(int4(_5.Load4(0)).y), _5.Load4(16).z >= uint(int4(_5.Load4(0)).z), _5.Load4(16).w >= uint(int4(_5.Load4(0)).w));
+ _6.Store4(0, uint4(_31.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _31.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _31.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _31.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+ _6.Store4(0, uint4(_32.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _32.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _32.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _32.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+ _6.Store4(0, uint4(_33.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _33.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _33.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _33.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+ _6.Store4(0, uint4(_34.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _34.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _34.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _34.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+ _6.Store4(0, uint4(_35.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _35.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _35.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _35.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+ _6.Store4(0, uint4(_36.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _36.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _36.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _36.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+ _6.Store4(0, uint4(_37.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _37.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _37.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _37.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+ _6.Store4(0, uint4(_38.x ? uint4(1u, 1u, 1u, 1u).x : uint4(0u, 0u, 0u, 0u).x, _38.y ? uint4(1u, 1u, 1u, 1u).y : uint4(0u, 0u, 0u, 0u).y, _38.z ? uint4(1u, 1u, 1u, 1u).z : uint4(0u, 0u, 0u, 0u).z, _38.w ? uint4(1u, 1u, 1u, 1u).w : uint4(0u, 0u, 0u, 0u).w));
+}
+
+[numthreads(1, 1, 1)]
+void main()
+{
+ comp_main();
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp
new file mode 100644
index 00000000000..d24b9666fab
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp
@@ -0,0 +1,38 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct T
+{
+ float a;
+};
+
+struct T_1
+{
+ float b;
+};
+
+struct SSBO1
+{
+ T_1 foo[1];
+};
+
+struct T_2
+{
+ float c;
+ char _m0_final_padding[12];
+};
+
+struct SSBO2
+{
+ T_2 bar[1];
+};
+
+kernel void main0(device SSBO1& _7 [[buffer(0)]], device SSBO2& _10 [[buffer(1)]])
+{
+ T v = T{ 40.0 };
+ _7.foo[10].b = v.a;
+ _10.bar[30].c = v.a;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/storage-buffer-pointer-argument.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/storage-buffer-pointer-argument.asm.comp
index eee35d297a1..6e9768540b7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/storage-buffer-pointer-argument.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/storage-buffer-pointer-argument.asm.comp
@@ -15,7 +15,8 @@ struct SSBORead
float b;
};
-inline void copy_out(device float& A, device const float& B)
+static inline __attribute__((always_inline))
+void copy_out(device float& A, device const float& B)
{
A = B;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/variable-pointers.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/variable-pointers.asm.comp
index a42eca2b377..7c9718d1c95 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/variable-pointers.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/variable-pointers.asm.comp
@@ -22,17 +22,20 @@ struct baz
int e[128];
};
-inline device int* select_buffer(device foo& buf, device baz& buf2, constant bar& cb)
+static inline __attribute__((always_inline))
+device int* select_buffer(device foo& buf, device baz& buf2, constant bar& cb)
{
return (cb.d != 0) ? &buf.a[0u] : &buf2.e[0u];
}
-inline device int* select_buffer_null(device foo& buf, constant bar& cb)
+static inline __attribute__((always_inline))
+device int* select_buffer_null(device foo& buf, constant bar& cb)
{
return (cb.d != 0) ? &buf.a[0u] : nullptr;
}
-inline threadgroup int* select_tgsm(constant bar& cb, threadgroup int (&tgsm)[128])
+static inline __attribute__((always_inline))
+threadgroup int* select_tgsm(constant bar& cb, threadgroup int (&tgsm)[128])
{
return (cb.d != 0) ? &tgsm[0u] : nullptr;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/empty-struct-in-struct.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/empty-struct-in-struct.asm.frag
new file mode 100644
index 00000000000..fdf4a92b993
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/empty-struct-in-struct.asm.frag
@@ -0,0 +1,35 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct EmptyStructTest
+{
+};
+struct EmptyStruct2Test
+{
+ EmptyStructTest _m0;
+};
+
+static inline __attribute__((always_inline))
+float GetValue(thread const EmptyStruct2Test& self)
+{
+ return 0.0;
+}
+
+static inline __attribute__((always_inline))
+float GetValue_1(EmptyStruct2Test self)
+{
+ return 0.0;
+}
+
+fragment void main0()
+{
+ EmptyStruct2Test emptyStruct;
+ float value = GetValue(emptyStruct);
+ value = GetValue_1(EmptyStruct2Test{ EmptyStructTest{ } });
+ value = GetValue_1(EmptyStruct2Test{ { } });
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag
deleted file mode 100644
index 168129ae810..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag
+++ /dev/null
@@ -1,235 +0,0 @@
-#include <metal_stdlib>
-#include <simd/simd.h>
-
-using namespace metal;
-
-struct VertexOutput
-{
- float4 HPosition;
- float4 Uv_EdgeDistance1;
- float4 UvStuds_EdgeDistance2;
- float4 Color;
- float4 LightPosition_Fog;
- float4 View_Depth;
- float4 Normal_SpecPower;
- float3 Tangent;
- float4 PosLightSpace_Reflectance;
- float studIndex;
-};
-
-struct Surface
-{
- float3 albedo;
- float3 normal;
- float specular;
- float gloss;
- float reflectance;
- float opacity;
-};
-
-struct SurfaceInput
-{
- float4 Color;
- float2 Uv;
- float2 UvStuds;
-};
-
-struct Globals
-{
- float4x4 ViewProjection;
- float4 ViewRight;
- float4 ViewUp;
- float4 ViewDir;
- float3 CameraPosition;
- float3 AmbientColor;
- float3 Lamp0Color;
- float3 Lamp0Dir;
- float3 Lamp1Color;
- float4 FogParams;
- float3 FogColor;
- float4 LightBorder;
- float4 LightConfig0;
- float4 LightConfig1;
- float4 LightConfig2;
- float4 LightConfig3;
- float4 RefractionBias_FadeDistance_GlowFactor;
- float4 OutlineBrightness_ShadowInfo;
- float4 ShadowMatrix0;
- float4 ShadowMatrix1;
- float4 ShadowMatrix2;
-};
-
-struct CB0
-{
- Globals CB0;
-};
-
-struct Params
-{
- float4 LqmatFarTilingFactor;
-};
-
-struct CB2
-{
- Params CB2;
-};
-
-constant VertexOutput _121 = {};
-constant SurfaceInput _122 = {};
-constant float2 _123 = {};
-constant float4 _124 = {};
-constant Surface _125 = {};
-constant float4 _192 = {};
-constant float4 _219 = {};
-constant float4 _297 = {};
-
-struct main0_out
-{
- float4 _entryPointOutput [[color(0)]];
-};
-
-struct main0_in
-{
- float4 IN_Uv_EdgeDistance1 [[user(locn0)]];
- float4 IN_UvStuds_EdgeDistance2 [[user(locn1)]];
- float4 IN_Color [[user(locn2)]];
- float4 IN_LightPosition_Fog [[user(locn3)]];
- float4 IN_View_Depth [[user(locn4)]];
- float4 IN_Normal_SpecPower [[user(locn5)]];
- float3 IN_Tangent [[user(locn6)]];
- float4 IN_PosLightSpace_Reflectance [[user(locn7)]];
- float IN_studIndex [[user(locn8)]];
-};
-
-fragment main0_out main0(main0_in in [[stage_in]], constant CB0& _19 [[buffer(0)]], texture3d<float> LightMapTexture [[texture(0)]], texture2d<float> ShadowMapTexture [[texture(1)]], texturecube<float> EnvironmentMapTexture [[texture(2)]], texture2d<float> DiffuseMapTexture [[texture(3)]], texture2d<float> NormalMapTexture [[texture(4)]], texture2d<float> NormalDetailMapTexture [[texture(5)]], texture2d<float> StudsMapTexture [[texture(6)]], texture2d<float> SpecularMapTexture [[texture(7)]], sampler LightMapSampler [[sampler(0)]], sampler ShadowMapSampler [[sampler(1)]], sampler EnvironmentMapSampler [[sampler(2)]], sampler DiffuseMapSampler [[sampler(3)]], sampler NormalMapSampler [[sampler(4)]], sampler NormalDetailMapSampler [[sampler(5)]], sampler StudsMapSampler [[sampler(6)]], sampler SpecularMapSampler [[sampler(7)]], float4 gl_FragCoord [[position]])
-{
- main0_out out = {};
- VertexOutput _128 = _121;
- _128.HPosition = gl_FragCoord;
- VertexOutput _130 = _128;
- _130.Uv_EdgeDistance1 = in.IN_Uv_EdgeDistance1;
- VertexOutput _132 = _130;
- _132.UvStuds_EdgeDistance2 = in.IN_UvStuds_EdgeDistance2;
- VertexOutput _134 = _132;
- _134.Color = in.IN_Color;
- VertexOutput _136 = _134;
- _136.LightPosition_Fog = in.IN_LightPosition_Fog;
- VertexOutput _138 = _136;
- _138.View_Depth = in.IN_View_Depth;
- VertexOutput _140 = _138;
- _140.Normal_SpecPower = in.IN_Normal_SpecPower;
- VertexOutput _142 = _140;
- _142.Tangent = in.IN_Tangent;
- VertexOutput _144 = _142;
- _144.PosLightSpace_Reflectance = in.IN_PosLightSpace_Reflectance;
- VertexOutput _146 = _144;
- _146.studIndex = in.IN_studIndex;
- SurfaceInput _147 = _122;
- _147.Color = in.IN_Color;
- SurfaceInput _149 = _147;
- _149.Uv = in.IN_Uv_EdgeDistance1.xy;
- SurfaceInput _151 = _149;
- _151.UvStuds = in.IN_UvStuds_EdgeDistance2.xy;
- SurfaceInput _156 = _151;
- _156.UvStuds.y = (fract(_151.UvStuds.y) + in.IN_studIndex) * 0.25;
- float _163 = _146.View_Depth.w * _19.CB0.RefractionBias_FadeDistance_GlowFactor.y;
- float _165 = fast::clamp(1.0 - _163, 0.0, 1.0);
- float2 _166 = in.IN_Uv_EdgeDistance1.xy * 1.0;
- bool _173;
- float4 _193;
- for (;;)
- {
- _173 = 0.0 == 0.0;
- if (_173)
- {
- _193 = DiffuseMapTexture.sample(DiffuseMapSampler, _166);
- break;
- }
- else
- {
- float _180 = 1.0 / (1.0 - 0.0);
- _193 = mix(DiffuseMapTexture.sample(DiffuseMapSampler, (_166 * 0.25)), DiffuseMapTexture.sample(DiffuseMapSampler, _166), float4(fast::clamp((fast::clamp(1.0 - (_146.View_Depth.w * 0.00333332992158830165863037109375), 0.0, 1.0) * _180) - (0.0 * _180), 0.0, 1.0)));
- break;
- }
- _193 = _192;
- break;
- }
- float4 _220;
- for (;;)
- {
- if (_173)
- {
- _220 = NormalMapTexture.sample(NormalMapSampler, _166);
- break;
- }
- else
- {
- float _207 = 1.0 / (1.0 - 0.0);
- _220 = mix(NormalMapTexture.sample(NormalMapSampler, (_166 * 0.25)), NormalMapTexture.sample(NormalMapSampler, _166), float4(fast::clamp((_165 * _207) - (0.0 * _207), 0.0, 1.0)));
- break;
- }
- _220 = _219;
- break;
- }
- float2 _223 = float2(1.0);
- float2 _224 = (_220.wy * 2.0) - _223;
- float3 _232 = float3(_224, sqrt(fast::clamp(1.0 + dot(-_224, _224), 0.0, 1.0)));
- float2 _240 = (NormalDetailMapTexture.sample(NormalDetailMapSampler, (_166 * 0.0)).wy * 2.0) - _223;
- float2 _252 = _232.xy + (float3(_240, sqrt(fast::clamp(1.0 + dot(-_240, _240), 0.0, 1.0))).xy * 0.0);
- float3 _253 = float3(_252.x, _252.y, _232.z);
- float2 _255 = _253.xy * _165;
- float3 _256 = float3(_255.x, _255.y, _253.z);
- float3 _271 = ((in.IN_Color.xyz * (_193 * 1.0).xyz) * (1.0 + (_256.x * 0.300000011920928955078125))) * (StudsMapTexture.sample(StudsMapSampler, _156.UvStuds).x * 2.0);
- float4 _298;
- for (;;)
- {
- if (0.75 == 0.0)
- {
- _298 = SpecularMapTexture.sample(SpecularMapSampler, _166);
- break;
- }
- else
- {
- float _285 = 1.0 / (1.0 - 0.75);
- _298 = mix(SpecularMapTexture.sample(SpecularMapSampler, (_166 * 0.25)), SpecularMapTexture.sample(SpecularMapSampler, _166), float4(fast::clamp((_165 * _285) - (0.75 * _285), 0.0, 1.0)));
- break;
- }
- _298 = _297;
- break;
- }
- float2 _303 = mix(float2(0.800000011920928955078125, 120.0), (_298.xy * float2(2.0, 256.0)) + float2(0.0, 0.00999999977648258209228515625), float2(_165));
- Surface _304 = _125;
- _304.albedo = _271;
- Surface _305 = _304;
- _305.normal = _256;
- float _306 = _303.x;
- Surface _307 = _305;
- _307.specular = _306;
- float _308 = _303.y;
- Surface _309 = _307;
- _309.gloss = _308;
- float _312 = (_298.xy.y * _165) * 0.0;
- Surface _313 = _309;
- _313.reflectance = _312;
- float4 _318 = float4(_271, _146.Color.w);
- float3 _329 = normalize(((in.IN_Tangent * _313.normal.x) + (cross(in.IN_Normal_SpecPower.xyz, in.IN_Tangent) * _313.normal.y)) + (in.IN_Normal_SpecPower.xyz * _313.normal.z));
- float3 _332 = -_19.CB0.Lamp0Dir;
- float _333 = dot(_329, _332);
- float _357 = fast::clamp(dot(step(_19.CB0.LightConfig3.xyz, abs(in.IN_LightPosition_Fog.xyz - _19.CB0.LightConfig2.xyz)), float3(1.0)), 0.0, 1.0);
- float4 _368 = mix(LightMapTexture.sample(LightMapSampler, (in.IN_LightPosition_Fog.xyz.yzx - (in.IN_LightPosition_Fog.xyz.yzx * _357))), _19.CB0.LightBorder, float4(_357));
- float2 _376 = ShadowMapTexture.sample(ShadowMapSampler, in.IN_PosLightSpace_Reflectance.xyz.xy).xy;
- float _392 = (1.0 - (((step(_376.x, in.IN_PosLightSpace_Reflectance.xyz.z) * fast::clamp(9.0 - (20.0 * abs(in.IN_PosLightSpace_Reflectance.xyz.z - 0.5)), 0.0, 1.0)) * _376.y) * _19.CB0.OutlineBrightness_ShadowInfo.w)) * _368.w;
- float3 _403 = mix(_318.xyz, EnvironmentMapTexture.sample(EnvironmentMapSampler, reflect(-in.IN_View_Depth.xyz, _329)).xyz, float3(_312));
- float4 _404 = float4(_403.x, _403.y, _403.z, _318.w);
- float3 _422 = (((_19.CB0.AmbientColor + (((_19.CB0.Lamp0Color * fast::clamp(_333, 0.0, 1.0)) + (_19.CB0.Lamp1Color * fast::max(-_333, 0.0))) * _392)) + _368.xyz) * _404.xyz) + (_19.CB0.Lamp0Color * (((step(0.0, _333) * _306) * _392) * pow(fast::clamp(dot(_329, normalize(_332 + normalize(in.IN_View_Depth.xyz))), 0.0, 1.0), _308)));
- float4 _425 = float4(_422.x, _422.y, _422.z, _124.w);
- _425.w = _404.w;
- float2 _435 = fast::min(in.IN_Uv_EdgeDistance1.wz, in.IN_UvStuds_EdgeDistance2.wz);
- float _439 = fast::min(_435.x, _435.y) / _163;
- float3 _445 = _425.xyz * fast::clamp((fast::clamp((_163 * _19.CB0.OutlineBrightness_ShadowInfo.x) + _19.CB0.OutlineBrightness_ShadowInfo.y, 0.0, 1.0) * (1.5 - _439)) + _439, 0.0, 1.0);
- float4 _446 = float4(_445.x, _445.y, _445.z, _425.w);
- float3 _453 = mix(_19.CB0.FogColor, _446.xyz, float3(fast::clamp(_146.LightPosition_Fog.w, 0.0, 1.0)));
- out._entryPointOutput = float4(_453.x, _453.y, _453.z, _446.w);
- return out;
-}
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-callstack.msl2.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-callstack.msl2.asm.frag
index 1b6af2a36a0..8ceb9f43e72 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-callstack.msl2.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-callstack.msl2.asm.frag
@@ -15,13 +15,15 @@ struct SSBO0
uint values0[1];
};
-inline void callee2(thread float4& gl_FragCoord, device SSBO1& v_7)
+static inline __attribute__((always_inline))
+void callee2(thread float4& gl_FragCoord, device SSBO1& v_7)
{
int _31 = int(gl_FragCoord.x);
v_7.values1[_31]++;
}
-inline void callee(thread float4& gl_FragCoord, device SSBO1& v_7, device SSBO0& v_9)
+static inline __attribute__((always_inline))
+void callee(thread float4& gl_FragCoord, device SSBO1& v_7, device SSBO0& v_9)
{
int _39 = int(gl_FragCoord.x);
v_9.values0[_39]++;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-control-flow.msl2.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-control-flow.msl2.asm.frag
index dded6a145f5..a3823163914 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-control-flow.msl2.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-control-flow.msl2.asm.frag
@@ -20,13 +20,15 @@ struct SSBO0
uint values0[1];
};
-inline void callee2(thread float4& gl_FragCoord, device SSBO1& v_7)
+static inline __attribute__((always_inline))
+void callee2(thread float4& gl_FragCoord, device SSBO1& v_7)
{
int _44 = int(gl_FragCoord.x);
v_7.values1[_44]++;
}
-inline void callee(thread float4& gl_FragCoord, device SSBO1& v_7, device SSBO0& v_9)
+static inline __attribute__((always_inline))
+void callee(thread float4& gl_FragCoord, device SSBO1& v_7, device SSBO0& v_9)
{
int _52 = int(gl_FragCoord.x);
v_9.values0[_52]++;
@@ -36,7 +38,8 @@ inline void callee(thread float4& gl_FragCoord, device SSBO1& v_7, device SSBO0&
}
}
-inline void _35(thread float4& gl_FragCoord, device _12& v_13)
+static inline __attribute__((always_inline))
+void _35(thread float4& gl_FragCoord, device _12& v_13)
{
v_13._m0[int(gl_FragCoord.x)] = 4u;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-split-functions.msl2.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-split-functions.msl2.asm.frag
index 5fe65f3b03c..beb21241f4e 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-split-functions.msl2.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/pixel-interlock-split-functions.msl2.asm.frag
@@ -15,24 +15,28 @@ struct SSBO0
uint values0[1];
};
-inline void callee2(thread float4& gl_FragCoord, device SSBO1& v_7)
+static inline __attribute__((always_inline))
+void callee2(thread float4& gl_FragCoord, device SSBO1& v_7)
{
int _37 = int(gl_FragCoord.x);
v_7.values1[_37]++;
}
-inline void callee(thread float4& gl_FragCoord, device SSBO1& v_7, device SSBO0& v_9)
+static inline __attribute__((always_inline))
+void callee(thread float4& gl_FragCoord, device SSBO1& v_7, device SSBO0& v_9)
{
int _45 = int(gl_FragCoord.x);
v_9.values0[_45]++;
callee2(gl_FragCoord, v_7);
}
-inline void _29()
+static inline __attribute__((always_inline))
+void _29()
{
}
-inline void _31()
+static inline __attribute__((always_inline))
+void _31()
{
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/texture-access.swizzle.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/texture-access.swizzle.asm.frag
index 78b33afde13..9d71a91e430 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/texture-access.swizzle.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/frag/texture-access.swizzle.asm.frag
@@ -6,7 +6,8 @@
using namespace metal;
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/vert/empty-struct-composite.asm.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/vert/empty-struct-composite.asm.vert
index e9cd6a540aa..95b61a40dbe 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/vert/empty-struct-composite.asm.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/vert/empty-struct-composite.asm.vert
@@ -5,12 +5,9 @@ using namespace metal;
struct Test
{
- int empty_struct_member;
};
-
vertex void main0()
{
- Test _14 = Test{ 0 };
- Test t = _14;
+ Test t = Test{ };
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/vert/op-load-forced-temporary-array.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/vert/op-load-forced-temporary-array.asm.frag
index 47e4fe71600..18d98993e5f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/vert/op-load-forced-temporary-array.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/vert/op-load-forced-temporary-array.asm.frag
@@ -1,8 +1,49 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
constant float _21 = {};
struct main0_out
@@ -13,7 +54,7 @@ struct main0_out
vertex main0_out main0()
{
main0_out out = {};
- float _23[2];
+ spvUnsafeArray<float, 2> _23;
for (int _25 = 0; _25 < 2; )
{
_23[_25] = 0.0;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/array-copy-threadgroup-memory.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/array-copy-threadgroup-memory.comp
index 85a06afaa21..24ae08e7bb0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/array-copy-threadgroup-memory.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/array-copy-threadgroup-memory.comp
@@ -1,10 +1,49 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(8u, 1u, 1u);
template<typename T, uint A>
@@ -65,15 +104,15 @@ kernel void main0(uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]])
{
threadgroup float shared_group[8][8];
threadgroup float shared_group_alt[8][8];
- float blob[8];
+ spvUnsafeArray<float, 8> blob;
for (int i = 0; i < 8; i++)
{
blob[i] = float(i);
}
- spvArrayCopyFromStackToThreadGroup1(shared_group[gl_LocalInvocationIndex], blob);
+ spvArrayCopyFromStackToThreadGroup1(shared_group[gl_LocalInvocationIndex], blob.elements);
threadgroup_barrier(mem_flags::mem_threadgroup);
- float copied_blob[8];
- spvArrayCopyFromThreadGroupToStack1(copied_blob, shared_group[gl_LocalInvocationIndex ^ 1u]);
+ spvUnsafeArray<float, 8> copied_blob;
+ spvArrayCopyFromThreadGroupToStack1(copied_blob.elements, shared_group[gl_LocalInvocationIndex ^ 1u]);
spvArrayCopyFromThreadGroupToThreadGroup1(shared_group_alt[gl_LocalInvocationIndex], shared_group[gl_LocalInvocationIndex]);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/glsl.std450.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/glsl.std450.comp
index 83ac061a706..e357c64c8d9 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/glsl.std450.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/glsl.std450.comp
@@ -70,20 +70,23 @@ inline T sign(T x)
}
// Returns the determinant of a 2x2 matrix.
-inline float spvDet2x2(float a1, float a2, float b1, float b2)
+static inline __attribute__((always_inline))
+float spvDet2x2(float a1, float a2, float b1, float b2)
{
return a1 * b2 - b1 * a2;
}
// Returns the determinant of a 3x3 matrix.
-inline float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
+static inline __attribute__((always_inline))
+float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
{
return a1 * spvDet2x2(b2, b3, c2, c3) - b1 * spvDet2x2(a2, a3, c2, c3) + c1 * spvDet2x2(a2, a3, b2, b3);
}
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
// adjoint and dividing by the determinant. The contents of the matrix are changed.
-inline float4x4 spvInverse4x4(float4x4 m)
+static inline __attribute__((always_inline))
+float4x4 spvInverse4x4(float4x4 m)
{
float4x4 adj; // The adjoint matrix (inverse after dividing by determinant)
@@ -118,7 +121,8 @@ inline float4x4 spvInverse4x4(float4x4 m)
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
// adjoint and dividing by the determinant. The contents of the matrix are changed.
-inline float3x3 spvInverse3x3(float3x3 m)
+static inline __attribute__((always_inline))
+float3x3 spvInverse3x3(float3x3 m)
{
float3x3 adj; // The adjoint matrix (inverse after dividing by determinant)
@@ -145,7 +149,8 @@ inline float3x3 spvInverse3x3(float3x3 m)
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
// adjoint and dividing by the determinant. The contents of the matrix are changed.
-inline float2x2 spvInverse2x2(float2x2 m)
+static inline __attribute__((always_inline))
+float2x2 spvInverse2x2(float2x2 m)
{
float2x2 adj; // The adjoint matrix (inverse after dividing by determinant)
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/std140-array-load-composite-construct.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/std140-array-load-composite-construct.comp
new file mode 100644
index 00000000000..ba278ccde76
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/std140-array-load-composite-construct.comp
@@ -0,0 +1,18 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct SSBO
+{
+ float4 a[16];
+ float4 b[16];
+};
+
+constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
+
+kernel void main0(device SSBO& _14 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
+{
+ _14.b[gl_GlobalInvocationID.x] = float4(_14.a[gl_GlobalInvocationID.x].x);
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/pixel-interlock-simple-callstack.msl2.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/pixel-interlock-simple-callstack.msl2.frag
index 716ba251f5e..cb01950d221 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/pixel-interlock-simple-callstack.msl2.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/pixel-interlock-simple-callstack.msl2.frag
@@ -15,13 +15,15 @@ struct SSBO0
uint values0[1];
};
-inline void callee2(device SSBO1& v_14, thread float4& gl_FragCoord)
+static inline __attribute__((always_inline))
+void callee2(device SSBO1& v_14, thread float4& gl_FragCoord)
{
int _25 = int(gl_FragCoord.x);
v_14.values1[_25]++;
}
-inline void callee(device SSBO1& v_14, thread float4& gl_FragCoord, device SSBO0& v_35)
+static inline __attribute__((always_inline))
+void callee(device SSBO1& v_14, thread float4& gl_FragCoord, device SSBO0& v_35)
{
int _38 = int(gl_FragCoord.x);
v_35.values0[_38]++;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-int.swizzle.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-int.swizzle.frag
index d1c52aef4a3..ff4b8a91943 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-int.swizzle.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-int.swizzle.frag
@@ -6,7 +6,8 @@
using namespace metal;
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-leaf.swizzle.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-leaf.swizzle.frag
index 4666702b4f7..730728c1aac 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-leaf.swizzle.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-leaf.swizzle.frag
@@ -6,7 +6,8 @@
using namespace metal;
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
@@ -131,7 +132,8 @@ inline vec<T, 4> spvGatherCompareSwizzle(const thread Tex<T>& t, sampler s, uint
return t.gather_compare(s, spvForward<Ts>(params)...);
}
-inline float4 doSwizzle(thread texture1d<float> tex1d, thread const sampler tex1dSmplr, constant uint& tex1dSwzl, thread texture2d<float> tex2d, thread const sampler tex2dSmplr, constant uint& tex2dSwzl, thread texture3d<float> tex3d, thread const sampler tex3dSmplr, constant uint& tex3dSwzl, thread texturecube<float> texCube, thread const sampler texCubeSmplr, constant uint& texCubeSwzl, thread texture2d_array<float> tex2dArray, thread const sampler tex2dArraySmplr, constant uint& tex2dArraySwzl, thread texturecube_array<float> texCubeArray, thread const sampler texCubeArraySmplr, constant uint& texCubeArraySwzl, thread depth2d<float> depth2d, thread const sampler depth2dSmplr, constant uint& depth2dSwzl, thread depthcube<float> depthCube, thread const sampler depthCubeSmplr, constant uint& depthCubeSwzl, thread depth2d_array<float> depth2dArray, thread const sampler depth2dArraySmplr, constant uint& depth2dArraySwzl, thread depthcube_array<float> depthCubeArray, thread const sampler depthCubeArraySmplr, constant uint& depthCubeArraySwzl, thread texture2d<float> texBuffer)
+static inline __attribute__((always_inline))
+float4 doSwizzle(thread texture1d<float> tex1d, thread const sampler tex1dSmplr, constant uint& tex1dSwzl, thread texture2d<float> tex2d, thread const sampler tex2dSmplr, constant uint& tex2dSwzl, thread texture3d<float> tex3d, thread const sampler tex3dSmplr, constant uint& tex3dSwzl, thread texturecube<float> texCube, thread const sampler texCubeSmplr, constant uint& texCubeSwzl, thread texture2d_array<float> tex2dArray, thread const sampler tex2dArraySmplr, constant uint& tex2dArraySwzl, thread texturecube_array<float> texCubeArray, thread const sampler texCubeArraySmplr, constant uint& texCubeArraySwzl, thread depth2d<float> depth2d, thread const sampler depth2dSmplr, constant uint& depth2dSwzl, thread depthcube<float> depthCube, thread const sampler depthCubeSmplr, constant uint& depthCubeSwzl, thread depth2d_array<float> depth2dArray, thread const sampler depth2dArraySmplr, constant uint& depth2dArraySwzl, thread depthcube_array<float> depthCubeArray, thread const sampler depthCubeArraySmplr, constant uint& depthCubeArraySwzl, thread texture2d<float> texBuffer)
{
float4 c = spvTextureSwizzle(tex1d.sample(tex1dSmplr, 0.0), tex1dSwzl);
c = spvTextureSwizzle(tex2d.sample(tex2dSmplr, float2(0.0)), tex2dSwzl);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-uint.swizzle.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-uint.swizzle.frag
index 1063b8ab3bd..0ec278f977c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-uint.swizzle.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access-uint.swizzle.frag
@@ -6,7 +6,8 @@
using namespace metal;
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access.swizzle.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access.swizzle.frag
index 389b3a68a6d..c31d5d7dca0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access.swizzle.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/frag/texture-access.swizzle.frag
@@ -6,7 +6,8 @@
using namespace metal;
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/array-of-vec3.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/array-of-vec3.comp
new file mode 100644
index 00000000000..0dd52ab36d9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/array-of-vec3.comp
@@ -0,0 +1,17 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct SSBO
+{
+ packed_float3 v[16];
+};
+
+constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
+
+kernel void main0(device SSBO& _13 [[buffer(0)]])
+{
+ _13.v[1] = float3(_13.v[0]);
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/array-of-vec4.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/array-of-vec4.comp
new file mode 100644
index 00000000000..025cd425469
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/array-of-vec4.comp
@@ -0,0 +1,17 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct SSBO
+{
+ float4 v[16];
+};
+
+constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
+
+kernel void main0(device SSBO& _13 [[buffer(0)]])
+{
+ _13.v[1] = _13.v[0];
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-scalar.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-scalar.comp
index bc392f3da18..d1bdd47f55a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-scalar.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-scalar.comp
@@ -19,46 +19,54 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float2x2 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float2x2 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
v_41.row_major0[1][1] = v_29.col_major0[1].y;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-std140.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-std140.comp
index e378317ebcf..1e23ce37239 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-std140.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-std140.comp
@@ -19,52 +19,60 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float2x2 loaded = float2x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy);
v_29.col_major1[0].xy = loaded[0];
v_29.col_major1[1].xy = loaded[1];
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float2x2 loaded = transpose(float2x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy));
v_41.row_major0[0].xy = float2(loaded[0][0], loaded[1][0]);
v_41.row_major0[1].xy = float2(loaded[0][1], loaded[1][1]);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0[0].xy = float2x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy)[0];
v_29.col_major0[1].xy = float2x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy)[1];
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0[0].xy = float2(float2x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy)[0][0], float2x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy)[1][0]);
v_41.row_major0[1].xy = float2(float2x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy)[0][1], float2x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy)[1][1]);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].xy = float2(float2x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy)[0][0], float2x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy)[1][0]);
v_29.col_major0[1].xy = float2(float2x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy)[0][1], float2x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy)[1][1]);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0[0].xy = float2x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy)[0];
v_41.row_major0[1].xy = float2x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy)[1];
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1].xy = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
v_41.row_major0[1][1] = v_29.col_major0[1].y;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-std430.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-std430.comp
index bc392f3da18..d1bdd47f55a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-std430.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x2-std430.comp
@@ -19,46 +19,54 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float2x2 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float2x2 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
v_41.row_major0[1][1] = v_29.col_major0[1].y;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-scalar.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-scalar.comp
index e49ca8d913b..cf321492476 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-scalar.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-scalar.comp
@@ -21,42 +21,49 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float2x3 loaded = float2x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]));
v_29.col_major1[0] = loaded[0];
v_29.col_major1[1] = loaded[1];
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float2x3 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0[0] = float2x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]))[0];
v_29.col_major0[1] = float2x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]))[1];
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(float2x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1])));
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0] = float3(v_41.row_major0[0][0], v_41.row_major0[1][0], v_41.row_major0[2][0]);
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
v_41.row_major0[0][1] = v_29.col_major0[1][0];
@@ -64,7 +71,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[2][1] = v_29.col_major0[1][2];
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0][1u] = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0][1u];
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-std140.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-std140.comp
index 3ef891d85fe..c94069fed6e 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-std140.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-std140.comp
@@ -19,13 +19,15 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float2x3 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float2x3 loaded = transpose(float3x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy, v_41.row_major0[2].xy));
v_41.row_major0[0].xy = float2(loaded[0][0], loaded[1][0]);
@@ -33,31 +35,36 @@ inline void load_store_to_variable_row_major(device SSBORow& v_41)
v_41.row_major0[2].xy = float2(loaded[0][2], loaded[1][2]);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0[0].xy = float2(v_29.col_major0[0][0], v_29.col_major0[1][0]);
v_41.row_major0[1].xy = float2(v_29.col_major0[0][1], v_29.col_major0[1][1]);
v_41.row_major0[2].xy = float2(v_29.col_major0[0][2], v_29.col_major0[1][2]);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(float3x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy, v_41.row_major0[2].xy));
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0[0].xy = float3x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy, v_41.row_major1[2].xy)[0];
v_41.row_major0[1].xy = float3x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy, v_41.row_major1[2].xy)[1];
v_41.row_major0[2].xy = float3x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy, v_41.row_major1[2].xy)[2];
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -65,7 +72,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[2][1] = v_29.col_major0[1].z;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-std430.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-std430.comp
index 6b6e1ea7c7b..6263c058ed4 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-std430.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x3-std430.comp
@@ -19,39 +19,46 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float2x3 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float2x3 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -59,7 +66,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[2][1] = v_29.col_major0[1].z;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-scalar.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-scalar.comp
index e4725e0fb8c..cea5620ab65 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-scalar.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-scalar.comp
@@ -19,39 +19,46 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float2x4 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float2x4 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -60,7 +67,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[3][1] = v_29.col_major0[1].w;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-std140.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-std140.comp
index 05e5492ce17..2227048342a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-std140.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-std140.comp
@@ -19,13 +19,15 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float2x4 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float2x4 loaded = transpose(float4x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy, v_41.row_major0[2].xy, v_41.row_major0[3].xy));
v_41.row_major0[0].xy = float2(loaded[0][0], loaded[1][0]);
@@ -34,12 +36,14 @@ inline void load_store_to_variable_row_major(device SSBORow& v_41)
v_41.row_major0[3].xy = float2(loaded[0][3], loaded[1][3]);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0[0].xy = float2(v_29.col_major0[0][0], v_29.col_major0[1][0]);
v_41.row_major0[1].xy = float2(v_29.col_major0[0][1], v_29.col_major0[1][1]);
@@ -47,12 +51,14 @@ inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_
v_41.row_major0[3].xy = float2(v_29.col_major0[0][3], v_29.col_major0[1][3]);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(float4x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy, v_41.row_major0[2].xy, v_41.row_major0[3].xy));
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0[0].xy = float4x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy, v_41.row_major1[2].xy, v_41.row_major1[3].xy)[0];
v_41.row_major0[1].xy = float4x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy, v_41.row_major1[2].xy, v_41.row_major1[3].xy)[1];
@@ -60,7 +66,8 @@ inline void copy_row_major_to_row_major(device SSBORow& v_41)
v_41.row_major0[3].xy = float4x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy, v_41.row_major1[2].xy, v_41.row_major1[3].xy)[3];
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -69,7 +76,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[3][1] = v_29.col_major0[1].w;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-std430.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-std430.comp
index e4725e0fb8c..cea5620ab65 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-std430.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-2x4-std430.comp
@@ -19,39 +19,46 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float2x4 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float2x4 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -60,7 +67,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[3][1] = v_29.col_major0[1].w;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-scalar.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-scalar.comp
index 621071878c7..4cbd0bd2a0b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-scalar.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-scalar.comp
@@ -21,49 +21,57 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float3x2 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float3x2 loaded = transpose(float2x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1])));
v_41.row_major0[0] = float3(loaded[0][0], loaded[1][0], loaded[2][0]);
v_41.row_major0[1] = float3(loaded[0][1], loaded[1][1], loaded[2][1]);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0[0] = float3(v_29.col_major0[0][0], v_29.col_major0[1][0], v_29.col_major0[2][0]);
v_41.row_major0[1] = float3(v_29.col_major0[0][1], v_29.col_major0[1][1], v_29.col_major0[2][1]);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(float2x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1])));
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0[0] = float2x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]))[0];
v_41.row_major0[1] = float2x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]))[1];
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
v_41.row_major0[1][1] = v_29.col_major0[1].y;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-std140.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-std140.comp
index 96a7814875e..5a74c072898 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-std140.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-std140.comp
@@ -19,7 +19,8 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float3x2 loaded = float3x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy, v_29.col_major0[2].xy);
v_29.col_major1[0].xy = loaded[0];
@@ -27,44 +28,51 @@ inline void load_store_to_variable_col_major(device SSBOCol& v_29)
v_29.col_major1[2].xy = loaded[2];
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float3x2 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0[0].xy = float3x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy, v_29.col_major1[2].xy)[0];
v_29.col_major0[1].xy = float3x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy, v_29.col_major1[2].xy)[1];
v_29.col_major0[2].xy = float3x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy, v_29.col_major1[2].xy)[2];
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(float3x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy, v_29.col_major0[2].xy));
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].xy = float2(v_41.row_major0[0][0], v_41.row_major0[1][0]);
v_29.col_major0[1].xy = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
v_29.col_major0[2].xy = float2(v_41.row_major0[0][2], v_41.row_major0[1][2]);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1].xy = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
v_41.row_major0[1][1] = v_29.col_major0[1].y;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-std430.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-std430.comp
index 8a4d00bf2b4..77a419c4db9 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-std430.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x2-std430.comp
@@ -19,46 +19,54 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float3x2 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float3x2 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
v_41.row_major0[1][1] = v_29.col_major0[1].y;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-scalar.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-scalar.comp
index 1ada47bd3c6..8701e96eaad 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-scalar.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-scalar.comp
@@ -22,7 +22,8 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float3x3 loaded = float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]));
v_29.col_major1[0] = loaded[0];
@@ -30,7 +31,8 @@ inline void load_store_to_variable_col_major(device SSBOCol& v_29)
v_29.col_major1[2] = loaded[2];
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float3x3 loaded = transpose(float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2])));
v_41.row_major0[0] = float3(loaded[0][0], loaded[1][0], loaded[2][0]);
@@ -38,35 +40,40 @@ inline void load_store_to_variable_row_major(device SSBORow& v_41)
v_41.row_major0[2] = float3(loaded[0][2], loaded[1][2], loaded[2][2]);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0[0] = float3x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]), float3(v_29.col_major1[2]))[0];
v_29.col_major0[1] = float3x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]), float3(v_29.col_major1[2]))[1];
v_29.col_major0[2] = float3x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]), float3(v_29.col_major1[2]))[2];
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0[0] = float3(float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[0][0], float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[1][0], float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[2][0]);
v_41.row_major0[1] = float3(float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[0][1], float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[1][1], float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[2][1]);
v_41.row_major0[2] = float3(float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[0][2], float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[1][2], float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[2][2]);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0] = float3(float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[0][0], float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[1][0], float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[2][0]);
v_29.col_major0[1] = float3(float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[0][1], float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[1][1], float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[2][1]);
v_29.col_major0[2] = float3(float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[0][2], float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[1][2], float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[2][2]);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0[0] = float3x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]), float3(v_41.row_major1[2]))[0];
v_41.row_major0[1] = float3x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]), float3(v_41.row_major1[2]))[1];
v_41.row_major0[2] = float3x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]), float3(v_41.row_major1[2]))[2];
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
v_41.row_major0[0][1] = v_29.col_major0[1][0];
@@ -74,7 +81,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[2][1] = v_29.col_major0[1][2];
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0][1u] = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0][1u];
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-std140.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-std140.comp
index 44f50f7880e..2551c023c6a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-std140.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-std140.comp
@@ -19,39 +19,46 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float3x3 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float3x3 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -59,7 +66,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[2][1] = v_29.col_major0[1].z;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-std430.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-std430.comp
index 44f50f7880e..2551c023c6a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-std430.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x3-std430.comp
@@ -19,39 +19,46 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float3x3 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float3x3 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -59,7 +66,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[2][1] = v_29.col_major0[1].z;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-scalar.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-scalar.comp
index 155c485b46b..32dafdd088f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-scalar.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-scalar.comp
@@ -21,13 +21,15 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float3x4 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float3x4 loaded = transpose(float4x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]), float3(v_41.row_major0[3])));
v_41.row_major0[0] = float3(loaded[0][0], loaded[1][0], loaded[2][0]);
@@ -36,12 +38,14 @@ inline void load_store_to_variable_row_major(device SSBORow& v_41)
v_41.row_major0[3] = float3(loaded[0][3], loaded[1][3], loaded[2][3]);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0[0] = float3(v_29.col_major0[0][0], v_29.col_major0[1][0], v_29.col_major0[2][0]);
v_41.row_major0[1] = float3(v_29.col_major0[0][1], v_29.col_major0[1][1], v_29.col_major0[2][1]);
@@ -49,12 +53,14 @@ inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_
v_41.row_major0[3] = float3(v_29.col_major0[0][3], v_29.col_major0[1][3], v_29.col_major0[2][3]);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(float4x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]), float3(v_41.row_major0[3])));
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0[0] = float4x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]), float3(v_41.row_major1[2]), float3(v_41.row_major1[3]))[0];
v_41.row_major0[1] = float4x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]), float3(v_41.row_major1[2]), float3(v_41.row_major1[3]))[1];
@@ -62,7 +68,8 @@ inline void copy_row_major_to_row_major(device SSBORow& v_41)
v_41.row_major0[3] = float4x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]), float3(v_41.row_major1[2]), float3(v_41.row_major1[3]))[3];
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -71,7 +78,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[3][1] = v_29.col_major0[1].w;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-std140.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-std140.comp
index a078488971e..e58cab08937 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-std140.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-std140.comp
@@ -19,39 +19,46 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float3x4 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float3x4 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -60,7 +67,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[3][1] = v_29.col_major0[1].w;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-std430.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-std430.comp
index a078488971e..e58cab08937 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-std430.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-3x4-std430.comp
@@ -19,39 +19,46 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float3x4 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float3x4 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -60,7 +67,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[3][1] = v_29.col_major0[1].w;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-scalar.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-scalar.comp
index 94befba2fa5..f7ca929781e 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-scalar.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-scalar.comp
@@ -19,46 +19,54 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float4x2 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float4x2 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
v_41.row_major0[1][1] = v_29.col_major0[1].y;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-std140.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-std140.comp
index f09d118168a..e5cca638e5a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-std140.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-std140.comp
@@ -19,7 +19,8 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float4x2 loaded = float4x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy, v_29.col_major0[2].xy, v_29.col_major0[3].xy);
v_29.col_major1[0].xy = loaded[0];
@@ -28,13 +29,15 @@ inline void load_store_to_variable_col_major(device SSBOCol& v_29)
v_29.col_major1[3].xy = loaded[3];
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float4x2 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0[0].xy = float4x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy, v_29.col_major1[2].xy, v_29.col_major1[3].xy)[0];
v_29.col_major0[1].xy = float4x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy, v_29.col_major1[2].xy, v_29.col_major1[3].xy)[1];
@@ -42,12 +45,14 @@ inline void copy_col_major_to_col_major(device SSBOCol& v_29)
v_29.col_major0[3].xy = float4x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy, v_29.col_major1[2].xy, v_29.col_major1[3].xy)[3];
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(float4x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy, v_29.col_major0[2].xy, v_29.col_major0[3].xy));
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].xy = float2(v_41.row_major0[0][0], v_41.row_major0[1][0]);
v_29.col_major0[1].xy = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
@@ -55,19 +60,22 @@ inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_
v_29.col_major0[3].xy = float2(v_41.row_major0[0][3], v_41.row_major0[1][3]);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1].xy = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
v_41.row_major0[1][1] = v_29.col_major0[1].y;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-std430.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-std430.comp
index 94befba2fa5..f7ca929781e 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-std430.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x2-std430.comp
@@ -19,46 +19,54 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float4x2 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float4x2 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
v_41.row_major0[1][1] = v_29.col_major0[1].y;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-scalar.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-scalar.comp
index 4edf68ed808..0655253505f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-scalar.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-scalar.comp
@@ -21,7 +21,8 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float4x3 loaded = float4x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]), float3(v_29.col_major0[3]));
v_29.col_major1[0] = loaded[0];
@@ -30,13 +31,15 @@ inline void load_store_to_variable_col_major(device SSBOCol& v_29)
v_29.col_major1[3] = loaded[3];
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float4x3 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0[0] = float4x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]), float3(v_29.col_major1[2]), float3(v_29.col_major1[3]))[0];
v_29.col_major0[1] = float4x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]), float3(v_29.col_major1[2]), float3(v_29.col_major1[3]))[1];
@@ -44,12 +47,14 @@ inline void copy_col_major_to_col_major(device SSBOCol& v_29)
v_29.col_major0[3] = float4x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]), float3(v_29.col_major1[2]), float3(v_29.col_major1[3]))[3];
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(float4x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]), float3(v_29.col_major0[3])));
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0] = float3(v_41.row_major0[0][0], v_41.row_major0[1][0], v_41.row_major0[2][0]);
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
@@ -57,12 +62,14 @@ inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_
v_29.col_major0[3] = float3(v_41.row_major0[0][3], v_41.row_major0[1][3], v_41.row_major0[2][3]);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
v_41.row_major0[0][1] = v_29.col_major0[1][0];
@@ -70,7 +77,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[2][1] = v_29.col_major0[1][2];
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0][1u] = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0][1u];
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-std140.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-std140.comp
index e19d043f069..34420a46ba2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-std140.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-std140.comp
@@ -19,39 +19,46 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float4x3 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float4x3 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -59,7 +66,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[2][1] = v_29.col_major0[1].z;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-std430.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-std430.comp
index e19d043f069..34420a46ba2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-std430.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x3-std430.comp
@@ -19,39 +19,46 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float4x3 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float4x3 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -59,7 +66,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[2][1] = v_29.col_major0[1].z;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-scalar.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-scalar.comp
index ff72744a0c9..c36369a6b60 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-scalar.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-scalar.comp
@@ -19,39 +19,46 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float4x4 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float4x4 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -60,7 +67,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[3][1] = v_29.col_major0[1].w;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-std140.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-std140.comp
index ff72744a0c9..c36369a6b60 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-std140.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-std140.comp
@@ -19,39 +19,46 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float4x4 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float4x4 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -60,7 +67,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[3][1] = v_29.col_major0[1].w;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-std430.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-std430.comp
index ff72744a0c9..c36369a6b60 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-std430.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/packing/matrix-4x4-std430.comp
@@ -19,39 +19,46 @@ struct SSBORow
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void load_store_to_variable_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void load_store_to_variable_col_major(device SSBOCol& v_29)
{
float4x4 loaded = v_29.col_major0;
v_29.col_major1 = loaded;
}
-inline void load_store_to_variable_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void load_store_to_variable_row_major(device SSBORow& v_41)
{
float4x4 loaded = transpose(v_41.row_major0);
v_41.row_major0 = transpose(loaded);
}
-inline void copy_col_major_to_col_major(device SSBOCol& v_29)
+static inline __attribute__((always_inline))
+void copy_col_major_to_col_major(device SSBOCol& v_29)
{
v_29.col_major0 = v_29.col_major1;
}
-inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_41.row_major0 = transpose(v_29.col_major0);
}
-inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0 = transpose(v_41.row_major0);
}
-inline void copy_row_major_to_row_major(device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_row_major_to_row_major(device SSBORow& v_41)
{
v_41.row_major0 = v_41.row_major1;
}
-inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
v_41.row_major0[0][1] = v_29.col_major0[1].x;
@@ -60,7 +67,8 @@ inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
v_41.row_major0[3][1] = v_29.col_major0[1].w;
}
-inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
+static inline __attribute__((always_inline))
+void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
{
v_29.col_major0[0].y = v_41.row_major0[1u][0];
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vert/functions_nested.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vert/functions_nested.vert
index 0f2b70bb0f2..5ef90014d41 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vert/functions_nested.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vert/functions_nested.vert
@@ -37,12 +37,14 @@ struct main0_out
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
-inline attr_desc fetch_desc(thread const int& location, constant VertexBuffer& v_227)
+static inline __attribute__((always_inline))
+attr_desc fetch_desc(thread const int& location, constant VertexBuffer& v_227)
{
int attribute_flags = v_227.input_attributes[location].w;
attr_desc result;
@@ -55,7 +57,8 @@ inline attr_desc fetch_desc(thread const int& location, constant VertexBuffer& v
return result;
}
-inline uint get_bits(thread const uint4& v, thread const int& swap)
+static inline __attribute__((always_inline))
+uint get_bits(thread const uint4& v, thread const int& swap)
{
if (swap != 0)
{
@@ -64,7 +67,8 @@ inline uint get_bits(thread const uint4& v, thread const int& swap)
return ((v.x | (v.y << uint(8))) | (v.z << uint(16))) | (v.w << uint(24));
}
-inline float4 fetch_attr(thread const attr_desc& desc, thread const int& vertex_id, thread const texture2d<uint> input_stream)
+static inline __attribute__((always_inline))
+float4 fetch_attr(thread const attr_desc& desc, thread const int& vertex_id, thread const texture2d<uint> input_stream)
{
float4 result = float4(0.0, 0.0, 0.0, 1.0);
bool reverse_order = false;
@@ -132,7 +136,8 @@ inline float4 fetch_attr(thread const attr_desc& desc, thread const int& vertex_
return _210;
}
-inline float4 read_location(thread const int& location, constant VertexBuffer& v_227, thread uint& gl_VertexIndex, thread texture2d<uint> buff_in_2, thread texture2d<uint> buff_in_1)
+static inline __attribute__((always_inline))
+float4 read_location(thread const int& location, constant VertexBuffer& v_227, thread uint& gl_VertexIndex, thread texture2d<uint> buff_in_2, thread texture2d<uint> buff_in_1)
{
int param = location;
attr_desc desc = fetch_desc(param, v_227);
@@ -151,7 +156,8 @@ inline float4 read_location(thread const int& location, constant VertexBuffer& v
}
}
-inline void vs_adjust(thread float4& dst_reg0, thread float4& dst_reg1, thread float4& dst_reg7, constant VertexBuffer& v_227, thread uint& gl_VertexIndex, thread texture2d<uint> buff_in_2, thread texture2d<uint> buff_in_1, constant VertexConstantsBuffer& v_309)
+static inline __attribute__((always_inline))
+void vs_adjust(thread float4& dst_reg0, thread float4& dst_reg1, thread float4& dst_reg7, constant VertexBuffer& v_227, thread uint& gl_VertexIndex, thread texture2d<uint> buff_in_2, thread texture2d<uint> buff_in_1, constant VertexConstantsBuffer& v_309)
{
int param = 3;
float4 in_diff_color = read_location(param, v_227, gl_VertexIndex, buff_in_2, buff_in_1);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vert/pass-array-by-value.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vert/pass-array-by-value.vert
index 5fc73a3a3db..f6e3efbecf7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vert/pass-array-by-value.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vert/pass-array-by-value.vert
@@ -1,101 +1,87 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
-constant float4 _68[4] = { float4(0.0), float4(1.0), float4(2.0), float4(3.0) };
-
-struct main0_out
-{
- float4 gl_Position [[position]];
-};
-
-struct main0_in
-{
- int Index1 [[attribute(0)]];
- int Index2 [[attribute(1)]];
-};
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
+template<typename T, size_t Num>
+struct spvUnsafeArray
{
- for (uint i = 0; i < A; i++)
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const thread T& operator [] (size_t pos) const thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ device T& operator [] (size_t pos) device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const device T& operator [] (size_t pos) const device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ constexpr const constant T& operator [] (size_t pos) const constant
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ threadgroup T& operator [] (size_t pos) threadgroup
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+constant spvUnsafeArray<float4, 4> _68 = spvUnsafeArray<float4, 4>({ float4(0.0), float4(1.0), float4(2.0), float4(3.0) });
+
+struct main0_out
+{
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ int Index1 [[attribute(0)]];
+ int Index2 [[attribute(1)]];
+};
-inline float4 consume_constant_arrays2(thread const float4 (&positions)[4], thread const float4 (&positions2)[4], thread int& Index1, thread int& Index2)
+static inline __attribute__((always_inline))
+float4 consume_constant_arrays2(spvUnsafeArray<float4, 4> positions, spvUnsafeArray<float4, 4> positions2, thread int& Index1, thread int& Index2)
{
- float4 indexable[4];
- spvArrayCopyFromStackToStack1(indexable, positions);
- float4 indexable_1[4];
- spvArrayCopyFromStackToStack1(indexable_1, positions2);
+ spvUnsafeArray<float4, 4> indexable;
+ indexable = positions;
+ spvUnsafeArray<float4, 4> indexable_1;
+ indexable_1 = positions2;
return indexable[Index1] + indexable_1[Index2];
}
-inline float4 consume_constant_arrays(thread const float4 (&positions)[4], thread const float4 (&positions2)[4], thread int& Index1, thread int& Index2)
+static inline __attribute__((always_inline))
+float4 consume_constant_arrays(spvUnsafeArray<float4, 4> positions, spvUnsafeArray<float4, 4> positions2, thread int& Index1, thread int& Index2)
{
return consume_constant_arrays2(positions, positions2, Index1, Index2);
}
vertex main0_out main0(main0_in in [[stage_in]])
{
- float4 _68_array_copy[4] = { float4(0.0), float4(1.0), float4(2.0), float4(3.0) };
main0_out out = {};
- float4 LUT2[4];
+ spvUnsafeArray<float4, 4> LUT2;
LUT2[0] = float4(10.0);
LUT2[1] = float4(11.0);
LUT2[2] = float4(12.0);
LUT2[3] = float4(13.0);
- out.gl_Position = consume_constant_arrays(_68_array_copy, LUT2, in.Index1, in.Index2);
+ out.gl_Position = consume_constant_arrays(_68, LUT2, in.Index1, in.Index2);
return out;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vulkan/frag/texture-access-function.swizzle.vk.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vulkan/frag/texture-access-function.swizzle.vk.frag
index 0fcca3af8cd..d4f70e0e1dc 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vulkan/frag/texture-access-function.swizzle.vk.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl-no-opt/vulkan/frag/texture-access-function.swizzle.vk.frag
@@ -11,7 +11,8 @@ struct main0_out
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
@@ -136,7 +137,8 @@ inline vec<T, 4> spvGatherCompareSwizzle(const thread Tex<T>& t, sampler s, uint
return t.gather_compare(s, spvForward<Ts>(params)...);
}
-inline float4 do_samples(thread const texture1d<float> t1, thread const sampler t1Smplr, constant uint& t1Swzl, thread const texture2d<float> t2, constant uint& t2Swzl, thread const texture3d<float> t3, thread const sampler t3Smplr, constant uint& t3Swzl, thread const texturecube<float> tc, constant uint& tcSwzl, thread const texture2d_array<float> t2a, thread const sampler t2aSmplr, constant uint& t2aSwzl, thread const texturecube_array<float> tca, thread const sampler tcaSmplr, constant uint& tcaSwzl, thread const texture2d<float> tb, thread const depth2d<float> d2, thread const sampler d2Smplr, constant uint& d2Swzl, thread const depthcube<float> dc, thread const sampler dcSmplr, constant uint& dcSwzl, thread const depth2d_array<float> d2a, constant uint& d2aSwzl, thread const depthcube_array<float> dca, thread const sampler dcaSmplr, constant uint& dcaSwzl, thread sampler defaultSampler, thread sampler shadowSampler)
+static inline __attribute__((always_inline))
+float4 do_samples(thread const texture1d<float> t1, thread const sampler t1Smplr, constant uint& t1Swzl, thread const texture2d<float> t2, constant uint& t2Swzl, thread const texture3d<float> t3, thread const sampler t3Smplr, constant uint& t3Swzl, thread const texturecube<float> tc, constant uint& tcSwzl, thread const texture2d_array<float> t2a, thread const sampler t2aSmplr, constant uint& t2aSwzl, thread const texturecube_array<float> tca, thread const sampler tcaSmplr, constant uint& tcaSwzl, thread const texture2d<float> tb, thread const depth2d<float> d2, thread const sampler d2Smplr, constant uint& d2Swzl, thread const depthcube<float> dc, thread const sampler dcSmplr, constant uint& dcSwzl, thread const depth2d_array<float> d2a, constant uint& d2aSwzl, thread const depthcube_array<float> dca, thread const sampler dcaSmplr, constant uint& dcaSwzl, thread sampler defaultSampler, thread sampler shadowSampler)
{
float4 c = spvTextureSwizzle(t1.sample(t1Smplr, 0.0), t1Swzl);
c = spvTextureSwizzle(t2.sample(defaultSampler, float2(0.0)), t2Swzl);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-decrement.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-decrement.asm.comp
index ca9ba154441..e250770dc20 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-decrement.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-decrement.asm.comp
@@ -13,7 +13,8 @@ struct u0_counters
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-increment.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-increment.asm.comp
index b8d5b3cca3d..22c104f9333 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-increment.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-increment.asm.comp
@@ -13,7 +13,8 @@ struct u0_counters
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/bitcast_icmp.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/bitcast_icmp.asm.comp
new file mode 100644
index 00000000000..31c71daa4b5
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/bitcast_icmp.asm.comp
@@ -0,0 +1,29 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct _3
+{
+ int4 _m0;
+ uint4 _m1;
+};
+
+struct _4
+{
+ uint4 _m0;
+ int4 _m1;
+};
+
+kernel void main0(device _3& restrict _5 [[buffer(0)]], device _4& restrict _6 [[buffer(1)]])
+{
+ _6._m0 = select(uint4(0u), uint4(1u), int4(_5._m1) < _5._m0);
+ _6._m0 = select(uint4(0u), uint4(1u), int4(_5._m1) <= _5._m0);
+ _6._m0 = select(uint4(0u), uint4(1u), _5._m1 < uint4(_5._m0));
+ _6._m0 = select(uint4(0u), uint4(1u), _5._m1 <= uint4(_5._m0));
+ _6._m0 = select(uint4(0u), uint4(1u), int4(_5._m1) > _5._m0);
+ _6._m0 = select(uint4(0u), uint4(1u), int4(_5._m1) >= _5._m0);
+ _6._m0 = select(uint4(0u), uint4(1u), _5._m1 > uint4(_5._m0));
+ _6._m0 = select(uint4(0u), uint4(1u), _5._m1 >= uint4(_5._m0));
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/buffer-write-relative-addr.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/buffer-write-relative-addr.asm.comp
index 54323859c7a..57d2205a47c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/buffer-write-relative-addr.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/buffer-write-relative-addr.asm.comp
@@ -11,7 +11,8 @@ struct cb5_struct
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/buffer-write.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/buffer-write.asm.comp
index c4a0476c323..8c9e23aa06d 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/buffer-write.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/buffer-write.asm.comp
@@ -11,7 +11,8 @@ struct cb
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/global-parameter-name-alias.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/global-parameter-name-alias.asm.comp
index 0c0d8b599d5..ec1b2a2da24 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/global-parameter-name-alias.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/global-parameter-name-alias.asm.comp
@@ -10,13 +10,15 @@ struct ssbo
uint _data[1];
};
-inline void Load(thread const uint& size, const device ssbo& ssbo_1)
+static inline __attribute__((always_inline))
+void Load(thread const uint& size, const device ssbo& ssbo_1)
{
int byteAddrTemp = int(size >> uint(2));
uint4 data = uint4(ssbo_1._data[byteAddrTemp], ssbo_1._data[byteAddrTemp + 1], ssbo_1._data[byteAddrTemp + 2], ssbo_1._data[byteAddrTemp + 3]);
}
-inline void _main(thread const uint3& id, const device ssbo& ssbo_1)
+static inline __attribute__((always_inline))
+void _main(thread const uint3& id, const device ssbo& ssbo_1)
{
uint param = 4u;
Load(param, ssbo_1);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/image-load-store-short-vector.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/image-load-store-short-vector.asm.comp
index 4770033bc31..fca572e36f4 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/image-load-store-short-vector.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/image-load-store-short-vector.asm.comp
@@ -5,7 +5,8 @@
using namespace metal;
-inline void _main(thread const uint3& id, thread texture2d<float, access::read_write> TargetTexture)
+static inline __attribute__((always_inline))
+void _main(thread const uint3& id, thread texture2d<float, access::read_write> TargetTexture)
{
float2 loaded = TargetTexture.read(uint2(id.xy)).xy;
float2 storeTemp = loaded + float2(1.0);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/struct-resource-name-aliasing.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/struct-resource-name-aliasing.asm.comp
index 8ea93473025..fa7d2698210 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/struct-resource-name-aliasing.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/struct-resource-name-aliasing.asm.comp
@@ -10,7 +10,8 @@ struct bufA
uint _data[1];
};
-inline void _main(device bufA& bufA_1, device bufA& bufB)
+static inline __attribute__((always_inline))
+void _main(device bufA& bufA_1, device bufA& bufB)
{
bufA_1._data[0] = 0u;
bufB._data[0] = 0u;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/variable-pointers-2.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/variable-pointers-2.asm.comp
index 7855c4c8256..4bf34ff4b2b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/variable-pointers-2.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/variable-pointers-2.asm.comp
@@ -17,12 +17,14 @@ struct bar
int d;
};
-inline device foo* select_buffer(device foo& a, constant bar& cb)
+static inline __attribute__((always_inline))
+device foo* select_buffer(device foo& a, constant bar& cb)
{
return (cb.d != 0) ? &a : nullptr;
}
-inline thread uint3* select_input(thread uint3& gl_GlobalInvocationID, thread uint3& gl_LocalInvocationID, constant bar& cb)
+static inline __attribute__((always_inline))
+thread uint3* select_input(thread uint3& gl_GlobalInvocationID, thread uint3& gl_LocalInvocationID, constant bar& cb)
{
return (cb.d != 0) ? &gl_GlobalInvocationID : &gl_LocalInvocationID;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/variable-pointers-store-forwarding.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/variable-pointers-store-forwarding.asm.comp
index 11a39ad23e8..00c490c77fc 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/variable-pointers-store-forwarding.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/variable-pointers-store-forwarding.asm.comp
@@ -15,7 +15,8 @@ struct bar
int b;
};
-inline device int* _24(device foo& a, device bar& b, thread uint3& gl_GlobalInvocationID)
+static inline __attribute__((always_inline))
+device int* _24(device foo& a, device bar& b, thread uint3& gl_GlobalInvocationID)
{
return (gl_GlobalInvocationID.x != 0u) ? &a.a : &b.b;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/vector-builtin-type-cast-func.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/vector-builtin-type-cast-func.asm.comp
index e4573f37ad9..93e14e861db 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/vector-builtin-type-cast-func.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/vector-builtin-type-cast-func.asm.comp
@@ -12,7 +12,8 @@ struct cb1_struct
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(16u, 16u, 1u);
-inline int2 get_texcoord(thread const int2& base, thread const int2& index, thread uint3& gl_LocalInvocationID)
+static inline __attribute__((always_inline))
+int2 get_texcoord(thread const int2& base, thread const int2& index, thread uint3& gl_LocalInvocationID)
{
return (base * int3(gl_LocalInvocationID).xy) + index;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/empty-struct.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/empty-struct.asm.frag
index 61d49d7836b..e30c5864b26 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/empty-struct.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/empty-struct.asm.frag
@@ -7,24 +7,23 @@ using namespace metal;
struct EmptyStructTest
{
- int empty_struct_member;
};
-
-inline float GetValue(thread const EmptyStructTest& self)
+static inline __attribute__((always_inline))
+float GetValue(thread const EmptyStructTest& self)
{
return 0.0;
}
-inline float GetValue_1(EmptyStructTest self)
+static inline __attribute__((always_inline))
+float GetValue_1(EmptyStructTest self)
{
return 0.0;
}
fragment void main0()
{
- EmptyStructTest _23 = EmptyStructTest{ 0 };
EmptyStructTest emptyStruct;
float value = GetValue(emptyStruct);
- value = GetValue_1(_23);
+ value = GetValue_1(EmptyStructTest{ });
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/extract-packed-from-composite.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/extract-packed-from-composite.asm.frag
index ec5534515b8..e926bc5f3e8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/extract-packed-from-composite.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/extract-packed-from-composite.asm.frag
@@ -28,7 +28,8 @@ struct main0_out
float4 _entryPointOutput [[color(0)]];
};
-inline float4 _main(thread const float4& pos, constant buf& v_11)
+static inline __attribute__((always_inline))
+float4 _main(thread const float4& pos, constant buf& v_11)
{
int _46 = int(pos.x) % 16;
Foo foo;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/function-overload-alias.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/function-overload-alias.asm.frag
index 13e359680ef..40fe5c5d812 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/function-overload-alias.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/function-overload-alias.asm.frag
@@ -10,22 +10,26 @@ struct main0_out
float4 FragColor [[color(0)]];
};
-inline float4 foo(thread const float4& foo_1)
+static inline __attribute__((always_inline))
+float4 foo(thread const float4& foo_1)
{
return foo_1 + float4(1.0);
}
-inline float4 foo(thread const float3& foo_1)
+static inline __attribute__((always_inline))
+float4 foo(thread const float3& foo_1)
{
return foo_1.xyzz + float4(1.0);
}
-inline float4 foo_1(thread const float4& foo_2)
+static inline __attribute__((always_inline))
+float4 foo_1(thread const float4& foo_2)
{
return foo_2 + float4(2.0);
}
-inline float4 foo(thread const float2& foo_2)
+static inline __attribute__((always_inline))
+float4 foo(thread const float2& foo_2)
{
return foo_2.xyxy + float4(2.0);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/line-directive.line.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/line-directive.line.asm.frag
index b44b83d0359..38fbd27ba3a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/line-directive.line.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/line-directive.line.asm.frag
@@ -16,7 +16,8 @@ struct main0_in
};
#line 6 "test.frag"
-inline void func(thread float& FragColor, thread float& vColor)
+static inline __attribute__((always_inline))
+void func(thread float& FragColor, thread float& vColor)
{
#line 8 "test.frag"
FragColor = 1.0;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag
index 428a9bf244f..41193536e69 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag
@@ -1,82 +1,67 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
-constant float _46[16] = { 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0 };
-constant float4 _76[4] = { float4(0.0), float4(1.0), float4(8.0), float4(5.0) };
-constant float4 _90[4] = { float4(20.0), float4(30.0), float4(50.0), float4(60.0) };
-
-struct main0_out
-{
- float FragColor [[color(0)]];
-};
-
-struct main0_in
-{
- int index [[user(locn0)]];
-};
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
+template<typename T, size_t Num>
+struct spvUnsafeArray
{
- for (uint i = 0; i < A; i++)
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const thread T& operator [] (size_t pos) const thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ device T& operator [] (size_t pos) device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const device T& operator [] (size_t pos) const device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ constexpr const constant T& operator [] (size_t pos) const constant
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ threadgroup T& operator [] (size_t pos) threadgroup
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+constant spvUnsafeArray<float, 16> _46 = spvUnsafeArray<float, 16>({ 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0 });
+constant spvUnsafeArray<float4, 4> _76 = spvUnsafeArray<float4, 4>({ float4(0.0), float4(1.0), float4(8.0), float4(5.0) });
+constant spvUnsafeArray<float4, 4> _90 = spvUnsafeArray<float4, 4>({ float4(20.0), float4(30.0), float4(50.0), float4(60.0) });
+
+struct main0_out
+{
+ float FragColor [[color(0)]];
+};
+
+struct main0_in
+{
+ int index [[user(locn0)]];
+};
fragment main0_out main0(main0_in in [[stage_in]])
{
- float4 foobar[4] = { float4(0.0), float4(1.0), float4(8.0), float4(5.0) };
- float4 baz[4] = { float4(0.0), float4(1.0), float4(8.0), float4(5.0) };
+ spvUnsafeArray<float4, 4> foobar = spvUnsafeArray<float4, 4>({ float4(0.0), float4(1.0), float4(8.0), float4(5.0) });
+ spvUnsafeArray<float4, 4> baz = spvUnsafeArray<float4, 4>({ float4(0.0), float4(1.0), float4(8.0), float4(5.0) });
main0_out out = {};
out.FragColor = _46[in.index];
if (in.index < 10)
@@ -100,7 +85,7 @@ fragment main0_out main0(main0_in in [[stage_in]])
foobar[1].z = 20.0;
}
out.FragColor += foobar[in.index & 3].z;
- spvArrayCopyFromConstantToStack1(baz, _90);
+ baz = _90;
out.FragColor += baz[in.index & 3].z;
return out;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/op-constant-null.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/op-constant-null.asm.frag
index 9d5d7fb1d69..f8104f81657 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/op-constant-null.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/op-constant-null.asm.frag
@@ -1,15 +1,56 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct D
{
float4 a;
float b;
};
-constant float4 _14[4] = { float4(0.0), float4(0.0), float4(0.0), float4(0.0) };
+constant spvUnsafeArray<float4, 4> _14 = spvUnsafeArray<float4, 4>({ float4(0.0), float4(0.0), float4(0.0), float4(0.0) });
struct main0_out
{
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/pass-by-value.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/pass-by-value.asm.frag
index 1935c3f815f..46648f6d309 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/pass-by-value.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/pass-by-value.asm.frag
@@ -15,7 +15,8 @@ struct main0_out
float FragColor [[color(0)]];
};
-inline float add_value(float v, float w)
+static inline __attribute__((always_inline))
+float add_value(float v, float w)
{
return v + w;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/single-function-private-lut.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/single-function-private-lut.asm.frag
index 127f18181f5..54325051f49 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/single-function-private-lut.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/single-function-private-lut.asm.frag
@@ -1,17 +1,54 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct myType
{
float data;
};
-constant myType _21[5] = { myType{ 0.0 }, myType{ 1.0 }, myType{ 0.0 }, myType{ 1.0 }, myType{ 0.0 } };
-
struct main0_out
{
float4 o_color [[color(0)]];
@@ -24,62 +61,10 @@ inline Tx mod(Tx x, Ty y)
return x - y * floor(x / y);
}
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
fragment main0_out main0(float4 gl_FragCoord [[position]])
{
+ spvUnsafeArray<myType, 5> _21 = spvUnsafeArray<myType, 5>({ myType{ 0.0 }, myType{ 1.0 }, myType{ 0.0 }, myType{ 1.0 }, myType{ 0.0 } });
+
main0_out out = {};
float2 uv = gl_FragCoord.xy;
int index = int(mod(uv.x, 4.0));
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/storage-class-output-initializer.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/storage-class-output-initializer.asm.frag
index 1bafc6953ba..d59013daaf8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/storage-class-output-initializer.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/storage-class-output-initializer.asm.frag
@@ -1,9 +1,50 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
-constant float4 _20[2] = { float4(1.0, 2.0, 3.0, 4.0), float4(10.0) };
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+constant spvUnsafeArray<float4, 2> _20 = spvUnsafeArray<float4, 2>({ float4(1.0, 2.0, 3.0, 4.0), float4(10.0) });
struct main0_out
{
@@ -15,7 +56,7 @@ struct main0_out
fragment main0_out main0()
{
main0_out out = {};
- float4 FragColors[2] = { float4(1.0, 2.0, 3.0, 4.0), float4(10.0) };
+ spvUnsafeArray<float4, 2> FragColors = spvUnsafeArray<float4, 2>({ float4(1.0, 2.0, 3.0, 4.0), float4(10.0) });
out.FragColor = float4(5.0);
out.FragColors_0 = FragColors[0];
out.FragColors_1 = FragColors[1];
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/texture-atomics.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/texture-atomics.asm.frag
new file mode 100644
index 00000000000..ab5be649849
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/texture-atomics.asm.frag
@@ -0,0 +1,121 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+#pragma clang diagnostic ignored "-Wunused-variable"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+#include <metal_atomic>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_StructuredBuffer_v4float
+{
+ spvUnsafeArray<float4, 1> _m0;
+};
+
+struct type_Globals
+{
+ uint2 ShadowTileListGroupSize;
+};
+
+constant float3 _70 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+struct main0_in
+{
+ uint in_var_TEXCOORD0 [[user(locn0)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], const device type_StructuredBuffer_v4float& CulledObjectBoxBounds [[buffer(0)]], constant type_Globals& _Globals [[buffer(1)]], texture2d<uint> RWShadowTileNumCulledObjects [[texture(2)]], device atomic_uint* RWShadowTileNumCulledObjects_atomic [[buffer(2)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ uint2 _77 = uint2(gl_FragCoord.xy);
+ uint _78 = _77.y;
+ uint _83 = _77.x;
+ float2 _91 = float2(float(_83), float((_Globals.ShadowTileListGroupSize.y - 1u) - _78));
+ float2 _93 = float2(_Globals.ShadowTileListGroupSize);
+ float2 _96 = ((_91 / _93) * float2(2.0)) - float2(1.0);
+ float2 _100 = (((_91 + float2(1.0)) / _93) * float2(2.0)) - float2(1.0);
+ float3 _102 = float3(_100.x, _100.y, _70.z);
+ _102.z = 1.0;
+ uint _103 = in.in_var_TEXCOORD0 * 5u;
+ uint _107 = _103 + 1u;
+ if (all(CulledObjectBoxBounds._m0[_107].xy > _96.xy) && all(CulledObjectBoxBounds._m0[_103].xyz < _102))
+ {
+ float _122 = _96.x;
+ float _123 = _96.y;
+ spvUnsafeArray<float3, 8> _73;
+ _73[0] = float3(_122, _123, -1000.0);
+ float _126 = _100.x;
+ _73[1] = float3(_126, _123, -1000.0);
+ float _129 = _100.y;
+ _73[2] = float3(_122, _129, -1000.0);
+ _73[3] = float3(_126, _129, -1000.0);
+ _73[4] = float3(_122, _123, 1.0);
+ _73[5] = float3(_126, _123, 1.0);
+ _73[6] = float3(_122, _129, 1.0);
+ _73[7] = float3(_126, _129, 1.0);
+ float3 _155;
+ float3 _158;
+ _155 = float3(-500000.0);
+ _158 = float3(500000.0);
+ for (int _160 = 0; _160 < 8; )
+ {
+ float3 _166 = _73[_160] - (float3(0.5) * (CulledObjectBoxBounds._m0[_103].xyz + CulledObjectBoxBounds._m0[_107].xyz));
+ float3 _170 = float3(dot(_166, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 4u].xyz));
+ _155 = fast::max(_155, _170);
+ _158 = fast::min(_158, _170);
+ _160++;
+ continue;
+ }
+ if (all(_158 < float3(1.0)) && all(_155 > float3(-1.0)))
+ {
+ uint _179 = atomic_fetch_add_explicit((device atomic_uint*)&RWShadowTileNumCulledObjects_atomic[(_78 * _Globals.ShadowTileListGroupSize.x) + _83], 1u, memory_order_relaxed);
+ }
+ }
+ out.out_var_SV_Target0 = float4(0.0);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/texture-atomics.asm.graphics-robust-access.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/texture-atomics.asm.graphics-robust-access.frag
new file mode 100644
index 00000000000..ab5be649849
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/texture-atomics.asm.graphics-robust-access.frag
@@ -0,0 +1,121 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+#pragma clang diagnostic ignored "-Wunused-variable"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+#include <metal_atomic>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_StructuredBuffer_v4float
+{
+ spvUnsafeArray<float4, 1> _m0;
+};
+
+struct type_Globals
+{
+ uint2 ShadowTileListGroupSize;
+};
+
+constant float3 _70 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+struct main0_in
+{
+ uint in_var_TEXCOORD0 [[user(locn0)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], const device type_StructuredBuffer_v4float& CulledObjectBoxBounds [[buffer(0)]], constant type_Globals& _Globals [[buffer(1)]], texture2d<uint> RWShadowTileNumCulledObjects [[texture(2)]], device atomic_uint* RWShadowTileNumCulledObjects_atomic [[buffer(2)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ uint2 _77 = uint2(gl_FragCoord.xy);
+ uint _78 = _77.y;
+ uint _83 = _77.x;
+ float2 _91 = float2(float(_83), float((_Globals.ShadowTileListGroupSize.y - 1u) - _78));
+ float2 _93 = float2(_Globals.ShadowTileListGroupSize);
+ float2 _96 = ((_91 / _93) * float2(2.0)) - float2(1.0);
+ float2 _100 = (((_91 + float2(1.0)) / _93) * float2(2.0)) - float2(1.0);
+ float3 _102 = float3(_100.x, _100.y, _70.z);
+ _102.z = 1.0;
+ uint _103 = in.in_var_TEXCOORD0 * 5u;
+ uint _107 = _103 + 1u;
+ if (all(CulledObjectBoxBounds._m0[_107].xy > _96.xy) && all(CulledObjectBoxBounds._m0[_103].xyz < _102))
+ {
+ float _122 = _96.x;
+ float _123 = _96.y;
+ spvUnsafeArray<float3, 8> _73;
+ _73[0] = float3(_122, _123, -1000.0);
+ float _126 = _100.x;
+ _73[1] = float3(_126, _123, -1000.0);
+ float _129 = _100.y;
+ _73[2] = float3(_122, _129, -1000.0);
+ _73[3] = float3(_126, _129, -1000.0);
+ _73[4] = float3(_122, _123, 1.0);
+ _73[5] = float3(_126, _123, 1.0);
+ _73[6] = float3(_122, _129, 1.0);
+ _73[7] = float3(_126, _129, 1.0);
+ float3 _155;
+ float3 _158;
+ _155 = float3(-500000.0);
+ _158 = float3(500000.0);
+ for (int _160 = 0; _160 < 8; )
+ {
+ float3 _166 = _73[_160] - (float3(0.5) * (CulledObjectBoxBounds._m0[_103].xyz + CulledObjectBoxBounds._m0[_107].xyz));
+ float3 _170 = float3(dot(_166, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 4u].xyz));
+ _155 = fast::max(_155, _170);
+ _158 = fast::min(_158, _170);
+ _160++;
+ continue;
+ }
+ if (all(_158 < float3(1.0)) && all(_155 > float3(-1.0)))
+ {
+ uint _179 = atomic_fetch_add_explicit((device atomic_uint*)&RWShadowTileNumCulledObjects_atomic[(_78 * _Globals.ShadowTileListGroupSize.x) + _83], 1u, memory_order_relaxed);
+ }
+ }
+ out.out_var_SV_Target0 = float4(0.0);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/unknown-depth-state.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/unknown-depth-state.asm.frag
index 8bc8d36f20d..01a0e5a7320 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/unknown-depth-state.asm.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/frag/unknown-depth-state.asm.frag
@@ -15,12 +15,14 @@ struct main0_in
float3 vUV [[user(locn0)]];
};
-inline float sample_combined(thread float3& vUV, thread depth2d<float> uShadow, thread const sampler uShadowSmplr)
+static inline __attribute__((always_inline))
+float sample_combined(thread float3& vUV, thread depth2d<float> uShadow, thread const sampler uShadowSmplr)
{
return uShadow.sample_compare(uShadowSmplr, vUV.xy, vUV.z);
}
-inline float sample_separate(thread float3& vUV, thread depth2d<float> uTexture, thread sampler uSampler)
+static inline __attribute__((always_inline))
+float sample_separate(thread float3& vUV, thread depth2d<float> uTexture, thread sampler uSampler)
{
return uTexture.sample_compare(uSampler, vUV.xy, vUV.z);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc
index ebe723de66e..2c83e9e4200 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc
@@ -1,10 +1,49 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct VertexOutput
{
float4 pos;
@@ -19,7 +58,7 @@ struct HSOut
struct HSConstantOut
{
- float EdgeTess[3];
+ spvUnsafeArray<float, 3> EdgeTess;
float InsideTess;
};
@@ -45,61 +84,8 @@ struct main0_in
float4 gl_Position [[attribute(1)]];
};
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-inline HSOut _hs_main(thread const VertexOutput (&p)[3], thread const uint& i)
+static inline __attribute__((always_inline))
+HSOut _hs_main(thread const spvUnsafeArray<VertexOutput, 3> (&p), thread const uint& i)
{
HSOut _output;
_output.pos = p[i].pos;
@@ -107,7 +93,8 @@ inline HSOut _hs_main(thread const VertexOutput (&p)[3], thread const uint& i)
return _output;
}
-inline HSConstantOut PatchHS(thread const VertexOutput (&_patch)[3])
+static inline __attribute__((always_inline))
+HSConstantOut PatchHS(thread const spvUnsafeArray<VertexOutput, 3> (&_patch))
{
HSConstantOut _output;
_output.EdgeTess[0] = (float2(1.0) + _patch[0].uv).x;
@@ -125,7 +112,7 @@ kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_
threadgroup_barrier(mem_flags::mem_threadgroup);
if (gl_InvocationID >= 3)
return;
- VertexOutput p[3];
+ spvUnsafeArray<VertexOutput, 3> p;
p[0].pos = gl_in[0].gl_Position;
p[0].uv = gl_in[0].VertexOutput_uv;
p[1].pos = gl_in[1].gl_Position;
@@ -133,17 +120,17 @@ kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_
p[2].pos = gl_in[2].gl_Position;
p[2].uv = gl_in[2].VertexOutput_uv;
uint i = gl_InvocationID;
- VertexOutput param[3];
- spvArrayCopyFromStackToStack1(param, p);
+ spvUnsafeArray<VertexOutput, 3> param;
+ param = p;
uint param_1 = i;
HSOut flattenTemp = _hs_main(param, param_1);
gl_out[gl_InvocationID].gl_Position = flattenTemp.pos;
gl_out[gl_InvocationID]._entryPointOutput.uv = flattenTemp.uv;
- threadgroup_barrier(mem_flags::mem_device);
+ threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup);
if (int(gl_InvocationID) == 0)
{
- VertexOutput param_2[3];
- spvArrayCopyFromStackToStack1(param_2, p);
+ spvUnsafeArray<VertexOutput, 3> param_2;
+ param_2 = p;
HSConstantOut _patchConstantResult = PatchHS(param_2);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0] = half(_patchConstantResult.EdgeTess[0]);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1] = half(_patchConstantResult.EdgeTess[1]);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/extract-transposed-matrix-from-struct.asm.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/extract-transposed-matrix-from-struct.asm.vert
index 455735d011f..b94687a52bc 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/extract-transposed-matrix-from-struct.asm.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/extract-transposed-matrix-from-struct.asm.vert
@@ -39,7 +39,8 @@ struct main0_in
float3 PosL [[attribute(0)]];
};
-inline V2F _VS(thread const float3& PosL, thread const uint& instanceID, const device gInstanceData& gInstanceData_1)
+static inline __attribute__((always_inline))
+V2F _VS(thread const float3& PosL, thread const uint& instanceID, const device gInstanceData& gInstanceData_1)
{
InstanceData instData;
instData.MATRIX_MVP = transpose(gInstanceData_1._data[instanceID].MATRIX_MVP);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/invariant.msl21.asm.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/invariant.msl21.asm.vert
index 798a4404328..d74c43b3f05 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/invariant.msl21.asm.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/invariant.msl21.asm.vert
@@ -10,7 +10,8 @@ struct main0_out
float4 gl_Position [[position, invariant]];
};
-inline float4 _main()
+static inline __attribute__((always_inline))
+float4 _main()
{
return float4(1.0);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/uint-vertex-id-instance-id.asm.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/uint-vertex-id-instance-id.asm.vert
index 231336df446..30df905e6ab 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/uint-vertex-id-instance-id.asm.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/asm/vert/uint-vertex-id-instance-id.asm.vert
@@ -10,7 +10,8 @@ struct main0_out
float4 gl_Position [[position]];
};
-inline float4 _main(thread const uint& vid, thread const uint& iid)
+static inline __attribute__((always_inline))
+float4 _main(thread const uint& vid, thread const uint& iid)
{
return float4(float(vid + iid));
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/access-private-workgroup-in-function.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/access-private-workgroup-in-function.comp
index 7449b29862d..85185e6df6a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/access-private-workgroup-in-function.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/access-private-workgroup-in-function.comp
@@ -7,12 +7,14 @@ using namespace metal;
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline void set_f(thread int& f)
+static inline __attribute__((always_inline))
+void set_f(thread int& f)
{
f = 40;
}
-inline void set_shared_u(threadgroup int& u)
+static inline __attribute__((always_inline))
+void set_shared_u(threadgroup int& u)
{
u = 50;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/array-length.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/array-length.comp
index fa3aca1a032..9ac8c827e62 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/array-length.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/array-length.comp
@@ -18,7 +18,8 @@ struct SSBO1
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline uint get_size(device SSBO& v_14, constant uint& v_14BufferSize, device SSBO1* (&ssbos)[2], constant uint* ssbosBufferSize)
+static inline __attribute__((always_inline))
+uint get_size(device SSBO& v_14, constant uint& v_14BufferSize, device SSBO1* (&ssbos)[2], constant uint* ssbosBufferSize)
{
return uint(int((v_14BufferSize - 16) / 16) + int((ssbosBufferSize[1] - 0) / 4));
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/array-length.msl2.argument.discrete.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/array-length.msl2.argument.discrete.comp
index bbd4cbf32c7..aa1f4424d12 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/array-length.msl2.argument.discrete.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/array-length.msl2.argument.discrete.comp
@@ -41,7 +41,8 @@ struct spvDescriptorSetBuffer1
constant uint* spvBufferSizeConstants [[id(2)]];
};
-inline uint get_size(device SSBO& v_16, constant uint& v_16BufferSize, device SSBO1* constant (&ssbos)[2], constant uint* ssbosBufferSize, device SSBO2& v_38, constant uint& v_38BufferSize, device SSBO3* (&ssbos2)[2], constant uint* ssbos2BufferSize)
+static inline __attribute__((always_inline))
+uint get_size(device SSBO& v_16, constant uint& v_16BufferSize, device SSBO1* constant (&ssbos)[2], constant uint* ssbosBufferSize, device SSBO2& v_38, constant uint& v_38BufferSize, device SSBO3* (&ssbos2)[2], constant uint* ssbos2BufferSize)
{
uint len = uint(int((v_16BufferSize - 16) / 16));
len += uint(int((ssbosBufferSize[1] - 0) / 4));
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/barriers.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/barriers.comp
index 8c9cfb5d129..82813906f68 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/barriers.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/barriers.comp
@@ -7,57 +7,68 @@ using namespace metal;
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(4u, 1u, 1u);
-inline void barrier_shared()
+static inline __attribute__((always_inline))
+void barrier_shared()
{
threadgroup_barrier(mem_flags::mem_threadgroup);
}
-inline void full_barrier()
+static inline __attribute__((always_inline))
+void full_barrier()
{
threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup | mem_flags::mem_texture);
}
-inline void image_barrier()
+static inline __attribute__((always_inline))
+void image_barrier()
{
threadgroup_barrier(mem_flags::mem_texture);
}
-inline void buffer_barrier()
+static inline __attribute__((always_inline))
+void buffer_barrier()
{
threadgroup_barrier(mem_flags::mem_device);
}
-inline void group_barrier()
+static inline __attribute__((always_inline))
+void group_barrier()
{
threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup | mem_flags::mem_texture);
}
-inline void barrier_shared_exec()
+static inline __attribute__((always_inline))
+void barrier_shared_exec()
{
threadgroup_barrier(mem_flags::mem_threadgroup);
}
-inline void full_barrier_exec()
+static inline __attribute__((always_inline))
+void full_barrier_exec()
{
threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup | mem_flags::mem_texture);
}
-inline void image_barrier_exec()
+static inline __attribute__((always_inline))
+void image_barrier_exec()
{
threadgroup_barrier(mem_flags::mem_texture);
}
-inline void buffer_barrier_exec()
+static inline __attribute__((always_inline))
+void buffer_barrier_exec()
{
threadgroup_barrier(mem_flags::mem_device);
}
-inline void group_barrier_exec()
+static inline __attribute__((always_inline))
+void group_barrier_exec()
{
threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup | mem_flags::mem_texture);
}
-inline void exec_barrier()
+static inline __attribute__((always_inline))
+void exec_barrier()
{
threadgroup_barrier(mem_flags::mem_threadgroup);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/cfg-preserve-parameter.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/cfg-preserve-parameter.comp
index 91fe5384dc2..ce1bef3f8e6 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/cfg-preserve-parameter.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/cfg-preserve-parameter.comp
@@ -5,7 +5,8 @@
using namespace metal;
-inline void out_test_0(thread const int& cond, thread int& i)
+static inline __attribute__((always_inline))
+void out_test_0(thread const int& cond, thread int& i)
{
if (cond == 0)
{
@@ -17,7 +18,8 @@ inline void out_test_0(thread const int& cond, thread int& i)
}
}
-inline void out_test_1(thread const int& cond, thread int& i)
+static inline __attribute__((always_inline))
+void out_test_1(thread const int& cond, thread int& i)
{
switch (cond)
{
@@ -34,7 +36,8 @@ inline void out_test_1(thread const int& cond, thread int& i)
}
}
-inline void inout_test_0(thread const int& cond, thread int& i)
+static inline __attribute__((always_inline))
+void inout_test_0(thread const int& cond, thread int& i)
{
if (cond == 0)
{
@@ -42,7 +45,8 @@ inline void inout_test_0(thread const int& cond, thread int& i)
}
}
-inline void inout_test_1(thread const int& cond, thread int& i)
+static inline __attribute__((always_inline))
+void inout_test_1(thread const int& cond, thread int& i)
{
switch (cond)
{
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/complex-composite-constant-array.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/complex-composite-constant-array.comp
new file mode 100644
index 00000000000..2f5549f5fb2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/complex-composite-constant-array.comp
@@ -0,0 +1,65 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct SSBO
+{
+ float4x4 a;
+ uint index;
+};
+
+constant spvUnsafeArray<float4x4, 2> _32 = spvUnsafeArray<float4x4, 2>({ float4x4(float4(1.0, 0.0, 0.0, 0.0), float4(0.0, 1.0, 0.0, 0.0), float4(0.0, 0.0, 1.0, 0.0), float4(0.0, 0.0, 0.0, 1.0)), float4x4(float4(2.0, 0.0, 0.0, 0.0), float4(0.0, 2.0, 0.0, 0.0), float4(0.0, 0.0, 2.0, 0.0), float4(0.0, 0.0, 0.0, 2.0)) });
+
+static inline __attribute__((always_inline))
+void write_global(device SSBO& v_14)
+{
+ v_14.a = _32[v_14.index];
+}
+
+kernel void main0(device SSBO& v_14 [[buffer(0)]])
+{
+ write_global(v_14);
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/complex-type-alias.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/complex-type-alias.comp
index ad429cbf7e6..fc0d57500b7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/complex-type-alias.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/complex-type-alias.comp
@@ -44,7 +44,8 @@ struct SSBO
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(8u, 8u, 1u);
-inline void Zero(thread Foo0& v)
+static inline __attribute__((always_inline))
+void Zero(thread Foo0& v)
{
v.a = 0.0;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/composite-array-initialization.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/composite-array-initialization.comp
index d4051bedacc..c6c17b1f392 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/composite-array-initialization.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/composite-array-initialization.comp
@@ -1,10 +1,49 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct Data
{
float a;
@@ -27,73 +66,20 @@ struct SSBO
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(2u, 1u, 1u);
-constant Data _25[2] = { Data{ 1.0, 2.0 }, Data{ 3.0, 4.0 } };
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
+constant spvUnsafeArray<Data, 2> _25 = spvUnsafeArray<Data, 2>({ Data{ 1.0, 2.0 }, Data{ 3.0, 4.0 } });
-inline Data combine(thread const Data& a, thread const Data& b)
+static inline __attribute__((always_inline))
+Data combine(thread const Data& a, thread const Data& b)
{
return Data{ a.a + b.a, a.b + b.b };
}
kernel void main0(device SSBO& _53 [[buffer(0)]], uint3 gl_WorkGroupID [[threadgroup_position_in_grid]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
{
- Data data[2] = { Data{ 1.0, 2.0 }, Data{ 3.0, 4.0 } };
- Data _31[2] = { Data{ X, 2.0 }, Data{ 3.0, 5.0 } };
- Data data2[2];
- spvArrayCopyFromStackToStack1(data2, _31);
+ spvUnsafeArray<Data, 2> data = spvUnsafeArray<Data, 2>({ Data{ 1.0, 2.0 }, Data{ 3.0, 4.0 } });
+ spvUnsafeArray<Data, 2> _31 = spvUnsafeArray<Data, 2>({ Data{ X, 2.0 }, Data{ 3.0, 5.0 } });
+ spvUnsafeArray<Data, 2> data2;
+ data2 = _31;
Data param = data[gl_LocalInvocationID.x];
Data param_1 = data2[gl_LocalInvocationID.x];
Data _73 = combine(param, param_1);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/composite-construct.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/composite-construct.comp
index 8d6bf982b91..aada82fc92c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/composite-construct.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/composite-construct.comp
@@ -1,10 +1,49 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct SSBO0
{
float4 as[1];
@@ -23,67 +62,13 @@ struct Composite
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-constant float4 _43[2] = { float4(20.0), float4(40.0) };
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
+constant spvUnsafeArray<float4, 2> _43 = spvUnsafeArray<float4, 2>({ float4(20.0), float4(40.0) });
kernel void main0(device SSBO0& _16 [[buffer(0)]], device SSBO1& _32 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]])
{
- float4 _37[2] = { _16.as[gl_GlobalInvocationID.x], _32.bs[gl_GlobalInvocationID.x] };
- float4 values[2];
- spvArrayCopyFromStackToStack1(values, _37);
+ spvUnsafeArray<float4, 2> _37 = spvUnsafeArray<float4, 2>({ _16.as[gl_GlobalInvocationID.x], _32.bs[gl_GlobalInvocationID.x] });
+ spvUnsafeArray<float4, 2> values;
+ values = _37;
Composite c = Composite{ values[0], _43[1] };
_16.as[0] = values[gl_LocalInvocationIndex];
_32.bs[1] = c.b;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/copy-array-of-arrays.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/copy-array-of-arrays.comp
index 5f8b033037d..21fb9b367c5 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/copy-array-of-arrays.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/copy-array-of-arrays.comp
@@ -1,202 +1,79 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
-struct BUF
-{
- int a;
- float b;
- float c;
-};
-
-constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-
-constant float _16[2] = { 1.0, 2.0 };
-constant float _19[2] = { 3.0, 4.0 };
-constant float _20[2][2] = { { 1.0, 2.0 }, { 3.0, 4.0 } };
-constant float _21[2][2][2] = { { { 1.0, 2.0 }, { 3.0, 4.0 } }, { { 1.0, 2.0 }, { 3.0, 4.0 } } };
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
+template<typename T, size_t Num>
+struct spvUnsafeArray
{
- for (uint i = 0; i < A; i++)
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const thread T& operator [] (size_t pos) const thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ device T& operator [] (size_t pos) device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A, uint B>
-inline void spvArrayCopyFromConstantToStack2(thread T (&dst)[A][B], constant T (&src)[A][B])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const device T& operator [] (size_t pos) const device
{
- spvArrayCopyFromConstantToStack1(dst[i], src[i]);
+ return elements[pos];
}
-}
-
-template<typename T, uint A, uint B>
-inline void spvArrayCopyFromConstantToThreadGroup2(threadgroup T (&dst)[A][B], constant T (&src)[A][B])
-{
- for (uint i = 0; i < A; i++)
+
+ constexpr const constant T& operator [] (size_t pos) const constant
{
- spvArrayCopyFromConstantToThreadGroup1(dst[i], src[i]);
+ return elements[pos];
}
-}
-
-template<typename T, uint A, uint B>
-inline void spvArrayCopyFromStackToStack2(thread T (&dst)[A][B], thread const T (&src)[A][B])
-{
- for (uint i = 0; i < A; i++)
+
+ threadgroup T& operator [] (size_t pos) threadgroup
{
- spvArrayCopyFromStackToStack1(dst[i], src[i]);
+ return elements[pos];
}
-}
-
-template<typename T, uint A, uint B>
-inline void spvArrayCopyFromStackToThreadGroup2(threadgroup T (&dst)[A][B], thread const T (&src)[A][B])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
{
- spvArrayCopyFromStackToThreadGroup1(dst[i], src[i]);
+ return elements[pos];
}
-}
-
-template<typename T, uint A, uint B>
-inline void spvArrayCopyFromThreadGroupToStack2(thread T (&dst)[A][B], threadgroup const T (&src)[A][B])
-{
- for (uint i = 0; i < A; i++)
- {
- spvArrayCopyFromThreadGroupToStack1(dst[i], src[i]);
- }
-}
-
-template<typename T, uint A, uint B>
-inline void spvArrayCopyFromThreadGroupToThreadGroup2(threadgroup T (&dst)[A][B], threadgroup const T (&src)[A][B])
-{
- for (uint i = 0; i < A; i++)
- {
- spvArrayCopyFromThreadGroupToThreadGroup1(dst[i], src[i]);
- }
-}
-
-template<typename T, uint A, uint B, uint C>
-inline void spvArrayCopyFromConstantToStack3(thread T (&dst)[A][B][C], constant T (&src)[A][B][C])
-{
- for (uint i = 0; i < A; i++)
- {
- spvArrayCopyFromConstantToStack2(dst[i], src[i]);
- }
-}
-
-template<typename T, uint A, uint B, uint C>
-inline void spvArrayCopyFromConstantToThreadGroup3(threadgroup T (&dst)[A][B][C], constant T (&src)[A][B][C])
-{
- for (uint i = 0; i < A; i++)
- {
- spvArrayCopyFromConstantToThreadGroup2(dst[i], src[i]);
- }
-}
-
-template<typename T, uint A, uint B, uint C>
-inline void spvArrayCopyFromStackToStack3(thread T (&dst)[A][B][C], thread const T (&src)[A][B][C])
-{
- for (uint i = 0; i < A; i++)
- {
- spvArrayCopyFromStackToStack2(dst[i], src[i]);
- }
-}
+};
-template<typename T, uint A, uint B, uint C>
-inline void spvArrayCopyFromStackToThreadGroup3(threadgroup T (&dst)[A][B][C], thread const T (&src)[A][B][C])
+struct BUF
{
- for (uint i = 0; i < A; i++)
- {
- spvArrayCopyFromStackToThreadGroup2(dst[i], src[i]);
- }
-}
+ int a;
+ float b;
+ float c;
+};
-template<typename T, uint A, uint B, uint C>
-inline void spvArrayCopyFromThreadGroupToStack3(thread T (&dst)[A][B][C], threadgroup const T (&src)[A][B][C])
-{
- for (uint i = 0; i < A; i++)
- {
- spvArrayCopyFromThreadGroupToStack2(dst[i], src[i]);
- }
-}
+constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-template<typename T, uint A, uint B, uint C>
-inline void spvArrayCopyFromThreadGroupToThreadGroup3(threadgroup T (&dst)[A][B][C], threadgroup const T (&src)[A][B][C])
-{
- for (uint i = 0; i < A; i++)
- {
- spvArrayCopyFromThreadGroupToThreadGroup2(dst[i], src[i]);
- }
-}
+constant spvUnsafeArray<float, 2> _16 = spvUnsafeArray<float, 2>({ 1.0, 2.0 });
+constant spvUnsafeArray<float, 2> _19 = spvUnsafeArray<float, 2>({ 3.0, 4.0 });
+constant spvUnsafeArray<spvUnsafeArray<float, 2>, 2> _20 = spvUnsafeArray<spvUnsafeArray<float, 2>, 2>({ spvUnsafeArray<float, 2>({ 1.0, 2.0 }), spvUnsafeArray<float, 2>({ 3.0, 4.0 }) });
+constant spvUnsafeArray<spvUnsafeArray<spvUnsafeArray<float, 2>, 2>, 2> _21 = spvUnsafeArray<spvUnsafeArray<spvUnsafeArray<float, 2>, 2>, 2>({ spvUnsafeArray<spvUnsafeArray<float, 2>, 2>({ spvUnsafeArray<float, 2>({ 1.0, 2.0 }), spvUnsafeArray<float, 2>({ 3.0, 4.0 }) }), spvUnsafeArray<spvUnsafeArray<float, 2>, 2>({ spvUnsafeArray<float, 2>({ 1.0, 2.0 }), spvUnsafeArray<float, 2>({ 3.0, 4.0 }) }) });
kernel void main0(device BUF& o [[buffer(0)]])
{
- float c[2][2][2];
- spvArrayCopyFromConstantToStack3(c, _21);
+ spvUnsafeArray<spvUnsafeArray<spvUnsafeArray<float, 2>, 2>, 2> c;
+ c = _21;
o.a = int(c[1][1][1]);
- float _43[2] = { o.b, o.c };
- float _48[2] = { o.b, o.b };
- float _49[2][2] = { { _43[0], _43[1] }, { _48[0], _48[1] } };
- float _54[2] = { o.c, o.c };
- float _59[2] = { o.c, o.b };
- float _60[2][2] = { { _54[0], _54[1] }, { _59[0], _59[1] } };
- float _61[2][2][2] = { { { _49[0][0], _49[0][1] }, { _49[1][0], _49[1][1] } }, { { _60[0][0], _60[0][1] }, { _60[1][0], _60[1][1] } } };
- float d[2][2][2];
- spvArrayCopyFromStackToStack3(d, _61);
- float e[2][2][2];
- spvArrayCopyFromStackToStack3(e, d);
+ spvUnsafeArray<float, 2> _43 = spvUnsafeArray<float, 2>({ o.b, o.c });
+ spvUnsafeArray<float, 2> _48 = spvUnsafeArray<float, 2>({ o.b, o.b });
+ spvUnsafeArray<spvUnsafeArray<float, 2>, 2> _49 = spvUnsafeArray<spvUnsafeArray<float, 2>, 2>({ _43, _48 });
+ spvUnsafeArray<float, 2> _54 = spvUnsafeArray<float, 2>({ o.c, o.c });
+ spvUnsafeArray<float, 2> _59 = spvUnsafeArray<float, 2>({ o.c, o.b });
+ spvUnsafeArray<spvUnsafeArray<float, 2>, 2> _60 = spvUnsafeArray<spvUnsafeArray<float, 2>, 2>({ _54, _59 });
+ spvUnsafeArray<spvUnsafeArray<spvUnsafeArray<float, 2>, 2>, 2> _61 = spvUnsafeArray<spvUnsafeArray<spvUnsafeArray<float, 2>, 2>, 2>({ _49, _60 });
+ spvUnsafeArray<spvUnsafeArray<spvUnsafeArray<float, 2>, 2>, 2> d;
+ d = _61;
+ spvUnsafeArray<spvUnsafeArray<spvUnsafeArray<float, 2>, 2>, 2> e;
+ e = d;
o.b = e[1][0][1];
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/functions.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/functions.comp
index 947077879c7..b1072608787 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/functions.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/functions.comp
@@ -5,7 +5,8 @@
using namespace metal;
-inline void myfunc(threadgroup int (&foo)[1337])
+static inline __attribute__((always_inline))
+void myfunc(threadgroup int (&foo)[1337])
{
foo[0] = 13;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/global-invocation-id-writable-ssbo-in-function.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/global-invocation-id-writable-ssbo-in-function.comp
index f398ef671a3..dbc5886356f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/global-invocation-id-writable-ssbo-in-function.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/global-invocation-id-writable-ssbo-in-function.comp
@@ -18,7 +18,8 @@ inline Tx mod(Tx x, Ty y)
return x - y * floor(x / y);
}
-inline float getB(device myBlock& myStorage, thread uint3& gl_GlobalInvocationID)
+static inline __attribute__((always_inline))
+float getB(device myBlock& myStorage, thread uint3& gl_GlobalInvocationID)
{
return myStorage.b[gl_GlobalInvocationID.x];
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/int64.invalid.msl22.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/int64.invalid.msl22.comp
index dd014343816..d5bbbb47fc6 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/int64.invalid.msl22.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/int64.invalid.msl22.comp
@@ -1,14 +1,55 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct M0
{
long v;
- long2 b[2];
+ spvUnsafeArray<long2, 2> b;
ulong c;
- ulong d[5];
+ spvUnsafeArray<ulong, 5> d;
};
struct SSBO0_Type
@@ -25,14 +66,14 @@ struct SSBO1_Type
struct SSBO2_Type
{
- long a[4];
- long2 b[4];
+ spvUnsafeArray<long, 4> a;
+ spvUnsafeArray<long2, 4> b;
};
struct SSBO3_Type
{
- long a[4];
- long2 b[4];
+ spvUnsafeArray<long, 4> a;
+ spvUnsafeArray<long2, 4> b;
};
struct SSBO
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/inverse.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/inverse.comp
index a4ef60c4273..33aed468f73 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/inverse.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/inverse.comp
@@ -22,20 +22,23 @@ struct MatrixIn
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
// Returns the determinant of a 2x2 matrix.
-inline float spvDet2x2(float a1, float a2, float b1, float b2)
+static inline __attribute__((always_inline))
+float spvDet2x2(float a1, float a2, float b1, float b2)
{
return a1 * b2 - b1 * a2;
}
// Returns the determinant of a 3x3 matrix.
-inline float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
+static inline __attribute__((always_inline))
+float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
{
return a1 * spvDet2x2(b2, b3, c2, c3) - b1 * spvDet2x2(a2, a3, c2, c3) + c1 * spvDet2x2(a2, a3, b2, b3);
}
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
// adjoint and dividing by the determinant. The contents of the matrix are changed.
-inline float4x4 spvInverse4x4(float4x4 m)
+static inline __attribute__((always_inline))
+float4x4 spvInverse4x4(float4x4 m)
{
float4x4 adj; // The adjoint matrix (inverse after dividing by determinant)
@@ -70,7 +73,8 @@ inline float4x4 spvInverse4x4(float4x4 m)
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
// adjoint and dividing by the determinant. The contents of the matrix are changed.
-inline float3x3 spvInverse3x3(float3x3 m)
+static inline __attribute__((always_inline))
+float3x3 spvInverse3x3(float3x3 m)
{
float3x3 adj; // The adjoint matrix (inverse after dividing by determinant)
@@ -97,7 +101,8 @@ inline float3x3 spvInverse3x3(float3x3 m)
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
// adjoint and dividing by the determinant. The contents of the matrix are changed.
-inline float2x2 spvInverse2x2(float2x2 m)
+static inline __attribute__((always_inline))
+float2x2 spvInverse2x2(float2x2 m)
{
float2x2 adj; // The adjoint matrix (inverse after dividing by determinant)
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/shared-array-of-arrays.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/shared-array-of-arrays.comp
index 510297802b0..8b532368959 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/shared-array-of-arrays.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/shared-array-of-arrays.comp
@@ -12,7 +12,8 @@ struct SSBO
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(4u, 4u, 1u);
-inline void work(threadgroup float (&foo)[4][4], thread uint3& gl_LocalInvocationID, thread uint& gl_LocalInvocationIndex, device SSBO& v_67, thread uint3& gl_GlobalInvocationID)
+static inline __attribute__((always_inline))
+void work(threadgroup float (&foo)[4][4], thread uint3& gl_LocalInvocationID, thread uint& gl_LocalInvocationIndex, device SSBO& v_67, thread uint3& gl_GlobalInvocationID)
{
foo[gl_LocalInvocationID.x][gl_LocalInvocationID.y] = float(gl_LocalInvocationIndex);
threadgroup_barrier(mem_flags::mem_threadgroup);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/spec-constant-work-group-size.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/spec-constant-work-group-size.comp
index bb796ab95d7..de30edec155 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/spec-constant-work-group-size.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/spec-constant-work-group-size.comp
@@ -1,8 +1,49 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
#ifndef SPIRV_CROSS_CONSTANT_ID_1
#define SPIRV_CROSS_CONSTANT_ID_1 2
#endif
@@ -27,7 +68,7 @@ constant int _32 = (1 - a);
kernel void main0(device SSBO& _17 [[buffer(0)]])
{
- int spec_const_array_size[b];
+ spvUnsafeArray<int, b> spec_const_array_size;
spec_const_array_size[a] = a;
_17.v[_30] = b + spec_const_array_size[_32];
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/storage-buffer-std140-vector-array.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/storage-buffer-std140-vector-array.comp
index 0cafa5f3820..b8e086b6458 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/storage-buffer-std140-vector-array.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/storage-buffer-std140-vector-array.comp
@@ -1,14 +1,55 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct Sub
{
- float f[2];
- float2 f2[2];
- float3 f3[2];
- float4 f4[2];
+ spvUnsafeArray<float, 2> f;
+ spvUnsafeArray<float2, 2> f2;
+ spvUnsafeArray<float3, 2> f3;
+ spvUnsafeArray<float4, 2> f4;
};
struct Sub_1
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/type-alias.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/type-alias.comp
index e419efb2c1b..e3ac031668f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/type-alias.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/type-alias.comp
@@ -42,12 +42,14 @@ struct SSBO2
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
-inline float4 overload(thread const S0& s0)
+static inline __attribute__((always_inline))
+float4 overload(thread const S0& s0)
{
return s0.a;
}
-inline float4 overload(thread const S1& s1)
+static inline __attribute__((always_inline))
+float4 overload(thread const S1& s1)
{
return s1.a;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc
index a5e30b6de1a..01fceeb6c7b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc
@@ -1,8 +1,49 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct main0_out
{
float3 vVertex;
@@ -10,7 +51,7 @@ struct main0_out
struct main0_patchOut
{
- float3 vPatch[2];
+ spvUnsafeArray<float3, 2> vPatch;
};
struct main0_in
@@ -28,7 +69,7 @@ kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_
if (gl_InvocationID >= 4)
return;
gl_out[gl_InvocationID].vVertex = gl_in[gl_InvocationID].vInput + gl_in[gl_InvocationID ^ 1].vInput;
- threadgroup_barrier(mem_flags::mem_device);
+ threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup);
if (gl_InvocationID == 0)
{
patchOut.vPatch[0] = float3(10.0);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/basic.desktop.sso.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/basic.desktop.sso.tesc
index 3da718142d0..054b4e74188 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/basic.desktop.sso.tesc
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/basic.desktop.sso.tesc
@@ -20,7 +20,8 @@ struct main0_in
float4 gl_Position [[attribute(0)]];
};
-inline void set_position(device main0_out* thread & gl_out, thread uint& gl_InvocationID, threadgroup main0_in* thread & gl_in)
+static inline __attribute__((always_inline))
+void set_position(device main0_out* thread & gl_out, thread uint& gl_InvocationID, threadgroup main0_in* thread & gl_in)
{
gl_out[gl_InvocationID].gl_Position = gl_in[0].gl_Position + gl_in[1].gl_Position;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc
index cd4d8d80e52..e7e184a980a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc
@@ -28,10 +28,8 @@ kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_
threadgroup_barrier(mem_flags::mem_threadgroup);
if (gl_InvocationID >= 4)
return;
- Boo vInput_24;
- vInput_24.a = gl_in[gl_InvocationID].Boo_a;
- vInput_24.b = gl_in[gl_InvocationID].Boo_b;
- gl_out[gl_InvocationID].vVertex = vInput_24;
+ Boo _25 = Boo{ gl_in[gl_InvocationID].Boo_a, gl_in[gl_InvocationID].Boo_b };
+ gl_out[gl_InvocationID].vVertex = _25;
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0] = half(1.0);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1] = half(2.0);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2] = half(3.0);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/argument-buffers.msl2.argument.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/argument-buffers.msl2.argument.frag
index 7092dfdbdf2..b7005ff981e 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/argument-buffers.msl2.argument.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/argument-buffers.msl2.argument.frag
@@ -62,7 +62,8 @@ struct main0_in
float2 vUV [[user(locn0)]];
};
-inline float4 sample_in_function2(thread texture2d<float> uTexture, thread const sampler uTextureSmplr, thread float2& vUV, thread const array<texture2d<float>, 4> uTexture2, thread const array<sampler, 2> uSampler, thread const array<texture2d<float>, 2> uTextures, thread const array<sampler, 2> uTexturesSmplr, device SSBO& v_60, const device SSBOs* constant (&ssbos)[2], constant Push& registers)
+static inline __attribute__((always_inline))
+float4 sample_in_function2(thread texture2d<float> uTexture, thread const sampler uTextureSmplr, thread float2& vUV, thread const array<texture2d<float>, 4> uTexture2, thread const array<sampler, 2> uSampler, thread const array<texture2d<float>, 2> uTextures, thread const array<sampler, 2> uTexturesSmplr, device SSBO& v_60, const device SSBOs* constant (&ssbos)[2], constant Push& registers)
{
float4 ret = uTexture.sample(uTextureSmplr, vUV);
ret += uTexture2[2].sample(uSampler[1], vUV);
@@ -73,7 +74,8 @@ inline float4 sample_in_function2(thread texture2d<float> uTexture, thread const
return ret;
}
-inline float4 sample_in_function(thread texture2d<float> uTexture, thread const sampler uTextureSmplr, thread float2& vUV, thread const array<texture2d<float>, 4> uTexture2, thread const array<sampler, 2> uSampler, thread const array<texture2d<float>, 2> uTextures, thread const array<sampler, 2> uTexturesSmplr, device SSBO& v_60, const device SSBOs* constant (&ssbos)[2], constant Push& registers, constant UBO& v_90, constant UBOs* constant (&ubos)[4])
+static inline __attribute__((always_inline))
+float4 sample_in_function(thread texture2d<float> uTexture, thread const sampler uTextureSmplr, thread float2& vUV, thread const array<texture2d<float>, 4> uTexture2, thread const array<sampler, 2> uSampler, thread const array<texture2d<float>, 2> uTextures, thread const array<sampler, 2> uTexturesSmplr, device SSBO& v_60, const device SSBOs* constant (&ssbos)[2], constant Push& registers, constant UBO& v_90, constant UBOs* constant (&ubos)[4])
{
float4 ret = sample_in_function2(uTexture, uTextureSmplr, vUV, uTexture2, uSampler, uTextures, uTexturesSmplr, v_60, ssbos, registers);
ret += v_90.ubo;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-lut-no-loop-variable.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-lut-no-loop-variable.frag
index 87158849b6f..cdedd73a748 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-lut-no-loop-variable.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-lut-no-loop-variable.frag
@@ -1,9 +1,50 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
-constant float _17[5] = { 1.0, 2.0, 3.0, 4.0, 5.0 };
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+constant spvUnsafeArray<float, 5> _17 = spvUnsafeArray<float, 5>({ 1.0, 2.0, 3.0, 4.0, 5.0 });
struct main0_out
{
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-of-array-lut.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-of-array-lut.frag
new file mode 100644
index 00000000000..ba553824e79
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-of-array-lut.frag
@@ -0,0 +1,68 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+constant spvUnsafeArray<float, 3> _17 = spvUnsafeArray<float, 3>({ 1.0, 2.0, 3.0 });
+constant spvUnsafeArray<float, 3> _21 = spvUnsafeArray<float, 3>({ 4.0, 5.0, 6.0 });
+constant spvUnsafeArray<spvUnsafeArray<float, 3>, 2> _22 = spvUnsafeArray<spvUnsafeArray<float, 3>, 2>({ spvUnsafeArray<float, 3>({ 1.0, 2.0, 3.0 }), spvUnsafeArray<float, 3>({ 4.0, 5.0, 6.0 }) });
+
+struct main0_out
+{
+ float vOutput [[color(0)]];
+};
+
+struct main0_in
+{
+ int vIndex1 [[user(locn0)]];
+ int vIndex2 [[user(locn1)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]])
+{
+ main0_out out = {};
+ out.vOutput = _22[in.vIndex1][in.vIndex2];
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.argument.discrete.swizzle.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.argument.discrete.swizzle.frag
index e06824407b2..833ddec0118 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.argument.discrete.swizzle.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.argument.discrete.swizzle.frag
@@ -82,17 +82,20 @@ inline T spvTextureSwizzle(T x, uint s)
return spvTextureSwizzle(vec<T, 4>(x, 0, 0, 1), s).x;
}
-inline float4 sample_in_func_1(thread const array<texture2d<float>, 4> uSampler0, thread const array<sampler, 4> uSampler0Smplr, constant uint* uSampler0Swzl, thread float2& vUV)
+static inline __attribute__((always_inline))
+float4 sample_in_func_1(thread const array<texture2d<float>, 4> uSampler0, thread const array<sampler, 4> uSampler0Smplr, constant uint* uSampler0Swzl, thread float2& vUV)
{
return spvTextureSwizzle(uSampler0[2].sample(uSampler0Smplr[2], vUV), uSampler0Swzl[2]);
}
-inline float4 sample_in_func_2(thread float2& vUV, thread texture2d<float> uSampler1, thread const sampler uSampler1Smplr, constant uint& uSampler1Swzl)
+static inline __attribute__((always_inline))
+float4 sample_in_func_2(thread float2& vUV, thread texture2d<float> uSampler1, thread const sampler uSampler1Smplr, constant uint& uSampler1Swzl)
{
return spvTextureSwizzle(uSampler1.sample(uSampler1Smplr, vUV), uSampler1Swzl);
}
-inline float4 sample_single_in_func(thread const texture2d<float> s, thread const sampler sSmplr, constant uint& sSwzl, thread float2& vUV)
+static inline __attribute__((always_inline))
+float4 sample_single_in_func(thread const texture2d<float> s, thread const sampler sSmplr, constant uint& sSwzl, thread float2& vUV)
{
return spvTextureSwizzle(s.sample(sSmplr, vUV), sSwzl);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.swizzle.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.swizzle.frag
index 19d030063f7..64b361ec971 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.swizzle.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.swizzle.frag
@@ -75,12 +75,14 @@ inline T spvTextureSwizzle(T x, uint s)
return spvTextureSwizzle(vec<T, 4>(x, 0, 0, 1), s).x;
}
-inline float4 sample_in_func(thread const array<texture2d<float>, 4> uSampler, thread const array<sampler, 4> uSamplerSmplr, constant uint* uSamplerSwzl, thread float2& vUV)
+static inline __attribute__((always_inline))
+float4 sample_in_func(thread const array<texture2d<float>, 4> uSampler, thread const array<sampler, 4> uSamplerSmplr, constant uint* uSamplerSwzl, thread float2& vUV)
{
return spvTextureSwizzle(uSampler[2].sample(uSamplerSmplr[2], vUV), uSamplerSwzl[2]);
}
-inline float4 sample_single_in_func(thread const texture2d<float> s, thread const sampler sSmplr, constant uint& sSwzl, thread float2& vUV)
+static inline __attribute__((always_inline))
+float4 sample_single_in_func(thread const texture2d<float> s, thread const sampler sSmplr, constant uint& sSwzl, thread float2& vUV)
{
return spvTextureSwizzle(s.sample(sSmplr, vUV), sSwzl);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/buffer-read-write.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/buffer-read-write.frag
index 36b1a18098b..166d4311ba0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/buffer-read-write.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/buffer-read-write.frag
@@ -11,7 +11,8 @@ struct main0_out
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/constant-array.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/constant-array.frag
index 0950d23d97b..990860762c3 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/constant-array.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/constant-array.frag
@@ -1,21 +1,60 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct Foobar
{
float a;
float b;
};
-constant float4 _37[3] = { float4(1.0), float4(2.0), float4(3.0) };
-constant float4 _49[2] = { float4(1.0), float4(2.0) };
-constant float4 _54[2] = { float4(8.0), float4(10.0) };
-constant float4 _55[2][2] = { { float4(1.0), float4(2.0) }, { float4(8.0), float4(10.0) } };
-constant Foobar _75[2] = { Foobar{ 10.0, 40.0 }, Foobar{ 90.0, 70.0 } };
+constant spvUnsafeArray<float4, 3> _37 = spvUnsafeArray<float4, 3>({ float4(1.0), float4(2.0), float4(3.0) });
+constant spvUnsafeArray<float4, 2> _49 = spvUnsafeArray<float4, 2>({ float4(1.0), float4(2.0) });
+constant spvUnsafeArray<float4, 2> _54 = spvUnsafeArray<float4, 2>({ float4(8.0), float4(10.0) });
+constant spvUnsafeArray<spvUnsafeArray<float4, 2>, 2> _55 = spvUnsafeArray<spvUnsafeArray<float4, 2>, 2>({ spvUnsafeArray<float4, 2>({ float4(1.0), float4(2.0) }), spvUnsafeArray<float4, 2>({ float4(8.0), float4(10.0) }) });
+constant spvUnsafeArray<Foobar, 2> _75 = spvUnsafeArray<Foobar, 2>({ Foobar{ 10.0, 40.0 }, Foobar{ 90.0, 70.0 } });
struct main0_out
{
@@ -27,7 +66,8 @@ struct main0_in
int index [[user(locn0)]];
};
-inline float4 resolve(thread const Foobar& f)
+static inline __attribute__((always_inline))
+float4 resolve(thread const Foobar& f)
{
return float4(f.a + f.b);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/constant-composites.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/constant-composites.frag
index ccaac97bcbc..e0fa980fb85 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/constant-composites.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/constant-composites.frag
@@ -1,18 +1,56 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct Foo
{
float a;
float b;
};
-constant float _16[4] = { 1.0, 4.0, 3.0, 2.0 };
-constant Foo _28[2] = { Foo{ 10.0, 20.0 }, Foo{ 30.0, 40.0 } };
+constant spvUnsafeArray<float, 4> _16 = spvUnsafeArray<float, 4>({ 1.0, 4.0, 3.0, 2.0 });
struct main0_out
{
@@ -24,62 +62,10 @@ struct main0_in
int line [[user(locn0)]];
};
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
- {
- dst[i] = src[i];
- }
-}
-
fragment main0_out main0(main0_in in [[stage_in]])
{
+ spvUnsafeArray<Foo, 2> _28 = spvUnsafeArray<Foo, 2>({ Foo{ 10.0, 20.0 }, Foo{ 30.0, 40.0 } });
+
main0_out out = {};
out.FragColor = float4(_16[in.line]);
out.FragColor += float4(_28[in.line].a * _28[1 - in.line].a);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/flush_params.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/flush_params.frag
index ef3b688b447..905a179bc6a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/flush_params.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/flush_params.frag
@@ -15,12 +15,14 @@ struct main0_out
float4 FragColor [[color(0)]];
};
-inline void foo2(thread Structy& f)
+static inline __attribute__((always_inline))
+void foo2(thread Structy& f)
{
f.c = float4(10.0);
}
-inline Structy foo()
+static inline __attribute__((always_inline))
+Structy foo()
{
Structy param;
foo2(param);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/fp16.desktop.invalid.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/fp16.desktop.invalid.frag
index 4791a0bb803..2814a12f135 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/fp16.desktop.invalid.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/fp16.desktop.invalid.frag
@@ -40,17 +40,20 @@ inline T degrees(T r)
return r * T(57.2957795131);
}
-inline half2x2 test_mat2(thread const half2& a, thread const half2& b, thread const half2& c, thread const half2& d)
+static inline __attribute__((always_inline))
+half2x2 test_mat2(thread const half2& a, thread const half2& b, thread const half2& c, thread const half2& d)
{
return half2x2(half2(a), half2(b)) * half2x2(half2(c), half2(d));
}
-inline half3x3 test_mat3(thread const half3& a, thread const half3& b, thread const half3& c, thread const half3& d, thread const half3& e, thread const half3& f)
+static inline __attribute__((always_inline))
+half3x3 test_mat3(thread const half3& a, thread const half3& b, thread const half3& c, thread const half3& d, thread const half3& e, thread const half3& f)
{
return half3x3(half3(a), half3(b), half3(c)) * half3x3(half3(d), half3(e), half3(f));
}
-inline void test_constants()
+static inline __attribute__((always_inline))
+void test_constants()
{
half a = half(1.0);
half b = half(1.5);
@@ -62,12 +65,14 @@ inline void test_constants()
half h = half(9.5367431640625e-07);
}
-inline half test_result()
+static inline __attribute__((always_inline))
+half test_result()
{
return half(1.0);
}
-inline void test_conversions()
+static inline __attribute__((always_inline))
+void test_conversions()
{
half one = test_result();
int a = int(one);
@@ -80,7 +85,8 @@ inline void test_conversions()
half d2 = half(d);
}
-inline void test_builtins(thread half4& v4, thread half3& v3, thread half& v1)
+static inline __attribute__((always_inline))
+void test_builtins(thread half4& v4, thread half3& v3, thread half& v1)
{
half4 res = radians(v4);
res = degrees(v4);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/fragment-component-padding.pad-fragment.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/fragment-component-padding.pad-fragment.frag
index 58bafc9e504..7c2925264d2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/fragment-component-padding.pad-fragment.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/fragment-component-padding.pad-fragment.frag
@@ -1,10 +1,49 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct main0_out
{
float4 FragColors_0 [[color(0)]];
@@ -18,7 +57,8 @@ struct main0_in
float3 vColor [[user(locn0)]];
};
-inline void set_globals(thread float (&FragColors)[2], thread float3& vColor, thread float2& FragColor2, thread float3& FragColor3)
+static inline __attribute__((always_inline))
+void set_globals(thread spvUnsafeArray<float, 2> (&FragColors), thread float3& vColor, thread float2& FragColor2, thread float3& FragColor3)
{
FragColors[0] = vColor.x;
FragColors[1] = vColor.y;
@@ -29,7 +69,7 @@ inline void set_globals(thread float (&FragColors)[2], thread float3& vColor, th
fragment main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
- float FragColors[2] = {};
+ spvUnsafeArray<float, 2> FragColors = {};
float2 FragColor2 = {};
float3 FragColor3 = {};
set_globals(FragColors, in.vColor, FragColor2, FragColor3);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/helper-invocation.msl21.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/helper-invocation.msl21.frag
index bc2b17c7feb..97d69e19dce 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/helper-invocation.msl21.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/helper-invocation.msl21.frag
@@ -15,7 +15,8 @@ struct main0_in
float2 vUV [[user(locn0)]];
};
-inline float4 foo(thread bool& gl_HelperInvocation, thread texture2d<float> uSampler, thread const sampler uSamplerSmplr, thread float2& vUV)
+static inline __attribute__((always_inline))
+float4 foo(thread bool& gl_HelperInvocation, thread texture2d<float> uSampler, thread const sampler uSamplerSmplr, thread float2& vUV)
{
float4 color;
if (!gl_HelperInvocation)
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag
new file mode 100644
index 00000000000..0e35c2485a6
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag
@@ -0,0 +1,58 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct UBO
+{
+ float4 v;
+};
+
+struct spvDescriptorSetBuffer0
+{
+ array<texture2d<float>, 10000> uSamplers [[id(0)]];
+ array<sampler, 10000> uSamplersSmplr [[id(10000)]];
+};
+
+struct spvDescriptorSetBuffer1
+{
+ constant UBO* vs [[id(0)]][10000];
+};
+
+struct spvDescriptorSetBuffer2
+{
+ texture2d<float> uSampler [[id(0)]];
+ sampler uSamplerSmplr [[id(1)]];
+};
+
+struct main0_out
+{
+ float4 FragColor [[color(0)]];
+};
+
+struct main0_in
+{
+ float2 vUV [[user(locn0)]];
+};
+
+static inline __attribute__((always_inline))
+float4 samp_array(thread const array<texture2d<float>, 10000> uSamplers, thread const array<sampler, 10000> uSamplersSmplr, thread float2& vUV, constant UBO* const device (&vs)[10000])
+{
+ return uSamplers[9999].sample(uSamplersSmplr[9999], vUV) + vs[5000]->v;
+}
+
+static inline __attribute__((always_inline))
+float4 samp_single(thread float2& vUV, thread texture2d<float> uSampler, thread const sampler uSamplerSmplr)
+{
+ return uSampler.sample(uSamplerSmplr, vUV);
+}
+
+fragment main0_out main0(main0_in in [[stage_in]], const device spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], const device spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]], constant spvDescriptorSetBuffer2& spvDescriptorSet2 [[buffer(2)]])
+{
+ main0_out out = {};
+ out.FragColor = samp_array(spvDescriptorSet0.uSamplers, spvDescriptorSet0.uSamplersSmplr, in.vUV, spvDescriptorSet1.vs) + samp_single(in.vUV, spvDescriptorSet2.uSampler, spvDescriptorSet2.uSamplerSmplr);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/image-query-lod.msl22.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/image-query-lod.msl22.frag
index 43074427419..6e7991f28ae 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/image-query-lod.msl22.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/image-query-lod.msl22.frag
@@ -15,7 +15,8 @@ struct main0_in
float3 vUV [[user(locn0)]];
};
-inline void from_function(thread float2& FragColor, thread texture2d<float> uSampler2D, thread const sampler uSampler2DSmplr, thread float3& vUV, thread texture3d<float> uSampler3D, thread const sampler uSampler3DSmplr, thread texturecube<float> uSamplerCube, thread const sampler uSamplerCubeSmplr, thread texture2d<float> uTexture2D, thread sampler uSampler, thread texture3d<float> uTexture3D, thread texturecube<float> uTextureCube)
+static inline __attribute__((always_inline))
+void from_function(thread float2& FragColor, thread texture2d<float> uSampler2D, thread const sampler uSampler2DSmplr, thread float3& vUV, thread texture3d<float> uSampler3D, thread const sampler uSampler3DSmplr, thread texturecube<float> uSamplerCube, thread const sampler uSamplerCubeSmplr, thread texture2d<float> uTexture2D, thread sampler uSampler, thread texture3d<float> uTexture3D, thread texturecube<float> uTextureCube)
{
float2 _22;
_22.x = uSampler2D.calculate_clamped_lod(uSampler2DSmplr, vUV.xy);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/input-attachment-ms.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/input-attachment-ms.frag
index 80dd6d665fc..6f5c2b94c86 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/input-attachment-ms.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/input-attachment-ms.frag
@@ -10,7 +10,8 @@ struct main0_out
float4 FragColor [[color(0)]];
};
-inline float4 load_subpasses(thread const texture2d_ms<float> uInput, thread uint& gl_SampleID, thread float4& gl_FragCoord)
+static inline __attribute__((always_inline))
+float4 load_subpasses(thread const texture2d_ms<float> uInput, thread uint& gl_SampleID, thread float4& gl_FragCoord)
{
return uInput.read(uint2(gl_FragCoord.xy), gl_SampleID);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/input-attachment.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/input-attachment.frag
index 7224722691e..d43b0adc4e9 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/input-attachment.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/input-attachment.frag
@@ -10,7 +10,8 @@ struct main0_out
float4 FragColor [[color(0)]];
};
-inline float4 load_subpasses(thread const texture2d<float> uInput, thread float4& gl_FragCoord)
+static inline __attribute__((always_inline))
+float4 load_subpasses(thread const texture2d<float> uInput, thread float4& gl_FragCoord)
{
return uInput.read(uint2(gl_FragCoord.xy), 0);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/lut-promotion.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/lut-promotion.frag
index 1af7f872bdc..b1e0e7311dc 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/lut-promotion.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/lut-promotion.frag
@@ -1,77 +1,62 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
-constant float _16[16] = { 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0 };
-constant float4 _60[4] = { float4(0.0), float4(1.0), float4(8.0), float4(5.0) };
-constant float4 _104[4] = { float4(20.0), float4(30.0), float4(50.0), float4(60.0) };
-
-struct main0_out
-{
- float FragColor [[color(0)]];
-};
-
-struct main0_in
-{
- int index [[user(locn0)]];
-};
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
+template<typename T, size_t Num>
+struct spvUnsafeArray
{
- for (uint i = 0; i < A; i++)
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const thread T& operator [] (size_t pos) const thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ device T& operator [] (size_t pos) device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const device T& operator [] (size_t pos) const device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ constexpr const constant T& operator [] (size_t pos) const constant
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ threadgroup T& operator [] (size_t pos) threadgroup
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+constant spvUnsafeArray<float, 16> _16 = spvUnsafeArray<float, 16>({ 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0 });
+constant spvUnsafeArray<float4, 4> _60 = spvUnsafeArray<float4, 4>({ float4(0.0), float4(1.0), float4(8.0), float4(5.0) });
+constant spvUnsafeArray<float4, 4> _104 = spvUnsafeArray<float4, 4>({ float4(20.0), float4(30.0), float4(50.0), float4(60.0) });
+
+struct main0_out
+{
+ float FragColor [[color(0)]];
+};
+
+struct main0_in
+{
+ int index [[user(locn0)]];
+};
fragment main0_out main0(main0_in in [[stage_in]])
{
@@ -93,14 +78,14 @@ fragment main0_out main0(main0_in in [[stage_in]])
{
out.FragColor += _60[in.index & 1].x;
}
- float4 foobar[4] = { float4(0.0), float4(1.0), float4(8.0), float4(5.0) };
+ spvUnsafeArray<float4, 4> foobar = spvUnsafeArray<float4, 4>({ float4(0.0), float4(1.0), float4(8.0), float4(5.0) });
if (in.index > 30)
{
foobar[1].z = 20.0;
}
out.FragColor += foobar[in.index & 3].z;
- float4 baz[4] = { float4(0.0), float4(1.0), float4(8.0), float4(5.0) };
- spvArrayCopyFromConstantToStack1(baz, _104);
+ spvUnsafeArray<float4, 4> baz = spvUnsafeArray<float4, 4>({ float4(0.0), float4(1.0), float4(8.0), float4(5.0) });
+ baz = _104;
out.FragColor += baz[in.index & 3].z;
return out;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/mrt-array.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/mrt-array.frag
index 1cd06a292fb..2746ad6396a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/mrt-array.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/mrt-array.frag
@@ -1,10 +1,49 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct main0_out
{
float4 FragColor_0 [[color(0)]];
@@ -26,12 +65,14 @@ inline Tx mod(Tx x, Ty y)
return x - y * floor(x / y);
}
-inline void write_deeper_in_function(thread float4 (&FragColor)[4], thread float4& vA, thread float4& vB)
+static inline __attribute__((always_inline))
+void write_deeper_in_function(thread spvUnsafeArray<float4, 4> (&FragColor), thread float4& vA, thread float4& vB)
{
FragColor[3] = vA * vB;
}
-inline void write_in_function(thread float4 (&FragColor)[4], thread float4& vA, thread float4& vB)
+static inline __attribute__((always_inline))
+void write_in_function(thread spvUnsafeArray<float4, 4> (&FragColor), thread float4& vA, thread float4& vB)
{
FragColor[2] = vA - vB;
write_deeper_in_function(FragColor, vA, vB);
@@ -40,7 +81,7 @@ inline void write_in_function(thread float4 (&FragColor)[4], thread float4& vA,
fragment main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
- float4 FragColor[4] = {};
+ spvUnsafeArray<float4, 4> FragColor = {};
FragColor[0] = mod(in.vA, in.vB);
FragColor[1] = in.vA + in.vB;
write_in_function(FragColor, in.vA, in.vB);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/packing-test-3.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/packing-test-3.frag
index 172186188f3..cfb0ceae2e9 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/packing-test-3.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/packing-test-3.frag
@@ -32,7 +32,8 @@ struct main0_out
float4 _entryPointOutput [[color(0)]];
};
-inline float4 _main(thread const VertexOutput& IN, constant CB0& v_26)
+static inline __attribute__((always_inline))
+float4 _main(thread const VertexOutput& IN, constant CB0& v_26)
{
TestStruct st;
st.position = float3(v_26.CB0[1].position);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/private-variable-prototype-declaration.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/private-variable-prototype-declaration.frag
index c5462ee3105..7c11a937a21 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/private-variable-prototype-declaration.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/private-variable-prototype-declaration.frag
@@ -15,12 +15,14 @@ struct main0_out
float3 FragColor [[color(0)]];
};
-inline void someFunction(thread AStruct& s)
+static inline __attribute__((always_inline))
+void someFunction(thread AStruct& s)
{
s.foobar = float4(1.0);
}
-inline void otherFunction(thread float3& global_variable)
+static inline __attribute__((always_inline))
+void otherFunction(thread float3& global_variable)
{
global_variable = float3(1.0);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/readonly-ssbo.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/readonly-ssbo.frag
index 439f14c17f2..7d73da79b2f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/readonly-ssbo.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/readonly-ssbo.frag
@@ -15,7 +15,8 @@ struct main0_out
float4 FragColor [[color(0)]];
};
-inline float4 read_from_function(const device SSBO& v_13)
+static inline __attribute__((always_inline))
+float4 read_from_function(const device SSBO& v_13)
{
return v_13.v;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag
new file mode 100644
index 00000000000..a093d3f4891
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag
@@ -0,0 +1,43 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct main0_out
+{
+ float FragColor [[color(0)]];
+};
+
+struct main0_in
+{
+ float3 vUV [[user(locn0)]];
+};
+
+static inline __attribute__((always_inline))
+float sample_normal2(thread const depth2d<float> tex, thread sampler uSampler, thread float3& vUV)
+{
+ return float4(tex.sample(uSampler, vUV.xy)).x;
+}
+
+static inline __attribute__((always_inline))
+float sample_normal(thread const depth2d<float> tex, thread sampler uSampler, thread float3& vUV)
+{
+ return sample_normal2(tex, uSampler, vUV);
+}
+
+static inline __attribute__((always_inline))
+float sample_comp(thread const depth2d<float> tex, thread float3& vUV, thread sampler uSamplerShadow)
+{
+ return tex.sample_compare(uSamplerShadow, vUV.xy, vUV.z);
+}
+
+fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uTexture [[texture(0)]], sampler uSampler [[sampler(0)]], sampler uSamplerShadow [[sampler(1)]])
+{
+ main0_out out = {};
+ out.FragColor = sample_normal(uTexture, uSampler, in.vUV);
+ out.FragColor += sample_comp(uTexture, in.vUV, uSamplerShadow);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sample-depth-separate-image-sampler.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sample-depth-separate-image-sampler.frag
index ce87db5ab2a..d285941d7a0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sample-depth-separate-image-sampler.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sample-depth-separate-image-sampler.frag
@@ -10,12 +10,14 @@ struct main0_out
float FragColor [[color(0)]];
};
-inline float sample_depth_from_function(thread const depth2d<float> uT, thread const sampler uS)
+static inline __attribute__((always_inline))
+float sample_depth_from_function(thread const depth2d<float> uT, thread const sampler uS)
{
return uT.sample_compare(uS, float3(0.5).xy, float3(0.5).z);
}
-inline float sample_color_from_function(thread const texture2d<float> uT, thread const sampler uS)
+static inline __attribute__((always_inline))
+float sample_color_from_function(thread const texture2d<float> uT, thread const sampler uS)
{
return uT.sample(uS, float2(0.5)).x;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sample-position-func.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sample-position-func.frag
index e95d5bfb044..025f874d266 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sample-position-func.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sample-position-func.frag
@@ -15,7 +15,8 @@ struct main0_in
int index [[user(locn0)]];
};
-inline float4 getColor(thread const int& i, thread float2& gl_SamplePosition)
+static inline __attribute__((always_inline))
+float4 getColor(thread const int& i, thread float2& gl_SamplePosition)
{
return float4(gl_SamplePosition, float(i), 1.0);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sampler-image-arrays.msl2.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sampler-image-arrays.msl2.frag
index a500dfeb2f1..dec6d051ae7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sampler-image-arrays.msl2.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sampler-image-arrays.msl2.frag
@@ -16,17 +16,20 @@ struct main0_in
int vIndex [[user(locn1)]];
};
-inline float4 sample_from_global(thread int& vIndex, thread float2& vTex, thread const array<texture2d<float>, 4> uSampler, thread const array<sampler, 4> uSamplerSmplr)
+static inline __attribute__((always_inline))
+float4 sample_from_global(thread int& vIndex, thread float2& vTex, thread const array<texture2d<float>, 4> uSampler, thread const array<sampler, 4> uSamplerSmplr)
{
return uSampler[vIndex].sample(uSamplerSmplr[vIndex], (vTex + float2(0.100000001490116119384765625)));
}
-inline float4 sample_from_argument(thread const array<texture2d<float>, 4> samplers, thread const array<sampler, 4> samplersSmplr, thread int& vIndex, thread float2& vTex)
+static inline __attribute__((always_inline))
+float4 sample_from_argument(thread const array<texture2d<float>, 4> samplers, thread const array<sampler, 4> samplersSmplr, thread int& vIndex, thread float2& vTex)
{
return samplers[vIndex].sample(samplersSmplr[vIndex], (vTex + float2(0.20000000298023223876953125)));
}
-inline float4 sample_single_from_argument(thread const texture2d<float> samp, thread const sampler sampSmplr, thread float2& vTex)
+static inline __attribute__((always_inline))
+float4 sample_single_from_argument(thread const texture2d<float> samp, thread const sampler sampSmplr, thread float2& vTex)
{
return samp.sample(sampSmplr, (vTex + float2(0.300000011920928955078125)));
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sampler.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sampler.frag
index 86917ea080f..6484161b699 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sampler.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/sampler.frag
@@ -16,7 +16,8 @@ struct main0_in
float2 vTex [[user(locn1)]];
};
-inline float4 sample_texture(thread const texture2d<float> tex, thread const sampler texSmplr, thread const float2& uv)
+static inline __attribute__((always_inline))
+float4 sample_texture(thread const texture2d<float> tex, thread const sampler texSmplr, thread const float2& uv)
{
return tex.sample(texSmplr, uv);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/separate-image-sampler-argument.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/separate-image-sampler-argument.frag
index 7f7e0bd170e..d196243d4b7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/separate-image-sampler-argument.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/separate-image-sampler-argument.frag
@@ -10,7 +10,8 @@ struct main0_out
float4 FragColor [[color(0)]];
};
-inline float4 samp(thread const texture2d<float> t, thread const sampler s)
+static inline __attribute__((always_inline))
+float4 samp(thread const texture2d<float> t, thread const sampler s)
{
return t.sample(s, float2(0.5));
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/shader-arithmetic-8bit.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/shader-arithmetic-8bit.frag
index 2ac4897b55a..e9694aa196c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/shader-arithmetic-8bit.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/shader-arithmetic-8bit.frag
@@ -34,7 +34,8 @@ struct main0_in
int4 vColor [[user(locn0)]];
};
-inline void packing_int8(device SSBO& ssbo)
+static inline __attribute__((always_inline))
+void packing_int8(device SSBO& ssbo)
{
short i16 = short(10);
int i32 = 20;
@@ -48,7 +49,8 @@ inline void packing_int8(device SSBO& ssbo)
ssbo.i8[3] = i8_4.w;
}
-inline void packing_uint8(device SSBO& ssbo)
+static inline __attribute__((always_inline))
+void packing_uint8(device SSBO& ssbo)
{
ushort u16 = ushort(10);
uint u32 = 20u;
@@ -62,7 +64,8 @@ inline void packing_uint8(device SSBO& ssbo)
ssbo.u8[3] = u8_4.w;
}
-inline void compute_int8(device SSBO& ssbo, thread int4& vColor, constant Push& registers, constant UBO& ubo, thread int4& FragColorInt)
+static inline __attribute__((always_inline))
+void compute_int8(device SSBO& ssbo, thread int4& vColor, constant Push& registers, constant UBO& ubo, thread int4& FragColorInt)
{
char4 tmp = char4(vColor);
tmp += char4(registers.i8);
@@ -74,7 +77,8 @@ inline void compute_int8(device SSBO& ssbo, thread int4& vColor, constant Push&
FragColorInt = int4(tmp);
}
-inline void compute_uint8(device SSBO& ssbo, thread int4& vColor, constant Push& registers, constant UBO& ubo, thread uint4& FragColorUint)
+static inline __attribute__((always_inline))
+void compute_uint8(device SSBO& ssbo, thread int4& vColor, constant Push& registers, constant UBO& ubo, thread uint4& FragColorUint)
{
uchar4 tmp = uchar4(char4(vColor));
tmp += uchar4(registers.u8);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/shadow-compare-global-alias.invalid.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/shadow-compare-global-alias.invalid.frag
index fa0a10b0a4a..8f7b8ece499 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/shadow-compare-global-alias.invalid.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/shadow-compare-global-alias.invalid.frag
@@ -15,22 +15,26 @@ struct main0_in
float3 vUV [[user(locn0)]];
};
-inline float Samp(thread const float3& uv, thread depth2d<float> uTex, thread sampler uSamp)
+static inline __attribute__((always_inline))
+float Samp(thread const float3& uv, thread depth2d<float> uTex, thread sampler uSamp)
{
return uTex.sample_compare(uSamp, uv.xy, uv.z);
}
-inline float Samp2(thread const float3& uv, thread depth2d<float> uSampler, thread const sampler uSamplerSmplr, thread float3& vUV)
+static inline __attribute__((always_inline))
+float Samp2(thread const float3& uv, thread depth2d<float> uSampler, thread const sampler uSamplerSmplr, thread float3& vUV)
{
return uSampler.sample_compare(uSamplerSmplr, vUV.xy, vUV.z);
}
-inline float Samp3(thread const depth2d<float> uT, thread const sampler uS, thread const float3& uv, thread float3& vUV)
+static inline __attribute__((always_inline))
+float Samp3(thread const depth2d<float> uT, thread const sampler uS, thread const float3& uv, thread float3& vUV)
{
return uT.sample_compare(uS, vUV.xy, vUV.z);
}
-inline float Samp4(thread const depth2d<float> uS, thread const sampler uSSmplr, thread const float3& uv, thread float3& vUV)
+static inline __attribute__((always_inline))
+float Samp4(thread const depth2d<float> uS, thread const sampler uSSmplr, thread const float3& uv, thread float3& vUV)
{
return uS.sample_compare(uSSmplr, vUV.xy, vUV.z);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/stencil-export.msl21.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/stencil-export.msl21.frag
index a4f11c89619..f3629e18beb 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/stencil-export.msl21.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/stencil-export.msl21.frag
@@ -12,7 +12,8 @@ struct main0_out
uint gl_FragStencilRefARB [[stencil]];
};
-inline void update_stencil(thread uint& gl_FragStencilRefARB)
+static inline __attribute__((always_inline))
+void update_stencil(thread uint& gl_FragStencilRefARB)
{
gl_FragStencilRefARB = uint(int(gl_FragStencilRefARB) + 10);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/texture-cube-array.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/texture-cube-array.frag
new file mode 100644
index 00000000000..9f1832ec04b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/texture-cube-array.frag
@@ -0,0 +1,25 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct main0_out
+{
+ float4 FragColor [[color(0)]];
+};
+
+struct main0_in
+{
+ float4 vUV [[user(locn0)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], texturecube<float> cubeSampler [[texture(0)]], texturecube_array<float> cubeArraySampler [[texture(1)]], texture2d_array<float> texArraySampler [[texture(2)]], sampler cubeSamplerSmplr [[sampler(0)]], sampler cubeArraySamplerSmplr [[sampler(1)]], sampler texArraySamplerSmplr [[sampler(2)]])
+{
+ main0_out out = {};
+ float4 a = cubeSampler.sample(cubeSamplerSmplr, in.vUV.xyz);
+ float4 b = cubeArraySampler.sample(cubeArraySamplerSmplr, in.vUV.xyz, uint(round(in.vUV.w)));
+ float4 c = texArraySampler.sample(texArraySamplerSmplr, in.vUV.xyz.xy, uint(round(in.vUV.xyz.z)));
+ out.FragColor = (a + b) + c;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/texture-cube-array.ios.emulate-cube-array.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/texture-cube-array.ios.emulate-cube-array.frag
new file mode 100644
index 00000000000..3c4d0adb510
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/texture-cube-array.ios.emulate-cube-array.frag
@@ -0,0 +1,61 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct main0_out
+{
+ float4 FragColor [[color(0)]];
+};
+
+struct main0_in
+{
+ float4 vUV [[user(locn0)]];
+};
+
+static inline __attribute__((always_inline))
+float3 spvCubemapTo2DArrayFace(float3 P)
+{
+ float3 Coords = abs(P.xyz);
+ float CubeFace = 0;
+ float ProjectionAxis = 0;
+ float u = 0;
+ float v = 0;
+ if (Coords.x >= Coords.y && Coords.x >= Coords.z)
+ {
+ CubeFace = P.x >= 0 ? 0 : 1;
+ ProjectionAxis = Coords.x;
+ u = P.x >= 0 ? -P.z : P.z;
+ v = -P.y;
+ }
+ else if (Coords.y >= Coords.x && Coords.y >= Coords.z)
+ {
+ CubeFace = P.y >= 0 ? 2 : 3;
+ ProjectionAxis = Coords.y;
+ u = P.x;
+ v = P.y >= 0 ? P.z : -P.z;
+ }
+ else
+ {
+ CubeFace = P.z >= 0 ? 4 : 5;
+ ProjectionAxis = Coords.z;
+ u = P.z >= 0 ? P.x : -P.x;
+ v = -P.y;
+ }
+ u = 0.5 * (u/ProjectionAxis + 1);
+ v = 0.5 * (v/ProjectionAxis + 1);
+ return float3(u, v, CubeFace);
+}
+
+fragment main0_out main0(main0_in in [[stage_in]], texturecube<float> cubeSampler [[texture(0)]], texture2d_array<float> cubeArraySampler [[texture(1)]], texture2d_array<float> texArraySampler [[texture(2)]], sampler cubeSamplerSmplr [[sampler(0)]], sampler cubeArraySamplerSmplr [[sampler(1)]], sampler texArraySamplerSmplr [[sampler(2)]])
+{
+ main0_out out = {};
+ float4 a = cubeSampler.sample(cubeSamplerSmplr, in.vUV.xyz);
+ float4 b = cubeArraySampler.sample(cubeArraySamplerSmplr, spvCubemapTo2DArrayFace(in.vUV.xyz).xy, uint(spvCubemapTo2DArrayFace(in.vUV.xyz).z) + (uint(round(in.vUV.w)) * 6u));
+ float4 c = texArraySampler.sample(texArraySamplerSmplr, in.vUV.xyz.xy, uint(round(in.vUV.xyz.z)));
+ out.FragColor = (a + b) + c;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/write-depth-in-function.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/write-depth-in-function.frag
index eab4ef4c515..c3ab221fc32 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/write-depth-in-function.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/frag/write-depth-in-function.frag
@@ -11,7 +11,8 @@ struct main0_out
float gl_FragDepth [[depth(any)]];
};
-inline void set_output_depth(thread float& gl_FragDepth)
+static inline __attribute__((always_inline))
+void set_output_depth(thread float& gl_FragDepth)
{
gl_FragDepth = 0.20000000298023223876953125;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/load-control-point-array-of-matrix.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/load-control-point-array-of-matrix.tesc
new file mode 100644
index 00000000000..46d4b4ad588
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/load-control-point-array-of-matrix.tesc
@@ -0,0 +1,73 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct main0_out
+{
+ float4x4 vOutputs;
+};
+
+struct main0_in
+{
+ float4 vInputs_0 [[attribute(0)]];
+ float4 vInputs_1 [[attribute(1)]];
+ float4 vInputs_2 [[attribute(2)]];
+ float4 vInputs_3 [[attribute(3)]];
+};
+
+kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
+{
+ device main0_out* gl_out = &spvOut[gl_PrimitiveID * 4];
+ if (gl_InvocationID < spvIndirectParams[0])
+ gl_in[gl_InvocationID] = in;
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+ if (gl_InvocationID >= 4)
+ return;
+ spvUnsafeArray<float4x4, 32> _16 = spvUnsafeArray<float4x4, 32>({ float4x4(gl_in[0].vInputs_0, gl_in[0].vInputs_1, gl_in[0].vInputs_2, gl_in[0].vInputs_3), float4x4(gl_in[1].vInputs_0, gl_in[1].vInputs_1, gl_in[1].vInputs_2, gl_in[1].vInputs_3), float4x4(gl_in[2].vInputs_0, gl_in[2].vInputs_1, gl_in[2].vInputs_2, gl_in[2].vInputs_3), float4x4(gl_in[3].vInputs_0, gl_in[3].vInputs_1, gl_in[3].vInputs_2, gl_in[3].vInputs_3), float4x4(gl_in[4].vInputs_0, gl_in[4].vInputs_1, gl_in[4].vInputs_2, gl_in[4].vInputs_3), float4x4(gl_in[5].vInputs_0, gl_in[5].vInputs_1, gl_in[5].vInputs_2, gl_in[5].vInputs_3), float4x4(gl_in[6].vInputs_0, gl_in[6].vInputs_1, gl_in[6].vInputs_2, gl_in[6].vInputs_3), float4x4(gl_in[7].vInputs_0, gl_in[7].vInputs_1, gl_in[7].vInputs_2, gl_in[7].vInputs_3), float4x4(gl_in[8].vInputs_0, gl_in[8].vInputs_1, gl_in[8].vInputs_2, gl_in[8].vInputs_3), float4x4(gl_in[9].vInputs_0, gl_in[9].vInputs_1, gl_in[9].vInputs_2, gl_in[9].vInputs_3), float4x4(gl_in[10].vInputs_0, gl_in[10].vInputs_1, gl_in[10].vInputs_2, gl_in[10].vInputs_3), float4x4(gl_in[11].vInputs_0, gl_in[11].vInputs_1, gl_in[11].vInputs_2, gl_in[11].vInputs_3), float4x4(gl_in[12].vInputs_0, gl_in[12].vInputs_1, gl_in[12].vInputs_2, gl_in[12].vInputs_3), float4x4(gl_in[13].vInputs_0, gl_in[13].vInputs_1, gl_in[13].vInputs_2, gl_in[13].vInputs_3), float4x4(gl_in[14].vInputs_0, gl_in[14].vInputs_1, gl_in[14].vInputs_2, gl_in[14].vInputs_3), float4x4(gl_in[15].vInputs_0, gl_in[15].vInputs_1, gl_in[15].vInputs_2, gl_in[15].vInputs_3), float4x4(gl_in[16].vInputs_0, gl_in[16].vInputs_1, gl_in[16].vInputs_2, gl_in[16].vInputs_3), float4x4(gl_in[17].vInputs_0, gl_in[17].vInputs_1, gl_in[17].vInputs_2, gl_in[17].vInputs_3), float4x4(gl_in[18].vInputs_0, gl_in[18].vInputs_1, gl_in[18].vInputs_2, gl_in[18].vInputs_3), float4x4(gl_in[19].vInputs_0, gl_in[19].vInputs_1, gl_in[19].vInputs_2, gl_in[19].vInputs_3), float4x4(gl_in[20].vInputs_0, gl_in[20].vInputs_1, gl_in[20].vInputs_2, gl_in[20].vInputs_3), float4x4(gl_in[21].vInputs_0, gl_in[21].vInputs_1, gl_in[21].vInputs_2, gl_in[21].vInputs_3), float4x4(gl_in[22].vInputs_0, gl_in[22].vInputs_1, gl_in[22].vInputs_2, gl_in[22].vInputs_3), float4x4(gl_in[23].vInputs_0, gl_in[23].vInputs_1, gl_in[23].vInputs_2, gl_in[23].vInputs_3), float4x4(gl_in[24].vInputs_0, gl_in[24].vInputs_1, gl_in[24].vInputs_2, gl_in[24].vInputs_3), float4x4(gl_in[25].vInputs_0, gl_in[25].vInputs_1, gl_in[25].vInputs_2, gl_in[25].vInputs_3), float4x4(gl_in[26].vInputs_0, gl_in[26].vInputs_1, gl_in[26].vInputs_2, gl_in[26].vInputs_3), float4x4(gl_in[27].vInputs_0, gl_in[27].vInputs_1, gl_in[27].vInputs_2, gl_in[27].vInputs_3), float4x4(gl_in[28].vInputs_0, gl_in[28].vInputs_1, gl_in[28].vInputs_2, gl_in[28].vInputs_3), float4x4(gl_in[29].vInputs_0, gl_in[29].vInputs_1, gl_in[29].vInputs_2, gl_in[29].vInputs_3), float4x4(gl_in[30].vInputs_0, gl_in[30].vInputs_1, gl_in[30].vInputs_2, gl_in[30].vInputs_3), float4x4(gl_in[31].vInputs_0, gl_in[31].vInputs_1, gl_in[31].vInputs_2, gl_in[31].vInputs_3) });
+ spvUnsafeArray<float4x4, 32> tmp;
+ tmp = _16;
+ gl_out[gl_InvocationID].vOutputs = tmp[gl_InvocationID];
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/load-control-point-array-of-struct.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/load-control-point-array-of-struct.tesc
new file mode 100644
index 00000000000..91d3521dfa0
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/load-control-point-array-of-struct.tesc
@@ -0,0 +1,86 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct VertexData
+{
+ float4x4 a;
+ spvUnsafeArray<float4, 2> b;
+ float4 c;
+};
+
+struct main0_out
+{
+ float4 vOutputs;
+};
+
+struct main0_in
+{
+ float4 VertexData_a_0 [[attribute(0)]];
+ float4 VertexData_a_1 [[attribute(1)]];
+ float4 VertexData_a_2 [[attribute(2)]];
+ float4 VertexData_a_3 [[attribute(3)]];
+ float4 VertexData_b_0 [[attribute(4)]];
+ float4 VertexData_b_1 [[attribute(5)]];
+ float4 VertexData_c [[attribute(6)]];
+};
+
+kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
+{
+ device main0_out* gl_out = &spvOut[gl_PrimitiveID * 4];
+ if (gl_InvocationID < spvIndirectParams[0])
+ gl_in[gl_InvocationID] = in;
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+ if (gl_InvocationID >= 4)
+ return;
+ spvUnsafeArray<VertexData, 32> _19 = spvUnsafeArray<VertexData, 32>({ VertexData{ float4x4(gl_in[0].VertexData_a_0, gl_in[0].VertexData_a_1, gl_in[0].VertexData_a_2, gl_in[0].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[0].VertexData_b_0, gl_in[0].VertexData_b_1 }), gl_in[0].VertexData_c }, VertexData{ float4x4(gl_in[1].VertexData_a_0, gl_in[1].VertexData_a_1, gl_in[1].VertexData_a_2, gl_in[1].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[1].VertexData_b_0, gl_in[1].VertexData_b_1 }), gl_in[1].VertexData_c }, VertexData{ float4x4(gl_in[2].VertexData_a_0, gl_in[2].VertexData_a_1, gl_in[2].VertexData_a_2, gl_in[2].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[2].VertexData_b_0, gl_in[2].VertexData_b_1 }), gl_in[2].VertexData_c }, VertexData{ float4x4(gl_in[3].VertexData_a_0, gl_in[3].VertexData_a_1, gl_in[3].VertexData_a_2, gl_in[3].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[3].VertexData_b_0, gl_in[3].VertexData_b_1 }), gl_in[3].VertexData_c }, VertexData{ float4x4(gl_in[4].VertexData_a_0, gl_in[4].VertexData_a_1, gl_in[4].VertexData_a_2, gl_in[4].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[4].VertexData_b_0, gl_in[4].VertexData_b_1 }), gl_in[4].VertexData_c }, VertexData{ float4x4(gl_in[5].VertexData_a_0, gl_in[5].VertexData_a_1, gl_in[5].VertexData_a_2, gl_in[5].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[5].VertexData_b_0, gl_in[5].VertexData_b_1 }), gl_in[5].VertexData_c }, VertexData{ float4x4(gl_in[6].VertexData_a_0, gl_in[6].VertexData_a_1, gl_in[6].VertexData_a_2, gl_in[6].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[6].VertexData_b_0, gl_in[6].VertexData_b_1 }), gl_in[6].VertexData_c }, VertexData{ float4x4(gl_in[7].VertexData_a_0, gl_in[7].VertexData_a_1, gl_in[7].VertexData_a_2, gl_in[7].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[7].VertexData_b_0, gl_in[7].VertexData_b_1 }), gl_in[7].VertexData_c }, VertexData{ float4x4(gl_in[8].VertexData_a_0, gl_in[8].VertexData_a_1, gl_in[8].VertexData_a_2, gl_in[8].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[8].VertexData_b_0, gl_in[8].VertexData_b_1 }), gl_in[8].VertexData_c }, VertexData{ float4x4(gl_in[9].VertexData_a_0, gl_in[9].VertexData_a_1, gl_in[9].VertexData_a_2, gl_in[9].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[9].VertexData_b_0, gl_in[9].VertexData_b_1 }), gl_in[9].VertexData_c }, VertexData{ float4x4(gl_in[10].VertexData_a_0, gl_in[10].VertexData_a_1, gl_in[10].VertexData_a_2, gl_in[10].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[10].VertexData_b_0, gl_in[10].VertexData_b_1 }), gl_in[10].VertexData_c }, VertexData{ float4x4(gl_in[11].VertexData_a_0, gl_in[11].VertexData_a_1, gl_in[11].VertexData_a_2, gl_in[11].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[11].VertexData_b_0, gl_in[11].VertexData_b_1 }), gl_in[11].VertexData_c }, VertexData{ float4x4(gl_in[12].VertexData_a_0, gl_in[12].VertexData_a_1, gl_in[12].VertexData_a_2, gl_in[12].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[12].VertexData_b_0, gl_in[12].VertexData_b_1 }), gl_in[12].VertexData_c }, VertexData{ float4x4(gl_in[13].VertexData_a_0, gl_in[13].VertexData_a_1, gl_in[13].VertexData_a_2, gl_in[13].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[13].VertexData_b_0, gl_in[13].VertexData_b_1 }), gl_in[13].VertexData_c }, VertexData{ float4x4(gl_in[14].VertexData_a_0, gl_in[14].VertexData_a_1, gl_in[14].VertexData_a_2, gl_in[14].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[14].VertexData_b_0, gl_in[14].VertexData_b_1 }), gl_in[14].VertexData_c }, VertexData{ float4x4(gl_in[15].VertexData_a_0, gl_in[15].VertexData_a_1, gl_in[15].VertexData_a_2, gl_in[15].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[15].VertexData_b_0, gl_in[15].VertexData_b_1 }), gl_in[15].VertexData_c }, VertexData{ float4x4(gl_in[16].VertexData_a_0, gl_in[16].VertexData_a_1, gl_in[16].VertexData_a_2, gl_in[16].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[16].VertexData_b_0, gl_in[16].VertexData_b_1 }), gl_in[16].VertexData_c }, VertexData{ float4x4(gl_in[17].VertexData_a_0, gl_in[17].VertexData_a_1, gl_in[17].VertexData_a_2, gl_in[17].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[17].VertexData_b_0, gl_in[17].VertexData_b_1 }), gl_in[17].VertexData_c }, VertexData{ float4x4(gl_in[18].VertexData_a_0, gl_in[18].VertexData_a_1, gl_in[18].VertexData_a_2, gl_in[18].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[18].VertexData_b_0, gl_in[18].VertexData_b_1 }), gl_in[18].VertexData_c }, VertexData{ float4x4(gl_in[19].VertexData_a_0, gl_in[19].VertexData_a_1, gl_in[19].VertexData_a_2, gl_in[19].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[19].VertexData_b_0, gl_in[19].VertexData_b_1 }), gl_in[19].VertexData_c }, VertexData{ float4x4(gl_in[20].VertexData_a_0, gl_in[20].VertexData_a_1, gl_in[20].VertexData_a_2, gl_in[20].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[20].VertexData_b_0, gl_in[20].VertexData_b_1 }), gl_in[20].VertexData_c }, VertexData{ float4x4(gl_in[21].VertexData_a_0, gl_in[21].VertexData_a_1, gl_in[21].VertexData_a_2, gl_in[21].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[21].VertexData_b_0, gl_in[21].VertexData_b_1 }), gl_in[21].VertexData_c }, VertexData{ float4x4(gl_in[22].VertexData_a_0, gl_in[22].VertexData_a_1, gl_in[22].VertexData_a_2, gl_in[22].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[22].VertexData_b_0, gl_in[22].VertexData_b_1 }), gl_in[22].VertexData_c }, VertexData{ float4x4(gl_in[23].VertexData_a_0, gl_in[23].VertexData_a_1, gl_in[23].VertexData_a_2, gl_in[23].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[23].VertexData_b_0, gl_in[23].VertexData_b_1 }), gl_in[23].VertexData_c }, VertexData{ float4x4(gl_in[24].VertexData_a_0, gl_in[24].VertexData_a_1, gl_in[24].VertexData_a_2, gl_in[24].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[24].VertexData_b_0, gl_in[24].VertexData_b_1 }), gl_in[24].VertexData_c }, VertexData{ float4x4(gl_in[25].VertexData_a_0, gl_in[25].VertexData_a_1, gl_in[25].VertexData_a_2, gl_in[25].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[25].VertexData_b_0, gl_in[25].VertexData_b_1 }), gl_in[25].VertexData_c }, VertexData{ float4x4(gl_in[26].VertexData_a_0, gl_in[26].VertexData_a_1, gl_in[26].VertexData_a_2, gl_in[26].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[26].VertexData_b_0, gl_in[26].VertexData_b_1 }), gl_in[26].VertexData_c }, VertexData{ float4x4(gl_in[27].VertexData_a_0, gl_in[27].VertexData_a_1, gl_in[27].VertexData_a_2, gl_in[27].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[27].VertexData_b_0, gl_in[27].VertexData_b_1 }), gl_in[27].VertexData_c }, VertexData{ float4x4(gl_in[28].VertexData_a_0, gl_in[28].VertexData_a_1, gl_in[28].VertexData_a_2, gl_in[28].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[28].VertexData_b_0, gl_in[28].VertexData_b_1 }), gl_in[28].VertexData_c }, VertexData{ float4x4(gl_in[29].VertexData_a_0, gl_in[29].VertexData_a_1, gl_in[29].VertexData_a_2, gl_in[29].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[29].VertexData_b_0, gl_in[29].VertexData_b_1 }), gl_in[29].VertexData_c }, VertexData{ float4x4(gl_in[30].VertexData_a_0, gl_in[30].VertexData_a_1, gl_in[30].VertexData_a_2, gl_in[30].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[30].VertexData_b_0, gl_in[30].VertexData_b_1 }), gl_in[30].VertexData_c }, VertexData{ float4x4(gl_in[31].VertexData_a_0, gl_in[31].VertexData_a_1, gl_in[31].VertexData_a_2, gl_in[31].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[31].VertexData_b_0, gl_in[31].VertexData_b_1 }), gl_in[31].VertexData_c } });
+ spvUnsafeArray<VertexData, 32> tmp;
+ tmp = _19;
+ int _27 = gl_InvocationID ^ 1;
+ VertexData _30 = VertexData{ float4x4(gl_in[_27].VertexData_a_0, gl_in[_27].VertexData_a_1, gl_in[_27].VertexData_a_2, gl_in[_27].VertexData_a_3), spvUnsafeArray<float4, 2>({ gl_in[_27].VertexData_b_0, gl_in[_27].VertexData_b_1 }), gl_in[_27].VertexData_c };
+ VertexData tmp_single = _30;
+ gl_out[gl_InvocationID].vOutputs = ((tmp[gl_InvocationID].a[1] + tmp[gl_InvocationID].b[1]) + tmp[gl_InvocationID].c) + tmp_single.c;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/load-control-point-array.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/load-control-point-array.tesc
new file mode 100644
index 00000000000..d04571ae364
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/load-control-point-array.tesc
@@ -0,0 +1,70 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct main0_out
+{
+ float4 vOutputs;
+};
+
+struct main0_in
+{
+ float4 vInputs [[attribute(0)]];
+};
+
+kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
+{
+ device main0_out* gl_out = &spvOut[gl_PrimitiveID * 4];
+ if (gl_InvocationID < spvIndirectParams[0])
+ gl_in[gl_InvocationID] = in;
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+ if (gl_InvocationID >= 4)
+ return;
+ spvUnsafeArray<float4, 32> _15 = spvUnsafeArray<float4, 32>({ gl_in[0].vInputs, gl_in[1].vInputs, gl_in[2].vInputs, gl_in[3].vInputs, gl_in[4].vInputs, gl_in[5].vInputs, gl_in[6].vInputs, gl_in[7].vInputs, gl_in[8].vInputs, gl_in[9].vInputs, gl_in[10].vInputs, gl_in[11].vInputs, gl_in[12].vInputs, gl_in[13].vInputs, gl_in[14].vInputs, gl_in[15].vInputs, gl_in[16].vInputs, gl_in[17].vInputs, gl_in[18].vInputs, gl_in[19].vInputs, gl_in[20].vInputs, gl_in[21].vInputs, gl_in[22].vInputs, gl_in[23].vInputs, gl_in[24].vInputs, gl_in[25].vInputs, gl_in[26].vInputs, gl_in[27].vInputs, gl_in[28].vInputs, gl_in[29].vInputs, gl_in[30].vInputs, gl_in[31].vInputs });
+ spvUnsafeArray<float4, 32> tmp;
+ tmp = _15;
+ gl_out[gl_InvocationID].vOutputs = tmp[gl_InvocationID];
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/water_tess.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/water_tess.tesc
index 596abe13091..d74f5752f8b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/water_tess.tesc
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tesc/water_tess.tesc
@@ -26,7 +26,8 @@ struct main0_in
float2 vPatchPosBase [[attribute(0)]];
};
-inline bool frustum_cull(thread const float2& p0, constant UBO& v_41)
+static inline __attribute__((always_inline))
+bool frustum_cull(thread const float2& p0, constant UBO& v_41)
{
float2 min_xz = (p0 - float2(10.0)) * v_41.uScale.xy;
float2 max_xz = ((p0 + v_41.uPatchSize) + float2(10.0)) * v_41.uScale.xy;
@@ -49,7 +50,8 @@ inline bool frustum_cull(thread const float2& p0, constant UBO& v_41)
return !_215;
}
-inline float lod_factor(thread const float2& pos_, constant UBO& v_41)
+static inline __attribute__((always_inline))
+float lod_factor(thread const float2& pos_, constant UBO& v_41)
{
float2 pos = pos_ * v_41.uScale.xy;
float3 dist_to_cam = v_41.uCamPos - float3(pos.x, 0.0, pos.y);
@@ -57,17 +59,20 @@ inline float lod_factor(thread const float2& pos_, constant UBO& v_41)
return fast::clamp(level, 0.0, v_41.uMaxTessLevel.x);
}
-inline float4 tess_level(thread const float4& lod, constant UBO& v_41)
+static inline __attribute__((always_inline))
+float4 tess_level(thread const float4& lod, constant UBO& v_41)
{
return exp2(-lod) * v_41.uMaxTessLevel.y;
}
-inline float tess_level(thread const float& lod, constant UBO& v_41)
+static inline __attribute__((always_inline))
+float tess_level(thread const float& lod, constant UBO& v_41)
{
return v_41.uMaxTessLevel.y * exp2(-lod);
}
-inline void compute_tess_levels(thread const float2& p0, constant UBO& v_41, device float2& vOutPatchPosBase, device float4& vPatchLods, device half (&gl_TessLevelOuter)[4], device half (&gl_TessLevelInner)[2])
+static inline __attribute__((always_inline))
+void compute_tess_levels(thread const float2& p0, constant UBO& v_41, device float2& vOutPatchPosBase, device float4& vPatchLods, device half (&gl_TessLevelOuter)[4], device half (&gl_TessLevelInner)[2])
{
vOutPatchPosBase = p0;
float2 param = p0 + (float2(-0.5) * v_41.uPatchSize);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/input-array.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/input-array.tese
index 33ac58419d5..f6cfa2fb90f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/input-array.tese
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/input-array.tese
@@ -21,7 +21,8 @@ struct main0_patchIn
patch_control_point<main0_in> gl_in;
};
-inline void set_position(thread float4& gl_Position, thread patch_control_point<main0_in>& gl_in, thread float2& gl_TessCoord)
+static inline __attribute__((always_inline))
+void set_position(thread float4& gl_Position, thread patch_control_point<main0_in>& gl_in, thread float2& gl_TessCoord)
{
gl_Position = (gl_in[0].Floats * gl_TessCoord.x) + (gl_in[1].Floats2 * gl_TessCoord.y);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/input-types.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/input-types.tese
index 6091434fcab..af6db4626c3 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/input-types.tese
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/input-types.tese
@@ -47,7 +47,8 @@ struct main0_patchIn
patch_control_point<main0_in> gl_in;
};
-inline void set_from_function(thread float4& gl_Position, thread patch_control_point<main0_in>& gl_in, thread PatchBlock& patch_block, thread float4& vColors, thread Foo& vFoo)
+static inline __attribute__((always_inline))
+void set_from_function(thread float4& gl_Position, thread patch_control_point<main0_in>& gl_in, thread PatchBlock& patch_block, thread float4& vColors, thread Foo& vFoo)
{
gl_Position = gl_in[0].Block_a;
gl_Position += gl_in[0].Block_b;
@@ -61,16 +62,12 @@ inline void set_from_function(thread float4& gl_Position, thread patch_control_p
Foo foo = vFoo;
gl_Position += foo.a;
gl_Position += foo.b;
- Foo vFoos_105;
- vFoos_105.a = gl_in[0].Foo_a;
- vFoos_105.b = gl_in[0].Foo_b;
- foo = vFoos_105;
+ Foo _106 = Foo{ gl_in[0].Foo_a, gl_in[0].Foo_b };
+ foo = _106;
gl_Position += foo.a;
gl_Position += foo.b;
- Foo vFoos_119;
- vFoos_119.a = gl_in[1].Foo_a;
- vFoos_119.b = gl_in[1].Foo_b;
- foo = vFoos_119;
+ Foo _120 = Foo{ gl_in[1].Foo_a, gl_in[1].Foo_b };
+ foo = _120;
gl_Position += foo.a;
gl_Position += foo.b;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/load-control-point-array-of-matrix.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/load-control-point-array-of-matrix.tese
new file mode 100644
index 00000000000..162874abd01
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/load-control-point-array-of-matrix.tese
@@ -0,0 +1,84 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct main0_out
+{
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 vInputs_0 [[attribute(0)]];
+ float4 vInputs_1 [[attribute(1)]];
+ float4 vInputs_2 [[attribute(2)]];
+ float4 vInputs_3 [[attribute(3)]];
+};
+
+struct main0_patchIn
+{
+ float4 vBoo_0 [[attribute(4)]];
+ float4 vBoo_1 [[attribute(5)]];
+ float4 vBoo_2 [[attribute(6)]];
+ float4 vBoo_3 [[attribute(7)]];
+ int vIndex [[attribute(8)]];
+ patch_control_point<main0_in> gl_in;
+};
+
+[[ patch(quad, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 4> vBoo = {};
+ vBoo[0] = patchIn.vBoo_0;
+ vBoo[1] = patchIn.vBoo_1;
+ vBoo[2] = patchIn.vBoo_2;
+ vBoo[3] = patchIn.vBoo_3;
+ spvUnsafeArray<float4x4, 32> _16 = spvUnsafeArray<float4x4, 32>({ float4x4(patchIn.gl_in[0].vInputs_0, patchIn.gl_in[0].vInputs_1, patchIn.gl_in[0].vInputs_2, patchIn.gl_in[0].vInputs_3), float4x4(patchIn.gl_in[1].vInputs_0, patchIn.gl_in[1].vInputs_1, patchIn.gl_in[1].vInputs_2, patchIn.gl_in[1].vInputs_3), float4x4(patchIn.gl_in[2].vInputs_0, patchIn.gl_in[2].vInputs_1, patchIn.gl_in[2].vInputs_2, patchIn.gl_in[2].vInputs_3), float4x4(patchIn.gl_in[3].vInputs_0, patchIn.gl_in[3].vInputs_1, patchIn.gl_in[3].vInputs_2, patchIn.gl_in[3].vInputs_3), float4x4(patchIn.gl_in[4].vInputs_0, patchIn.gl_in[4].vInputs_1, patchIn.gl_in[4].vInputs_2, patchIn.gl_in[4].vInputs_3), float4x4(patchIn.gl_in[5].vInputs_0, patchIn.gl_in[5].vInputs_1, patchIn.gl_in[5].vInputs_2, patchIn.gl_in[5].vInputs_3), float4x4(patchIn.gl_in[6].vInputs_0, patchIn.gl_in[6].vInputs_1, patchIn.gl_in[6].vInputs_2, patchIn.gl_in[6].vInputs_3), float4x4(patchIn.gl_in[7].vInputs_0, patchIn.gl_in[7].vInputs_1, patchIn.gl_in[7].vInputs_2, patchIn.gl_in[7].vInputs_3), float4x4(patchIn.gl_in[8].vInputs_0, patchIn.gl_in[8].vInputs_1, patchIn.gl_in[8].vInputs_2, patchIn.gl_in[8].vInputs_3), float4x4(patchIn.gl_in[9].vInputs_0, patchIn.gl_in[9].vInputs_1, patchIn.gl_in[9].vInputs_2, patchIn.gl_in[9].vInputs_3), float4x4(patchIn.gl_in[10].vInputs_0, patchIn.gl_in[10].vInputs_1, patchIn.gl_in[10].vInputs_2, patchIn.gl_in[10].vInputs_3), float4x4(patchIn.gl_in[11].vInputs_0, patchIn.gl_in[11].vInputs_1, patchIn.gl_in[11].vInputs_2, patchIn.gl_in[11].vInputs_3), float4x4(patchIn.gl_in[12].vInputs_0, patchIn.gl_in[12].vInputs_1, patchIn.gl_in[12].vInputs_2, patchIn.gl_in[12].vInputs_3), float4x4(patchIn.gl_in[13].vInputs_0, patchIn.gl_in[13].vInputs_1, patchIn.gl_in[13].vInputs_2, patchIn.gl_in[13].vInputs_3), float4x4(patchIn.gl_in[14].vInputs_0, patchIn.gl_in[14].vInputs_1, patchIn.gl_in[14].vInputs_2, patchIn.gl_in[14].vInputs_3), float4x4(patchIn.gl_in[15].vInputs_0, patchIn.gl_in[15].vInputs_1, patchIn.gl_in[15].vInputs_2, patchIn.gl_in[15].vInputs_3), float4x4(patchIn.gl_in[16].vInputs_0, patchIn.gl_in[16].vInputs_1, patchIn.gl_in[16].vInputs_2, patchIn.gl_in[16].vInputs_3), float4x4(patchIn.gl_in[17].vInputs_0, patchIn.gl_in[17].vInputs_1, patchIn.gl_in[17].vInputs_2, patchIn.gl_in[17].vInputs_3), float4x4(patchIn.gl_in[18].vInputs_0, patchIn.gl_in[18].vInputs_1, patchIn.gl_in[18].vInputs_2, patchIn.gl_in[18].vInputs_3), float4x4(patchIn.gl_in[19].vInputs_0, patchIn.gl_in[19].vInputs_1, patchIn.gl_in[19].vInputs_2, patchIn.gl_in[19].vInputs_3), float4x4(patchIn.gl_in[20].vInputs_0, patchIn.gl_in[20].vInputs_1, patchIn.gl_in[20].vInputs_2, patchIn.gl_in[20].vInputs_3), float4x4(patchIn.gl_in[21].vInputs_0, patchIn.gl_in[21].vInputs_1, patchIn.gl_in[21].vInputs_2, patchIn.gl_in[21].vInputs_3), float4x4(patchIn.gl_in[22].vInputs_0, patchIn.gl_in[22].vInputs_1, patchIn.gl_in[22].vInputs_2, patchIn.gl_in[22].vInputs_3), float4x4(patchIn.gl_in[23].vInputs_0, patchIn.gl_in[23].vInputs_1, patchIn.gl_in[23].vInputs_2, patchIn.gl_in[23].vInputs_3), float4x4(patchIn.gl_in[24].vInputs_0, patchIn.gl_in[24].vInputs_1, patchIn.gl_in[24].vInputs_2, patchIn.gl_in[24].vInputs_3), float4x4(patchIn.gl_in[25].vInputs_0, patchIn.gl_in[25].vInputs_1, patchIn.gl_in[25].vInputs_2, patchIn.gl_in[25].vInputs_3), float4x4(patchIn.gl_in[26].vInputs_0, patchIn.gl_in[26].vInputs_1, patchIn.gl_in[26].vInputs_2, patchIn.gl_in[26].vInputs_3), float4x4(patchIn.gl_in[27].vInputs_0, patchIn.gl_in[27].vInputs_1, patchIn.gl_in[27].vInputs_2, patchIn.gl_in[27].vInputs_3), float4x4(patchIn.gl_in[28].vInputs_0, patchIn.gl_in[28].vInputs_1, patchIn.gl_in[28].vInputs_2, patchIn.gl_in[28].vInputs_3), float4x4(patchIn.gl_in[29].vInputs_0, patchIn.gl_in[29].vInputs_1, patchIn.gl_in[29].vInputs_2, patchIn.gl_in[29].vInputs_3), float4x4(patchIn.gl_in[30].vInputs_0, patchIn.gl_in[30].vInputs_1, patchIn.gl_in[30].vInputs_2, patchIn.gl_in[30].vInputs_3), float4x4(patchIn.gl_in[31].vInputs_0, patchIn.gl_in[31].vInputs_1, patchIn.gl_in[31].vInputs_2, patchIn.gl_in[31].vInputs_3) });
+ spvUnsafeArray<float4x4, 32> tmp;
+ tmp = _16;
+ out.gl_Position = (tmp[0][patchIn.vIndex] + tmp[1][patchIn.vIndex]) + vBoo[patchIn.vIndex];
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/load-control-point-array.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/load-control-point-array.tese
new file mode 100644
index 00000000000..09c19cb47f4
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/load-control-point-array.tese
@@ -0,0 +1,81 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct main0_out
+{
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 vInputs [[attribute(0)]];
+};
+
+struct main0_patchIn
+{
+ float4 vBoo_0 [[attribute(1)]];
+ float4 vBoo_1 [[attribute(2)]];
+ float4 vBoo_2 [[attribute(3)]];
+ float4 vBoo_3 [[attribute(4)]];
+ int vIndex [[attribute(5)]];
+ patch_control_point<main0_in> gl_in;
+};
+
+[[ patch(quad, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 4> vBoo = {};
+ vBoo[0] = patchIn.vBoo_0;
+ vBoo[1] = patchIn.vBoo_1;
+ vBoo[2] = patchIn.vBoo_2;
+ vBoo[3] = patchIn.vBoo_3;
+ spvUnsafeArray<float4, 32> _15 = spvUnsafeArray<float4, 32>({ patchIn.gl_in[0].vInputs, patchIn.gl_in[1].vInputs, patchIn.gl_in[2].vInputs, patchIn.gl_in[3].vInputs, patchIn.gl_in[4].vInputs, patchIn.gl_in[5].vInputs, patchIn.gl_in[6].vInputs, patchIn.gl_in[7].vInputs, patchIn.gl_in[8].vInputs, patchIn.gl_in[9].vInputs, patchIn.gl_in[10].vInputs, patchIn.gl_in[11].vInputs, patchIn.gl_in[12].vInputs, patchIn.gl_in[13].vInputs, patchIn.gl_in[14].vInputs, patchIn.gl_in[15].vInputs, patchIn.gl_in[16].vInputs, patchIn.gl_in[17].vInputs, patchIn.gl_in[18].vInputs, patchIn.gl_in[19].vInputs, patchIn.gl_in[20].vInputs, patchIn.gl_in[21].vInputs, patchIn.gl_in[22].vInputs, patchIn.gl_in[23].vInputs, patchIn.gl_in[24].vInputs, patchIn.gl_in[25].vInputs, patchIn.gl_in[26].vInputs, patchIn.gl_in[27].vInputs, patchIn.gl_in[28].vInputs, patchIn.gl_in[29].vInputs, patchIn.gl_in[30].vInputs, patchIn.gl_in[31].vInputs });
+ spvUnsafeArray<float4, 32> tmp;
+ tmp = _15;
+ out.gl_Position = (tmp[0] + tmp[1]) + vBoo[patchIn.vIndex];
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/quad.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/quad.tese
index 9c4f2e27118..40273582ccc 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/quad.tese
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/quad.tese
@@ -16,7 +16,8 @@ struct main0_patchIn
float4 gl_TessLevelOuter [[attribute(1)]];
};
-inline void set_position(thread float4& gl_Position, thread float2& gl_TessCoord, thread float2& gl_TessLevelInner, thread float4& gl_TessLevelOuter)
+static inline __attribute__((always_inline))
+void set_position(thread float4& gl_Position, thread float2& gl_TessCoord, thread float2& gl_TessLevelInner, thread float4& gl_TessLevelOuter)
{
gl_Position = float4(((gl_TessCoord.x * gl_TessLevelInner.x) * gl_TessLevelOuter.x) + (((1.0 - gl_TessCoord.x) * gl_TessLevelInner.x) * gl_TessLevelOuter.z), ((gl_TessCoord.y * gl_TessLevelInner.y) * gl_TessLevelOuter.y) + (((1.0 - gl_TessCoord.y) * gl_TessLevelInner.y) * gl_TessLevelOuter.w), 0.0, 1.0);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/set-from-function.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/set-from-function.tese
index f629878d3ff..30bb720c01d 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/set-from-function.tese
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/set-from-function.tese
@@ -37,7 +37,8 @@ struct main0_patchIn
patch_control_point<main0_in> gl_in;
};
-inline void set_from_function(thread float4& gl_Position, thread patch_control_point<main0_in>& gl_in, thread float4& vColors, thread Foo& vFoo)
+static inline __attribute__((always_inline))
+void set_from_function(thread float4& gl_Position, thread patch_control_point<main0_in>& gl_in, thread float4& vColors, thread Foo& vFoo)
{
gl_Position = gl_in[0].Block_a;
gl_Position += gl_in[0].Block_b;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/triangle-tess-level.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/triangle-tess-level.tese
index 975e6298518..6930e1479d6 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/triangle-tess-level.tese
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/triangle-tess-level.tese
@@ -1,8 +1,49 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct main0_out
{
float4 gl_Position [[position]];
@@ -16,8 +57,8 @@ struct main0_patchIn
[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], float3 gl_TessCoord [[position_in_patch]])
{
main0_out out = {};
- float gl_TessLevelInner[2] = {};
- float gl_TessLevelOuter[4] = {};
+ spvUnsafeArray<float, 2> gl_TessLevelInner = {};
+ spvUnsafeArray<float, 4> gl_TessLevelOuter = {};
gl_TessLevelInner[0] = patchIn.gl_TessLevel.w;
gl_TessLevelOuter[0] = patchIn.gl_TessLevel.x;
gl_TessLevelOuter[1] = patchIn.gl_TessLevel.y;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/water_tess.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/water_tess.tese
index eb19dbfcecc..f0054562b0f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/water_tess.tese
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/tese/water_tess.tese
@@ -28,12 +28,14 @@ struct main0_patchIn
float4 vPatchLods [[attribute(1)]];
};
-inline float2 lerp_vertex(thread const float2& tess_coord, thread float2& vOutPatchPosBase, constant UBO& v_31)
+static inline __attribute__((always_inline))
+float2 lerp_vertex(thread const float2& tess_coord, thread float2& vOutPatchPosBase, constant UBO& v_31)
{
return vOutPatchPosBase + (tess_coord * v_31.uPatchSize);
}
-inline float2 lod_factor(thread const float2& tess_coord, thread float4& vPatchLods)
+static inline __attribute__((always_inline))
+float2 lod_factor(thread const float2& tess_coord, thread float4& vPatchLods)
{
float2 x = mix(vPatchLods.yx, vPatchLods.zw, float2(tess_coord.x));
float level = mix(x.x, x.y, tess_coord.y);
@@ -42,7 +44,8 @@ inline float2 lod_factor(thread const float2& tess_coord, thread float4& vPatchL
return float2(floor_level, fract_level);
}
-inline float3 sample_height_displacement(thread const float2& uv, thread const float2& off, thread const float2& lod, thread texture2d<float> uHeightmapDisplacement, thread const sampler uHeightmapDisplacementSmplr)
+static inline __attribute__((always_inline))
+float3 sample_height_displacement(thread const float2& uv, thread const float2& off, thread const float2& lod, thread texture2d<float> uHeightmapDisplacement, thread const sampler uHeightmapDisplacementSmplr)
{
return mix(uHeightmapDisplacement.sample(uHeightmapDisplacementSmplr, (uv + (off * 0.5)), level(lod.x)).xyz, uHeightmapDisplacement.sample(uHeightmapDisplacementSmplr, (uv + (off * 1.0)), level(lod.x + 1.0)).xyz, float3(lod.y));
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/float-math.invariant-float-math.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/float-math.invariant-float-math.vert
new file mode 100644
index 00000000000..d603884cd80
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/float-math.invariant-float-math.vert
@@ -0,0 +1,136 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct Matrices
+{
+ float4x4 vpMatrix;
+ float4x4 wMatrix;
+ float4x3 wMatrix4x3;
+ float3x4 wMatrix3x4;
+};
+
+struct main0_out
+{
+ float3 OutNormal [[user(locn0)]];
+ float4 OutWorldPos_0 [[user(locn1)]];
+ float4 OutWorldPos_1 [[user(locn2)]];
+ float4 OutWorldPos_2 [[user(locn3)]];
+ float4 OutWorldPos_3 [[user(locn4)]];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float3 InPos [[attribute(0)]];
+ float3 InNormal [[attribute(1)]];
+};
+
+template<typename T>
+T spvFMul(T l, T r)
+{
+ return fma(l, r, T(0));
+}
+
+template<typename T, int Cols, int Rows>
+vec<T, Cols> spvFMulVectorMatrix(vec<T, Rows> v, matrix<T, Cols, Rows> m)
+{
+ vec<T, Cols> res = vec<T, Cols>(0);
+ for (uint i = Rows; i > 0; --i)
+ {
+ vec<T, Cols> tmp(0);
+ for (uint j = 0; j < Cols; ++j)
+ {
+ tmp[j] = m[j][i - 1];
+ }
+ res = fma(tmp, vec<T, Cols>(v[i - 1]), res);
+ }
+ return res;
+}
+
+template<typename T, int Cols, int Rows>
+vec<T, Rows> spvFMulMatrixVector(matrix<T, Cols, Rows> m, vec<T, Cols> v)
+{
+ vec<T, Rows> res = vec<T, Rows>(0);
+ for (uint i = Cols; i > 0; --i)
+ {
+ res = fma(m[i - 1], vec<T, Rows>(v[i - 1]), res);
+ }
+ return res;
+}
+
+template<typename T, int LCols, int LRows, int RCols, int RRows>
+matrix<T, RCols, LRows> spvFMulMatrixMatrix(matrix<T, LCols, LRows> l, matrix<T, RCols, RRows> r)
+{
+ matrix<T, RCols, LRows> res;
+ for (uint i = 0; i < RCols; i++)
+ {
+ vec<T, RCols> tmp(0);
+ for (uint j = 0; j < LCols; j++)
+ {
+ tmp = fma(vec<T, RCols>(r[i][j]), l[j], tmp);
+ }
+ res[i] = tmp;
+ }
+ return res;
+}
+
+vertex main0_out main0(main0_in in [[stage_in]], constant Matrices& _22 [[buffer(0)]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 4> OutWorldPos = {};
+ out.gl_Position = spvFMulMatrixVector(spvFMulMatrixMatrix(_22.vpMatrix, _22.wMatrix), float4(in.InPos, 1.0));
+ OutWorldPos[0] = spvFMulMatrixVector(_22.wMatrix, float4(in.InPos, 1.0));
+ OutWorldPos[1] = spvFMulVectorMatrix(float4(in.InPos, 1.0), _22.wMatrix);
+ OutWorldPos[2] = spvFMulMatrixVector(_22.wMatrix3x4, in.InPos);
+ OutWorldPos[3] = spvFMulVectorMatrix(in.InPos, _22.wMatrix4x3);
+ out.OutNormal = spvFMulMatrixVector(_22.wMatrix, float4(in.InNormal, 0.0)).xyz;
+ out.OutWorldPos_0 = OutWorldPos[0];
+ out.OutWorldPos_1 = OutWorldPos[1];
+ out.OutWorldPos_2 = OutWorldPos[2];
+ out.OutWorldPos_3 = OutWorldPos[3];
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/float-math.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/float-math.vert
new file mode 100644
index 00000000000..e96fdaedc22
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/float-math.vert
@@ -0,0 +1,87 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct Matrices
+{
+ float4x4 vpMatrix;
+ float4x4 wMatrix;
+ float4x3 wMatrix4x3;
+ float3x4 wMatrix3x4;
+};
+
+struct main0_out
+{
+ float3 OutNormal [[user(locn0)]];
+ float4 OutWorldPos_0 [[user(locn1)]];
+ float4 OutWorldPos_1 [[user(locn2)]];
+ float4 OutWorldPos_2 [[user(locn3)]];
+ float4 OutWorldPos_3 [[user(locn4)]];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float3 InPos [[attribute(0)]];
+ float3 InNormal [[attribute(1)]];
+};
+
+vertex main0_out main0(main0_in in [[stage_in]], constant Matrices& _22 [[buffer(0)]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 4> OutWorldPos = {};
+ out.gl_Position = (_22.vpMatrix * _22.wMatrix) * float4(in.InPos, 1.0);
+ OutWorldPos[0] = _22.wMatrix * float4(in.InPos, 1.0);
+ OutWorldPos[1] = float4(in.InPos, 1.0) * _22.wMatrix;
+ OutWorldPos[2] = _22.wMatrix3x4 * in.InPos;
+ OutWorldPos[3] = in.InPos * _22.wMatrix4x3;
+ out.OutNormal = (_22.wMatrix * float4(in.InNormal, 0.0)).xyz;
+ out.OutWorldPos_0 = OutWorldPos[0];
+ out.OutWorldPos_1 = OutWorldPos[1];
+ out.OutWorldPos_2 = OutWorldPos[2];
+ out.OutWorldPos_3 = OutWorldPos[3];
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/functions.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/functions.vert
index 7a598d48ad8..73eaa8b7517 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/functions.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/functions.vert
@@ -59,20 +59,23 @@ inline T spvFindSMSB(T x)
}
// Returns the determinant of a 2x2 matrix.
-inline float spvDet2x2(float a1, float a2, float b1, float b2)
+static inline __attribute__((always_inline))
+float spvDet2x2(float a1, float a2, float b1, float b2)
{
return a1 * b2 - b1 * a2;
}
// Returns the determinant of a 3x3 matrix.
-inline float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
+static inline __attribute__((always_inline))
+float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
{
return a1 * spvDet2x2(b2, b3, c2, c3) - b1 * spvDet2x2(a2, a3, c2, c3) + c1 * spvDet2x2(a2, a3, b2, b3);
}
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
// adjoint and dividing by the determinant. The contents of the matrix are changed.
-inline float4x4 spvInverse4x4(float4x4 m)
+static inline __attribute__((always_inline))
+float4x4 spvInverse4x4(float4x4 m)
{
float4x4 adj; // The adjoint matrix (inverse after dividing by determinant)
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/in_out_array_mat.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/in_out_array_mat.vert
index 71b6ab3abc1..4fd1365edc4 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/in_out_array_mat.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/in_out_array_mat.vert
@@ -1,10 +1,49 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct UBO
{
float4x4 projection;
@@ -38,13 +77,15 @@ struct main0_in
float4 inViewMat_3 [[attribute(8)]];
};
-inline void write_deeper_in_function(thread float4x4& outTransModel, constant UBO& ubo, thread float4& color, thread float4 (&colors)[3])
+static inline __attribute__((always_inline))
+void write_deeper_in_function(thread float4x4& outTransModel, constant UBO& ubo, thread float4& color, thread spvUnsafeArray<float4, 3> (&colors))
{
outTransModel[1].y = ubo.lodBias;
color = colors[2];
}
-inline void write_in_function(thread float4x4& outTransModel, constant UBO& ubo, thread float4& color, thread float4 (&colors)[3], thread float3& inNormal)
+static inline __attribute__((always_inline))
+void write_in_function(thread float4x4& outTransModel, constant UBO& ubo, thread float4& color, thread spvUnsafeArray<float4, 3> (&colors), thread float3& inNormal)
{
outTransModel[2] = float4(inNormal, 1.0);
write_deeper_in_function(outTransModel, ubo, color, colors);
@@ -54,7 +95,7 @@ vertex main0_out main0(main0_in in [[stage_in]], constant UBO& ubo [[buffer(0)]]
{
main0_out out = {};
float4x4 outTransModel = {};
- float4 colors[3] = {};
+ spvUnsafeArray<float4, 3> colors = {};
float4x4 inViewMat = {};
colors[0] = in.colors_0;
colors[1] = in.colors_1;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/interface-block-block-composites.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/interface-block-block-composites.frag
index c42381d0046..c160ade2dd7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/interface-block-block-composites.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/interface-block-block-composites.frag
@@ -1,13 +1,54 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct Vert
{
float3x3 wMatrix;
float4 wTmp;
- float arr[4];
+ spvUnsafeArray<float, 4> arr;
};
struct main0_out
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/interface-block-block-composites.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/interface-block-block-composites.vert
index 3d97ae6dcff..69f271a83cb 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/interface-block-block-composites.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/interface-block-block-composites.vert
@@ -1,11 +1,52 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct Vert
{
- float arr[3];
+ spvUnsafeArray<float, 3> arr;
float3x3 wMatrix;
float4 wTmp;
};
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/leaf-function.capture.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/leaf-function.capture.vert
index 289d4ff55b8..6519e56b8ff 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/leaf-function.capture.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/leaf-function.capture.vert
@@ -22,7 +22,8 @@ struct main0_in
float3 aNormal [[attribute(1)]];
};
-inline void set_output(device float4& gl_Position, constant UBO& v_18, thread float4& aVertex, device float3& vNormal, thread float3& aNormal)
+static inline __attribute__((always_inline))
+void set_output(device float4& gl_Position, constant UBO& v_18, thread float4& aVertex, device float3& vNormal, thread float3& aNormal)
{
gl_Position = v_18.uMVP * aVertex;
vNormal = aNormal;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/read-from-row-major-array.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/read-from-row-major-array.vert
index 35af2e99f41..d6ade7c38b9 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/read-from-row-major-array.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/read-from-row-major-array.vert
@@ -21,12 +21,14 @@ struct main0_in
float4 a_position [[attribute(0)]];
};
-inline float compare_float(thread const float& a, thread const float& b)
+static inline __attribute__((always_inline))
+float compare_float(thread const float& a, thread const float& b)
{
return float(abs(a - b) < 0.0500000007450580596923828125);
}
-inline float compare_vec3(thread const float3& a, thread const float3& b)
+static inline __attribute__((always_inline))
+float compare_vec3(thread const float3& a, thread const float3& b)
{
float param = a.x;
float param_1 = b.x;
@@ -37,7 +39,8 @@ inline float compare_vec3(thread const float3& a, thread const float3& b)
return (compare_float(param, param_1) * compare_float(param_2, param_3)) * compare_float(param_4, param_5);
}
-inline float compare_mat2x3(thread const float2x3& a, thread const float2x3& b)
+static inline __attribute__((always_inline))
+float compare_mat2x3(thread const float2x3& a, thread const float2x3& b)
{
float3 param = a[0];
float3 param_1 = b[0];
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/resource-arrays-leaf.ios.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/resource-arrays-leaf.ios.vert
index d23edacb2cb..8ab252f5351 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/resource-arrays-leaf.ios.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/resource-arrays-leaf.ios.vert
@@ -22,7 +22,8 @@ struct constant_block
#endif
constant int arraySize = SPIRV_CROSS_CONSTANT_ID_0;
-inline void doWork(device storage_block* (&storage)[2], constant constant_block* (&constants)[4], thread const array<texture2d<int>, 3> images)
+static inline __attribute__((always_inline))
+void doWork(device storage_block* (&storage)[2], constant constant_block* (&constants)[4], thread const array<texture2d<int>, 3> images)
{
storage[0]->baz = uint4(constants[3]->foo);
storage[1]->quux = images[2].read(uint2(int2(constants[1]->bar))).xy;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/return-array.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/return-array.vert
index 0833388acfd..dacb0ba3053 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/return-array.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/return-array.vert
@@ -1,98 +1,81 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
-constant float4 _20[2] = { float4(10.0), float4(20.0) };
-
-struct main0_out
-{
- float4 gl_Position [[position]];
-};
-
-struct main0_in
-{
- float4 vInput0 [[attribute(0)]];
- float4 vInput1 [[attribute(1)]];
-};
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
+template<typename T, size_t Num>
+struct spvUnsafeArray
{
- for (uint i = 0; i < A; i++)
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const thread T& operator [] (size_t pos) const thread
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ device T& operator [] (size_t pos) device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+ constexpr const device T& operator [] (size_t pos) const device
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ constexpr const constant T& operator [] (size_t pos) const constant
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
-
-template<typename T, uint A>
-inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
-{
- for (uint i = 0; i < A; i++)
+
+ threadgroup T& operator [] (size_t pos) threadgroup
{
- dst[i] = src[i];
+ return elements[pos];
}
-}
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+constant spvUnsafeArray<float4, 2> _20 = spvUnsafeArray<float4, 2>({ float4(10.0), float4(20.0) });
+
+struct main0_out
+{
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 vInput0 [[attribute(0)]];
+ float4 vInput1 [[attribute(1)]];
+};
-inline void test(thread float4 (&SPIRV_Cross_return_value)[2])
+static inline __attribute__((always_inline))
+spvUnsafeArray<float4, 2> test()
{
- spvArrayCopyFromConstantToStack1(SPIRV_Cross_return_value, _20);
+ return _20;
}
-inline void test2(thread float4 (&SPIRV_Cross_return_value)[2], thread float4& vInput0, thread float4& vInput1)
+static inline __attribute__((always_inline))
+spvUnsafeArray<float4, 2> test2(thread float4& vInput0, thread float4& vInput1)
{
- float4 foobar[2];
+ spvUnsafeArray<float4, 2> foobar;
foobar[0] = vInput0;
foobar[1] = vInput1;
- spvArrayCopyFromStackToStack1(SPIRV_Cross_return_value, foobar);
+ return foobar;
}
vertex main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
- float4 _42[2];
- test(_42);
- float4 _44[2];
- test2(_44, in.vInput0, in.vInput1);
- out.gl_Position = _42[0] + _44[1];
+ out.gl_Position = test()[0] + test2(in.vInput0, in.vInput1)[1];
return out;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/set_builtin_in_func.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/set_builtin_in_func.vert
index 54c4cedb81d..91057da2ba9 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/set_builtin_in_func.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/set_builtin_in_func.vert
@@ -11,7 +11,8 @@ struct main0_out
float gl_PointSize [[point_size]];
};
-inline void write_outblock(thread float4& gl_Position, thread float& gl_PointSize)
+static inline __attribute__((always_inline))
+void write_outblock(thread float4& gl_Position, thread float& gl_PointSize)
{
gl_PointSize = 1.0;
gl_Position = float4(gl_PointSize);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/texture_buffer.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/texture_buffer.vert
index 677a2f8fdd6..3b3d92b5654 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/texture_buffer.vert
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vert/texture_buffer.vert
@@ -11,7 +11,8 @@ struct main0_out
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
-inline uint2 spvTexelBufferCoord(uint tc)
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag
index 23c554940b8..67895e3e92c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag
@@ -1,8 +1,49 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
struct main0_out
{
float4 FragColor [[color(0)]];
@@ -20,7 +61,7 @@ struct main0_in
fragment main0_out main0(main0_in in [[stage_in]], constant uint* spvViewMask [[buffer(24)]], texture2d<float> uTex [[texture(0)]], sampler uTexSmplr [[sampler(0)]], uint gl_ViewIndex [[render_target_array_index]])
{
main0_out out = {};
- float2 vTex[4] = {};
+ spvUnsafeArray<float2, 4> vTex = {};
vTex[0] = in.vTex_0;
vTex[1] = in.vTex_1;
vTex[2] = in.vTex_2;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/access-tracking-function-call-result.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/access-tracking-function-call-result.asm.comp
new file mode 100644
index 00000000000..e4dfdb87a82
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/access-tracking-function-call-result.asm.comp
@@ -0,0 +1,24 @@
+#version 460
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+
+layout(binding = 0, std430) buffer Output
+{
+ int myout;
+} _5;
+
+int foo()
+{
+ return 12;
+}
+
+void main()
+{
+ int _17 = foo();
+ while (true)
+ {
+ _5.myout = _17;
+ return;
+ }
+ _5.myout = _17;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp
new file mode 100644
index 00000000000..2d32b401a5a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp
@@ -0,0 +1,30 @@
+#version 450
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+
+struct T
+{
+ float c;
+};
+
+struct T_1
+{
+ float b;
+};
+
+layout(binding = 0, std430) buffer SSBO1
+{
+ T_1 foo[];
+} _7;
+
+layout(binding = 1, std140) buffer SSBO2
+{
+ T bar[];
+} _10;
+
+void main()
+{
+ T v = T(40.0);
+ _7.foo[10].b = v.c;
+ _10.bar[30].c = v.c;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/empty-struct-in-struct.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/empty-struct-in-struct.asm.frag
new file mode 100644
index 00000000000..0d3958b5b08
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/empty-struct-in-struct.asm.frag
@@ -0,0 +1,31 @@
+#version 450
+
+struct EmptyStructTest
+{
+ int empty_struct_member;
+};
+
+struct EmptyStruct2Test
+{
+ EmptyStructTest _m0;
+};
+
+float GetValue(EmptyStruct2Test self)
+{
+ return 0.0;
+}
+
+float GetValue_1(EmptyStruct2Test self)
+{
+ return 0.0;
+}
+
+void main()
+{
+ EmptyStructTest _25 = EmptyStructTest(0);
+ EmptyStruct2Test emptyStruct;
+ float value = GetValue(emptyStruct);
+ value = GetValue_1(EmptyStruct2Test(_25));
+ value = GetValue_1(EmptyStruct2Test(EmptyStructTest(0)));
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/unordered-compare.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/unordered-compare.asm.frag
new file mode 100644
index 00000000000..2cc81295521
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/unordered-compare.asm.frag
@@ -0,0 +1,33 @@
+#version 450
+
+layout(location = 0) in vec4 A;
+layout(location = 1) in vec4 B;
+layout(location = 0) out vec4 FragColor;
+
+vec4 test_vector()
+{
+ bvec4 le = not(greaterThanEqual(A, B));
+ bvec4 leq = not(greaterThan(A, B));
+ bvec4 ge = not(lessThanEqual(A, B));
+ bvec4 geq = not(lessThan(A, B));
+ bvec4 eq = not(notEqual(A, B));
+ bvec4 neq = not(equal(A, B));
+ return ((((mix(vec4(0.0), vec4(1.0), le) + mix(vec4(0.0), vec4(1.0), leq)) + mix(vec4(0.0), vec4(1.0), ge)) + mix(vec4(0.0), vec4(1.0), geq)) + mix(vec4(0.0), vec4(1.0), eq)) + mix(vec4(0.0), vec4(1.0), neq);
+}
+
+float test_scalar()
+{
+ bool le = !(A.x >= B.x);
+ bool leq = !(A.x > B.x);
+ bool ge = !(A.x <= B.x);
+ bool geq = !(A.x < B.x);
+ bool eq = !(A.x != B.x);
+ bool neq = !(A.x == B.x);
+ return ((((float(le) + float(leq)) + float(ge)) + float(geq)) + float(eq)) + float(neq);
+}
+
+void main()
+{
+ FragColor = test_vector() + vec4(test_scalar());
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/vector-extract-dynamic-spec-constant.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/vector-extract-dynamic-spec-constant.asm.frag
new file mode 100644
index 00000000000..d4f3acae097
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/vector-extract-dynamic-spec-constant.asm.frag
@@ -0,0 +1,27 @@
+#version 450
+
+#ifndef SPIRV_CROSS_CONSTANT_ID_0
+#define SPIRV_CROSS_CONSTANT_ID_0 0
+#endif
+const int omap_r = SPIRV_CROSS_CONSTANT_ID_0;
+#ifndef SPIRV_CROSS_CONSTANT_ID_1
+#define SPIRV_CROSS_CONSTANT_ID_1 1
+#endif
+const int omap_g = SPIRV_CROSS_CONSTANT_ID_1;
+#ifndef SPIRV_CROSS_CONSTANT_ID_2
+#define SPIRV_CROSS_CONSTANT_ID_2 2
+#endif
+const int omap_b = SPIRV_CROSS_CONSTANT_ID_2;
+#ifndef SPIRV_CROSS_CONSTANT_ID_3
+#define SPIRV_CROSS_CONSTANT_ID_3 3
+#endif
+const int omap_a = SPIRV_CROSS_CONSTANT_ID_3;
+
+layout(location = 0) out vec4 FragColor;
+layout(location = 0) in vec4 vColor;
+
+void main()
+{
+ FragColor = vec4(vColor[omap_r], vColor[omap_g], vColor[omap_b], vColor[omap_a]);
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag
new file mode 100644
index 00000000000..1af8db75894
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag
@@ -0,0 +1,366 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_844;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_860;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_876;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_892;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_908;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_956;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_972;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_988;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1004;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1660;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1676;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1692;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2012;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2084;
+ float PrePadding_View_2088;
+ float PrePadding_View_2092;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2164;
+ float PrePadding_View_2168;
+ float PrePadding_View_2172;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2204;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2348;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2488;
+ float PrePadding_View_2492;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2648;
+ float PrePadding_View_2652;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2828;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2844;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2860;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2876;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_2892;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_MobileDirectionalLight
+{
+ float4 MobileDirectionalLight_DirectionalLightColor;
+ float4 MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition;
+ float4 MobileDirectionalLight_DirectionalLightShadowSize;
+ float4 MobileDirectionalLight_DirectionalLightDistanceFadeMAD;
+ float4 MobileDirectionalLight_DirectionalLightShadowDistances;
+ float4x4 MobileDirectionalLight_DirectionalLightScreenToShadow[4];
+};
+
+struct type_Globals
+{
+ int NumDynamicPointLights;
+ float4 LightPositionAndInvRadius[4];
+ float4 LightColorAndFalloffExponent[4];
+ float4 MobileReflectionParams;
+};
+
+constant float3 _136 = {};
+constant float4 _137 = {};
+constant float _138 = {};
+constant float3 _139 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+struct main0_in
+{
+ float2 in_var_TEXCOORD0 [[user(locn0)]];
+ float4 in_var_TEXCOORD7 [[user(locn1)]];
+ float4 in_var_TEXCOORD8 [[user(locn2)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_MobileDirectionalLight& MobileDirectionalLight [[buffer(1)]], constant type_Globals& _Globals [[buffer(2)]], texture2d<float> MobileDirectionalLight_DirectionalLightShadowTexture [[texture(0)]], texture2d<float> Material_Texture2D_0 [[texture(1)]], texture2d<float> Material_Texture2D_1 [[texture(2)]], texturecube<float> ReflectionCubemap [[texture(3)]], sampler MobileDirectionalLight_DirectionalLightShadowSampler [[sampler(0)]], sampler Material_Texture2D_0Sampler [[sampler(1)]], sampler Material_Texture2D_1Sampler [[sampler(2)]], sampler ReflectionCubemapSampler [[sampler(3)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ float4 _177 = float4((((gl_FragCoord.xy - View.View_ViewRectMin.xy) * View.View_ViewSizeAndInvSize.zw) - float2(0.5)) * float2(2.0, -2.0), _138, 1.0) * float4(gl_FragCoord.w);
+ float3 _181 = normalize(-in.in_var_TEXCOORD8.xyz);
+ float2 _190 = (Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (in.in_var_TEXCOORD0 * float2(10.0))).xy * float2(2.0)) - float2(1.0);
+ float3 _206 = normalize(float3x3(float3(1.0, 0.0, 0.0), float3(0.0, 1.0, 0.0), float3(0.0, 0.0, 1.0)) * (((float4(_190, sqrt(fast::clamp(1.0 - dot(_190, _190), 0.0, 1.0)), 1.0).xyz * float3(0.300000011920928955078125, 0.300000011920928955078125, 1.0)) * float3(View.View_NormalOverrideParameter.w)) + View.View_NormalOverrideParameter.xyz));
+ float _208 = dot(_206, _181);
+ float _219 = mix(0.4000000059604644775390625, 1.0, Material_Texture2D_1.sample(Material_Texture2D_1Sampler, (in.in_var_TEXCOORD0 * float2(20.0))).x);
+ float4 _223 = Material_Texture2D_1.sample(Material_Texture2D_1Sampler, (in.in_var_TEXCOORD0 * float2(5.0)));
+ float _224 = _177.w;
+ float _228 = fast::min(fast::max((_224 - 24.0) * 0.000666666659526526927947998046875, 0.0), 1.0);
+ float _229 = _223.y;
+ float4 _233 = Material_Texture2D_1.sample(Material_Texture2D_1Sampler, (in.in_var_TEXCOORD0 * float2(0.5)));
+ float _235 = _233.y;
+ float _253 = fast::clamp((fast::min(fast::max(mix(0.0, 0.5, _235) + mix(mix(0.699999988079071044921875, 1.0, _229), 1.0, _228), 0.0), 1.0) * View.View_RoughnessOverrideParameter.y) + View.View_RoughnessOverrideParameter.x, 0.119999997317790985107421875, 1.0);
+ float2 _257 = (float2(_253) * float2(-1.0, -0.0274999998509883880615234375)) + float2(1.0, 0.0425000004470348358154296875);
+ float _258 = _257.x;
+ float3 _270 = (fast::clamp(float3(mix(_219, 1.0 - _219, mix(_229, 1.0, _228)) * (mix(0.2949999868869781494140625, 0.660000026226043701171875, mix(_235 + mix(_229, 0.0, _228), 0.5, 0.5)) * 0.5)), float3(0.0), float3(1.0)) * float3(View.View_DiffuseOverrideParameter.w)) + View.View_DiffuseOverrideParameter.xyz;
+ float3 _275 = float3(((fast::min(_258 * _258, exp2((-9.27999973297119140625) * fast::max(_208, 0.0))) * _258) + _257.y) * View.View_SpecularOverrideParameter.w) + View.View_SpecularOverrideParameter.xyz;
+ float _276 = _275.x;
+ float4 _303;
+ int _286 = 0;
+ for (;;)
+ {
+ if (_286 < 2)
+ {
+ if (_224 < MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowDistances[uint(_286)])
+ {
+ _303 = MobileDirectionalLight.MobileDirectionalLight_DirectionalLightScreenToShadow[_286] * float4(_177.xy, _224, 1.0);
+ break;
+ }
+ _286++;
+ continue;
+ }
+ else
+ {
+ _303 = float4(0.0);
+ break;
+ }
+ }
+ float _423;
+ if (_303.z > 0.0)
+ {
+ float2 _311 = _303.xy * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.xy;
+ float2 _312 = fract(_311);
+ float2 _313 = floor(_311);
+ float3 _320 = _139;
+ _320.x = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(-0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _326 = _320;
+ _326.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5, -0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _332 = _326;
+ _332.z = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(1.5, -0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _335 = float3(MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.w);
+ float3 _337 = float3((fast::min(_303.z, 0.999989986419677734375) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.w) - 1.0);
+ float3 _339 = fast::clamp((_332 * _335) - _337, float3(0.0), float3(1.0));
+ float3 _345 = _139;
+ _345.x = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(-0.5, 0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _351 = _345;
+ _351.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _357 = _351;
+ _357.z = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(1.5, 0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _360 = fast::clamp((_357 * _335) - _337, float3(0.0), float3(1.0));
+ float3 _366 = _139;
+ _366.x = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(-0.5, 1.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _372 = _366;
+ _372.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5, 1.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _378 = _372;
+ _378.z = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(1.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _381 = fast::clamp((_378 * _335) - _337, float3(0.0), float3(1.0));
+ float _383 = _312.x;
+ float _384 = 1.0 - _383;
+ float3 _399 = _136;
+ _399.x = ((_339.x * _384) + _339.y) + (_339.z * _383);
+ float3 _403 = _399;
+ _403.y = ((_360.x * _384) + _360.y) + (_360.z * _383);
+ float3 _407 = _403;
+ _407.z = ((_381.x * _384) + _381.y) + (_381.z * _383);
+ float _408 = _312.y;
+ float _420 = fast::clamp((_224 * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDistanceFadeMAD.x) + MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDistanceFadeMAD.y, 0.0, 1.0);
+ _423 = mix(fast::clamp(0.25 * dot(_407, float3(1.0 - _408, 1.0, _408)), 0.0, 1.0), 1.0, _420 * _420);
+ }
+ else
+ {
+ _423 = 1.0;
+ }
+ float3 _429 = normalize(_181 + MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.xyz);
+ float _439 = (_253 * 0.25) + 0.25;
+ float3 _440 = cross(_206, _429);
+ float _442 = _253 * _253;
+ float _443 = fast::max(0.0, dot(_206, _429)) * _442;
+ float _446 = _442 / (dot(_440, _440) + (_443 * _443));
+ bool _458 = float(_Globals.MobileReflectionParams.w > 0.0) != 0.0;
+ float4 _468 = ReflectionCubemap.sample(ReflectionCubemapSampler, ((-_181) + ((_206 * float3(_208)) * float3(2.0))), level(((_458 ? _Globals.MobileReflectionParams.w : View.View_ReflectionCubemapMaxMip) - 1.0) - (1.0 - (1.2000000476837158203125 * log2(_253)))));
+ float3 _481;
+ if (_458)
+ {
+ _481 = _468.xyz * View.View_SkyLightColor.xyz;
+ }
+ else
+ {
+ float3 _476 = _468.xyz * float3(_468.w * 16.0);
+ _481 = _476 * _476;
+ }
+ float3 _484 = float3(_276);
+ float3 _488;
+ _488 = ((float3(_423 * fast::max(0.0, dot(_206, MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.xyz))) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightColor.xyz) * (_270 + float3(_276 * (_439 * fast::min(_446 * _446, 65504.0))))) + ((_481 * float3(fast::clamp(1.0, 0.0, 1.0))) * _484);
+ float3 _507;
+ float _509;
+ float _511;
+ float _537;
+ int _491 = 0;
+ for (;;)
+ {
+ if (_491 < _Globals.NumDynamicPointLights)
+ {
+ float3 _501 = _Globals.LightPositionAndInvRadius[_491].xyz - (in.in_var_TEXCOORD8.xyz - float3(View.View_PreViewTranslation));
+ float _502 = dot(_501, _501);
+ float3 _505 = _501 * float3(rsqrt(_502));
+ _507 = normalize(_181 + _505);
+ _509 = fast::max(0.0, dot(_206, _505));
+ _511 = fast::max(0.0, dot(_206, _507));
+ if (_Globals.LightColorAndFalloffExponent[_491].w == 0.0)
+ {
+ float _531 = _502 * (_Globals.LightPositionAndInvRadius[_491].w * _Globals.LightPositionAndInvRadius[_491].w);
+ float _534 = fast::clamp(1.0 - (_531 * _531), 0.0, 1.0);
+ _537 = (1.0 / (_502 + 1.0)) * (_534 * _534);
+ }
+ else
+ {
+ float3 _521 = _501 * float3(_Globals.LightPositionAndInvRadius[_491].w);
+ _537 = pow(1.0 - fast::clamp(dot(_521, _521), 0.0, 1.0), _Globals.LightColorAndFalloffExponent[_491].w);
+ }
+ float3 _544 = cross(_206, _507);
+ float _546 = _511 * _442;
+ float _549 = _442 / (dot(_544, _544) + (_546 * _546));
+ _488 += fast::min(float3(65000.0), ((float3(_537 * _509) * _Globals.LightColorAndFalloffExponent[_491].xyz) * float3(0.3183098733425140380859375)) * (_270 + float3(_276 * (_439 * fast::min(_549 * _549, 65504.0)))));
+ _491++;
+ continue;
+ }
+ else
+ {
+ break;
+ }
+ }
+ float3 _567 = (mix(_488 + fast::max(float3(0.0), float3(0.0)), _270 + _484, float3(View.View_UnlitViewmodeMask)) * float3(in.in_var_TEXCOORD7.w)) + in.in_var_TEXCOORD7.xyz;
+ float4 _571 = float4(_567.x, _567.y, _567.z, _137.w);
+ _571.w = fast::min(in.in_var_TEXCOORD8.w, 65500.0);
+ out.out_var_SV_Target0 = _571;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/array-copy-error.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/array-copy-error.asm.frag
new file mode 100644
index 00000000000..73dc2eee1b5
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/array-copy-error.asm.frag
@@ -0,0 +1,350 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_ClipToWorld;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_908;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_924;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_940;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_956;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_972;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_1020;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_1036;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_1052;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1068;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1724;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1740;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1756;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2076;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2148;
+ float PrePadding_View_2152;
+ float PrePadding_View_2156;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2228;
+ float PrePadding_View_2232;
+ float PrePadding_View_2236;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2268;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2412;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ float View_AtmosphericFogSunDiscHalfApexAngleRadian;
+ float PrePadding_View_2492;
+ float4 View_AtmosphericFogSunDiscLuminance;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ uint PrePadding_View_2520;
+ uint PrePadding_View_2524;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2584;
+ float PrePadding_View_2588;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2744;
+ float PrePadding_View_2748;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float PrePadding_View_2908;
+ int2 View_CursorPosition;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ float PrePadding_View_2924;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2940;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2956;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2972;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2988;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_3004;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_PrimitiveDither
+{
+ float PrimitiveDither_LODFactor;
+};
+
+struct type_PrimitiveFade
+{
+ float2 PrimitiveFade_FadeTimeScaleBias;
+};
+
+struct type_Material
+{
+ float4 Material_VectorExpressions[9];
+ float4 Material_ScalarExpressions[3];
+};
+
+constant float _98 = {};
+constant float _103 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+ float gl_FragDepth [[depth(less)]];
+};
+
+struct main0_in
+{
+ float4 in_var_TEXCOORD6 [[user(locn0)]];
+ float4 in_var_TEXCOORD7 [[user(locn1)]];
+ float4 in_var_TEXCOORD10_centroid [[user(locn2)]];
+ float4 in_var_TEXCOORD11_centroid [[user(locn3)]];
+ float4 in_var_TEXCOORD0_0 [[user(locn4)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_PrimitiveDither& PrimitiveDither [[buffer(1)]], constant type_PrimitiveFade& PrimitiveFade [[buffer(2)]], constant type_Material& Material [[buffer(3)]], texture2d<float> Material_Texture2D_0 [[texture(0)]], texture2d<float> Material_Texture2D_3 [[texture(1)]], sampler Material_Texture2D_0Sampler [[sampler(0)]], sampler Material_Texture2D_3Sampler [[sampler(1)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 1> in_var_TEXCOORD0 = {};
+ in_var_TEXCOORD0[0] = in.in_var_TEXCOORD0_0;
+ float2 _135 = gl_FragCoord.xy - View.View_ViewRectMin.xy;
+ float4 _140 = float4(_103, _103, gl_FragCoord.z, 1.0) * float4(gl_FragCoord.w);
+ float4 _144 = View.View_SVPositionToTranslatedWorld * float4(gl_FragCoord.xyz, 1.0);
+ float3 _148 = _144.xyz / float3(_144.w);
+ float3 _149 = _148 - float3(View.View_PreViewTranslation);
+ float3 _151 = normalize(-_148);
+ float3 _152 = _151 * float3x3(in.in_var_TEXCOORD10_centroid.xyz, cross(in.in_var_TEXCOORD11_centroid.xyz, in.in_var_TEXCOORD10_centroid.xyz) * float3(in.in_var_TEXCOORD11_centroid.w), in.in_var_TEXCOORD11_centroid.xyz);
+ float _170 = mix(Material.Material_ScalarExpressions[0].y, Material.Material_ScalarExpressions[0].z, fast::min(fast::max(abs(dot(_151, in.in_var_TEXCOORD11_centroid.xyz)), 0.0), 1.0));
+ float _172 = 1.0 / _170;
+ float2 _174 = (float2(Material.Material_ScalarExpressions[0].x) * ((_152.xy * float2(-1.0)) / float2(_152.z))) * float2(_172);
+ float _180_copy;
+ float2 _183;
+ _183 = float2(0.0);
+ float _188;
+ float _211;
+ float2 _212;
+ float _180 = 1.0;
+ int _185 = 0;
+ float _187 = 1.0;
+ float _189 = 1.0;
+ for (;;)
+ {
+ if (float(_185) < (floor(_170) + 2.0))
+ {
+ _188 = Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y) + _183), gradient2d(dfdx(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y)), dfdy(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y)))).y;
+ if (_180 < _188)
+ {
+ float _201 = _188 - _180;
+ float _203 = _201 / ((_189 - _187) + _201);
+ _211 = (_189 * _203) + (_180 * (1.0 - _203));
+ _212 = _183 - (float2(_203) * _174);
+ break;
+ }
+ _180_copy = _180;
+ _180 -= _172;
+ _183 += _174;
+ _185++;
+ _187 = _188;
+ _189 = _180_copy;
+ continue;
+ }
+ else
+ {
+ _211 = _98;
+ _212 = _183;
+ break;
+ }
+ }
+ float4 _218 = Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y) + _212.xy), bias(View.View_MaterialTextureMipBias));
+ float2 _229 = _135 + float2(View.View_TemporalAAParams.x);
+ float _237 = float((uint(_229.x) + (2u * uint(_229.y))) % 5u);
+ float2 _238 = _135 * float2(0.015625);
+ float4 _242 = Material_Texture2D_3.sample(Material_Texture2D_3Sampler, _238, bias(View.View_MaterialTextureMipBias));
+ float4 _254 = Material_Texture2D_3.sample(Material_Texture2D_3Sampler, _238, bias(View.View_MaterialTextureMipBias));
+ float3 _272 = float3(_212, (1.0 - _211) * Material.Material_ScalarExpressions[0].x);
+ float2 _275 = dfdx(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y));
+ float2 _276 = abs(_275);
+ float3 _279 = dfdx(_149);
+ float2 _283 = dfdy(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y));
+ float2 _284 = abs(_283);
+ float3 _287 = dfdy(_149);
+ if (PrimitiveDither.PrimitiveDither_LODFactor != 0.0)
+ {
+ if (abs(PrimitiveDither.PrimitiveDither_LODFactor) > 0.001000000047497451305389404296875)
+ {
+ float _317 = fract(cos(dot(floor(gl_FragCoord.xy), float2(347.834503173828125, 3343.28369140625))) * 1000.0);
+ if ((float((PrimitiveDither.PrimitiveDither_LODFactor < 0.0) ? ((PrimitiveDither.PrimitiveDither_LODFactor + 1.0) > _317) : (PrimitiveDither.PrimitiveDither_LODFactor < _317)) - 0.001000000047497451305389404296875) < 0.0)
+ {
+ discard_fragment();
+ }
+ }
+ }
+ if ((((_218.z + ((fast::min(fast::max(1.0 - (_218.x * Material.Material_ScalarExpressions[2].y), 0.0), 1.0) + ((_237 + (_242.x * Material.Material_ScalarExpressions[2].z)) * 0.16666667163372039794921875)) + (-0.5))) * ((fast::clamp((View.View_RealTime * PrimitiveFade.PrimitiveFade_FadeTimeScaleBias.x) + PrimitiveFade.PrimitiveFade_FadeTimeScaleBias.y, 0.0, 1.0) + ((_237 + _254.x) * 0.16666667163372039794921875)) + (-0.5))) - 0.33329999446868896484375) < 0.0)
+ {
+ discard_fragment();
+ }
+ float2 _351 = ((((in.in_var_TEXCOORD6.xy / float2(in.in_var_TEXCOORD6.w)) - View.View_TemporalAAJitter.xy) - ((in.in_var_TEXCOORD7.xy / float2(in.in_var_TEXCOORD7.w)) - View.View_TemporalAAJitter.zw)) * float2(0.2495000064373016357421875)) + float2(0.49999237060546875);
+ out.gl_FragDepth = fast::min(_140.z / (_140.w + (sqrt(dot(_272, _272)) / (fast::max(sqrt(dot(_276, _276)) / sqrt(dot(_279, _279)), sqrt(dot(_284, _284)) / sqrt(dot(_287, _287))) / abs(dot(float3x3(View.View_ViewToTranslatedWorld[0].xyz, View.View_ViewToTranslatedWorld[1].xyz, View.View_ViewToTranslatedWorld[2].xyz) * float3(0.0, 0.0, 1.0), _151))))), gl_FragCoord.z);
+ out.out_var_SV_Target0 = float4(_351.x, _351.y, float2(0.0).x, float2(0.0).y);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/depth-compare.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/depth-compare.asm.frag
new file mode 100644
index 00000000000..bdeccc2f554
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/depth-compare.asm.frag
@@ -0,0 +1,314 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_844;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_860;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_876;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_892;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_908;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_956;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_972;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_988;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1004;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1660;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1676;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1692;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2012;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2084;
+ float PrePadding_View_2088;
+ float PrePadding_View_2092;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2164;
+ float PrePadding_View_2168;
+ float PrePadding_View_2172;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2204;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2348;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2488;
+ float PrePadding_View_2492;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2648;
+ float PrePadding_View_2652;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2828;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2844;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2860;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2876;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_2892;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_Globals
+{
+ float3 SoftTransitionScale;
+ float4x4 ShadowViewProjectionMatrices[6];
+ float InvShadowmapResolution;
+ float ShadowFadeFraction;
+ float ShadowSharpen;
+ float4 LightPositionAndInvRadius;
+ float2 ProjectionDepthBiasParameters;
+ float4 PointLightDepthBiasAndProjParameters;
+};
+
+constant float4 _107 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_Globals& _Globals [[buffer(1)]], texture2d<float> SceneTexturesStruct_SceneDepthTexture [[texture(0)]], texture2d<float> SceneTexturesStruct_GBufferATexture [[texture(1)]], texture2d<float> SceneTexturesStruct_GBufferBTexture [[texture(2)]], texture2d<float> SceneTexturesStruct_GBufferDTexture [[texture(3)]], depthcube<float> ShadowDepthCubeTexture [[texture(4)]], texture2d<float> SSProfilesTexture [[texture(5)]], sampler SceneTexturesStruct_SceneDepthTextureSampler [[sampler(0)]], sampler SceneTexturesStruct_GBufferATextureSampler [[sampler(1)]], sampler SceneTexturesStruct_GBufferBTextureSampler [[sampler(2)]], sampler SceneTexturesStruct_GBufferDTextureSampler [[sampler(3)]], sampler ShadowDepthTextureSampler [[sampler(4)]], sampler ShadowDepthCubeTextureSampler [[sampler(5)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ float2 _114 = gl_FragCoord.xy * View.View_BufferSizeAndInvSize.zw;
+ float4 _118 = SceneTexturesStruct_SceneDepthTexture.sample(SceneTexturesStruct_SceneDepthTextureSampler, _114, level(0.0));
+ float _119 = _118.x;
+ float _133 = ((_119 * View.View_InvDeviceZToWorldZTransform.x) + View.View_InvDeviceZToWorldZTransform.y) + (1.0 / ((_119 * View.View_InvDeviceZToWorldZTransform.z) - View.View_InvDeviceZToWorldZTransform.w));
+ float4 _147 = View.View_ScreenToWorld * float4(((_114 - View.View_ScreenPositionScaleBias.wz) / View.View_ScreenPositionScaleBias.xy) * float2(_133), _133, 1.0);
+ float3 _148 = _147.xyz;
+ float3 _152 = _Globals.LightPositionAndInvRadius.xyz - _148;
+ float _158 = length(_152);
+ bool _160 = (_158 * _Globals.LightPositionAndInvRadius.w) < 1.0;
+ float _207;
+ if (_160)
+ {
+ float3 _165 = abs(_152);
+ float _166 = _165.x;
+ float _167 = _165.y;
+ float _168 = _165.z;
+ float _170 = fast::max(_166, fast::max(_167, _168));
+ int _189;
+ if (_170 == _166)
+ {
+ _189 = (_166 == _152.x) ? 0 : 1;
+ }
+ else
+ {
+ int _185;
+ if (_170 == _167)
+ {
+ _185 = (_167 == _152.y) ? 2 : 3;
+ }
+ else
+ {
+ _185 = (_168 == _152.z) ? 4 : 5;
+ }
+ _189 = _185;
+ }
+ float4 _196 = _Globals.ShadowViewProjectionMatrices[_189] * float4(_147.xyz, 1.0);
+ float _198 = _196.w;
+ _207 = ShadowDepthCubeTexture.sample_compare(ShadowDepthCubeTextureSampler, (_152 / float3(_158)), (_196.z / _198) + ((-_Globals.PointLightDepthBiasAndProjParameters.x) / _198), level(0.0));
+ }
+ else
+ {
+ _207 = 1.0;
+ }
+ float _213 = fast::clamp(((_207 - 0.5) * _Globals.ShadowSharpen) + 0.5, 0.0, 1.0);
+ float _218 = sqrt(mix(1.0, _213 * _213, _Globals.ShadowFadeFraction));
+ float4 _219 = _107;
+ _219.z = _218;
+ float3 _236 = normalize((SceneTexturesStruct_GBufferATexture.sample(SceneTexturesStruct_GBufferATextureSampler, _114, level(0.0)).xyz * float3(2.0)) - float3(1.0));
+ uint _240 = uint(round(SceneTexturesStruct_GBufferBTexture.sample(SceneTexturesStruct_GBufferBTextureSampler, _114, level(0.0)).w * 255.0));
+ bool _248 = (_240 & 15u) == 5u;
+ float _448;
+ if (_248)
+ {
+ float4 _260 = SSProfilesTexture.read(uint2(int3(1, int(uint((select(float4(0.0), SceneTexturesStruct_GBufferDTexture.sample(SceneTexturesStruct_GBufferDTextureSampler, _114, level(0.0)), bool4(!(((_240 & 4294967280u) & 16u) != 0u))).x * 255.0) + 0.5)), 0).xy), 0);
+ float _263 = _260.y * 0.5;
+ float _274 = pow(fast::clamp(dot(-(_152 * float3(rsqrt(dot(_152, _152)))), _236), 0.0, 1.0), 1.0);
+ float _445;
+ if (_160)
+ {
+ float3 _278 = _152 / float3(_158);
+ float3 _280 = normalize(cross(_278, float3(0.0, 0.0, 1.0)));
+ float3 _284 = float3(_Globals.InvShadowmapResolution);
+ float3 _285 = _280 * _284;
+ float3 _286 = cross(_280, _278) * _284;
+ float3 _287 = abs(_278);
+ float _288 = _287.x;
+ float _289 = _287.y;
+ float _290 = _287.z;
+ float _292 = fast::max(_288, fast::max(_289, _290));
+ int _311;
+ if (_292 == _288)
+ {
+ _311 = (_288 == _278.x) ? 0 : 1;
+ }
+ else
+ {
+ int _307;
+ if (_292 == _289)
+ {
+ _307 = (_289 == _278.y) ? 2 : 3;
+ }
+ else
+ {
+ _307 = (_290 == _278.z) ? 4 : 5;
+ }
+ _311 = _307;
+ }
+ float4 _318 = _Globals.ShadowViewProjectionMatrices[_311] * float4(_148 - (_236 * float3(_263)), 1.0);
+ float _323 = _260.x * (10.0 / _Globals.LightPositionAndInvRadius.w);
+ float _329 = (1.0 / (((_318.z / _318.w) * _Globals.PointLightDepthBiasAndProjParameters.z) - _Globals.PointLightDepthBiasAndProjParameters.w)) * _Globals.LightPositionAndInvRadius.w;
+ float _342 = (_329 - ((1.0 / ((float4(ShadowDepthCubeTexture.sample(ShadowDepthTextureSampler, (_278 + (_286 * float3(2.5))), level(0.0))).x * _Globals.PointLightDepthBiasAndProjParameters.z) - _Globals.PointLightDepthBiasAndProjParameters.w)) * _Globals.LightPositionAndInvRadius.w)) * _323;
+ float _364 = (_329 - ((1.0 / ((float4(ShadowDepthCubeTexture.sample(ShadowDepthTextureSampler, ((_278 + (_285 * float3(2.3776409626007080078125))) + (_286 * float3(0.77254199981689453125))), level(0.0))).x * _Globals.PointLightDepthBiasAndProjParameters.z) - _Globals.PointLightDepthBiasAndProjParameters.w)) * _Globals.LightPositionAndInvRadius.w)) * _323;
+ float _387 = (_329 - ((1.0 / ((float4(ShadowDepthCubeTexture.sample(ShadowDepthTextureSampler, ((_278 + (_285 * float3(1.46946299076080322265625))) + (_286 * float3(-2.0225429534912109375))), level(0.0))).x * _Globals.PointLightDepthBiasAndProjParameters.z) - _Globals.PointLightDepthBiasAndProjParameters.w)) * _Globals.LightPositionAndInvRadius.w)) * _323;
+ float _410 = (_329 - ((1.0 / ((float4(ShadowDepthCubeTexture.sample(ShadowDepthTextureSampler, ((_278 + (_285 * float3(-1.46946299076080322265625))) + (_286 * float3(-2.02254199981689453125))), level(0.0))).x * _Globals.PointLightDepthBiasAndProjParameters.z) - _Globals.PointLightDepthBiasAndProjParameters.w)) * _Globals.LightPositionAndInvRadius.w)) * _323;
+ float _433 = (_329 - ((1.0 / ((float4(ShadowDepthCubeTexture.sample(ShadowDepthTextureSampler, ((_278 + (_285 * float3(-2.3776409626007080078125))) + (_286 * float3(0.772543013095855712890625))), level(0.0))).x * _Globals.PointLightDepthBiasAndProjParameters.z) - _Globals.PointLightDepthBiasAndProjParameters.w)) * _Globals.LightPositionAndInvRadius.w)) * _323;
+ _445 = (((((fast::clamp(abs((_342 > 0.0) ? (_342 + _263) : fast::max(0.0, (_342 * _274) + _263)), 0.1500000059604644775390625, 5.0) + 0.25) + (fast::clamp(abs((_364 > 0.0) ? (_364 + _263) : fast::max(0.0, (_364 * _274) + _263)), 0.1500000059604644775390625, 5.0) + 0.25)) + (fast::clamp(abs((_387 > 0.0) ? (_387 + _263) : fast::max(0.0, (_387 * _274) + _263)), 0.1500000059604644775390625, 5.0) + 0.25)) + (fast::clamp(abs((_410 > 0.0) ? (_410 + _263) : fast::max(0.0, (_410 * _274) + _263)), 0.1500000059604644775390625, 5.0) + 0.25)) + (fast::clamp(abs((_433 > 0.0) ? (_433 + _263) : fast::max(0.0, (_433 * _274) + _263)), 0.1500000059604644775390625, 5.0) + 0.25)) * 0.20000000298023223876953125;
+ }
+ else
+ {
+ _445 = 1.0;
+ }
+ _448 = 1.0 - (_445 * 0.20000000298023223876953125);
+ }
+ else
+ {
+ _448 = 1.0;
+ }
+ float4 _451 = float4(float3(1.0).x, float3(1.0).y, _219.z, float3(1.0).z);
+ _451.w = _248 ? sqrt(_448) : _218;
+ out.out_var_SV_Target0 = _451;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/global-constant-arrays.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/global-constant-arrays.asm.frag
new file mode 100644
index 00000000000..210d4f98d17
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/global-constant-arrays.asm.frag
@@ -0,0 +1,1365 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_Globals
+{
+ float4 MappingPolynomial;
+ float3 InverseGamma;
+ float4 ColorMatrixR_ColorCurveCd1;
+ float4 ColorMatrixG_ColorCurveCd3Cm3;
+ float4 ColorMatrixB_ColorCurveCm2;
+ float4 ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3;
+ float4 ColorCurve_Ch1_Ch2;
+ float4 ColorShadow_Luma;
+ float4 ColorShadow_Tint1;
+ float4 ColorShadow_Tint2;
+ float FilmSlope;
+ float FilmToe;
+ float FilmShoulder;
+ float FilmBlackClip;
+ float FilmWhiteClip;
+ packed_float3 ColorScale;
+ float4 OverlayColor;
+ float WhiteTemp;
+ float WhiteTint;
+ float4 ColorSaturation;
+ float4 ColorContrast;
+ float4 ColorGamma;
+ float4 ColorGain;
+ float4 ColorOffset;
+ float4 ColorSaturationShadows;
+ float4 ColorContrastShadows;
+ float4 ColorGammaShadows;
+ float4 ColorGainShadows;
+ float4 ColorOffsetShadows;
+ float4 ColorSaturationMidtones;
+ float4 ColorContrastMidtones;
+ float4 ColorGammaMidtones;
+ float4 ColorGainMidtones;
+ float4 ColorOffsetMidtones;
+ float4 ColorSaturationHighlights;
+ float4 ColorContrastHighlights;
+ float4 ColorGammaHighlights;
+ float4 ColorGainHighlights;
+ float4 ColorOffsetHighlights;
+ float ColorCorrectionShadowsMax;
+ float ColorCorrectionHighlightsMin;
+ uint OutputDevice;
+ uint OutputGamut;
+ float BlueCorrection;
+ float ExpandGamut;
+};
+
+constant spvUnsafeArray<float, 6> _475 = spvUnsafeArray<float, 6>({ -4.0, -4.0, -3.1573765277862548828125, -0.485249996185302734375, 1.84773242473602294921875, 1.84773242473602294921875 });
+constant spvUnsafeArray<float, 6> _476 = spvUnsafeArray<float, 6>({ -0.718548238277435302734375, 2.0810306072235107421875, 3.66812419891357421875, 4.0, 4.0, 4.0 });
+constant spvUnsafeArray<float, 10> _479 = spvUnsafeArray<float, 10>({ -4.97062206268310546875, -3.0293781757354736328125, -2.1261999607086181640625, -1.5104999542236328125, -1.0578000545501708984375, -0.4668000042438507080078125, 0.11937999725341796875, 0.7088134288787841796875, 1.2911865711212158203125, 1.2911865711212158203125 });
+constant spvUnsafeArray<float, 10> _480 = spvUnsafeArray<float, 10>({ 0.80891323089599609375, 1.19108676910400390625, 1.5683000087738037109375, 1.94830000400543212890625, 2.308300018310546875, 2.63840007781982421875, 2.85949993133544921875, 2.9872608184814453125, 3.0127391815185546875, 3.0127391815185546875 });
+constant spvUnsafeArray<float, 10> _482 = spvUnsafeArray<float, 10>({ -2.3010299205780029296875, -2.3010299205780029296875, -1.9312000274658203125, -1.5204999446868896484375, -1.0578000545501708984375, -0.4668000042438507080078125, 0.11937999725341796875, 0.7088134288787841796875, 1.2911865711212158203125, 1.2911865711212158203125 });
+constant spvUnsafeArray<float, 10> _483 = spvUnsafeArray<float, 10>({ 0.801995217800140380859375, 1.19800484180450439453125, 1.5943000316619873046875, 1.99730002880096435546875, 2.3782999515533447265625, 2.7683999538421630859375, 3.0515000820159912109375, 3.2746293544769287109375, 3.32743072509765625, 3.32743072509765625 });
+
+constant float3 _391 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+struct main0_in
+{
+ float2 in_var_TEXCOORD0 [[user(locn0), center_no_perspective]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globals [[buffer(0)]], uint gl_Layer [[render_target_array_index]])
+{
+ main0_out out = {};
+ float3x3 _546 = float3x3(float3(0.41245639324188232421875, 0.3575761020183563232421875, 0.180437505245208740234375), float3(0.21267290413379669189453125, 0.715152204036712646484375, 0.072175003588199615478515625), float3(0.01933390088379383087158203125, 0.119191996753215789794921875, 0.950304090976715087890625)) * float3x3(float3(1.01303005218505859375, 0.0061053098179399967193603515625, -0.014971000142395496368408203125), float3(0.0076982299797236919403076171875, 0.99816501140594482421875, -0.005032029934227466583251953125), float3(-0.0028413101099431514739990234375, 0.0046851597726345062255859375, 0.92450702190399169921875));
+ float3x3 _547 = _546 * float3x3(float3(1.6410233974456787109375, -0.324803292751312255859375, -0.23642469942569732666015625), float3(-0.663662850856781005859375, 1.6153316497802734375, 0.016756348311901092529296875), float3(0.01172189414501190185546875, -0.008284442126750946044921875, 0.98839485645294189453125));
+ float3x3 _548 = float3x3(float3(0.662454187870025634765625, 0.1340042054653167724609375, 0.1561876833438873291015625), float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625), float3(-0.0055746496655046939849853515625, 0.0040607335977256298065185546875, 1.01033914089202880859375)) * float3x3(float3(0.98722398281097412109375, -0.0061132698319852352142333984375, 0.01595330052077770233154296875), float3(-0.007598360069096088409423828125, 1.00186002254486083984375, 0.0053300200961530208587646484375), float3(0.003072570078074932098388671875, -0.0050959498621523380279541015625, 1.0816800594329833984375));
+ float3x3 _549 = _548 * float3x3(float3(3.2409698963165283203125, -1.53738319873809814453125, -0.4986107647418975830078125), float3(-0.96924364566802978515625, 1.875967502593994140625, 0.0415550582110881805419921875), float3(0.055630080401897430419921875, -0.2039769589900970458984375, 1.05697154998779296875));
+ float3x3 _550 = float3x3(float3(0.952552378177642822265625, 0.0, 9.25), float3(0.3439664542675018310546875, 0.728166103363037109375, -0.07213254272937774658203125), float3(0.0, 0.0, 1.00882518291473388671875)) * float3x3(float3(1.6410233974456787109375, -0.324803292751312255859375, -0.23642469942569732666015625), float3(-0.663662850856781005859375, 1.6153316497802734375, 0.016756348311901092529296875), float3(0.01172189414501190185546875, -0.008284442126750946044921875, 0.98839485645294189453125));
+ float3x3 _551 = float3x3(float3(0.662454187870025634765625, 0.1340042054653167724609375, 0.1561876833438873291015625), float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625), float3(-0.0055746496655046939849853515625, 0.0040607335977256298065185546875, 1.01033914089202880859375)) * float3x3(float3(1.04981100559234619140625, 0.0, -9.74845024757087230682373046875e-05), float3(-0.49590301513671875, 1.37331306934356689453125, 0.09824003279209136962890625), float3(0.0, 0.0, 0.991252005100250244140625));
+ float3x3 _576;
+ for (;;)
+ {
+ if (_Globals.OutputGamut == 1u)
+ {
+ _576 = _548 * float3x3(float3(2.493396282196044921875, -0.931345880031585693359375, -0.4026944935321807861328125), float3(-0.829486787319183349609375, 1.76265966892242431640625, 0.02362460084259510040283203125), float3(0.0358506999909877777099609375, -0.076182700693607330322265625, 0.957014024257659912109375));
+ break;
+ }
+ else
+ {
+ if (_Globals.OutputGamut == 2u)
+ {
+ _576 = _548 * float3x3(float3(1.71660840511322021484375, -0.3556621074676513671875, -0.253360092639923095703125), float3(-0.666682898998260498046875, 1.61647760868072509765625, 0.01576850004494190216064453125), float3(0.017642199993133544921875, -0.04277630150318145751953125, 0.94222867488861083984375));
+ break;
+ }
+ else
+ {
+ if (_Globals.OutputGamut == 3u)
+ {
+ _576 = float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625));
+ break;
+ }
+ else
+ {
+ if (_Globals.OutputGamut == 4u)
+ {
+ _576 = float3x3(float3(1.0, 0.0, 0.0), float3(0.0, 1.0, 0.0), float3(0.0, 0.0, 1.0));
+ break;
+ }
+ else
+ {
+ _576 = _549;
+ break;
+ }
+ }
+ }
+ }
+ }
+ float3 _577 = float4((in.in_var_TEXCOORD0 - float2(0.015625)) * float2(1.03225803375244140625), float(gl_Layer) * 0.0322580635547637939453125, 0.0).xyz;
+ float3 _599;
+ if (_Globals.OutputDevice >= 3u)
+ {
+ float3 _591 = pow(_577, float3(0.0126833133399486541748046875));
+ _599 = pow(fast::max(float3(0.0), _591 - float3(0.8359375)) / (float3(18.8515625) - (float3(18.6875) * _591)), float3(6.277394771575927734375)) * float3(10000.0);
+ }
+ else
+ {
+ _599 = (exp2((_577 - float3(0.434017598628997802734375)) * float3(14.0)) * float3(0.180000007152557373046875)) - (exp2(float3(-6.0762462615966796875)) * float3(0.180000007152557373046875));
+ }
+ float _602 = _Globals.WhiteTemp * 1.00055634975433349609375;
+ float _616 = (_602 <= 7000.0) ? (0.24406300485134124755859375 + ((99.1100006103515625 + ((2967800.0 - (4604438528.0 / _Globals.WhiteTemp)) / _602)) / _602)) : (0.23703999817371368408203125 + ((247.4799957275390625 + ((1901800.0 - (2005284352.0 / _Globals.WhiteTemp)) / _602)) / _602));
+ float _633 = ((0.860117733478546142578125 + (0.00015411825734190642833709716796875 * _Globals.WhiteTemp)) + ((1.2864121856637211749330163002014e-07 * _Globals.WhiteTemp) * _Globals.WhiteTemp)) / ((1.0 + (0.0008424202096648514270782470703125 * _Globals.WhiteTemp)) + ((7.0814513719597016461193561553955e-07 * _Globals.WhiteTemp) * _Globals.WhiteTemp));
+ float _644 = ((0.317398726940155029296875 + (4.25 * _Globals.WhiteTemp)) + ((4.2048167614439080352894961833954e-08 * _Globals.WhiteTemp) * _Globals.WhiteTemp)) / ((1.0 - (2.8974181986995972692966461181641e-05 * _Globals.WhiteTemp)) + ((1.6145605741257895715534687042236e-07 * _Globals.WhiteTemp) * _Globals.WhiteTemp));
+ float _649 = ((2.0 * _633) - (8.0 * _644)) + 4.0;
+ float2 _653 = float2((3.0 * _633) / _649, (2.0 * _644) / _649);
+ float2 _660 = normalize(float2(_633, _644));
+ float _665 = _633 + (((-_660.y) * _Globals.WhiteTint) * 0.0500000007450580596923828125);
+ float _669 = _644 + ((_660.x * _Globals.WhiteTint) * 0.0500000007450580596923828125);
+ float _674 = ((2.0 * _665) - (8.0 * _669)) + 4.0;
+ float2 _680 = select(float2(_616, ((((-3.0) * _616) * _616) + (2.86999988555908203125 * _616)) - 0.2750000059604644775390625), _653, bool2(_Globals.WhiteTemp < 4000.0)) + (float2((3.0 * _665) / _674, (2.0 * _669) / _674) - _653);
+ float _681 = _680.x;
+ float _682 = _680.y;
+ float _683 = fast::max(_682, 1.0000000133514319600180897396058e-10);
+ float3 _685 = _391;
+ _685.x = _681 / _683;
+ float3 _686 = _685;
+ _686.y = 1.0;
+ float3 _690 = _686;
+ _690.z = ((1.0 - _681) - _682) / _683;
+ float _691 = fast::max(0.328999996185302734375, 1.0000000133514319600180897396058e-10);
+ float3 _693 = _391;
+ _693.x = 0.3127000033855438232421875 / _691;
+ float3 _694 = _693;
+ _694.y = 1.0;
+ float3 _696 = _694;
+ _696.z = 0.3582999706268310546875 / _691;
+ float3 _697 = _690 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ float3 _698 = _696 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ float3 _717 = (_599 * ((float3x3(float3(0.41245639324188232421875, 0.3575761020183563232421875, 0.180437505245208740234375), float3(0.21267290413379669189453125, 0.715152204036712646484375, 0.072175003588199615478515625), float3(0.01933390088379383087158203125, 0.119191996753215789794921875, 0.950304090976715087890625)) * ((float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875)) * float3x3(float3(_698.x / _697.x, 0.0, 0.0), float3(0.0, _698.y / _697.y, 0.0), float3(0.0, 0.0, _698.z / _697.z))) * float3x3(float3(0.986992895603179931640625, -0.14705429971218109130859375, 0.15996269881725311279296875), float3(0.4323053061962127685546875, 0.518360316753387451171875, 0.049291200935840606689453125), float3(-0.00852870009839534759521484375, 0.0400427989661693572998046875, 0.968486726284027099609375)))) * float3x3(float3(3.2409698963165283203125, -1.53738319873809814453125, -0.4986107647418975830078125), float3(-0.96924364566802978515625, 1.875967502593994140625, 0.0415550582110881805419921875), float3(0.055630080401897430419921875, -0.2039769589900970458984375, 1.05697154998779296875)))) * _547;
+ float3 _745;
+ if (_Globals.ColorShadow_Tint2.w != 0.0)
+ {
+ float _724 = dot(_717, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625));
+ float3 _727 = (_717 / float3(_724)) - float3(1.0);
+ _745 = mix(_717, _717 * (_549 * (float3x3(float3(0.544169127941131591796875, 0.23959259688854217529296875, 0.16669429838657379150390625), float3(0.23946559429168701171875, 0.702153027057647705078125, 0.058381401002407073974609375), float3(-0.0023439000360667705535888671875, 0.0361833982169628143310546875, 1.05521833896636962890625)) * float3x3(float3(1.6410233974456787109375, -0.324803292751312255859375, -0.23642469942569732666015625), float3(-0.663662850856781005859375, 1.6153316497802734375, 0.016756348311901092529296875), float3(0.01172189414501190185546875, -0.008284442126750946044921875, 0.98839485645294189453125)))), float3((1.0 - exp2((-4.0) * dot(_727, _727))) * (1.0 - exp2((((-4.0) * _Globals.ExpandGamut) * _724) * _724))));
+ }
+ else
+ {
+ _745 = _717;
+ }
+ float _746 = dot(_745, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625));
+ float4 _751 = _Globals.ColorSaturationShadows * _Globals.ColorSaturation;
+ float4 _756 = _Globals.ColorContrastShadows * _Globals.ColorContrast;
+ float4 _761 = _Globals.ColorGammaShadows * _Globals.ColorGamma;
+ float4 _766 = _Globals.ColorGainShadows * _Globals.ColorGain;
+ float4 _771 = _Globals.ColorOffsetShadows + _Globals.ColorOffset;
+ float3 _772 = float3(_746);
+ float _804 = smoothstep(0.0, _Globals.ColorCorrectionShadowsMax, _746);
+ float4 _808 = _Globals.ColorSaturationHighlights * _Globals.ColorSaturation;
+ float4 _811 = _Globals.ColorContrastHighlights * _Globals.ColorContrast;
+ float4 _814 = _Globals.ColorGammaHighlights * _Globals.ColorGamma;
+ float4 _817 = _Globals.ColorGainHighlights * _Globals.ColorGain;
+ float4 _820 = _Globals.ColorOffsetHighlights + _Globals.ColorOffset;
+ float _852 = smoothstep(_Globals.ColorCorrectionHighlightsMin, 1.0, _746);
+ float4 _855 = _Globals.ColorSaturationMidtones * _Globals.ColorSaturation;
+ float4 _858 = _Globals.ColorContrastMidtones * _Globals.ColorContrast;
+ float4 _861 = _Globals.ColorGammaMidtones * _Globals.ColorGamma;
+ float4 _864 = _Globals.ColorGainMidtones * _Globals.ColorGain;
+ float4 _867 = _Globals.ColorOffsetMidtones + _Globals.ColorOffset;
+ float3 _905 = ((((pow(pow(fast::max(float3(0.0), mix(_772, _745, _751.xyz * float3(_751.w))) * float3(5.5555553436279296875), _756.xyz * float3(_756.w)) * float3(0.180000007152557373046875), float3(1.0) / (_761.xyz * float3(_761.w))) * (_766.xyz * float3(_766.w))) + (_771.xyz + float3(_771.w))) * float3(1.0 - _804)) + (((pow(pow(fast::max(float3(0.0), mix(_772, _745, _855.xyz * float3(_855.w))) * float3(5.5555553436279296875), _858.xyz * float3(_858.w)) * float3(0.180000007152557373046875), float3(1.0) / (_861.xyz * float3(_861.w))) * (_864.xyz * float3(_864.w))) + (_867.xyz + float3(_867.w))) * float3(_804 - _852))) + (((pow(pow(fast::max(float3(0.0), mix(_772, _745, _808.xyz * float3(_808.w))) * float3(5.5555553436279296875), _811.xyz * float3(_811.w)) * float3(0.180000007152557373046875), float3(1.0) / (_814.xyz * float3(_814.w))) * (_817.xyz * float3(_817.w))) + (_820.xyz + float3(_820.w))) * float3(_852));
+ float3 _906 = _905 * _549;
+ float3 _914 = float3(_Globals.BlueCorrection);
+ float3 _916 = mix(_905, _905 * ((_551 * float3x3(float3(0.940437257289886474609375, -0.01830687932670116424560546875, 0.07786960899829864501953125), float3(0.008378696627914905548095703125, 0.82866001129150390625, 0.162961304187774658203125), float3(0.0005471261101774871349334716796875, -0.00088337459601461887359619140625, 1.00033628940582275390625))) * _550), _914) * _551;
+ float _917 = _916.x;
+ float _918 = _916.y;
+ float _920 = _916.z;
+ float _923 = fast::max(fast::max(_917, _918), _920);
+ float _928 = (fast::max(_923, 1.0000000133514319600180897396058e-10) - fast::max(fast::min(fast::min(_917, _918), _920), 1.0000000133514319600180897396058e-10)) / fast::max(_923, 0.00999999977648258209228515625);
+ float _941 = ((_920 + _918) + _917) + (1.75 * sqrt(((_920 * (_920 - _918)) + (_918 * (_918 - _917))) + (_917 * (_917 - _920))));
+ float _942 = _941 * 0.3333333432674407958984375;
+ float _943 = _928 - 0.4000000059604644775390625;
+ float _948 = fast::max(1.0 - abs(_943 * 2.5), 0.0);
+ float _956 = (1.0 + (float(int(sign(_943 * 5.0))) * (1.0 - (_948 * _948)))) * 0.02500000037252902984619140625;
+ float _969;
+ if (_942 <= 0.053333334624767303466796875)
+ {
+ _969 = _956;
+ }
+ else
+ {
+ float _968;
+ if (_942 >= 0.1599999964237213134765625)
+ {
+ _968 = 0.0;
+ }
+ else
+ {
+ _968 = _956 * ((0.23999999463558197021484375 / _941) - 0.5);
+ }
+ _969 = _968;
+ }
+ float3 _972 = _916 * float3(1.0 + _969);
+ float _973 = _972.x;
+ float _974 = _972.y;
+ float _976 = _972.z;
+ float _990;
+ if ((_973 == _974) && (_974 == _976))
+ {
+ _990 = 0.0;
+ }
+ else
+ {
+ _990 = 57.2957763671875 * atan2(sqrt(3.0) * (_974 - _976), ((2.0 * _973) - _974) - _976);
+ }
+ float _995;
+ if (_990 < 0.0)
+ {
+ _995 = _990 + 360.0;
+ }
+ else
+ {
+ _995 = _990;
+ }
+ float _996 = fast::clamp(_995, 0.0, 360.0);
+ float _1001;
+ if (_996 > 180.0)
+ {
+ _1001 = _996 - 360.0;
+ }
+ else
+ {
+ _1001 = _996;
+ }
+ float _1005 = smoothstep(0.0, 1.0, 1.0 - abs(_1001 * 0.01481481455266475677490234375));
+ float3 _1012 = _972;
+ _1012.x = _973 + ((((_1005 * _1005) * _928) * (0.02999999932944774627685546875 - _973)) * 0.180000007152557373046875);
+ float3 _1014 = fast::max(float3(0.0), _1012 * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)));
+ float _1023 = (1.0 + _Globals.FilmBlackClip) - _Globals.FilmToe;
+ float _1026 = 1.0 + _Globals.FilmWhiteClip;
+ float _1029 = _1026 - _Globals.FilmShoulder;
+ float _1056;
+ if (_Globals.FilmToe > 0.800000011920928955078125)
+ {
+ _1056 = ((0.819999992847442626953125 - _Globals.FilmToe) / _Globals.FilmSlope) + (log(0.180000007152557373046875) / log(10.0));
+ }
+ else
+ {
+ float _1035 = (0.180000007152557373046875 + _Globals.FilmBlackClip) / _1023;
+ _1056 = (log(0.180000007152557373046875) / log(10.0)) - ((0.5 * log(_1035 / (2.0 - _1035))) * (_1023 / _Globals.FilmSlope));
+ }
+ float _1061 = ((1.0 - _Globals.FilmToe) / _Globals.FilmSlope) - _1056;
+ float _1063 = (_Globals.FilmShoulder / _Globals.FilmSlope) - _1061;
+ float _1065 = log(10.0);
+ float3 _1067 = log(mix(float3(dot(_1014, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1014, float3(0.959999978542327880859375))) / float3(_1065);
+ float3 _1071 = float3(_Globals.FilmSlope) * (_1067 + float3(_1061));
+ float3 _1079 = float3(_1056);
+ float3 _1080 = _1067 - _1079;
+ float3 _1092 = float3(_1063);
+ float3 _1106 = fast::clamp(_1080 / float3(_1063 - _1056), float3(0.0), float3(1.0));
+ float3 _1110 = select(_1106, float3(1.0) - _1106, bool3(_1063 < _1056));
+ float3 _1115 = mix(select(_1071, float3(-_Globals.FilmBlackClip) + (float3(2.0 * _1023) / (float3(1.0) + exp(float3(((-2.0) * _Globals.FilmSlope) / _1023) * _1080))), _1067 < _1079), select(_1071, float3(_1026) - (float3(2.0 * _1029) / (float3(1.0) + exp(float3((2.0 * _Globals.FilmSlope) / _1029) * (_1067 - _1092)))), _1067 > _1092), ((float3(3.0) - (float3(2.0) * _1110)) * _1110) * _1110);
+ float3 _1119 = fast::max(float3(0.0), mix(float3(dot(_1115, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1115, float3(0.930000007152557373046875)));
+ float3 _1189;
+ if (_Globals.ColorShadow_Tint2.w == 0.0)
+ {
+ float3 _1131 = _391;
+ _1131.x = dot(_906, _Globals.ColorMatrixR_ColorCurveCd1.xyz);
+ float3 _1136 = _1131;
+ _1136.y = dot(_906, _Globals.ColorMatrixG_ColorCurveCd3Cm3.xyz);
+ float3 _1141 = _1136;
+ _1141.z = dot(_906, _Globals.ColorMatrixB_ColorCurveCm2.xyz);
+ float3 _1157 = fast::max(float3(0.0), _1141 * (_Globals.ColorShadow_Tint1.xyz + (_Globals.ColorShadow_Tint2.xyz * float3(1.0 / (dot(_906, _Globals.ColorShadow_Luma.xyz) + 1.0)))));
+ float3 _1162 = fast::max(float3(0.0), _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx - _1157);
+ float3 _1164 = fast::max(_1157, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz);
+ _1189 = ((((_1164 * _Globals.ColorCurve_Ch1_Ch2.xxx) + _Globals.ColorCurve_Ch1_Ch2.yyy) * (float3(1.0) / (_1164 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.www))) + ((fast::clamp(_1157, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz) * _Globals.ColorMatrixB_ColorCurveCm2.www) + (((_1162 * _Globals.ColorMatrixR_ColorCurveCd1.www) * (float3(1.0) / (_1162 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.yyy))) + _Globals.ColorMatrixG_ColorCurveCd3Cm3.www))) - float3(0.00200000009499490261077880859375);
+ }
+ else
+ {
+ _1189 = fast::max(float3(0.0), mix(_1119, _1119 * ((_551 * float3x3(float3(1.06317996978759765625, 0.02339559979736804962158203125, -0.08657260239124298095703125), float3(-0.010633699595928192138671875, 1.2063200473785400390625, -0.1956900060176849365234375), float3(-0.0005908869788981974124908447265625, 0.00105247995816171169281005859375, 0.999538004398345947265625))) * _550), _914) * _549);
+ }
+ float3 _1218 = pow(fast::max(float3(0.0), mix((((float3(_Globals.MappingPolynomial.x) * (_1189 * _1189)) + (float3(_Globals.MappingPolynomial.y) * _1189)) + float3(_Globals.MappingPolynomial.z)) * float3(_Globals.ColorScale), _Globals.OverlayColor.xyz, float3(_Globals.OverlayColor.w))), float3(_Globals.InverseGamma.y));
+ float3 _3001;
+ if (_Globals.OutputDevice == 0u)
+ {
+ float _2961 = _1218.x;
+ float _2973;
+ for (;;)
+ {
+ if (_2961 < 0.00313066993840038776397705078125)
+ {
+ _2973 = _2961 * 12.9200000762939453125;
+ break;
+ }
+ _2973 = (pow(_2961, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ float _2974 = _1218.y;
+ float _2986;
+ for (;;)
+ {
+ if (_2974 < 0.00313066993840038776397705078125)
+ {
+ _2986 = _2974 * 12.9200000762939453125;
+ break;
+ }
+ _2986 = (pow(_2974, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ float _2987 = _1218.z;
+ float _2999;
+ for (;;)
+ {
+ if (_2987 < 0.00313066993840038776397705078125)
+ {
+ _2999 = _2987 * 12.9200000762939453125;
+ break;
+ }
+ _2999 = (pow(_2987, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ _3001 = float3(_2973, _2986, _2999);
+ }
+ else
+ {
+ float3 _2960;
+ if (_Globals.OutputDevice == 1u)
+ {
+ float3 _2953 = fast::max(float3(6.1035199905745685100555419921875e-05), (_1218 * _547) * _576);
+ _2960 = fast::min(_2953 * float3(4.5), (pow(fast::max(_2953, float3(0.017999999225139617919921875)), float3(0.449999988079071044921875)) * float3(1.09899997711181640625)) - float3(0.098999999463558197021484375));
+ }
+ else
+ {
+ float3 _2950;
+ if ((_Globals.OutputDevice == 3u) || (_Globals.OutputDevice == 5u))
+ {
+ float3 _2100 = (_906 * float3(1.5)) * (_546 * float3x3(float3(1.04981100559234619140625, 0.0, -9.74845024757087230682373046875e-05), float3(-0.49590301513671875, 1.37331306934356689453125, 0.09824003279209136962890625), float3(0.0, 0.0, 0.991252005100250244140625)));
+ float _2101 = _2100.x;
+ float _2102 = _2100.y;
+ float _2104 = _2100.z;
+ float _2107 = fast::max(fast::max(_2101, _2102), _2104);
+ float _2112 = (fast::max(_2107, 1.0000000133514319600180897396058e-10) - fast::max(fast::min(fast::min(_2101, _2102), _2104), 1.0000000133514319600180897396058e-10)) / fast::max(_2107, 0.00999999977648258209228515625);
+ float _2125 = ((_2104 + _2102) + _2101) + (1.75 * sqrt(((_2104 * (_2104 - _2102)) + (_2102 * (_2102 - _2101))) + (_2101 * (_2101 - _2104))));
+ float _2126 = _2125 * 0.3333333432674407958984375;
+ float _2127 = _2112 - 0.4000000059604644775390625;
+ float _2132 = fast::max(1.0 - abs(_2127 * 2.5), 0.0);
+ float _2140 = (1.0 + (float(int(sign(_2127 * 5.0))) * (1.0 - (_2132 * _2132)))) * 0.02500000037252902984619140625;
+ float _2153;
+ if (_2126 <= 0.053333334624767303466796875)
+ {
+ _2153 = _2140;
+ }
+ else
+ {
+ float _2152;
+ if (_2126 >= 0.1599999964237213134765625)
+ {
+ _2152 = 0.0;
+ }
+ else
+ {
+ _2152 = _2140 * ((0.23999999463558197021484375 / _2125) - 0.5);
+ }
+ _2153 = _2152;
+ }
+ float3 _2156 = _2100 * float3(1.0 + _2153);
+ float _2157 = _2156.x;
+ float _2158 = _2156.y;
+ float _2160 = _2156.z;
+ float _2174;
+ if ((_2157 == _2158) && (_2158 == _2160))
+ {
+ _2174 = 0.0;
+ }
+ else
+ {
+ _2174 = 57.2957763671875 * atan2(sqrt(3.0) * (_2158 - _2160), ((2.0 * _2157) - _2158) - _2160);
+ }
+ float _2179;
+ if (_2174 < 0.0)
+ {
+ _2179 = _2174 + 360.0;
+ }
+ else
+ {
+ _2179 = _2174;
+ }
+ float _2180 = fast::clamp(_2179, 0.0, 360.0);
+ float _2185;
+ if (_2180 > 180.0)
+ {
+ _2185 = _2180 - 360.0;
+ }
+ else
+ {
+ _2185 = _2180;
+ }
+ float _2235;
+ if ((_2185 > (-67.5)) && (_2185 < 67.5))
+ {
+ float _2192 = (_2185 - (-67.5)) * 0.0296296291053295135498046875;
+ int _2193 = int(_2192);
+ float _2195 = _2192 - float(_2193);
+ float _2196 = _2195 * _2195;
+ float _2197 = _2196 * _2195;
+ float _2234;
+ if (_2193 == 3)
+ {
+ _2234 = (((_2197 * (-0.16666667163372039794921875)) + (_2196 * 0.5)) + (_2195 * (-0.5))) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _2227;
+ if (_2193 == 2)
+ {
+ _2227 = ((_2197 * 0.5) + (_2196 * (-1.0))) + 0.666666686534881591796875;
+ }
+ else
+ {
+ float _2222;
+ if (_2193 == 1)
+ {
+ _2222 = (((_2197 * (-0.5)) + (_2196 * 0.5)) + (_2195 * 0.5)) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _2215;
+ if (_2193 == 0)
+ {
+ _2215 = _2197 * 0.16666667163372039794921875;
+ }
+ else
+ {
+ _2215 = 0.0;
+ }
+ _2222 = _2215;
+ }
+ _2227 = _2222;
+ }
+ _2234 = _2227;
+ }
+ _2235 = _2234;
+ }
+ else
+ {
+ _2235 = 0.0;
+ }
+ float3 _2242 = _2156;
+ _2242.x = _2157 + ((((_2235 * 1.5) * _2112) * (0.02999999932944774627685546875 - _2157)) * 0.180000007152557373046875);
+ float3 _2245 = fast::clamp(fast::clamp(_2242, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ float3 _2248 = mix(float3(dot(_2245, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _2245, float3(0.959999978542327880859375));
+ float _2249 = _2248.x;
+ float _2253 = 0.17999999225139617919921875 * exp2(18.0);
+ float _2255 = exp2(-14.0);
+ float _2258 = log((_2249 <= 0.0) ? _2255 : _2249) / _1065;
+ float _2260 = log(0.17999999225139617919921875 * exp2(-15.0)) / _1065;
+ float _2327;
+ if (_2258 <= _2260)
+ {
+ _2327 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _2267 = log(0.180000007152557373046875) / _1065;
+ float _2324;
+ if ((_2258 > _2260) && (_2258 < _2267))
+ {
+ float _2307 = (3.0 * (_2258 - _2260)) / (_2267 - _2260);
+ int _2308 = int(_2307);
+ float _2310 = _2307 - float(_2308);
+ _2324 = dot(float3(_2310 * _2310, _2310, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_2308], _475[_2308 + 1], _475[_2308 + 2]));
+ }
+ else
+ {
+ float _2275 = log(_2253) / _1065;
+ float _2303;
+ if ((_2258 >= _2267) && (_2258 < _2275))
+ {
+ float _2286 = (3.0 * (_2258 - _2267)) / (_2275 - _2267);
+ int _2287 = int(_2286);
+ float _2289 = _2286 - float(_2287);
+ _2303 = dot(float3(_2289 * _2289, _2289, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_2287], _476[_2287 + 1], _476[_2287 + 2]));
+ }
+ else
+ {
+ _2303 = log(10000.0) / _1065;
+ }
+ _2324 = _2303;
+ }
+ _2327 = _2324;
+ }
+ float3 _2329 = _391;
+ _2329.x = pow(10.0, _2327);
+ float _2330 = _2248.y;
+ float _2334 = log((_2330 <= 0.0) ? _2255 : _2330) / _1065;
+ float _2401;
+ if (_2334 <= _2260)
+ {
+ _2401 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _2341 = log(0.180000007152557373046875) / _1065;
+ float _2398;
+ if ((_2334 > _2260) && (_2334 < _2341))
+ {
+ float _2381 = (3.0 * (_2334 - _2260)) / (_2341 - _2260);
+ int _2382 = int(_2381);
+ float _2384 = _2381 - float(_2382);
+ _2398 = dot(float3(_2384 * _2384, _2384, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_2382], _475[_2382 + 1], _475[_2382 + 2]));
+ }
+ else
+ {
+ float _2349 = log(_2253) / _1065;
+ float _2377;
+ if ((_2334 >= _2341) && (_2334 < _2349))
+ {
+ float _2360 = (3.0 * (_2334 - _2341)) / (_2349 - _2341);
+ int _2361 = int(_2360);
+ float _2363 = _2360 - float(_2361);
+ _2377 = dot(float3(_2363 * _2363, _2363, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_2361], _476[_2361 + 1], _476[_2361 + 2]));
+ }
+ else
+ {
+ _2377 = log(10000.0) / _1065;
+ }
+ _2398 = _2377;
+ }
+ _2401 = _2398;
+ }
+ float3 _2403 = _2329;
+ _2403.y = pow(10.0, _2401);
+ float _2404 = _2248.z;
+ float _2408 = log((_2404 <= 0.0) ? _2255 : _2404) / _1065;
+ float _2475;
+ if (_2408 <= _2260)
+ {
+ _2475 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _2415 = log(0.180000007152557373046875) / _1065;
+ float _2472;
+ if ((_2408 > _2260) && (_2408 < _2415))
+ {
+ float _2455 = (3.0 * (_2408 - _2260)) / (_2415 - _2260);
+ int _2456 = int(_2455);
+ float _2458 = _2455 - float(_2456);
+ _2472 = dot(float3(_2458 * _2458, _2458, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_2456], _475[_2456 + 1], _475[_2456 + 2]));
+ }
+ else
+ {
+ float _2423 = log(_2253) / _1065;
+ float _2451;
+ if ((_2408 >= _2415) && (_2408 < _2423))
+ {
+ float _2434 = (3.0 * (_2408 - _2415)) / (_2423 - _2415);
+ int _2435 = int(_2434);
+ float _2437 = _2434 - float(_2435);
+ _2451 = dot(float3(_2437 * _2437, _2437, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_2435], _476[_2435 + 1], _476[_2435 + 2]));
+ }
+ else
+ {
+ _2451 = log(10000.0) / _1065;
+ }
+ _2472 = _2451;
+ }
+ _2475 = _2472;
+ }
+ float3 _2477 = _2403;
+ _2477.z = pow(10.0, _2475);
+ float3 _2479 = (_2477 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ float _2481 = 0.17999999225139617919921875 * pow(2.0, -12.0);
+ float _2485 = log((_2481 <= 0.0) ? _2255 : _2481) / _1065;
+ float _2552;
+ if (_2485 <= _2260)
+ {
+ _2552 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _2492 = log(0.180000007152557373046875) / _1065;
+ float _2549;
+ if ((_2485 > _2260) && (_2485 < _2492))
+ {
+ float _2532 = (3.0 * (_2485 - _2260)) / (_2492 - _2260);
+ int _2533 = int(_2532);
+ float _2535 = _2532 - float(_2533);
+ _2549 = dot(float3(_2535 * _2535, _2535, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_2533], _475[_2533 + 1], _475[_2533 + 2]));
+ }
+ else
+ {
+ float _2500 = log(_2253) / _1065;
+ float _2528;
+ if ((_2485 >= _2492) && (_2485 < _2500))
+ {
+ float _2511 = (3.0 * (_2485 - _2492)) / (_2500 - _2492);
+ int _2512 = int(_2511);
+ float _2514 = _2511 - float(_2512);
+ _2528 = dot(float3(_2514 * _2514, _2514, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_2512], _476[_2512 + 1], _476[_2512 + 2]));
+ }
+ else
+ {
+ _2528 = log(10000.0) / _1065;
+ }
+ _2549 = _2528;
+ }
+ _2552 = _2549;
+ }
+ float _2555 = log(0.180000007152557373046875) / _1065;
+ float _2611;
+ if (_2555 <= _2260)
+ {
+ _2611 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _2608;
+ if ((_2555 > _2260) && (_2555 < _2555))
+ {
+ _2608 = (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[3], _475[4], _475[5])).z;
+ }
+ else
+ {
+ float _2568 = log(_2253) / _1065;
+ float _2596;
+ if ((_2555 >= _2555) && (_2555 < _2568))
+ {
+ float _2579 = (3.0 * (_2555 - _2555)) / (_2568 - _2555);
+ int _2580 = int(_2579);
+ float _2582 = _2579 - float(_2580);
+ _2596 = dot(float3(_2582 * _2582, _2582, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_2580], _476[_2580 + 1], _476[_2580 + 2]));
+ }
+ else
+ {
+ _2596 = log(10000.0) / _1065;
+ }
+ _2608 = _2596;
+ }
+ _2611 = _2608;
+ }
+ float _2612 = pow(10.0, _2611);
+ float _2614 = 0.17999999225139617919921875 * pow(2.0, 10.0);
+ float _2618 = log((_2614 <= 0.0) ? _2255 : _2614) / _1065;
+ float _2683;
+ if (_2618 <= _2260)
+ {
+ _2683 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _2680;
+ if ((_2618 > _2260) && (_2618 < _2555))
+ {
+ float _2663 = (3.0 * (_2618 - _2260)) / (_2555 - _2260);
+ int _2664 = int(_2663);
+ float _2666 = _2663 - float(_2664);
+ _2680 = dot(float3(_2666 * _2666, _2666, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_2664], _475[_2664 + 1], _475[_2664 + 2]));
+ }
+ else
+ {
+ float _2631 = log(_2253) / _1065;
+ float _2659;
+ if ((_2618 >= _2555) && (_2618 < _2631))
+ {
+ float _2642 = (3.0 * (_2618 - _2555)) / (_2631 - _2555);
+ int _2643 = int(_2642);
+ float _2645 = _2642 - float(_2643);
+ _2659 = dot(float3(_2645 * _2645, _2645, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_2643], _476[_2643 + 1], _476[_2643 + 2]));
+ }
+ else
+ {
+ _2659 = log(10000.0) / _1065;
+ }
+ _2680 = _2659;
+ }
+ _2683 = _2680;
+ }
+ float _2684 = pow(10.0, _2683);
+ float _2685 = _2479.x;
+ float _2689 = log((_2685 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2685) / _1065;
+ float _2690 = log(pow(10.0, _2552));
+ float _2691 = _2690 / _1065;
+ float _2768;
+ if (_2689 <= _2691)
+ {
+ _2768 = (_2689 * 3.0) + ((log(9.9999997473787516355514526367188e-05) / _1065) - ((3.0 * _2690) / _1065));
+ }
+ else
+ {
+ float _2698 = log(_2612) / _1065;
+ float _2760;
+ if ((_2689 > _2691) && (_2689 < _2698))
+ {
+ float _2743 = (7.0 * (_2689 - _2691)) / (_2698 - _2691);
+ int _2744 = int(_2743);
+ float _2746 = _2743 - float(_2744);
+ _2760 = dot(float3(_2746 * _2746, _2746, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_479[_2744], _479[_2744 + 1], _479[_2744 + 2]));
+ }
+ else
+ {
+ float _2705 = log(_2684);
+ float _2706 = _2705 / _1065;
+ float _2739;
+ if ((_2689 >= _2698) && (_2689 < _2706))
+ {
+ float _2722 = (7.0 * (_2689 - _2698)) / (_2706 - _2698);
+ int _2723 = int(_2722);
+ float _2725 = _2722 - float(_2723);
+ _2739 = dot(float3(_2725 * _2725, _2725, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_480[_2723], _480[_2723 + 1], _480[_2723 + 2]));
+ }
+ else
+ {
+ _2739 = (_2689 * 0.0599999986588954925537109375) + ((log(1000.0) / _1065) - ((0.0599999986588954925537109375 * _2705) / _1065));
+ }
+ _2760 = _2739;
+ }
+ _2768 = _2760;
+ }
+ float3 _2770 = _391;
+ _2770.x = pow(10.0, _2768);
+ float _2771 = _2479.y;
+ float _2775 = log((_2771 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2771) / _1065;
+ float _2852;
+ if (_2775 <= _2691)
+ {
+ _2852 = (_2775 * 3.0) + ((log(9.9999997473787516355514526367188e-05) / _1065) - ((3.0 * _2690) / _1065));
+ }
+ else
+ {
+ float _2782 = log(_2612) / _1065;
+ float _2844;
+ if ((_2775 > _2691) && (_2775 < _2782))
+ {
+ float _2827 = (7.0 * (_2775 - _2691)) / (_2782 - _2691);
+ int _2828 = int(_2827);
+ float _2830 = _2827 - float(_2828);
+ _2844 = dot(float3(_2830 * _2830, _2830, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_479[_2828], _479[_2828 + 1], _479[_2828 + 2]));
+ }
+ else
+ {
+ float _2789 = log(_2684);
+ float _2790 = _2789 / _1065;
+ float _2823;
+ if ((_2775 >= _2782) && (_2775 < _2790))
+ {
+ float _2806 = (7.0 * (_2775 - _2782)) / (_2790 - _2782);
+ int _2807 = int(_2806);
+ float _2809 = _2806 - float(_2807);
+ _2823 = dot(float3(_2809 * _2809, _2809, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_480[_2807], _480[_2807 + 1], _480[_2807 + 2]));
+ }
+ else
+ {
+ _2823 = (_2775 * 0.0599999986588954925537109375) + ((log(1000.0) / _1065) - ((0.0599999986588954925537109375 * _2789) / _1065));
+ }
+ _2844 = _2823;
+ }
+ _2852 = _2844;
+ }
+ float3 _2854 = _2770;
+ _2854.y = pow(10.0, _2852);
+ float _2855 = _2479.z;
+ float _2859 = log((_2855 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2855) / _1065;
+ float _2936;
+ if (_2859 <= _2691)
+ {
+ _2936 = (_2859 * 3.0) + ((log(9.9999997473787516355514526367188e-05) / _1065) - ((3.0 * _2690) / _1065));
+ }
+ else
+ {
+ float _2866 = log(_2612) / _1065;
+ float _2928;
+ if ((_2859 > _2691) && (_2859 < _2866))
+ {
+ float _2911 = (7.0 * (_2859 - _2691)) / (_2866 - _2691);
+ int _2912 = int(_2911);
+ float _2914 = _2911 - float(_2912);
+ _2928 = dot(float3(_2914 * _2914, _2914, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_479[_2912], _479[_2912 + 1], _479[_2912 + 2]));
+ }
+ else
+ {
+ float _2873 = log(_2684);
+ float _2874 = _2873 / _1065;
+ float _2907;
+ if ((_2859 >= _2866) && (_2859 < _2874))
+ {
+ float _2890 = (7.0 * (_2859 - _2866)) / (_2874 - _2866);
+ int _2891 = int(_2890);
+ float _2893 = _2890 - float(_2891);
+ _2907 = dot(float3(_2893 * _2893, _2893, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_480[_2891], _480[_2891 + 1], _480[_2891 + 2]));
+ }
+ else
+ {
+ _2907 = (_2859 * 0.0599999986588954925537109375) + ((log(1000.0) / _1065) - ((0.0599999986588954925537109375 * _2873) / _1065));
+ }
+ _2928 = _2907;
+ }
+ _2936 = _2928;
+ }
+ float3 _2938 = _2854;
+ _2938.z = pow(10.0, _2936);
+ float3 _2942 = pow(((_2938 - float3(3.5073844628641381859779357910156e-05)) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _2950 = pow((float3(0.8359375) + (float3(18.8515625) * _2942)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2942))), float3(78.84375));
+ }
+ else
+ {
+ float3 _2097;
+ if ((_Globals.OutputDevice == 4u) || (_Globals.OutputDevice == 6u))
+ {
+ float3 _1263 = (_906 * float3(1.5)) * (_546 * float3x3(float3(1.04981100559234619140625, 0.0, -9.74845024757087230682373046875e-05), float3(-0.49590301513671875, 1.37331306934356689453125, 0.09824003279209136962890625), float3(0.0, 0.0, 0.991252005100250244140625)));
+ float _1264 = _1263.x;
+ float _1265 = _1263.y;
+ float _1267 = _1263.z;
+ float _1270 = fast::max(fast::max(_1264, _1265), _1267);
+ float _1275 = (fast::max(_1270, 1.0000000133514319600180897396058e-10) - fast::max(fast::min(fast::min(_1264, _1265), _1267), 1.0000000133514319600180897396058e-10)) / fast::max(_1270, 0.00999999977648258209228515625);
+ float _1288 = ((_1267 + _1265) + _1264) + (1.75 * sqrt(((_1267 * (_1267 - _1265)) + (_1265 * (_1265 - _1264))) + (_1264 * (_1264 - _1267))));
+ float _1289 = _1288 * 0.3333333432674407958984375;
+ float _1290 = _1275 - 0.4000000059604644775390625;
+ float _1295 = fast::max(1.0 - abs(_1290 * 2.5), 0.0);
+ float _1303 = (1.0 + (float(int(sign(_1290 * 5.0))) * (1.0 - (_1295 * _1295)))) * 0.02500000037252902984619140625;
+ float _1316;
+ if (_1289 <= 0.053333334624767303466796875)
+ {
+ _1316 = _1303;
+ }
+ else
+ {
+ float _1315;
+ if (_1289 >= 0.1599999964237213134765625)
+ {
+ _1315 = 0.0;
+ }
+ else
+ {
+ _1315 = _1303 * ((0.23999999463558197021484375 / _1288) - 0.5);
+ }
+ _1316 = _1315;
+ }
+ float3 _1319 = _1263 * float3(1.0 + _1316);
+ float _1320 = _1319.x;
+ float _1321 = _1319.y;
+ float _1323 = _1319.z;
+ float _1337;
+ if ((_1320 == _1321) && (_1321 == _1323))
+ {
+ _1337 = 0.0;
+ }
+ else
+ {
+ _1337 = 57.2957763671875 * atan2(sqrt(3.0) * (_1321 - _1323), ((2.0 * _1320) - _1321) - _1323);
+ }
+ float _1342;
+ if (_1337 < 0.0)
+ {
+ _1342 = _1337 + 360.0;
+ }
+ else
+ {
+ _1342 = _1337;
+ }
+ float _1343 = fast::clamp(_1342, 0.0, 360.0);
+ float _1348;
+ if (_1343 > 180.0)
+ {
+ _1348 = _1343 - 360.0;
+ }
+ else
+ {
+ _1348 = _1343;
+ }
+ float _1398;
+ if ((_1348 > (-67.5)) && (_1348 < 67.5))
+ {
+ float _1355 = (_1348 - (-67.5)) * 0.0296296291053295135498046875;
+ int _1356 = int(_1355);
+ float _1358 = _1355 - float(_1356);
+ float _1359 = _1358 * _1358;
+ float _1360 = _1359 * _1358;
+ float _1397;
+ if (_1356 == 3)
+ {
+ _1397 = (((_1360 * (-0.16666667163372039794921875)) + (_1359 * 0.5)) + (_1358 * (-0.5))) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _1390;
+ if (_1356 == 2)
+ {
+ _1390 = ((_1360 * 0.5) + (_1359 * (-1.0))) + 0.666666686534881591796875;
+ }
+ else
+ {
+ float _1385;
+ if (_1356 == 1)
+ {
+ _1385 = (((_1360 * (-0.5)) + (_1359 * 0.5)) + (_1358 * 0.5)) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _1378;
+ if (_1356 == 0)
+ {
+ _1378 = _1360 * 0.16666667163372039794921875;
+ }
+ else
+ {
+ _1378 = 0.0;
+ }
+ _1385 = _1378;
+ }
+ _1390 = _1385;
+ }
+ _1397 = _1390;
+ }
+ _1398 = _1397;
+ }
+ else
+ {
+ _1398 = 0.0;
+ }
+ float3 _1405 = _1319;
+ _1405.x = _1320 + ((((_1398 * 1.5) * _1275) * (0.02999999932944774627685546875 - _1320)) * 0.180000007152557373046875);
+ float3 _1408 = fast::clamp(fast::clamp(_1405, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ float3 _1411 = mix(float3(dot(_1408, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1408, float3(0.959999978542327880859375));
+ float _1412 = _1411.x;
+ float _1416 = 0.17999999225139617919921875 * exp2(18.0);
+ float _1418 = exp2(-14.0);
+ float _1421 = log((_1412 <= 0.0) ? _1418 : _1412) / _1065;
+ float _1423 = log(0.17999999225139617919921875 * exp2(-15.0)) / _1065;
+ float _1490;
+ if (_1421 <= _1423)
+ {
+ _1490 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _1430 = log(0.180000007152557373046875) / _1065;
+ float _1487;
+ if ((_1421 > _1423) && (_1421 < _1430))
+ {
+ float _1470 = (3.0 * (_1421 - _1423)) / (_1430 - _1423);
+ int _1471 = int(_1470);
+ float _1473 = _1470 - float(_1471);
+ _1487 = dot(float3(_1473 * _1473, _1473, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_1471], _475[_1471 + 1], _475[_1471 + 2]));
+ }
+ else
+ {
+ float _1438 = log(_1416) / _1065;
+ float _1466;
+ if ((_1421 >= _1430) && (_1421 < _1438))
+ {
+ float _1449 = (3.0 * (_1421 - _1430)) / (_1438 - _1430);
+ int _1450 = int(_1449);
+ float _1452 = _1449 - float(_1450);
+ _1466 = dot(float3(_1452 * _1452, _1452, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_1450], _476[_1450 + 1], _476[_1450 + 2]));
+ }
+ else
+ {
+ _1466 = log(10000.0) / _1065;
+ }
+ _1487 = _1466;
+ }
+ _1490 = _1487;
+ }
+ float3 _1492 = _391;
+ _1492.x = pow(10.0, _1490);
+ float _1493 = _1411.y;
+ float _1497 = log((_1493 <= 0.0) ? _1418 : _1493) / _1065;
+ float _1564;
+ if (_1497 <= _1423)
+ {
+ _1564 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _1504 = log(0.180000007152557373046875) / _1065;
+ float _1561;
+ if ((_1497 > _1423) && (_1497 < _1504))
+ {
+ float _1544 = (3.0 * (_1497 - _1423)) / (_1504 - _1423);
+ int _1545 = int(_1544);
+ float _1547 = _1544 - float(_1545);
+ _1561 = dot(float3(_1547 * _1547, _1547, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_1545], _475[_1545 + 1], _475[_1545 + 2]));
+ }
+ else
+ {
+ float _1512 = log(_1416) / _1065;
+ float _1540;
+ if ((_1497 >= _1504) && (_1497 < _1512))
+ {
+ float _1523 = (3.0 * (_1497 - _1504)) / (_1512 - _1504);
+ int _1524 = int(_1523);
+ float _1526 = _1523 - float(_1524);
+ _1540 = dot(float3(_1526 * _1526, _1526, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_1524], _476[_1524 + 1], _476[_1524 + 2]));
+ }
+ else
+ {
+ _1540 = log(10000.0) / _1065;
+ }
+ _1561 = _1540;
+ }
+ _1564 = _1561;
+ }
+ float3 _1566 = _1492;
+ _1566.y = pow(10.0, _1564);
+ float _1567 = _1411.z;
+ float _1571 = log((_1567 <= 0.0) ? _1418 : _1567) / _1065;
+ float _1638;
+ if (_1571 <= _1423)
+ {
+ _1638 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _1578 = log(0.180000007152557373046875) / _1065;
+ float _1635;
+ if ((_1571 > _1423) && (_1571 < _1578))
+ {
+ float _1618 = (3.0 * (_1571 - _1423)) / (_1578 - _1423);
+ int _1619 = int(_1618);
+ float _1621 = _1618 - float(_1619);
+ _1635 = dot(float3(_1621 * _1621, _1621, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_1619], _475[_1619 + 1], _475[_1619 + 2]));
+ }
+ else
+ {
+ float _1586 = log(_1416) / _1065;
+ float _1614;
+ if ((_1571 >= _1578) && (_1571 < _1586))
+ {
+ float _1597 = (3.0 * (_1571 - _1578)) / (_1586 - _1578);
+ int _1598 = int(_1597);
+ float _1600 = _1597 - float(_1598);
+ _1614 = dot(float3(_1600 * _1600, _1600, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_1598], _476[_1598 + 1], _476[_1598 + 2]));
+ }
+ else
+ {
+ _1614 = log(10000.0) / _1065;
+ }
+ _1635 = _1614;
+ }
+ _1638 = _1635;
+ }
+ float3 _1640 = _1566;
+ _1640.z = pow(10.0, _1638);
+ float3 _1642 = (_1640 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ float _1644 = 0.17999999225139617919921875 * pow(2.0, -12.0);
+ float _1648 = log((_1644 <= 0.0) ? _1418 : _1644) / _1065;
+ float _1715;
+ if (_1648 <= _1423)
+ {
+ _1715 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _1655 = log(0.180000007152557373046875) / _1065;
+ float _1712;
+ if ((_1648 > _1423) && (_1648 < _1655))
+ {
+ float _1695 = (3.0 * (_1648 - _1423)) / (_1655 - _1423);
+ int _1696 = int(_1695);
+ float _1698 = _1695 - float(_1696);
+ _1712 = dot(float3(_1698 * _1698, _1698, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_1696], _475[_1696 + 1], _475[_1696 + 2]));
+ }
+ else
+ {
+ float _1663 = log(_1416) / _1065;
+ float _1691;
+ if ((_1648 >= _1655) && (_1648 < _1663))
+ {
+ float _1674 = (3.0 * (_1648 - _1655)) / (_1663 - _1655);
+ int _1675 = int(_1674);
+ float _1677 = _1674 - float(_1675);
+ _1691 = dot(float3(_1677 * _1677, _1677, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_1675], _476[_1675 + 1], _476[_1675 + 2]));
+ }
+ else
+ {
+ _1691 = log(10000.0) / _1065;
+ }
+ _1712 = _1691;
+ }
+ _1715 = _1712;
+ }
+ float _1718 = log(0.180000007152557373046875) / _1065;
+ float _1774;
+ if (_1718 <= _1423)
+ {
+ _1774 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _1771;
+ if ((_1718 > _1423) && (_1718 < _1718))
+ {
+ _1771 = (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[3], _475[4], _475[5])).z;
+ }
+ else
+ {
+ float _1731 = log(_1416) / _1065;
+ float _1759;
+ if ((_1718 >= _1718) && (_1718 < _1731))
+ {
+ float _1742 = (3.0 * (_1718 - _1718)) / (_1731 - _1718);
+ int _1743 = int(_1742);
+ float _1745 = _1742 - float(_1743);
+ _1759 = dot(float3(_1745 * _1745, _1745, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_1743], _476[_1743 + 1], _476[_1743 + 2]));
+ }
+ else
+ {
+ _1759 = log(10000.0) / _1065;
+ }
+ _1771 = _1759;
+ }
+ _1774 = _1771;
+ }
+ float _1775 = pow(10.0, _1774);
+ float _1777 = 0.17999999225139617919921875 * pow(2.0, 11.0);
+ float _1781 = log((_1777 <= 0.0) ? _1418 : _1777) / _1065;
+ float _1846;
+ if (_1781 <= _1423)
+ {
+ _1846 = log(9.9999997473787516355514526367188e-05) / _1065;
+ }
+ else
+ {
+ float _1843;
+ if ((_1781 > _1423) && (_1781 < _1718))
+ {
+ float _1826 = (3.0 * (_1781 - _1423)) / (_1718 - _1423);
+ int _1827 = int(_1826);
+ float _1829 = _1826 - float(_1827);
+ _1843 = dot(float3(_1829 * _1829, _1829, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[_1827], _475[_1827 + 1], _475[_1827 + 2]));
+ }
+ else
+ {
+ float _1794 = log(_1416) / _1065;
+ float _1822;
+ if ((_1781 >= _1718) && (_1781 < _1794))
+ {
+ float _1805 = (3.0 * (_1781 - _1718)) / (_1794 - _1718);
+ int _1806 = int(_1805);
+ float _1808 = _1805 - float(_1806);
+ _1822 = dot(float3(_1808 * _1808, _1808, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[_1806], _476[_1806 + 1], _476[_1806 + 2]));
+ }
+ else
+ {
+ _1822 = log(10000.0) / _1065;
+ }
+ _1843 = _1822;
+ }
+ _1846 = _1843;
+ }
+ float _1847 = pow(10.0, _1846);
+ float _1848 = _1642.x;
+ float _1852 = log((_1848 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1848) / _1065;
+ float _1854 = log(pow(10.0, _1715)) / _1065;
+ float _1926;
+ if (_1852 <= _1854)
+ {
+ _1926 = log(0.004999999888241291046142578125) / _1065;
+ }
+ else
+ {
+ float _1861 = log(_1775) / _1065;
+ float _1923;
+ if ((_1852 > _1854) && (_1852 < _1861))
+ {
+ float _1906 = (7.0 * (_1852 - _1854)) / (_1861 - _1854);
+ int _1907 = int(_1906);
+ float _1909 = _1906 - float(_1907);
+ _1923 = dot(float3(_1909 * _1909, _1909, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_482[_1907], _482[_1907 + 1], _482[_1907 + 2]));
+ }
+ else
+ {
+ float _1868 = log(_1847);
+ float _1869 = _1868 / _1065;
+ float _1902;
+ if ((_1852 >= _1861) && (_1852 < _1869))
+ {
+ float _1885 = (7.0 * (_1852 - _1861)) / (_1869 - _1861);
+ int _1886 = int(_1885);
+ float _1888 = _1885 - float(_1886);
+ _1902 = dot(float3(_1888 * _1888, _1888, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_483[_1886], _483[_1886 + 1], _483[_1886 + 2]));
+ }
+ else
+ {
+ _1902 = (_1852 * 0.119999997317790985107421875) + ((log(2000.0) / _1065) - ((0.119999997317790985107421875 * _1868) / _1065));
+ }
+ _1923 = _1902;
+ }
+ _1926 = _1923;
+ }
+ float3 _1928 = _391;
+ _1928.x = pow(10.0, _1926);
+ float _1929 = _1642.y;
+ float _1933 = log((_1929 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1929) / _1065;
+ float _2005;
+ if (_1933 <= _1854)
+ {
+ _2005 = log(0.004999999888241291046142578125) / _1065;
+ }
+ else
+ {
+ float _1940 = log(_1775) / _1065;
+ float _2002;
+ if ((_1933 > _1854) && (_1933 < _1940))
+ {
+ float _1985 = (7.0 * (_1933 - _1854)) / (_1940 - _1854);
+ int _1986 = int(_1985);
+ float _1988 = _1985 - float(_1986);
+ _2002 = dot(float3(_1988 * _1988, _1988, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_482[_1986], _482[_1986 + 1], _482[_1986 + 2]));
+ }
+ else
+ {
+ float _1947 = log(_1847);
+ float _1948 = _1947 / _1065;
+ float _1981;
+ if ((_1933 >= _1940) && (_1933 < _1948))
+ {
+ float _1964 = (7.0 * (_1933 - _1940)) / (_1948 - _1940);
+ int _1965 = int(_1964);
+ float _1967 = _1964 - float(_1965);
+ _1981 = dot(float3(_1967 * _1967, _1967, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_483[_1965], _483[_1965 + 1], _483[_1965 + 2]));
+ }
+ else
+ {
+ _1981 = (_1933 * 0.119999997317790985107421875) + ((log(2000.0) / _1065) - ((0.119999997317790985107421875 * _1947) / _1065));
+ }
+ _2002 = _1981;
+ }
+ _2005 = _2002;
+ }
+ float3 _2007 = _1928;
+ _2007.y = pow(10.0, _2005);
+ float _2008 = _1642.z;
+ float _2012 = log((_2008 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2008) / _1065;
+ float _2084;
+ if (_2012 <= _1854)
+ {
+ _2084 = log(0.004999999888241291046142578125) / _1065;
+ }
+ else
+ {
+ float _2019 = log(_1775) / _1065;
+ float _2081;
+ if ((_2012 > _1854) && (_2012 < _2019))
+ {
+ float _2064 = (7.0 * (_2012 - _1854)) / (_2019 - _1854);
+ int _2065 = int(_2064);
+ float _2067 = _2064 - float(_2065);
+ _2081 = dot(float3(_2067 * _2067, _2067, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_482[_2065], _482[_2065 + 1], _482[_2065 + 2]));
+ }
+ else
+ {
+ float _2026 = log(_1847);
+ float _2027 = _2026 / _1065;
+ float _2060;
+ if ((_2012 >= _2019) && (_2012 < _2027))
+ {
+ float _2043 = (7.0 * (_2012 - _2019)) / (_2027 - _2019);
+ int _2044 = int(_2043);
+ float _2046 = _2043 - float(_2044);
+ _2060 = dot(float3(_2046 * _2046, _2046, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_483[_2044], _483[_2044 + 1], _483[_2044 + 2]));
+ }
+ else
+ {
+ _2060 = (_2012 * 0.119999997317790985107421875) + ((log(2000.0) / _1065) - ((0.119999997317790985107421875 * _2026) / _1065));
+ }
+ _2081 = _2060;
+ }
+ _2084 = _2081;
+ }
+ float3 _2086 = _2007;
+ _2086.z = pow(10.0, _2084);
+ float3 _2089 = pow((_2086 * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _2097 = pow((float3(0.8359375) + (float3(18.8515625) * _2089)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2089))), float3(78.84375));
+ }
+ else
+ {
+ float3 _1260;
+ if (_Globals.OutputDevice == 7u)
+ {
+ float3 _1252 = pow(((_906 * _547) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _1260 = pow((float3(0.8359375) + (float3(18.8515625) * _1252)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _1252))), float3(78.84375));
+ }
+ else
+ {
+ _1260 = pow((_1218 * _547) * _576, float3(_Globals.InverseGamma.z));
+ }
+ _2097 = _1260;
+ }
+ _2950 = _2097;
+ }
+ _2960 = _2950;
+ }
+ _3001 = _2960;
+ }
+ float3 _3002 = _3001 * float3(0.95238101482391357421875);
+ float4 _3004 = float4(_3002.x, _3002.y, _3002.z, float4(0.0).w);
+ _3004.w = 0.0;
+ out.out_var_SV_Target0 = _3004;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag
new file mode 100644
index 00000000000..67fa21aadda
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag
@@ -0,0 +1,1414 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_Globals
+{
+ float4 MappingPolynomial;
+ float3 InverseGamma;
+ float4 ColorMatrixR_ColorCurveCd1;
+ float4 ColorMatrixG_ColorCurveCd3Cm3;
+ float4 ColorMatrixB_ColorCurveCm2;
+ float4 ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3;
+ float4 ColorCurve_Ch1_Ch2;
+ float4 ColorShadow_Luma;
+ float4 ColorShadow_Tint1;
+ float4 ColorShadow_Tint2;
+ float FilmSlope;
+ float FilmToe;
+ float FilmShoulder;
+ float FilmBlackClip;
+ float FilmWhiteClip;
+ float4 LUTWeights[5];
+ float3 ColorScale;
+ float4 OverlayColor;
+ float WhiteTemp;
+ float WhiteTint;
+ float4 ColorSaturation;
+ float4 ColorContrast;
+ float4 ColorGamma;
+ float4 ColorGain;
+ float4 ColorOffset;
+ float4 ColorSaturationShadows;
+ float4 ColorContrastShadows;
+ float4 ColorGammaShadows;
+ float4 ColorGainShadows;
+ float4 ColorOffsetShadows;
+ float4 ColorSaturationMidtones;
+ float4 ColorContrastMidtones;
+ float4 ColorGammaMidtones;
+ float4 ColorGainMidtones;
+ float4 ColorOffsetMidtones;
+ float4 ColorSaturationHighlights;
+ float4 ColorContrastHighlights;
+ float4 ColorGammaHighlights;
+ float4 ColorGainHighlights;
+ float4 ColorOffsetHighlights;
+ float ColorCorrectionShadowsMax;
+ float ColorCorrectionHighlightsMin;
+ uint OutputDevice;
+ uint OutputGamut;
+ float BlueCorrection;
+ float ExpandGamut;
+};
+
+constant spvUnsafeArray<float, 6> _499 = spvUnsafeArray<float, 6>({ -4.0, -4.0, -3.1573765277862548828125, -0.485249996185302734375, 1.84773242473602294921875, 1.84773242473602294921875 });
+constant spvUnsafeArray<float, 6> _500 = spvUnsafeArray<float, 6>({ -0.718548238277435302734375, 2.0810306072235107421875, 3.66812419891357421875, 4.0, 4.0, 4.0 });
+constant spvUnsafeArray<float, 10> _503 = spvUnsafeArray<float, 10>({ -4.97062206268310546875, -3.0293781757354736328125, -2.1261999607086181640625, -1.5104999542236328125, -1.0578000545501708984375, -0.4668000042438507080078125, 0.11937999725341796875, 0.7088134288787841796875, 1.2911865711212158203125, 1.2911865711212158203125 });
+constant spvUnsafeArray<float, 10> _504 = spvUnsafeArray<float, 10>({ 0.80891323089599609375, 1.19108676910400390625, 1.5683000087738037109375, 1.94830000400543212890625, 2.308300018310546875, 2.63840007781982421875, 2.85949993133544921875, 2.9872608184814453125, 3.0127391815185546875, 3.0127391815185546875 });
+constant spvUnsafeArray<float, 10> _506 = spvUnsafeArray<float, 10>({ -2.3010299205780029296875, -2.3010299205780029296875, -1.9312000274658203125, -1.5204999446868896484375, -1.0578000545501708984375, -0.4668000042438507080078125, 0.11937999725341796875, 0.7088134288787841796875, 1.2911865711212158203125, 1.2911865711212158203125 });
+constant spvUnsafeArray<float, 10> _507 = spvUnsafeArray<float, 10>({ 0.801995217800140380859375, 1.19800484180450439453125, 1.5943000316619873046875, 1.99730002880096435546875, 2.3782999515533447265625, 2.7683999538421630859375, 3.0515000820159912109375, 3.2746293544769287109375, 3.32743072509765625, 3.32743072509765625 });
+
+constant float3 _523 = {};
+constant float3 _525 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+struct main0_in
+{
+ float2 in_var_TEXCOORD0 [[user(locn0), center_no_perspective]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globals [[buffer(0)]], texture2d<float> Texture1 [[texture(0)]], sampler Texture1Sampler [[sampler(0)]], uint gl_Layer [[render_target_array_index]])
+{
+ main0_out out = {};
+ float3x3 _572 = float3x3(float3(0.41245639324188232421875, 0.3575761020183563232421875, 0.180437505245208740234375), float3(0.21267290413379669189453125, 0.715152204036712646484375, 0.072175003588199615478515625), float3(0.01933390088379383087158203125, 0.119191996753215789794921875, 0.950304090976715087890625)) * float3x3(float3(1.01303005218505859375, 0.0061053098179399967193603515625, -0.014971000142395496368408203125), float3(0.0076982299797236919403076171875, 0.99816501140594482421875, -0.005032029934227466583251953125), float3(-0.0028413101099431514739990234375, 0.0046851597726345062255859375, 0.92450702190399169921875));
+ float3x3 _573 = _572 * float3x3(float3(1.6410233974456787109375, -0.324803292751312255859375, -0.23642469942569732666015625), float3(-0.663662850856781005859375, 1.6153316497802734375, 0.016756348311901092529296875), float3(0.01172189414501190185546875, -0.008284442126750946044921875, 0.98839485645294189453125));
+ float3x3 _574 = float3x3(float3(0.662454187870025634765625, 0.1340042054653167724609375, 0.1561876833438873291015625), float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625), float3(-0.0055746496655046939849853515625, 0.0040607335977256298065185546875, 1.01033914089202880859375)) * float3x3(float3(0.98722398281097412109375, -0.0061132698319852352142333984375, 0.01595330052077770233154296875), float3(-0.007598360069096088409423828125, 1.00186002254486083984375, 0.0053300200961530208587646484375), float3(0.003072570078074932098388671875, -0.0050959498621523380279541015625, 1.0816800594329833984375));
+ float3x3 _575 = _574 * float3x3(float3(3.2409698963165283203125, -1.53738319873809814453125, -0.4986107647418975830078125), float3(-0.96924364566802978515625, 1.875967502593994140625, 0.0415550582110881805419921875), float3(0.055630080401897430419921875, -0.2039769589900970458984375, 1.05697154998779296875));
+ float3x3 _576 = float3x3(float3(0.952552378177642822265625, 0.0, 9.25), float3(0.3439664542675018310546875, 0.728166103363037109375, -0.07213254272937774658203125), float3(0.0, 0.0, 1.00882518291473388671875)) * float3x3(float3(1.6410233974456787109375, -0.324803292751312255859375, -0.23642469942569732666015625), float3(-0.663662850856781005859375, 1.6153316497802734375, 0.016756348311901092529296875), float3(0.01172189414501190185546875, -0.008284442126750946044921875, 0.98839485645294189453125));
+ float3x3 _577 = float3x3(float3(0.662454187870025634765625, 0.1340042054653167724609375, 0.1561876833438873291015625), float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625), float3(-0.0055746496655046939849853515625, 0.0040607335977256298065185546875, 1.01033914089202880859375)) * float3x3(float3(1.04981100559234619140625, 0.0, -9.74845024757087230682373046875e-05), float3(-0.49590301513671875, 1.37331306934356689453125, 0.09824003279209136962890625), float3(0.0, 0.0, 0.991252005100250244140625));
+ float3x3 _602;
+ for (;;)
+ {
+ if (_Globals.OutputGamut == 1u)
+ {
+ _602 = _574 * float3x3(float3(2.493396282196044921875, -0.931345880031585693359375, -0.4026944935321807861328125), float3(-0.829486787319183349609375, 1.76265966892242431640625, 0.02362460084259510040283203125), float3(0.0358506999909877777099609375, -0.076182700693607330322265625, 0.957014024257659912109375));
+ break;
+ }
+ else
+ {
+ if (_Globals.OutputGamut == 2u)
+ {
+ _602 = _574 * float3x3(float3(1.71660840511322021484375, -0.3556621074676513671875, -0.253360092639923095703125), float3(-0.666682898998260498046875, 1.61647760868072509765625, 0.01576850004494190216064453125), float3(0.017642199993133544921875, -0.04277630150318145751953125, 0.94222867488861083984375));
+ break;
+ }
+ else
+ {
+ if (_Globals.OutputGamut == 3u)
+ {
+ _602 = float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625));
+ break;
+ }
+ else
+ {
+ if (_Globals.OutputGamut == 4u)
+ {
+ _602 = float3x3(float3(1.0, 0.0, 0.0), float3(0.0, 1.0, 0.0), float3(0.0, 0.0, 1.0));
+ break;
+ }
+ else
+ {
+ _602 = _575;
+ break;
+ }
+ }
+ }
+ }
+ }
+ float3 _603 = float4((in.in_var_TEXCOORD0 - float2(0.015625)) * float2(1.03225803375244140625), float(gl_Layer) * 0.0322580635547637939453125, 0.0).xyz;
+ float3 _625;
+ if (_Globals.OutputDevice >= 3u)
+ {
+ float3 _617 = pow(_603, float3(0.0126833133399486541748046875));
+ _625 = pow(fast::max(float3(0.0), _617 - float3(0.8359375)) / (float3(18.8515625) - (float3(18.6875) * _617)), float3(6.277394771575927734375)) * float3(10000.0);
+ }
+ else
+ {
+ _625 = (exp2((_603 - float3(0.434017598628997802734375)) * float3(14.0)) * float3(0.180000007152557373046875)) - (exp2(float3(-6.0762462615966796875)) * float3(0.180000007152557373046875));
+ }
+ float _628 = _Globals.WhiteTemp * 1.00055634975433349609375;
+ float _642 = (_628 <= 7000.0) ? (0.24406300485134124755859375 + ((99.1100006103515625 + ((2967800.0 - (4604438528.0 / _Globals.WhiteTemp)) / _628)) / _628)) : (0.23703999817371368408203125 + ((247.4799957275390625 + ((1901800.0 - (2005284352.0 / _Globals.WhiteTemp)) / _628)) / _628));
+ float _659 = ((0.860117733478546142578125 + (0.00015411825734190642833709716796875 * _Globals.WhiteTemp)) + ((1.2864121856637211749330163002014e-07 * _Globals.WhiteTemp) * _Globals.WhiteTemp)) / ((1.0 + (0.0008424202096648514270782470703125 * _Globals.WhiteTemp)) + ((7.0814513719597016461193561553955e-07 * _Globals.WhiteTemp) * _Globals.WhiteTemp));
+ float _670 = ((0.317398726940155029296875 + (4.25 * _Globals.WhiteTemp)) + ((4.2048167614439080352894961833954e-08 * _Globals.WhiteTemp) * _Globals.WhiteTemp)) / ((1.0 - (2.8974181986995972692966461181641e-05 * _Globals.WhiteTemp)) + ((1.6145605741257895715534687042236e-07 * _Globals.WhiteTemp) * _Globals.WhiteTemp));
+ float _675 = ((2.0 * _659) - (8.0 * _670)) + 4.0;
+ float2 _679 = float2((3.0 * _659) / _675, (2.0 * _670) / _675);
+ float2 _686 = normalize(float2(_659, _670));
+ float _691 = _659 + (((-_686.y) * _Globals.WhiteTint) * 0.0500000007450580596923828125);
+ float _695 = _670 + ((_686.x * _Globals.WhiteTint) * 0.0500000007450580596923828125);
+ float _700 = ((2.0 * _691) - (8.0 * _695)) + 4.0;
+ float2 _706 = select(float2(_642, ((((-3.0) * _642) * _642) + (2.86999988555908203125 * _642)) - 0.2750000059604644775390625), _679, bool2(_Globals.WhiteTemp < 4000.0)) + (float2((3.0 * _691) / _700, (2.0 * _695) / _700) - _679);
+ float _707 = _706.x;
+ float _708 = _706.y;
+ float _709 = fast::max(_708, 1.0000000133514319600180897396058e-10);
+ float3 _711 = _523;
+ _711.x = _707 / _709;
+ float3 _712 = _711;
+ _712.y = 1.0;
+ float3 _716 = _712;
+ _716.z = ((1.0 - _707) - _708) / _709;
+ float _717 = fast::max(0.328999996185302734375, 1.0000000133514319600180897396058e-10);
+ float3 _719 = _523;
+ _719.x = 0.3127000033855438232421875 / _717;
+ float3 _720 = _719;
+ _720.y = 1.0;
+ float3 _722 = _720;
+ _722.z = 0.3582999706268310546875 / _717;
+ float3 _723 = _716 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ float3 _724 = _722 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ float3 _743 = (_625 * ((float3x3(float3(0.41245639324188232421875, 0.3575761020183563232421875, 0.180437505245208740234375), float3(0.21267290413379669189453125, 0.715152204036712646484375, 0.072175003588199615478515625), float3(0.01933390088379383087158203125, 0.119191996753215789794921875, 0.950304090976715087890625)) * ((float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875)) * float3x3(float3(_724.x / _723.x, 0.0, 0.0), float3(0.0, _724.y / _723.y, 0.0), float3(0.0, 0.0, _724.z / _723.z))) * float3x3(float3(0.986992895603179931640625, -0.14705429971218109130859375, 0.15996269881725311279296875), float3(0.4323053061962127685546875, 0.518360316753387451171875, 0.049291200935840606689453125), float3(-0.00852870009839534759521484375, 0.0400427989661693572998046875, 0.968486726284027099609375)))) * float3x3(float3(3.2409698963165283203125, -1.53738319873809814453125, -0.4986107647418975830078125), float3(-0.96924364566802978515625, 1.875967502593994140625, 0.0415550582110881805419921875), float3(0.055630080401897430419921875, -0.2039769589900970458984375, 1.05697154998779296875)))) * _573;
+ float3 _771;
+ if (_Globals.ColorShadow_Tint2.w != 0.0)
+ {
+ float _750 = dot(_743, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625));
+ float3 _753 = (_743 / float3(_750)) - float3(1.0);
+ _771 = mix(_743, _743 * (_575 * (float3x3(float3(0.544169127941131591796875, 0.23959259688854217529296875, 0.16669429838657379150390625), float3(0.23946559429168701171875, 0.702153027057647705078125, 0.058381401002407073974609375), float3(-0.0023439000360667705535888671875, 0.0361833982169628143310546875, 1.05521833896636962890625)) * float3x3(float3(1.6410233974456787109375, -0.324803292751312255859375, -0.23642469942569732666015625), float3(-0.663662850856781005859375, 1.6153316497802734375, 0.016756348311901092529296875), float3(0.01172189414501190185546875, -0.008284442126750946044921875, 0.98839485645294189453125)))), float3((1.0 - exp2((-4.0) * dot(_753, _753))) * (1.0 - exp2((((-4.0) * _Globals.ExpandGamut) * _750) * _750))));
+ }
+ else
+ {
+ _771 = _743;
+ }
+ float _772 = dot(_771, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625));
+ float4 _777 = _Globals.ColorSaturationShadows * _Globals.ColorSaturation;
+ float4 _782 = _Globals.ColorContrastShadows * _Globals.ColorContrast;
+ float4 _787 = _Globals.ColorGammaShadows * _Globals.ColorGamma;
+ float4 _792 = _Globals.ColorGainShadows * _Globals.ColorGain;
+ float4 _797 = _Globals.ColorOffsetShadows + _Globals.ColorOffset;
+ float3 _798 = float3(_772);
+ float _830 = smoothstep(0.0, _Globals.ColorCorrectionShadowsMax, _772);
+ float4 _834 = _Globals.ColorSaturationHighlights * _Globals.ColorSaturation;
+ float4 _837 = _Globals.ColorContrastHighlights * _Globals.ColorContrast;
+ float4 _840 = _Globals.ColorGammaHighlights * _Globals.ColorGamma;
+ float4 _843 = _Globals.ColorGainHighlights * _Globals.ColorGain;
+ float4 _846 = _Globals.ColorOffsetHighlights + _Globals.ColorOffset;
+ float _878 = smoothstep(_Globals.ColorCorrectionHighlightsMin, 1.0, _772);
+ float4 _881 = _Globals.ColorSaturationMidtones * _Globals.ColorSaturation;
+ float4 _884 = _Globals.ColorContrastMidtones * _Globals.ColorContrast;
+ float4 _887 = _Globals.ColorGammaMidtones * _Globals.ColorGamma;
+ float4 _890 = _Globals.ColorGainMidtones * _Globals.ColorGain;
+ float4 _893 = _Globals.ColorOffsetMidtones + _Globals.ColorOffset;
+ float3 _931 = ((((pow(pow(fast::max(float3(0.0), mix(_798, _771, _777.xyz * float3(_777.w))) * float3(5.5555553436279296875), _782.xyz * float3(_782.w)) * float3(0.180000007152557373046875), float3(1.0) / (_787.xyz * float3(_787.w))) * (_792.xyz * float3(_792.w))) + (_797.xyz + float3(_797.w))) * float3(1.0 - _830)) + (((pow(pow(fast::max(float3(0.0), mix(_798, _771, _881.xyz * float3(_881.w))) * float3(5.5555553436279296875), _884.xyz * float3(_884.w)) * float3(0.180000007152557373046875), float3(1.0) / (_887.xyz * float3(_887.w))) * (_890.xyz * float3(_890.w))) + (_893.xyz + float3(_893.w))) * float3(_830 - _878))) + (((pow(pow(fast::max(float3(0.0), mix(_798, _771, _834.xyz * float3(_834.w))) * float3(5.5555553436279296875), _837.xyz * float3(_837.w)) * float3(0.180000007152557373046875), float3(1.0) / (_840.xyz * float3(_840.w))) * (_843.xyz * float3(_843.w))) + (_846.xyz + float3(_846.w))) * float3(_878));
+ float3 _932 = _931 * _575;
+ float3 _940 = float3(_Globals.BlueCorrection);
+ float3 _942 = mix(_931, _931 * ((_577 * float3x3(float3(0.940437257289886474609375, -0.01830687932670116424560546875, 0.07786960899829864501953125), float3(0.008378696627914905548095703125, 0.82866001129150390625, 0.162961304187774658203125), float3(0.0005471261101774871349334716796875, -0.00088337459601461887359619140625, 1.00033628940582275390625))) * _576), _940) * _577;
+ float _943 = _942.x;
+ float _944 = _942.y;
+ float _946 = _942.z;
+ float _949 = fast::max(fast::max(_943, _944), _946);
+ float _954 = (fast::max(_949, 1.0000000133514319600180897396058e-10) - fast::max(fast::min(fast::min(_943, _944), _946), 1.0000000133514319600180897396058e-10)) / fast::max(_949, 0.00999999977648258209228515625);
+ float _967 = ((_946 + _944) + _943) + (1.75 * sqrt(((_946 * (_946 - _944)) + (_944 * (_944 - _943))) + (_943 * (_943 - _946))));
+ float _968 = _967 * 0.3333333432674407958984375;
+ float _969 = _954 - 0.4000000059604644775390625;
+ float _974 = fast::max(1.0 - abs(_969 * 2.5), 0.0);
+ float _982 = (1.0 + (float(int(sign(_969 * 5.0))) * (1.0 - (_974 * _974)))) * 0.02500000037252902984619140625;
+ float _995;
+ if (_968 <= 0.053333334624767303466796875)
+ {
+ _995 = _982;
+ }
+ else
+ {
+ float _994;
+ if (_968 >= 0.1599999964237213134765625)
+ {
+ _994 = 0.0;
+ }
+ else
+ {
+ _994 = _982 * ((0.23999999463558197021484375 / _967) - 0.5);
+ }
+ _995 = _994;
+ }
+ float3 _998 = _942 * float3(1.0 + _995);
+ float _999 = _998.x;
+ float _1000 = _998.y;
+ float _1002 = _998.z;
+ float _1016;
+ if ((_999 == _1000) && (_1000 == _1002))
+ {
+ _1016 = 0.0;
+ }
+ else
+ {
+ _1016 = 57.2957763671875 * atan2(sqrt(3.0) * (_1000 - _1002), ((2.0 * _999) - _1000) - _1002);
+ }
+ float _1021;
+ if (_1016 < 0.0)
+ {
+ _1021 = _1016 + 360.0;
+ }
+ else
+ {
+ _1021 = _1016;
+ }
+ float _1022 = fast::clamp(_1021, 0.0, 360.0);
+ float _1027;
+ if (_1022 > 180.0)
+ {
+ _1027 = _1022 - 360.0;
+ }
+ else
+ {
+ _1027 = _1022;
+ }
+ float _1031 = smoothstep(0.0, 1.0, 1.0 - abs(_1027 * 0.01481481455266475677490234375));
+ float3 _1038 = _998;
+ _1038.x = _999 + ((((_1031 * _1031) * _954) * (0.02999999932944774627685546875 - _999)) * 0.180000007152557373046875);
+ float3 _1040 = fast::max(float3(0.0), _1038 * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)));
+ float _1049 = (1.0 + _Globals.FilmBlackClip) - _Globals.FilmToe;
+ float _1052 = 1.0 + _Globals.FilmWhiteClip;
+ float _1055 = _1052 - _Globals.FilmShoulder;
+ float _1082;
+ if (_Globals.FilmToe > 0.800000011920928955078125)
+ {
+ _1082 = ((0.819999992847442626953125 - _Globals.FilmToe) / _Globals.FilmSlope) + (log(0.180000007152557373046875) / log(10.0));
+ }
+ else
+ {
+ float _1061 = (0.180000007152557373046875 + _Globals.FilmBlackClip) / _1049;
+ _1082 = (log(0.180000007152557373046875) / log(10.0)) - ((0.5 * log(_1061 / (2.0 - _1061))) * (_1049 / _Globals.FilmSlope));
+ }
+ float _1087 = ((1.0 - _Globals.FilmToe) / _Globals.FilmSlope) - _1082;
+ float _1089 = (_Globals.FilmShoulder / _Globals.FilmSlope) - _1087;
+ float _1091 = log(10.0);
+ float3 _1093 = log(mix(float3(dot(_1040, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1040, float3(0.959999978542327880859375))) / float3(_1091);
+ float3 _1097 = float3(_Globals.FilmSlope) * (_1093 + float3(_1087));
+ float3 _1105 = float3(_1082);
+ float3 _1106 = _1093 - _1105;
+ float3 _1118 = float3(_1089);
+ float3 _1132 = fast::clamp(_1106 / float3(_1089 - _1082), float3(0.0), float3(1.0));
+ float3 _1136 = select(_1132, float3(1.0) - _1132, bool3(_1089 < _1082));
+ float3 _1141 = mix(select(_1097, float3(-_Globals.FilmBlackClip) + (float3(2.0 * _1049) / (float3(1.0) + exp(float3(((-2.0) * _Globals.FilmSlope) / _1049) * _1106))), _1093 < _1105), select(_1097, float3(_1052) - (float3(2.0 * _1055) / (float3(1.0) + exp(float3((2.0 * _Globals.FilmSlope) / _1055) * (_1093 - _1118)))), _1093 > _1118), ((float3(3.0) - (float3(2.0) * _1136)) * _1136) * _1136);
+ float3 _1145 = fast::max(float3(0.0), mix(float3(dot(_1141, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1141, float3(0.930000007152557373046875)));
+ float3 _1215;
+ if (_Globals.ColorShadow_Tint2.w == 0.0)
+ {
+ float3 _1157 = _525;
+ _1157.x = dot(_932, _Globals.ColorMatrixR_ColorCurveCd1.xyz);
+ float3 _1162 = _1157;
+ _1162.y = dot(_932, _Globals.ColorMatrixG_ColorCurveCd3Cm3.xyz);
+ float3 _1167 = _1162;
+ _1167.z = dot(_932, _Globals.ColorMatrixB_ColorCurveCm2.xyz);
+ float3 _1183 = fast::max(float3(0.0), _1167 * (_Globals.ColorShadow_Tint1.xyz + (_Globals.ColorShadow_Tint2.xyz * float3(1.0 / (dot(_932, _Globals.ColorShadow_Luma.xyz) + 1.0)))));
+ float3 _1188 = fast::max(float3(0.0), _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx - _1183);
+ float3 _1190 = fast::max(_1183, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz);
+ _1215 = ((((_1190 * _Globals.ColorCurve_Ch1_Ch2.xxx) + _Globals.ColorCurve_Ch1_Ch2.yyy) * (float3(1.0) / (_1190 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.www))) + ((fast::clamp(_1183, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz) * _Globals.ColorMatrixB_ColorCurveCm2.www) + (((_1188 * _Globals.ColorMatrixR_ColorCurveCd1.www) * (float3(1.0) / (_1188 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.yyy))) + _Globals.ColorMatrixG_ColorCurveCd3Cm3.www))) - float3(0.00200000009499490261077880859375);
+ }
+ else
+ {
+ _1215 = fast::max(float3(0.0), mix(_1145, _1145 * ((_577 * float3x3(float3(1.06317996978759765625, 0.02339559979736804962158203125, -0.08657260239124298095703125), float3(-0.010633699595928192138671875, 1.2063200473785400390625, -0.1956900060176849365234375), float3(-0.0005908869788981974124908447265625, 0.00105247995816171169281005859375, 0.999538004398345947265625))) * _576), _940) * _575);
+ }
+ float3 _1216 = fast::clamp(_1215, float3(0.0), float3(1.0));
+ float _1217 = _1216.x;
+ float _1229;
+ for (;;)
+ {
+ if (_1217 < 0.00313066993840038776397705078125)
+ {
+ _1229 = _1217 * 12.9200000762939453125;
+ break;
+ }
+ _1229 = (pow(_1217, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ float _1230 = _1216.y;
+ float _1242;
+ for (;;)
+ {
+ if (_1230 < 0.00313066993840038776397705078125)
+ {
+ _1242 = _1230 * 12.9200000762939453125;
+ break;
+ }
+ _1242 = (pow(_1230, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ float _1243 = _1216.z;
+ float _1255;
+ for (;;)
+ {
+ if (_1243 < 0.00313066993840038776397705078125)
+ {
+ _1255 = _1243 * 12.9200000762939453125;
+ break;
+ }
+ _1255 = (pow(_1243, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ float3 _1256 = float3(_1229, _1242, _1255);
+ float3 _1258 = (_1256 * float3(0.9375)) + float3(0.03125);
+ float _1270 = (_1258.z * 16.0) - 0.5;
+ float _1271 = floor(_1270);
+ float _1275 = (_1258.x + _1271) * 0.0625;
+ float _1276 = _1258.y;
+ float4 _1279 = Texture1.sample(Texture1Sampler, float2(_1275, _1276));
+ float4 _1283 = Texture1.sample(Texture1Sampler, float2(_1275 + 0.0625, _1276));
+ float3 _1289 = fast::max(float3(6.1035199905745685100555419921875e-05), (float3(_Globals.LUTWeights[0].x) * _1256) + (float3(_Globals.LUTWeights[1].x) * mix(_1279, _1283, float4(_1270 - _1271)).xyz));
+ float3 _1295 = select(_1289 * float3(0.077399380505084991455078125), pow((_1289 * float3(0.94786727428436279296875)) + float3(0.0521326996386051177978515625), float3(2.400000095367431640625)), _1289 > float3(0.040449999272823333740234375));
+ float3 _1324 = pow(fast::max(float3(0.0), mix((((float3(_Globals.MappingPolynomial.x) * (_1295 * _1295)) + (float3(_Globals.MappingPolynomial.y) * _1295)) + float3(_Globals.MappingPolynomial.z)) * _Globals.ColorScale, _Globals.OverlayColor.xyz, float3(_Globals.OverlayColor.w))), float3(_Globals.InverseGamma.y));
+ float3 _3103;
+ if (_Globals.OutputDevice == 0u)
+ {
+ float _3063 = _1324.x;
+ float _3075;
+ for (;;)
+ {
+ if (_3063 < 0.00313066993840038776397705078125)
+ {
+ _3075 = _3063 * 12.9200000762939453125;
+ break;
+ }
+ _3075 = (pow(_3063, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ float _3076 = _1324.y;
+ float _3088;
+ for (;;)
+ {
+ if (_3076 < 0.00313066993840038776397705078125)
+ {
+ _3088 = _3076 * 12.9200000762939453125;
+ break;
+ }
+ _3088 = (pow(_3076, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ float _3089 = _1324.z;
+ float _3101;
+ for (;;)
+ {
+ if (_3089 < 0.00313066993840038776397705078125)
+ {
+ _3101 = _3089 * 12.9200000762939453125;
+ break;
+ }
+ _3101 = (pow(_3089, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ break;
+ }
+ _3103 = float3(_3075, _3088, _3101);
+ }
+ else
+ {
+ float3 _3062;
+ if (_Globals.OutputDevice == 1u)
+ {
+ float3 _3055 = fast::max(float3(6.1035199905745685100555419921875e-05), (_1324 * _573) * _602);
+ _3062 = fast::min(_3055 * float3(4.5), (pow(fast::max(_3055, float3(0.017999999225139617919921875)), float3(0.449999988079071044921875)) * float3(1.09899997711181640625)) - float3(0.098999999463558197021484375));
+ }
+ else
+ {
+ float3 _3052;
+ if ((_Globals.OutputDevice == 3u) || (_Globals.OutputDevice == 5u))
+ {
+ float3 _2204 = (_932 * float3(1.5)) * (_572 * float3x3(float3(1.04981100559234619140625, 0.0, -9.74845024757087230682373046875e-05), float3(-0.49590301513671875, 1.37331306934356689453125, 0.09824003279209136962890625), float3(0.0, 0.0, 0.991252005100250244140625)));
+ float _2205 = _2204.x;
+ float _2206 = _2204.y;
+ float _2208 = _2204.z;
+ float _2211 = fast::max(fast::max(_2205, _2206), _2208);
+ float _2216 = (fast::max(_2211, 1.0000000133514319600180897396058e-10) - fast::max(fast::min(fast::min(_2205, _2206), _2208), 1.0000000133514319600180897396058e-10)) / fast::max(_2211, 0.00999999977648258209228515625);
+ float _2229 = ((_2208 + _2206) + _2205) + (1.75 * sqrt(((_2208 * (_2208 - _2206)) + (_2206 * (_2206 - _2205))) + (_2205 * (_2205 - _2208))));
+ float _2230 = _2229 * 0.3333333432674407958984375;
+ float _2231 = _2216 - 0.4000000059604644775390625;
+ float _2236 = fast::max(1.0 - abs(_2231 * 2.5), 0.0);
+ float _2244 = (1.0 + (float(int(sign(_2231 * 5.0))) * (1.0 - (_2236 * _2236)))) * 0.02500000037252902984619140625;
+ float _2257;
+ if (_2230 <= 0.053333334624767303466796875)
+ {
+ _2257 = _2244;
+ }
+ else
+ {
+ float _2256;
+ if (_2230 >= 0.1599999964237213134765625)
+ {
+ _2256 = 0.0;
+ }
+ else
+ {
+ _2256 = _2244 * ((0.23999999463558197021484375 / _2229) - 0.5);
+ }
+ _2257 = _2256;
+ }
+ float3 _2260 = _2204 * float3(1.0 + _2257);
+ float _2261 = _2260.x;
+ float _2262 = _2260.y;
+ float _2264 = _2260.z;
+ float _2278;
+ if ((_2261 == _2262) && (_2262 == _2264))
+ {
+ _2278 = 0.0;
+ }
+ else
+ {
+ _2278 = 57.2957763671875 * atan2(sqrt(3.0) * (_2262 - _2264), ((2.0 * _2261) - _2262) - _2264);
+ }
+ float _2283;
+ if (_2278 < 0.0)
+ {
+ _2283 = _2278 + 360.0;
+ }
+ else
+ {
+ _2283 = _2278;
+ }
+ float _2284 = fast::clamp(_2283, 0.0, 360.0);
+ float _2289;
+ if (_2284 > 180.0)
+ {
+ _2289 = _2284 - 360.0;
+ }
+ else
+ {
+ _2289 = _2284;
+ }
+ float _2339;
+ if ((_2289 > (-67.5)) && (_2289 < 67.5))
+ {
+ float _2296 = (_2289 - (-67.5)) * 0.0296296291053295135498046875;
+ int _2297 = int(_2296);
+ float _2299 = _2296 - float(_2297);
+ float _2300 = _2299 * _2299;
+ float _2301 = _2300 * _2299;
+ float _2338;
+ if (_2297 == 3)
+ {
+ _2338 = (((_2301 * (-0.16666667163372039794921875)) + (_2300 * 0.5)) + (_2299 * (-0.5))) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _2331;
+ if (_2297 == 2)
+ {
+ _2331 = ((_2301 * 0.5) + (_2300 * (-1.0))) + 0.666666686534881591796875;
+ }
+ else
+ {
+ float _2326;
+ if (_2297 == 1)
+ {
+ _2326 = (((_2301 * (-0.5)) + (_2300 * 0.5)) + (_2299 * 0.5)) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _2319;
+ if (_2297 == 0)
+ {
+ _2319 = _2301 * 0.16666667163372039794921875;
+ }
+ else
+ {
+ _2319 = 0.0;
+ }
+ _2326 = _2319;
+ }
+ _2331 = _2326;
+ }
+ _2338 = _2331;
+ }
+ _2339 = _2338;
+ }
+ else
+ {
+ _2339 = 0.0;
+ }
+ float3 _2346 = _2260;
+ _2346.x = _2261 + ((((_2339 * 1.5) * _2216) * (0.02999999932944774627685546875 - _2261)) * 0.180000007152557373046875);
+ float3 _2349 = fast::clamp(fast::clamp(_2346, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ float3 _2352 = mix(float3(dot(_2349, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _2349, float3(0.959999978542327880859375));
+ float _2353 = _2352.x;
+ float _2357 = 0.17999999225139617919921875 * exp2(18.0);
+ float _2359 = exp2(-14.0);
+ float _2362 = log((_2353 <= 0.0) ? _2359 : _2353) / _1091;
+ float _2364 = log(0.17999999225139617919921875 * exp2(-15.0)) / _1091;
+ float _2431;
+ if (_2362 <= _2364)
+ {
+ _2431 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _2371 = log(0.180000007152557373046875) / _1091;
+ float _2428;
+ if ((_2362 > _2364) && (_2362 < _2371))
+ {
+ float _2411 = (3.0 * (_2362 - _2364)) / (_2371 - _2364);
+ int _2412 = int(_2411);
+ float _2414 = _2411 - float(_2412);
+ _2428 = dot(float3(_2414 * _2414, _2414, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_2412], _499[_2412 + 1], _499[_2412 + 2]));
+ }
+ else
+ {
+ float _2379 = log(_2357) / _1091;
+ float _2407;
+ if ((_2362 >= _2371) && (_2362 < _2379))
+ {
+ float _2390 = (3.0 * (_2362 - _2371)) / (_2379 - _2371);
+ int _2391 = int(_2390);
+ float _2393 = _2390 - float(_2391);
+ _2407 = dot(float3(_2393 * _2393, _2393, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_2391], _500[_2391 + 1], _500[_2391 + 2]));
+ }
+ else
+ {
+ _2407 = log(10000.0) / _1091;
+ }
+ _2428 = _2407;
+ }
+ _2431 = _2428;
+ }
+ float3 _2433 = _523;
+ _2433.x = pow(10.0, _2431);
+ float _2434 = _2352.y;
+ float _2438 = log((_2434 <= 0.0) ? _2359 : _2434) / _1091;
+ float _2505;
+ if (_2438 <= _2364)
+ {
+ _2505 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _2445 = log(0.180000007152557373046875) / _1091;
+ float _2502;
+ if ((_2438 > _2364) && (_2438 < _2445))
+ {
+ float _2485 = (3.0 * (_2438 - _2364)) / (_2445 - _2364);
+ int _2486 = int(_2485);
+ float _2488 = _2485 - float(_2486);
+ _2502 = dot(float3(_2488 * _2488, _2488, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_2486], _499[_2486 + 1], _499[_2486 + 2]));
+ }
+ else
+ {
+ float _2453 = log(_2357) / _1091;
+ float _2481;
+ if ((_2438 >= _2445) && (_2438 < _2453))
+ {
+ float _2464 = (3.0 * (_2438 - _2445)) / (_2453 - _2445);
+ int _2465 = int(_2464);
+ float _2467 = _2464 - float(_2465);
+ _2481 = dot(float3(_2467 * _2467, _2467, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_2465], _500[_2465 + 1], _500[_2465 + 2]));
+ }
+ else
+ {
+ _2481 = log(10000.0) / _1091;
+ }
+ _2502 = _2481;
+ }
+ _2505 = _2502;
+ }
+ float3 _2507 = _2433;
+ _2507.y = pow(10.0, _2505);
+ float _2508 = _2352.z;
+ float _2512 = log((_2508 <= 0.0) ? _2359 : _2508) / _1091;
+ float _2579;
+ if (_2512 <= _2364)
+ {
+ _2579 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _2519 = log(0.180000007152557373046875) / _1091;
+ float _2576;
+ if ((_2512 > _2364) && (_2512 < _2519))
+ {
+ float _2559 = (3.0 * (_2512 - _2364)) / (_2519 - _2364);
+ int _2560 = int(_2559);
+ float _2562 = _2559 - float(_2560);
+ _2576 = dot(float3(_2562 * _2562, _2562, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_2560], _499[_2560 + 1], _499[_2560 + 2]));
+ }
+ else
+ {
+ float _2527 = log(_2357) / _1091;
+ float _2555;
+ if ((_2512 >= _2519) && (_2512 < _2527))
+ {
+ float _2538 = (3.0 * (_2512 - _2519)) / (_2527 - _2519);
+ int _2539 = int(_2538);
+ float _2541 = _2538 - float(_2539);
+ _2555 = dot(float3(_2541 * _2541, _2541, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_2539], _500[_2539 + 1], _500[_2539 + 2]));
+ }
+ else
+ {
+ _2555 = log(10000.0) / _1091;
+ }
+ _2576 = _2555;
+ }
+ _2579 = _2576;
+ }
+ float3 _2581 = _2507;
+ _2581.z = pow(10.0, _2579);
+ float3 _2583 = (_2581 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ float _2585 = 0.17999999225139617919921875 * pow(2.0, -12.0);
+ float _2589 = log((_2585 <= 0.0) ? _2359 : _2585) / _1091;
+ float _2656;
+ if (_2589 <= _2364)
+ {
+ _2656 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _2596 = log(0.180000007152557373046875) / _1091;
+ float _2653;
+ if ((_2589 > _2364) && (_2589 < _2596))
+ {
+ float _2636 = (3.0 * (_2589 - _2364)) / (_2596 - _2364);
+ int _2637 = int(_2636);
+ float _2639 = _2636 - float(_2637);
+ _2653 = dot(float3(_2639 * _2639, _2639, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_2637], _499[_2637 + 1], _499[_2637 + 2]));
+ }
+ else
+ {
+ float _2604 = log(_2357) / _1091;
+ float _2632;
+ if ((_2589 >= _2596) && (_2589 < _2604))
+ {
+ float _2615 = (3.0 * (_2589 - _2596)) / (_2604 - _2596);
+ int _2616 = int(_2615);
+ float _2618 = _2615 - float(_2616);
+ _2632 = dot(float3(_2618 * _2618, _2618, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_2616], _500[_2616 + 1], _500[_2616 + 2]));
+ }
+ else
+ {
+ _2632 = log(10000.0) / _1091;
+ }
+ _2653 = _2632;
+ }
+ _2656 = _2653;
+ }
+ float _2659 = log(0.180000007152557373046875) / _1091;
+ float _2713;
+ if (_2659 <= _2364)
+ {
+ _2713 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _2710;
+ if ((_2659 > _2364) && (_2659 < _2659))
+ {
+ _2710 = (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[3], _499[4], _499[5])).z;
+ }
+ else
+ {
+ float _2672 = log(_2357) / _1091;
+ float _2700;
+ if ((_2659 >= _2659) && (_2659 < _2672))
+ {
+ float _2683 = (3.0 * (_2659 - _2659)) / (_2672 - _2659);
+ int _2684 = int(_2683);
+ float _2686 = _2683 - float(_2684);
+ _2700 = dot(float3(_2686 * _2686, _2686, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_2684], _500[_2684 + 1], _500[_2684 + 2]));
+ }
+ else
+ {
+ _2700 = log(10000.0) / _1091;
+ }
+ _2710 = _2700;
+ }
+ _2713 = _2710;
+ }
+ float _2714 = pow(10.0, _2713);
+ float _2716 = 0.17999999225139617919921875 * pow(2.0, 10.0);
+ float _2720 = log((_2716 <= 0.0) ? _2359 : _2716) / _1091;
+ float _2785;
+ if (_2720 <= _2364)
+ {
+ _2785 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _2782;
+ if ((_2720 > _2364) && (_2720 < _2659))
+ {
+ float _2765 = (3.0 * (_2720 - _2364)) / (_2659 - _2364);
+ int _2766 = int(_2765);
+ float _2768 = _2765 - float(_2766);
+ _2782 = dot(float3(_2768 * _2768, _2768, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_2766], _499[_2766 + 1], _499[_2766 + 2]));
+ }
+ else
+ {
+ float _2733 = log(_2357) / _1091;
+ float _2761;
+ if ((_2720 >= _2659) && (_2720 < _2733))
+ {
+ float _2744 = (3.0 * (_2720 - _2659)) / (_2733 - _2659);
+ int _2745 = int(_2744);
+ float _2747 = _2744 - float(_2745);
+ _2761 = dot(float3(_2747 * _2747, _2747, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_2745], _500[_2745 + 1], _500[_2745 + 2]));
+ }
+ else
+ {
+ _2761 = log(10000.0) / _1091;
+ }
+ _2782 = _2761;
+ }
+ _2785 = _2782;
+ }
+ float _2786 = pow(10.0, _2785);
+ float _2787 = _2583.x;
+ float _2791 = log((_2787 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2787) / _1091;
+ float _2792 = log(pow(10.0, _2656));
+ float _2793 = _2792 / _1091;
+ float _2870;
+ if (_2791 <= _2793)
+ {
+ _2870 = (_2791 * 3.0) + ((log(9.9999997473787516355514526367188e-05) / _1091) - ((3.0 * _2792) / _1091));
+ }
+ else
+ {
+ float _2800 = log(_2714) / _1091;
+ float _2862;
+ if ((_2791 > _2793) && (_2791 < _2800))
+ {
+ float _2845 = (7.0 * (_2791 - _2793)) / (_2800 - _2793);
+ int _2846 = int(_2845);
+ float _2848 = _2845 - float(_2846);
+ _2862 = dot(float3(_2848 * _2848, _2848, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_503[_2846], _503[_2846 + 1], _503[_2846 + 2]));
+ }
+ else
+ {
+ float _2807 = log(_2786);
+ float _2808 = _2807 / _1091;
+ float _2841;
+ if ((_2791 >= _2800) && (_2791 < _2808))
+ {
+ float _2824 = (7.0 * (_2791 - _2800)) / (_2808 - _2800);
+ int _2825 = int(_2824);
+ float _2827 = _2824 - float(_2825);
+ _2841 = dot(float3(_2827 * _2827, _2827, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_504[_2825], _504[_2825 + 1], _504[_2825 + 2]));
+ }
+ else
+ {
+ _2841 = (_2791 * 0.0599999986588954925537109375) + ((log(1000.0) / _1091) - ((0.0599999986588954925537109375 * _2807) / _1091));
+ }
+ _2862 = _2841;
+ }
+ _2870 = _2862;
+ }
+ float3 _2872 = _523;
+ _2872.x = pow(10.0, _2870);
+ float _2873 = _2583.y;
+ float _2877 = log((_2873 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2873) / _1091;
+ float _2954;
+ if (_2877 <= _2793)
+ {
+ _2954 = (_2877 * 3.0) + ((log(9.9999997473787516355514526367188e-05) / _1091) - ((3.0 * _2792) / _1091));
+ }
+ else
+ {
+ float _2884 = log(_2714) / _1091;
+ float _2946;
+ if ((_2877 > _2793) && (_2877 < _2884))
+ {
+ float _2929 = (7.0 * (_2877 - _2793)) / (_2884 - _2793);
+ int _2930 = int(_2929);
+ float _2932 = _2929 - float(_2930);
+ _2946 = dot(float3(_2932 * _2932, _2932, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_503[_2930], _503[_2930 + 1], _503[_2930 + 2]));
+ }
+ else
+ {
+ float _2891 = log(_2786);
+ float _2892 = _2891 / _1091;
+ float _2925;
+ if ((_2877 >= _2884) && (_2877 < _2892))
+ {
+ float _2908 = (7.0 * (_2877 - _2884)) / (_2892 - _2884);
+ int _2909 = int(_2908);
+ float _2911 = _2908 - float(_2909);
+ _2925 = dot(float3(_2911 * _2911, _2911, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_504[_2909], _504[_2909 + 1], _504[_2909 + 2]));
+ }
+ else
+ {
+ _2925 = (_2877 * 0.0599999986588954925537109375) + ((log(1000.0) / _1091) - ((0.0599999986588954925537109375 * _2891) / _1091));
+ }
+ _2946 = _2925;
+ }
+ _2954 = _2946;
+ }
+ float3 _2956 = _2872;
+ _2956.y = pow(10.0, _2954);
+ float _2957 = _2583.z;
+ float _2961 = log((_2957 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2957) / _1091;
+ float _3038;
+ if (_2961 <= _2793)
+ {
+ _3038 = (_2961 * 3.0) + ((log(9.9999997473787516355514526367188e-05) / _1091) - ((3.0 * _2792) / _1091));
+ }
+ else
+ {
+ float _2968 = log(_2714) / _1091;
+ float _3030;
+ if ((_2961 > _2793) && (_2961 < _2968))
+ {
+ float _3013 = (7.0 * (_2961 - _2793)) / (_2968 - _2793);
+ int _3014 = int(_3013);
+ float _3016 = _3013 - float(_3014);
+ _3030 = dot(float3(_3016 * _3016, _3016, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_503[_3014], _503[_3014 + 1], _503[_3014 + 2]));
+ }
+ else
+ {
+ float _2975 = log(_2786);
+ float _2976 = _2975 / _1091;
+ float _3009;
+ if ((_2961 >= _2968) && (_2961 < _2976))
+ {
+ float _2992 = (7.0 * (_2961 - _2968)) / (_2976 - _2968);
+ int _2993 = int(_2992);
+ float _2995 = _2992 - float(_2993);
+ _3009 = dot(float3(_2995 * _2995, _2995, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_504[_2993], _504[_2993 + 1], _504[_2993 + 2]));
+ }
+ else
+ {
+ _3009 = (_2961 * 0.0599999986588954925537109375) + ((log(1000.0) / _1091) - ((0.0599999986588954925537109375 * _2975) / _1091));
+ }
+ _3030 = _3009;
+ }
+ _3038 = _3030;
+ }
+ float3 _3040 = _2956;
+ _3040.z = pow(10.0, _3038);
+ float3 _3044 = pow(((_3040 - float3(3.5073844628641381859779357910156e-05)) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _3052 = pow((float3(0.8359375) + (float3(18.8515625) * _3044)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _3044))), float3(78.84375));
+ }
+ else
+ {
+ float3 _2201;
+ if ((_Globals.OutputDevice == 4u) || (_Globals.OutputDevice == 6u))
+ {
+ float3 _1369 = (_932 * float3(1.5)) * (_572 * float3x3(float3(1.04981100559234619140625, 0.0, -9.74845024757087230682373046875e-05), float3(-0.49590301513671875, 1.37331306934356689453125, 0.09824003279209136962890625), float3(0.0, 0.0, 0.991252005100250244140625)));
+ float _1370 = _1369.x;
+ float _1371 = _1369.y;
+ float _1373 = _1369.z;
+ float _1376 = fast::max(fast::max(_1370, _1371), _1373);
+ float _1381 = (fast::max(_1376, 1.0000000133514319600180897396058e-10) - fast::max(fast::min(fast::min(_1370, _1371), _1373), 1.0000000133514319600180897396058e-10)) / fast::max(_1376, 0.00999999977648258209228515625);
+ float _1394 = ((_1373 + _1371) + _1370) + (1.75 * sqrt(((_1373 * (_1373 - _1371)) + (_1371 * (_1371 - _1370))) + (_1370 * (_1370 - _1373))));
+ float _1395 = _1394 * 0.3333333432674407958984375;
+ float _1396 = _1381 - 0.4000000059604644775390625;
+ float _1401 = fast::max(1.0 - abs(_1396 * 2.5), 0.0);
+ float _1409 = (1.0 + (float(int(sign(_1396 * 5.0))) * (1.0 - (_1401 * _1401)))) * 0.02500000037252902984619140625;
+ float _1422;
+ if (_1395 <= 0.053333334624767303466796875)
+ {
+ _1422 = _1409;
+ }
+ else
+ {
+ float _1421;
+ if (_1395 >= 0.1599999964237213134765625)
+ {
+ _1421 = 0.0;
+ }
+ else
+ {
+ _1421 = _1409 * ((0.23999999463558197021484375 / _1394) - 0.5);
+ }
+ _1422 = _1421;
+ }
+ float3 _1425 = _1369 * float3(1.0 + _1422);
+ float _1426 = _1425.x;
+ float _1427 = _1425.y;
+ float _1429 = _1425.z;
+ float _1443;
+ if ((_1426 == _1427) && (_1427 == _1429))
+ {
+ _1443 = 0.0;
+ }
+ else
+ {
+ _1443 = 57.2957763671875 * atan2(sqrt(3.0) * (_1427 - _1429), ((2.0 * _1426) - _1427) - _1429);
+ }
+ float _1448;
+ if (_1443 < 0.0)
+ {
+ _1448 = _1443 + 360.0;
+ }
+ else
+ {
+ _1448 = _1443;
+ }
+ float _1449 = fast::clamp(_1448, 0.0, 360.0);
+ float _1454;
+ if (_1449 > 180.0)
+ {
+ _1454 = _1449 - 360.0;
+ }
+ else
+ {
+ _1454 = _1449;
+ }
+ float _1504;
+ if ((_1454 > (-67.5)) && (_1454 < 67.5))
+ {
+ float _1461 = (_1454 - (-67.5)) * 0.0296296291053295135498046875;
+ int _1462 = int(_1461);
+ float _1464 = _1461 - float(_1462);
+ float _1465 = _1464 * _1464;
+ float _1466 = _1465 * _1464;
+ float _1503;
+ if (_1462 == 3)
+ {
+ _1503 = (((_1466 * (-0.16666667163372039794921875)) + (_1465 * 0.5)) + (_1464 * (-0.5))) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _1496;
+ if (_1462 == 2)
+ {
+ _1496 = ((_1466 * 0.5) + (_1465 * (-1.0))) + 0.666666686534881591796875;
+ }
+ else
+ {
+ float _1491;
+ if (_1462 == 1)
+ {
+ _1491 = (((_1466 * (-0.5)) + (_1465 * 0.5)) + (_1464 * 0.5)) + 0.16666667163372039794921875;
+ }
+ else
+ {
+ float _1484;
+ if (_1462 == 0)
+ {
+ _1484 = _1466 * 0.16666667163372039794921875;
+ }
+ else
+ {
+ _1484 = 0.0;
+ }
+ _1491 = _1484;
+ }
+ _1496 = _1491;
+ }
+ _1503 = _1496;
+ }
+ _1504 = _1503;
+ }
+ else
+ {
+ _1504 = 0.0;
+ }
+ float3 _1511 = _1425;
+ _1511.x = _1426 + ((((_1504 * 1.5) * _1381) * (0.02999999932944774627685546875 - _1426)) * 0.180000007152557373046875);
+ float3 _1514 = fast::clamp(fast::clamp(_1511, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ float3 _1517 = mix(float3(dot(_1514, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1514, float3(0.959999978542327880859375));
+ float _1518 = _1517.x;
+ float _1522 = 0.17999999225139617919921875 * exp2(18.0);
+ float _1524 = exp2(-14.0);
+ float _1527 = log((_1518 <= 0.0) ? _1524 : _1518) / _1091;
+ float _1529 = log(0.17999999225139617919921875 * exp2(-15.0)) / _1091;
+ float _1596;
+ if (_1527 <= _1529)
+ {
+ _1596 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _1536 = log(0.180000007152557373046875) / _1091;
+ float _1593;
+ if ((_1527 > _1529) && (_1527 < _1536))
+ {
+ float _1576 = (3.0 * (_1527 - _1529)) / (_1536 - _1529);
+ int _1577 = int(_1576);
+ float _1579 = _1576 - float(_1577);
+ _1593 = dot(float3(_1579 * _1579, _1579, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_1577], _499[_1577 + 1], _499[_1577 + 2]));
+ }
+ else
+ {
+ float _1544 = log(_1522) / _1091;
+ float _1572;
+ if ((_1527 >= _1536) && (_1527 < _1544))
+ {
+ float _1555 = (3.0 * (_1527 - _1536)) / (_1544 - _1536);
+ int _1556 = int(_1555);
+ float _1558 = _1555 - float(_1556);
+ _1572 = dot(float3(_1558 * _1558, _1558, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_1556], _500[_1556 + 1], _500[_1556 + 2]));
+ }
+ else
+ {
+ _1572 = log(10000.0) / _1091;
+ }
+ _1593 = _1572;
+ }
+ _1596 = _1593;
+ }
+ float3 _1598 = _523;
+ _1598.x = pow(10.0, _1596);
+ float _1599 = _1517.y;
+ float _1603 = log((_1599 <= 0.0) ? _1524 : _1599) / _1091;
+ float _1670;
+ if (_1603 <= _1529)
+ {
+ _1670 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _1610 = log(0.180000007152557373046875) / _1091;
+ float _1667;
+ if ((_1603 > _1529) && (_1603 < _1610))
+ {
+ float _1650 = (3.0 * (_1603 - _1529)) / (_1610 - _1529);
+ int _1651 = int(_1650);
+ float _1653 = _1650 - float(_1651);
+ _1667 = dot(float3(_1653 * _1653, _1653, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_1651], _499[_1651 + 1], _499[_1651 + 2]));
+ }
+ else
+ {
+ float _1618 = log(_1522) / _1091;
+ float _1646;
+ if ((_1603 >= _1610) && (_1603 < _1618))
+ {
+ float _1629 = (3.0 * (_1603 - _1610)) / (_1618 - _1610);
+ int _1630 = int(_1629);
+ float _1632 = _1629 - float(_1630);
+ _1646 = dot(float3(_1632 * _1632, _1632, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_1630], _500[_1630 + 1], _500[_1630 + 2]));
+ }
+ else
+ {
+ _1646 = log(10000.0) / _1091;
+ }
+ _1667 = _1646;
+ }
+ _1670 = _1667;
+ }
+ float3 _1672 = _1598;
+ _1672.y = pow(10.0, _1670);
+ float _1673 = _1517.z;
+ float _1677 = log((_1673 <= 0.0) ? _1524 : _1673) / _1091;
+ float _1744;
+ if (_1677 <= _1529)
+ {
+ _1744 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _1684 = log(0.180000007152557373046875) / _1091;
+ float _1741;
+ if ((_1677 > _1529) && (_1677 < _1684))
+ {
+ float _1724 = (3.0 * (_1677 - _1529)) / (_1684 - _1529);
+ int _1725 = int(_1724);
+ float _1727 = _1724 - float(_1725);
+ _1741 = dot(float3(_1727 * _1727, _1727, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_1725], _499[_1725 + 1], _499[_1725 + 2]));
+ }
+ else
+ {
+ float _1692 = log(_1522) / _1091;
+ float _1720;
+ if ((_1677 >= _1684) && (_1677 < _1692))
+ {
+ float _1703 = (3.0 * (_1677 - _1684)) / (_1692 - _1684);
+ int _1704 = int(_1703);
+ float _1706 = _1703 - float(_1704);
+ _1720 = dot(float3(_1706 * _1706, _1706, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_1704], _500[_1704 + 1], _500[_1704 + 2]));
+ }
+ else
+ {
+ _1720 = log(10000.0) / _1091;
+ }
+ _1741 = _1720;
+ }
+ _1744 = _1741;
+ }
+ float3 _1746 = _1672;
+ _1746.z = pow(10.0, _1744);
+ float3 _1748 = (_1746 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ float _1750 = 0.17999999225139617919921875 * pow(2.0, -12.0);
+ float _1754 = log((_1750 <= 0.0) ? _1524 : _1750) / _1091;
+ float _1821;
+ if (_1754 <= _1529)
+ {
+ _1821 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _1761 = log(0.180000007152557373046875) / _1091;
+ float _1818;
+ if ((_1754 > _1529) && (_1754 < _1761))
+ {
+ float _1801 = (3.0 * (_1754 - _1529)) / (_1761 - _1529);
+ int _1802 = int(_1801);
+ float _1804 = _1801 - float(_1802);
+ _1818 = dot(float3(_1804 * _1804, _1804, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_1802], _499[_1802 + 1], _499[_1802 + 2]));
+ }
+ else
+ {
+ float _1769 = log(_1522) / _1091;
+ float _1797;
+ if ((_1754 >= _1761) && (_1754 < _1769))
+ {
+ float _1780 = (3.0 * (_1754 - _1761)) / (_1769 - _1761);
+ int _1781 = int(_1780);
+ float _1783 = _1780 - float(_1781);
+ _1797 = dot(float3(_1783 * _1783, _1783, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_1781], _500[_1781 + 1], _500[_1781 + 2]));
+ }
+ else
+ {
+ _1797 = log(10000.0) / _1091;
+ }
+ _1818 = _1797;
+ }
+ _1821 = _1818;
+ }
+ float _1824 = log(0.180000007152557373046875) / _1091;
+ float _1878;
+ if (_1824 <= _1529)
+ {
+ _1878 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _1875;
+ if ((_1824 > _1529) && (_1824 < _1824))
+ {
+ _1875 = (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[3], _499[4], _499[5])).z;
+ }
+ else
+ {
+ float _1837 = log(_1522) / _1091;
+ float _1865;
+ if ((_1824 >= _1824) && (_1824 < _1837))
+ {
+ float _1848 = (3.0 * (_1824 - _1824)) / (_1837 - _1824);
+ int _1849 = int(_1848);
+ float _1851 = _1848 - float(_1849);
+ _1865 = dot(float3(_1851 * _1851, _1851, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_1849], _500[_1849 + 1], _500[_1849 + 2]));
+ }
+ else
+ {
+ _1865 = log(10000.0) / _1091;
+ }
+ _1875 = _1865;
+ }
+ _1878 = _1875;
+ }
+ float _1879 = pow(10.0, _1878);
+ float _1881 = 0.17999999225139617919921875 * pow(2.0, 11.0);
+ float _1885 = log((_1881 <= 0.0) ? _1524 : _1881) / _1091;
+ float _1950;
+ if (_1885 <= _1529)
+ {
+ _1950 = log(9.9999997473787516355514526367188e-05) / _1091;
+ }
+ else
+ {
+ float _1947;
+ if ((_1885 > _1529) && (_1885 < _1824))
+ {
+ float _1930 = (3.0 * (_1885 - _1529)) / (_1824 - _1529);
+ int _1931 = int(_1930);
+ float _1933 = _1930 - float(_1931);
+ _1947 = dot(float3(_1933 * _1933, _1933, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[_1931], _499[_1931 + 1], _499[_1931 + 2]));
+ }
+ else
+ {
+ float _1898 = log(_1522) / _1091;
+ float _1926;
+ if ((_1885 >= _1824) && (_1885 < _1898))
+ {
+ float _1909 = (3.0 * (_1885 - _1824)) / (_1898 - _1824);
+ int _1910 = int(_1909);
+ float _1912 = _1909 - float(_1910);
+ _1926 = dot(float3(_1912 * _1912, _1912, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[_1910], _500[_1910 + 1], _500[_1910 + 2]));
+ }
+ else
+ {
+ _1926 = log(10000.0) / _1091;
+ }
+ _1947 = _1926;
+ }
+ _1950 = _1947;
+ }
+ float _1951 = pow(10.0, _1950);
+ float _1952 = _1748.x;
+ float _1956 = log((_1952 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1952) / _1091;
+ float _1958 = log(pow(10.0, _1821)) / _1091;
+ float _2030;
+ if (_1956 <= _1958)
+ {
+ _2030 = log(0.004999999888241291046142578125) / _1091;
+ }
+ else
+ {
+ float _1965 = log(_1879) / _1091;
+ float _2027;
+ if ((_1956 > _1958) && (_1956 < _1965))
+ {
+ float _2010 = (7.0 * (_1956 - _1958)) / (_1965 - _1958);
+ int _2011 = int(_2010);
+ float _2013 = _2010 - float(_2011);
+ _2027 = dot(float3(_2013 * _2013, _2013, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_506[_2011], _506[_2011 + 1], _506[_2011 + 2]));
+ }
+ else
+ {
+ float _1972 = log(_1951);
+ float _1973 = _1972 / _1091;
+ float _2006;
+ if ((_1956 >= _1965) && (_1956 < _1973))
+ {
+ float _1989 = (7.0 * (_1956 - _1965)) / (_1973 - _1965);
+ int _1990 = int(_1989);
+ float _1992 = _1989 - float(_1990);
+ _2006 = dot(float3(_1992 * _1992, _1992, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_507[_1990], _507[_1990 + 1], _507[_1990 + 2]));
+ }
+ else
+ {
+ _2006 = (_1956 * 0.119999997317790985107421875) + ((log(2000.0) / _1091) - ((0.119999997317790985107421875 * _1972) / _1091));
+ }
+ _2027 = _2006;
+ }
+ _2030 = _2027;
+ }
+ float3 _2032 = _523;
+ _2032.x = pow(10.0, _2030);
+ float _2033 = _1748.y;
+ float _2037 = log((_2033 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2033) / _1091;
+ float _2109;
+ if (_2037 <= _1958)
+ {
+ _2109 = log(0.004999999888241291046142578125) / _1091;
+ }
+ else
+ {
+ float _2044 = log(_1879) / _1091;
+ float _2106;
+ if ((_2037 > _1958) && (_2037 < _2044))
+ {
+ float _2089 = (7.0 * (_2037 - _1958)) / (_2044 - _1958);
+ int _2090 = int(_2089);
+ float _2092 = _2089 - float(_2090);
+ _2106 = dot(float3(_2092 * _2092, _2092, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_506[_2090], _506[_2090 + 1], _506[_2090 + 2]));
+ }
+ else
+ {
+ float _2051 = log(_1951);
+ float _2052 = _2051 / _1091;
+ float _2085;
+ if ((_2037 >= _2044) && (_2037 < _2052))
+ {
+ float _2068 = (7.0 * (_2037 - _2044)) / (_2052 - _2044);
+ int _2069 = int(_2068);
+ float _2071 = _2068 - float(_2069);
+ _2085 = dot(float3(_2071 * _2071, _2071, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_507[_2069], _507[_2069 + 1], _507[_2069 + 2]));
+ }
+ else
+ {
+ _2085 = (_2037 * 0.119999997317790985107421875) + ((log(2000.0) / _1091) - ((0.119999997317790985107421875 * _2051) / _1091));
+ }
+ _2106 = _2085;
+ }
+ _2109 = _2106;
+ }
+ float3 _2111 = _2032;
+ _2111.y = pow(10.0, _2109);
+ float _2112 = _1748.z;
+ float _2116 = log((_2112 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2112) / _1091;
+ float _2188;
+ if (_2116 <= _1958)
+ {
+ _2188 = log(0.004999999888241291046142578125) / _1091;
+ }
+ else
+ {
+ float _2123 = log(_1879) / _1091;
+ float _2185;
+ if ((_2116 > _1958) && (_2116 < _2123))
+ {
+ float _2168 = (7.0 * (_2116 - _1958)) / (_2123 - _1958);
+ int _2169 = int(_2168);
+ float _2171 = _2168 - float(_2169);
+ _2185 = dot(float3(_2171 * _2171, _2171, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_506[_2169], _506[_2169 + 1], _506[_2169 + 2]));
+ }
+ else
+ {
+ float _2130 = log(_1951);
+ float _2131 = _2130 / _1091;
+ float _2164;
+ if ((_2116 >= _2123) && (_2116 < _2131))
+ {
+ float _2147 = (7.0 * (_2116 - _2123)) / (_2131 - _2123);
+ int _2148 = int(_2147);
+ float _2150 = _2147 - float(_2148);
+ _2164 = dot(float3(_2150 * _2150, _2150, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_507[_2148], _507[_2148 + 1], _507[_2148 + 2]));
+ }
+ else
+ {
+ _2164 = (_2116 * 0.119999997317790985107421875) + ((log(2000.0) / _1091) - ((0.119999997317790985107421875 * _2130) / _1091));
+ }
+ _2185 = _2164;
+ }
+ _2188 = _2185;
+ }
+ float3 _2190 = _2111;
+ _2190.z = pow(10.0, _2188);
+ float3 _2193 = pow((_2190 * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _2201 = pow((float3(0.8359375) + (float3(18.8515625) * _2193)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2193))), float3(78.84375));
+ }
+ else
+ {
+ float3 _1366;
+ if (_Globals.OutputDevice == 7u)
+ {
+ float3 _1358 = pow(((_932 * _573) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _1366 = pow((float3(0.8359375) + (float3(18.8515625) * _1358)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _1358))), float3(78.84375));
+ }
+ else
+ {
+ _1366 = pow((_1324 * _573) * _602, float3(_Globals.InverseGamma.z));
+ }
+ _2201 = _1366;
+ }
+ _3052 = _2201;
+ }
+ _3062 = _3052;
+ }
+ _3103 = _3062;
+ }
+ float3 _3104 = _3103 * float3(0.95238101482391357421875);
+ float4 _3106 = float4(_3104.x, _3104.y, _3104.z, float4(0.0).w);
+ _3106.w = 0.0;
+ out.out_var_SV_Target0 = _3106;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag
new file mode 100644
index 00000000000..73dc2eee1b5
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag
@@ -0,0 +1,350 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_ClipToWorld;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_908;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_924;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_940;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_956;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_972;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_1020;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_1036;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_1052;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1068;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1724;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1740;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1756;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2076;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2148;
+ float PrePadding_View_2152;
+ float PrePadding_View_2156;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2228;
+ float PrePadding_View_2232;
+ float PrePadding_View_2236;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2268;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2412;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ float View_AtmosphericFogSunDiscHalfApexAngleRadian;
+ float PrePadding_View_2492;
+ float4 View_AtmosphericFogSunDiscLuminance;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ uint PrePadding_View_2520;
+ uint PrePadding_View_2524;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2584;
+ float PrePadding_View_2588;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2744;
+ float PrePadding_View_2748;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float PrePadding_View_2908;
+ int2 View_CursorPosition;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ float PrePadding_View_2924;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2940;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2956;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2972;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2988;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_3004;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_PrimitiveDither
+{
+ float PrimitiveDither_LODFactor;
+};
+
+struct type_PrimitiveFade
+{
+ float2 PrimitiveFade_FadeTimeScaleBias;
+};
+
+struct type_Material
+{
+ float4 Material_VectorExpressions[9];
+ float4 Material_ScalarExpressions[3];
+};
+
+constant float _98 = {};
+constant float _103 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+ float gl_FragDepth [[depth(less)]];
+};
+
+struct main0_in
+{
+ float4 in_var_TEXCOORD6 [[user(locn0)]];
+ float4 in_var_TEXCOORD7 [[user(locn1)]];
+ float4 in_var_TEXCOORD10_centroid [[user(locn2)]];
+ float4 in_var_TEXCOORD11_centroid [[user(locn3)]];
+ float4 in_var_TEXCOORD0_0 [[user(locn4)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_PrimitiveDither& PrimitiveDither [[buffer(1)]], constant type_PrimitiveFade& PrimitiveFade [[buffer(2)]], constant type_Material& Material [[buffer(3)]], texture2d<float> Material_Texture2D_0 [[texture(0)]], texture2d<float> Material_Texture2D_3 [[texture(1)]], sampler Material_Texture2D_0Sampler [[sampler(0)]], sampler Material_Texture2D_3Sampler [[sampler(1)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 1> in_var_TEXCOORD0 = {};
+ in_var_TEXCOORD0[0] = in.in_var_TEXCOORD0_0;
+ float2 _135 = gl_FragCoord.xy - View.View_ViewRectMin.xy;
+ float4 _140 = float4(_103, _103, gl_FragCoord.z, 1.0) * float4(gl_FragCoord.w);
+ float4 _144 = View.View_SVPositionToTranslatedWorld * float4(gl_FragCoord.xyz, 1.0);
+ float3 _148 = _144.xyz / float3(_144.w);
+ float3 _149 = _148 - float3(View.View_PreViewTranslation);
+ float3 _151 = normalize(-_148);
+ float3 _152 = _151 * float3x3(in.in_var_TEXCOORD10_centroid.xyz, cross(in.in_var_TEXCOORD11_centroid.xyz, in.in_var_TEXCOORD10_centroid.xyz) * float3(in.in_var_TEXCOORD11_centroid.w), in.in_var_TEXCOORD11_centroid.xyz);
+ float _170 = mix(Material.Material_ScalarExpressions[0].y, Material.Material_ScalarExpressions[0].z, fast::min(fast::max(abs(dot(_151, in.in_var_TEXCOORD11_centroid.xyz)), 0.0), 1.0));
+ float _172 = 1.0 / _170;
+ float2 _174 = (float2(Material.Material_ScalarExpressions[0].x) * ((_152.xy * float2(-1.0)) / float2(_152.z))) * float2(_172);
+ float _180_copy;
+ float2 _183;
+ _183 = float2(0.0);
+ float _188;
+ float _211;
+ float2 _212;
+ float _180 = 1.0;
+ int _185 = 0;
+ float _187 = 1.0;
+ float _189 = 1.0;
+ for (;;)
+ {
+ if (float(_185) < (floor(_170) + 2.0))
+ {
+ _188 = Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y) + _183), gradient2d(dfdx(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y)), dfdy(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y)))).y;
+ if (_180 < _188)
+ {
+ float _201 = _188 - _180;
+ float _203 = _201 / ((_189 - _187) + _201);
+ _211 = (_189 * _203) + (_180 * (1.0 - _203));
+ _212 = _183 - (float2(_203) * _174);
+ break;
+ }
+ _180_copy = _180;
+ _180 -= _172;
+ _183 += _174;
+ _185++;
+ _187 = _188;
+ _189 = _180_copy;
+ continue;
+ }
+ else
+ {
+ _211 = _98;
+ _212 = _183;
+ break;
+ }
+ }
+ float4 _218 = Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y) + _212.xy), bias(View.View_MaterialTextureMipBias));
+ float2 _229 = _135 + float2(View.View_TemporalAAParams.x);
+ float _237 = float((uint(_229.x) + (2u * uint(_229.y))) % 5u);
+ float2 _238 = _135 * float2(0.015625);
+ float4 _242 = Material_Texture2D_3.sample(Material_Texture2D_3Sampler, _238, bias(View.View_MaterialTextureMipBias));
+ float4 _254 = Material_Texture2D_3.sample(Material_Texture2D_3Sampler, _238, bias(View.View_MaterialTextureMipBias));
+ float3 _272 = float3(_212, (1.0 - _211) * Material.Material_ScalarExpressions[0].x);
+ float2 _275 = dfdx(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y));
+ float2 _276 = abs(_275);
+ float3 _279 = dfdx(_149);
+ float2 _283 = dfdy(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y));
+ float2 _284 = abs(_283);
+ float3 _287 = dfdy(_149);
+ if (PrimitiveDither.PrimitiveDither_LODFactor != 0.0)
+ {
+ if (abs(PrimitiveDither.PrimitiveDither_LODFactor) > 0.001000000047497451305389404296875)
+ {
+ float _317 = fract(cos(dot(floor(gl_FragCoord.xy), float2(347.834503173828125, 3343.28369140625))) * 1000.0);
+ if ((float((PrimitiveDither.PrimitiveDither_LODFactor < 0.0) ? ((PrimitiveDither.PrimitiveDither_LODFactor + 1.0) > _317) : (PrimitiveDither.PrimitiveDither_LODFactor < _317)) - 0.001000000047497451305389404296875) < 0.0)
+ {
+ discard_fragment();
+ }
+ }
+ }
+ if ((((_218.z + ((fast::min(fast::max(1.0 - (_218.x * Material.Material_ScalarExpressions[2].y), 0.0), 1.0) + ((_237 + (_242.x * Material.Material_ScalarExpressions[2].z)) * 0.16666667163372039794921875)) + (-0.5))) * ((fast::clamp((View.View_RealTime * PrimitiveFade.PrimitiveFade_FadeTimeScaleBias.x) + PrimitiveFade.PrimitiveFade_FadeTimeScaleBias.y, 0.0, 1.0) + ((_237 + _254.x) * 0.16666667163372039794921875)) + (-0.5))) - 0.33329999446868896484375) < 0.0)
+ {
+ discard_fragment();
+ }
+ float2 _351 = ((((in.in_var_TEXCOORD6.xy / float2(in.in_var_TEXCOORD6.w)) - View.View_TemporalAAJitter.xy) - ((in.in_var_TEXCOORD7.xy / float2(in.in_var_TEXCOORD7.w)) - View.View_TemporalAAJitter.zw)) * float2(0.2495000064373016357421875)) + float2(0.49999237060546875);
+ out.gl_FragDepth = fast::min(_140.z / (_140.w + (sqrt(dot(_272, _272)) / (fast::max(sqrt(dot(_276, _276)) / sqrt(dot(_279, _279)), sqrt(dot(_284, _284)) / sqrt(dot(_287, _287))) / abs(dot(float3x3(View.View_ViewToTranslatedWorld[0].xyz, View.View_ViewToTranslatedWorld[1].xyz, View.View_ViewToTranslatedWorld[2].xyz) * float3(0.0, 0.0, 1.0), _151))))), gl_FragCoord.z);
+ out.out_var_SV_Target0 = float4(_351.x, _351.y, float2(0.0).x, float2(0.0).y);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag
new file mode 100644
index 00000000000..dd54893a24b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag
@@ -0,0 +1,503 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_844;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_860;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_876;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_892;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_908;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_956;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_972;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_988;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1004;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1660;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1676;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1692;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2012;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2084;
+ float PrePadding_View_2088;
+ float PrePadding_View_2092;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2164;
+ float PrePadding_View_2168;
+ float PrePadding_View_2172;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2204;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2348;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2488;
+ float PrePadding_View_2492;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2648;
+ float PrePadding_View_2652;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2828;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2844;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2860;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2876;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_2892;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_StructuredBuffer_v4float
+{
+ float4 _m0[1];
+};
+
+struct type_TranslucentBasePass
+{
+ uint TranslucentBasePass_Shared_Forward_NumLocalLights;
+ uint TranslucentBasePass_Shared_Forward_NumReflectionCaptures;
+ uint TranslucentBasePass_Shared_Forward_HasDirectionalLight;
+ uint TranslucentBasePass_Shared_Forward_NumGridCells;
+ packed_int3 TranslucentBasePass_Shared_Forward_CulledGridSize;
+ uint TranslucentBasePass_Shared_Forward_MaxCulledLightsPerCell;
+ uint TranslucentBasePass_Shared_Forward_LightGridPixelSizeShift;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_36;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_40;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_44;
+ packed_float3 TranslucentBasePass_Shared_Forward_LightGridZParams;
+ float PrePadding_TranslucentBasePass_Shared_Forward_60;
+ packed_float3 TranslucentBasePass_Shared_Forward_DirectionalLightDirection;
+ float PrePadding_TranslucentBasePass_Shared_Forward_76;
+ packed_float3 TranslucentBasePass_Shared_Forward_DirectionalLightColor;
+ float TranslucentBasePass_Shared_Forward_DirectionalLightVolumetricScatteringIntensity;
+ uint TranslucentBasePass_Shared_Forward_DirectionalLightShadowMapChannelMask;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_100;
+ float2 TranslucentBasePass_Shared_Forward_DirectionalLightDistanceFadeMAD;
+ uint TranslucentBasePass_Shared_Forward_NumDirectionalLightCascades;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_116;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_120;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_124;
+ float4 TranslucentBasePass_Shared_Forward_CascadeEndDepths;
+ float4x4 TranslucentBasePass_Shared_Forward_DirectionalLightWorldToShadowMatrix[4];
+ float4 TranslucentBasePass_Shared_Forward_DirectionalLightShadowmapMinMax[4];
+ float4 TranslucentBasePass_Shared_Forward_DirectionalLightShadowmapAtlasBufferSize;
+ float TranslucentBasePass_Shared_Forward_DirectionalLightDepthBias;
+ uint TranslucentBasePass_Shared_Forward_DirectionalLightUseStaticShadowing;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_488;
+ uint PrePadding_TranslucentBasePass_Shared_Forward_492;
+ float4 TranslucentBasePass_Shared_Forward_DirectionalLightStaticShadowBufferSize;
+ float4x4 TranslucentBasePass_Shared_Forward_DirectionalLightWorldToStaticShadow;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_576;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_580;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_584;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_588;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_592;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_596;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_600;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_604;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_608;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_612;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_616;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_620;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_624;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_628;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_632;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_636;
+ uint TranslucentBasePass_Shared_ForwardISR_NumLocalLights;
+ uint TranslucentBasePass_Shared_ForwardISR_NumReflectionCaptures;
+ uint TranslucentBasePass_Shared_ForwardISR_HasDirectionalLight;
+ uint TranslucentBasePass_Shared_ForwardISR_NumGridCells;
+ packed_int3 TranslucentBasePass_Shared_ForwardISR_CulledGridSize;
+ uint TranslucentBasePass_Shared_ForwardISR_MaxCulledLightsPerCell;
+ uint TranslucentBasePass_Shared_ForwardISR_LightGridPixelSizeShift;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_676;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_680;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_684;
+ packed_float3 TranslucentBasePass_Shared_ForwardISR_LightGridZParams;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_700;
+ packed_float3 TranslucentBasePass_Shared_ForwardISR_DirectionalLightDirection;
+ float PrePadding_TranslucentBasePass_Shared_ForwardISR_716;
+ packed_float3 TranslucentBasePass_Shared_ForwardISR_DirectionalLightColor;
+ float TranslucentBasePass_Shared_ForwardISR_DirectionalLightVolumetricScatteringIntensity;
+ uint TranslucentBasePass_Shared_ForwardISR_DirectionalLightShadowMapChannelMask;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_740;
+ float2 TranslucentBasePass_Shared_ForwardISR_DirectionalLightDistanceFadeMAD;
+ uint TranslucentBasePass_Shared_ForwardISR_NumDirectionalLightCascades;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_756;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_760;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_764;
+ float4 TranslucentBasePass_Shared_ForwardISR_CascadeEndDepths;
+ float4x4 TranslucentBasePass_Shared_ForwardISR_DirectionalLightWorldToShadowMatrix[4];
+ float4 TranslucentBasePass_Shared_ForwardISR_DirectionalLightShadowmapMinMax[4];
+ float4 TranslucentBasePass_Shared_ForwardISR_DirectionalLightShadowmapAtlasBufferSize;
+ float TranslucentBasePass_Shared_ForwardISR_DirectionalLightDepthBias;
+ uint TranslucentBasePass_Shared_ForwardISR_DirectionalLightUseStaticShadowing;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_1128;
+ uint PrePadding_TranslucentBasePass_Shared_ForwardISR_1132;
+ float4 TranslucentBasePass_Shared_ForwardISR_DirectionalLightStaticShadowBufferSize;
+ float4x4 TranslucentBasePass_Shared_ForwardISR_DirectionalLightWorldToStaticShadow;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1216;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1220;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1224;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1228;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1232;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1236;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1240;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1244;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1248;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1252;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1256;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1260;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1264;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1268;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1272;
+ float PrePadding_TranslucentBasePass_Shared_Reflection_1276;
+ float4 TranslucentBasePass_Shared_Reflection_SkyLightParameters;
+ float TranslucentBasePass_Shared_Reflection_SkyLightCubemapBrightness;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1300;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1304;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1308;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1312;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1316;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1320;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1324;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1328;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1332;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1336;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1340;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1344;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1348;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1352;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1356;
+ float4 TranslucentBasePass_Shared_PlanarReflection_ReflectionPlane;
+ float4 TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionOrigin;
+ float4 TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionXAxis;
+ float4 TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionYAxis;
+ float3x4 TranslucentBasePass_Shared_PlanarReflection_InverseTransposeMirrorMatrix;
+ packed_float3 TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionParameters;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1484;
+ float2 TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionParameters2;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1496;
+ float PrePadding_TranslucentBasePass_Shared_PlanarReflection_1500;
+ float4x4 TranslucentBasePass_Shared_PlanarReflection_ProjectionWithExtraFOV[2];
+ float4 TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionScreenScaleBias[2];
+ float2 TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionScreenBound;
+ uint TranslucentBasePass_Shared_PlanarReflection_bIsStereo;
+ float PrePadding_TranslucentBasePass_Shared_Fog_1676;
+ float PrePadding_TranslucentBasePass_Shared_Fog_1680;
+ float PrePadding_TranslucentBasePass_Shared_Fog_1684;
+ float PrePadding_TranslucentBasePass_Shared_Fog_1688;
+ float PrePadding_TranslucentBasePass_Shared_Fog_1692;
+ float4 TranslucentBasePass_Shared_Fog_ExponentialFogParameters;
+ float4 TranslucentBasePass_Shared_Fog_ExponentialFogParameters2;
+ float4 TranslucentBasePass_Shared_Fog_ExponentialFogColorParameter;
+ float4 TranslucentBasePass_Shared_Fog_ExponentialFogParameters3;
+ float4 TranslucentBasePass_Shared_Fog_InscatteringLightDirection;
+ float4 TranslucentBasePass_Shared_Fog_DirectionalInscatteringColor;
+ float2 TranslucentBasePass_Shared_Fog_SinCosInscatteringColorCubemapRotation;
+ float PrePadding_TranslucentBasePass_Shared_Fog_1800;
+ float PrePadding_TranslucentBasePass_Shared_Fog_1804;
+ packed_float3 TranslucentBasePass_Shared_Fog_FogInscatteringTextureParameters;
+ float TranslucentBasePass_Shared_Fog_ApplyVolumetricFog;
+ float PrePadding_TranslucentBasePass_1824;
+ float PrePadding_TranslucentBasePass_1828;
+ float PrePadding_TranslucentBasePass_1832;
+ float PrePadding_TranslucentBasePass_1836;
+ float PrePadding_TranslucentBasePass_1840;
+ float PrePadding_TranslucentBasePass_1844;
+ float PrePadding_TranslucentBasePass_1848;
+ float PrePadding_TranslucentBasePass_1852;
+ float PrePadding_TranslucentBasePass_1856;
+ float PrePadding_TranslucentBasePass_1860;
+ float PrePadding_TranslucentBasePass_1864;
+ float PrePadding_TranslucentBasePass_1868;
+ float PrePadding_TranslucentBasePass_1872;
+ float PrePadding_TranslucentBasePass_1876;
+ float PrePadding_TranslucentBasePass_1880;
+ float PrePadding_TranslucentBasePass_1884;
+ float PrePadding_TranslucentBasePass_1888;
+ float PrePadding_TranslucentBasePass_1892;
+ float PrePadding_TranslucentBasePass_1896;
+ float PrePadding_TranslucentBasePass_1900;
+ float PrePadding_TranslucentBasePass_1904;
+ float PrePadding_TranslucentBasePass_1908;
+ float PrePadding_TranslucentBasePass_1912;
+ float PrePadding_TranslucentBasePass_1916;
+ float PrePadding_TranslucentBasePass_1920;
+ float PrePadding_TranslucentBasePass_1924;
+ float PrePadding_TranslucentBasePass_1928;
+ float PrePadding_TranslucentBasePass_1932;
+ float PrePadding_TranslucentBasePass_1936;
+ float PrePadding_TranslucentBasePass_1940;
+ float PrePadding_TranslucentBasePass_1944;
+ float PrePadding_TranslucentBasePass_1948;
+ float PrePadding_TranslucentBasePass_1952;
+ float PrePadding_TranslucentBasePass_1956;
+ float PrePadding_TranslucentBasePass_1960;
+ float PrePadding_TranslucentBasePass_1964;
+ float PrePadding_TranslucentBasePass_1968;
+ float PrePadding_TranslucentBasePass_1972;
+ float PrePadding_TranslucentBasePass_1976;
+ float PrePadding_TranslucentBasePass_1980;
+ float PrePadding_TranslucentBasePass_1984;
+ float PrePadding_TranslucentBasePass_1988;
+ float PrePadding_TranslucentBasePass_1992;
+ float PrePadding_TranslucentBasePass_1996;
+ float PrePadding_TranslucentBasePass_2000;
+ float PrePadding_TranslucentBasePass_2004;
+ float PrePadding_TranslucentBasePass_2008;
+ float PrePadding_TranslucentBasePass_2012;
+ float PrePadding_TranslucentBasePass_2016;
+ float PrePadding_TranslucentBasePass_2020;
+ float PrePadding_TranslucentBasePass_2024;
+ float PrePadding_TranslucentBasePass_2028;
+ float PrePadding_TranslucentBasePass_2032;
+ float PrePadding_TranslucentBasePass_2036;
+ float PrePadding_TranslucentBasePass_2040;
+ float PrePadding_TranslucentBasePass_2044;
+ float PrePadding_TranslucentBasePass_2048;
+ float PrePadding_TranslucentBasePass_2052;
+ float PrePadding_TranslucentBasePass_2056;
+ float PrePadding_TranslucentBasePass_2060;
+ float PrePadding_TranslucentBasePass_2064;
+ float PrePadding_TranslucentBasePass_2068;
+ float PrePadding_TranslucentBasePass_2072;
+ float PrePadding_TranslucentBasePass_2076;
+ float PrePadding_TranslucentBasePass_2080;
+ float PrePadding_TranslucentBasePass_2084;
+ float PrePadding_TranslucentBasePass_2088;
+ float PrePadding_TranslucentBasePass_2092;
+ float PrePadding_TranslucentBasePass_2096;
+ float PrePadding_TranslucentBasePass_2100;
+ float PrePadding_TranslucentBasePass_2104;
+ float PrePadding_TranslucentBasePass_2108;
+ float PrePadding_TranslucentBasePass_2112;
+ float PrePadding_TranslucentBasePass_2116;
+ float PrePadding_TranslucentBasePass_2120;
+ float PrePadding_TranslucentBasePass_2124;
+ float PrePadding_TranslucentBasePass_2128;
+ float PrePadding_TranslucentBasePass_2132;
+ float PrePadding_TranslucentBasePass_2136;
+ float PrePadding_TranslucentBasePass_2140;
+ float4 TranslucentBasePass_HZBUvFactorAndInvFactor;
+ float4 TranslucentBasePass_PrevScreenPositionScaleBias;
+ float TranslucentBasePass_PrevSceneColorPreExposureInv;
+};
+
+struct type_Material
+{
+ float4 Material_VectorExpressions[2];
+ float4 Material_ScalarExpressions[1];
+};
+
+constant float _108 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+ uint gl_SampleMask [[sample_mask]];
+};
+
+struct main0_in
+{
+ float4 in_var_TEXCOORD10_centroid [[user(locn0)]];
+ float4 in_var_TEXCOORD11_centroid [[user(locn1)]];
+ uint in_var_PRIMITIVE_ID [[user(locn2)]];
+ float4 in_var_TEXCOORD7 [[user(locn3)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], const device type_StructuredBuffer_v4float& View_PrimitiveSceneData [[buffer(1)]], constant type_TranslucentBasePass& TranslucentBasePass [[buffer(2)]], constant type_Material& Material [[buffer(3)]], texture3d<float> TranslucentBasePass_Shared_Fog_IntegratedLightScattering [[texture(0)]], sampler View_SharedBilinearClampedSampler [[sampler(0)]], float4 gl_FragCoord [[position]], uint gl_SampleMaskIn [[sample_mask]])
+{
+ main0_out out = {};
+ float4 _137 = View.View_SVPositionToTranslatedWorld * float4(gl_FragCoord.xyz, 1.0);
+ float3 _142 = (_137.xyz / float3(_137.w)) - float3(View.View_PreViewTranslation);
+ bool _165 = TranslucentBasePass.TranslucentBasePass_Shared_Fog_ApplyVolumetricFog > 0.0;
+ float4 _215;
+ if (_165)
+ {
+ float4 _172 = View.View_WorldToClip * float4(_142, 1.0);
+ float _173 = _172.w;
+ float4 _202;
+ if (_165)
+ {
+ _202 = TranslucentBasePass_Shared_Fog_IntegratedLightScattering.sample(View_SharedBilinearClampedSampler, float3(((_172.xy / float2(_173)).xy * float2(0.5, -0.5)) + float2(0.5), (log2((_173 * View.View_VolumetricFogGridZParams[0]) + View.View_VolumetricFogGridZParams[1]) * View.View_VolumetricFogGridZParams[2]) * View.View_VolumetricFogInvGridSize[2]), level(0.0));
+ }
+ else
+ {
+ _202 = float4(0.0, 0.0, 0.0, 1.0);
+ }
+ _215 = float4(_202.xyz + (in.in_var_TEXCOORD7.xyz * float3(_202.w)), _202.w * in.in_var_TEXCOORD7.w);
+ }
+ else
+ {
+ _215 = in.in_var_TEXCOORD7;
+ }
+ float3 _216 = fast::max(Material.Material_VectorExpressions[1].xyz * float3(((1.0 + dot(float3(-1.0, -1.5, 3.0) / float3(sqrt(12.25)), normalize(float3x3(in.in_var_TEXCOORD10_centroid.xyz, cross(in.in_var_TEXCOORD11_centroid.xyz, in.in_var_TEXCOORD10_centroid.xyz) * float3(in.in_var_TEXCOORD11_centroid.w), in.in_var_TEXCOORD11_centroid.xyz) * normalize((float3(0.0, 0.0, 1.0) * float3(View.View_NormalOverrideParameter.w)) + View.View_NormalOverrideParameter.xyz)))) * 0.5) + 0.20000000298023223876953125), float3(0.0));
+ float3 _246;
+ if (View.View_OutOfBoundsMask > 0.0)
+ {
+ uint _222 = in.in_var_PRIMITIVE_ID * 26u;
+ float3 _245;
+ if (any(abs(_142 - View_PrimitiveSceneData._m0[_222 + 5u].xyz) > (View_PrimitiveSceneData._m0[_222 + 19u].xyz + float3(1.0))))
+ {
+ _245 = mix(float3(1.0, 1.0, 0.0), float3(0.0, 1.0, 1.0), select(float3(0.0), float3(1.0), float3(fract(dot(_142, float3(0.57700002193450927734375)) * 0.00200000009499490261077880859375)) > float3(0.5)));
+ }
+ else
+ {
+ _245 = _216;
+ }
+ _246 = _245;
+ }
+ else
+ {
+ _246 = _216;
+ }
+ float4 _256 = float4((_246 * float3(_215.w)) + _215.xyz, _108);
+ _256.w = 1.0;
+ float4 _268;
+ uint _269;
+ if (View.View_NumSceneColorMSAASamples > 1)
+ {
+ _268 = _256 * float4(float(View.View_NumSceneColorMSAASamples) * 0.25);
+ _269 = gl_SampleMaskIn & 15u;
+ }
+ else
+ {
+ _268 = _256;
+ _269 = gl_SampleMaskIn;
+ }
+ out.out_var_SV_Target0 = _268;
+ out.gl_SampleMask = _269;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag
new file mode 100644
index 00000000000..02cfc882943
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag
@@ -0,0 +1,213 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_844;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_860;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_876;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_892;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_908;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_956;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_972;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_988;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1004;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1660;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1676;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1692;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2012;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2084;
+ float PrePadding_View_2088;
+ float PrePadding_View_2092;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2164;
+ float PrePadding_View_2168;
+ float PrePadding_View_2172;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2204;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2348;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2488;
+ float PrePadding_View_2492;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2648;
+ float PrePadding_View_2652;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2828;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2844;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2860;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2876;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_2892;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_Globals
+{
+ float3 SoftTransitionScale;
+ float4 ShadowBufferSize;
+ float ShadowFadeFraction;
+ float ShadowSharpen;
+ float4 LightPositionAndInvRadius;
+ float4x4 ScreenToShadowMatrix;
+ float2 ProjectionDepthBiasParameters;
+ float4 ModulatedShadowColor;
+ float4 ShadowTileOffsetAndSize;
+};
+
+constant float4 _58 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_Globals& _Globals [[buffer(1)]], float4 _gl_LastFragData [[color(0)]], texture2d<float> ShadowDepthTexture [[texture(1)]], sampler ShadowDepthTextureSampler [[sampler(0)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ float4 _67 = _gl_LastFragData;
+ float _68 = _67.w;
+ float4 _82 = _Globals.ScreenToShadowMatrix * float4((((gl_FragCoord.xy * View.View_BufferSizeAndInvSize.zw) - View.View_ScreenPositionScaleBias.wz) / View.View_ScreenPositionScaleBias.xy) * float2(_68), _68, 1.0);
+ float _118 = fast::clamp(((fast::clamp((ShadowDepthTexture.sample(ShadowDepthTextureSampler, (((_82.xyz / float3(_82.w)).xy * _Globals.ShadowTileOffsetAndSize.zw).xy + _Globals.ShadowTileOffsetAndSize.xy).xy, level(0.0)).xxx * float3(_Globals.SoftTransitionScale.z)) - float3((fast::min(_82.z, 0.999989986419677734375) * _Globals.SoftTransitionScale.z) - 1.0), float3(0.0), float3(1.0)).x - 0.5) * _Globals.ShadowSharpen) + 0.5, 0.0, 1.0);
+ float3 _127 = mix(_Globals.ModulatedShadowColor.xyz, float3(1.0), float3(mix(1.0, _118 * _118, _Globals.ShadowFadeFraction)));
+ float4 _129 = float4(_127.x, _127.y, _127.z, _58.w);
+ _129.w = 0.0;
+ out.out_var_SV_Target0 = _129;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/texture-atomics.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/texture-atomics.asm.frag
new file mode 100644
index 00000000000..a416259d877
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/texture-atomics.asm.frag
@@ -0,0 +1,121 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+#pragma clang diagnostic ignored "-Wunused-variable"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+#include <metal_atomic>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_StructuredBuffer_v4float
+{
+ float4 _m0[1];
+};
+
+struct type_Globals
+{
+ uint2 ShadowTileListGroupSize;
+};
+
+constant float3 _70 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+struct main0_in
+{
+ uint in_var_TEXCOORD0 [[user(locn0)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], const device type_StructuredBuffer_v4float& CulledObjectBoxBounds [[buffer(0)]], constant type_Globals& _Globals [[buffer(1)]], texture2d<uint> RWShadowTileNumCulledObjects [[texture(2)]], device atomic_uint* RWShadowTileNumCulledObjects_atomic [[buffer(2)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ uint2 _77 = uint2(gl_FragCoord.xy);
+ uint _78 = _77.y;
+ uint _83 = _77.x;
+ float2 _91 = float2(float(_83), float((_Globals.ShadowTileListGroupSize.y - 1u) - _78));
+ float2 _93 = float2(_Globals.ShadowTileListGroupSize);
+ float2 _96 = ((_91 / _93) * float2(2.0)) - float2(1.0);
+ float2 _100 = (((_91 + float2(1.0)) / _93) * float2(2.0)) - float2(1.0);
+ float3 _102 = float3(_100.x, _100.y, _70.z);
+ _102.z = 1.0;
+ uint _103 = in.in_var_TEXCOORD0 * 5u;
+ uint _107 = _103 + 1u;
+ if (all(CulledObjectBoxBounds._m0[_107].xy > _96.xy) && all(CulledObjectBoxBounds._m0[_103].xyz < _102))
+ {
+ float _122 = _96.x;
+ float _123 = _96.y;
+ spvUnsafeArray<float3, 8> _73;
+ _73[0] = float3(_122, _123, -1000.0);
+ float _126 = _100.x;
+ _73[1] = float3(_126, _123, -1000.0);
+ float _129 = _100.y;
+ _73[2] = float3(_122, _129, -1000.0);
+ _73[3] = float3(_126, _129, -1000.0);
+ _73[4] = float3(_122, _123, 1.0);
+ _73[5] = float3(_126, _123, 1.0);
+ _73[6] = float3(_122, _129, 1.0);
+ _73[7] = float3(_126, _129, 1.0);
+ float3 _155;
+ float3 _158;
+ _155 = float3(-500000.0);
+ _158 = float3(500000.0);
+ for (int _160 = 0; _160 < 8; )
+ {
+ float3 _166 = _73[_160] - (float3(0.5) * (CulledObjectBoxBounds._m0[_103].xyz + CulledObjectBoxBounds._m0[_107].xyz));
+ float3 _170 = float3(dot(_166, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 4u].xyz));
+ _155 = fast::max(_155, _170);
+ _158 = fast::min(_158, _170);
+ _160++;
+ continue;
+ }
+ if (all(_158 < float3(1.0)) && all(_155 > float3(-1.0)))
+ {
+ uint _179 = atomic_fetch_add_explicit((device atomic_uint*)&RWShadowTileNumCulledObjects_atomic[(_78 * _Globals.ShadowTileListGroupSize.x) + _83], 1u, memory_order_relaxed);
+ }
+ }
+ out.out_var_SV_Target0 = float4(0.0);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag
new file mode 100644
index 00000000000..a416259d877
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag
@@ -0,0 +1,121 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+#pragma clang diagnostic ignored "-Wunused-variable"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+#include <metal_atomic>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_StructuredBuffer_v4float
+{
+ float4 _m0[1];
+};
+
+struct type_Globals
+{
+ uint2 ShadowTileListGroupSize;
+};
+
+constant float3 _70 = {};
+
+struct main0_out
+{
+ float4 out_var_SV_Target0 [[color(0)]];
+};
+
+struct main0_in
+{
+ uint in_var_TEXCOORD0 [[user(locn0)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]], const device type_StructuredBuffer_v4float& CulledObjectBoxBounds [[buffer(0)]], constant type_Globals& _Globals [[buffer(1)]], texture2d<uint> RWShadowTileNumCulledObjects [[texture(2)]], device atomic_uint* RWShadowTileNumCulledObjects_atomic [[buffer(2)]], float4 gl_FragCoord [[position]])
+{
+ main0_out out = {};
+ uint2 _77 = uint2(gl_FragCoord.xy);
+ uint _78 = _77.y;
+ uint _83 = _77.x;
+ float2 _91 = float2(float(_83), float((_Globals.ShadowTileListGroupSize.y - 1u) - _78));
+ float2 _93 = float2(_Globals.ShadowTileListGroupSize);
+ float2 _96 = ((_91 / _93) * float2(2.0)) - float2(1.0);
+ float2 _100 = (((_91 + float2(1.0)) / _93) * float2(2.0)) - float2(1.0);
+ float3 _102 = float3(_100.x, _100.y, _70.z);
+ _102.z = 1.0;
+ uint _103 = in.in_var_TEXCOORD0 * 5u;
+ uint _107 = _103 + 1u;
+ if (all(CulledObjectBoxBounds._m0[_107].xy > _96.xy) && all(CulledObjectBoxBounds._m0[_103].xyz < _102))
+ {
+ float _122 = _96.x;
+ float _123 = _96.y;
+ spvUnsafeArray<float3, 8> _73;
+ _73[0] = float3(_122, _123, -1000.0);
+ float _126 = _100.x;
+ _73[1] = float3(_126, _123, -1000.0);
+ float _129 = _100.y;
+ _73[2] = float3(_122, _129, -1000.0);
+ _73[3] = float3(_126, _129, -1000.0);
+ _73[4] = float3(_122, _123, 1.0);
+ _73[5] = float3(_126, _123, 1.0);
+ _73[6] = float3(_122, _129, 1.0);
+ _73[7] = float3(_126, _129, 1.0);
+ float3 _155;
+ float3 _158;
+ _155 = float3(-500000.0);
+ _158 = float3(500000.0);
+ for (int _160 = 0; _160 < 8; )
+ {
+ float3 _166 = _73[_160] - (float3(0.5) * (CulledObjectBoxBounds._m0[_103].xyz + CulledObjectBoxBounds._m0[_107].xyz));
+ float3 _170 = float3(dot(_166, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 4u].xyz));
+ _155 = fast::max(_155, _170);
+ _158 = fast::min(_158, _170);
+ _160++;
+ continue;
+ }
+ if (all(_158 < float3(1.0)) && all(_155 > float3(-1.0)))
+ {
+ uint _179 = atomic_fetch_add_explicit((device atomic_uint*)&RWShadowTileNumCulledObjects_atomic[(_78 * _Globals.ShadowTileListGroupSize.x) + _83], 1u, memory_order_relaxed);
+ }
+ }
+ out.out_var_SV_Target0 = float4(0.0);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/hs-incorrect-base-type.asm.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/hs-incorrect-base-type.asm.tesc
new file mode 100644
index 00000000000..70d17d47f25
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/hs-incorrect-base-type.asm.tesc
@@ -0,0 +1,399 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct FVertexFactoryInterpolantsVSToPS
+{
+ float4 TangentToWorld0;
+ float4 TangentToWorld2;
+ float4 Color;
+ spvUnsafeArray<float4, 1> TexCoords;
+ float4 LightMapCoordinate;
+ uint PrimitiveId;
+ uint LightmapDataIndex;
+};
+
+struct FVertexFactoryInterpolantsVSToDS
+{
+ FVertexFactoryInterpolantsVSToPS InterpolantsVSToPS;
+};
+
+struct FSharedBasePassInterpolants
+{
+};
+struct FBasePassInterpolantsVSToDS
+{
+ FSharedBasePassInterpolants _m0;
+};
+
+struct FBasePassVSToDS
+{
+ FVertexFactoryInterpolantsVSToDS FactoryInterpolants;
+ FBasePassInterpolantsVSToDS BasePassInterpolants;
+ float4 Position;
+};
+
+struct FPNTessellationHSToDS
+{
+ FBasePassVSToDS PassSpecificData;
+ spvUnsafeArray<float4, 3> WorldPosition;
+ float3 DisplacementScale;
+ float TessellationMultiplier;
+ float WorldDisplacementMultiplier;
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_844;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_860;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_876;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_892;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_908;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_956;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_972;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_988;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1004;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1660;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1676;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1692;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2012;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2084;
+ float PrePadding_View_2088;
+ float PrePadding_View_2092;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2164;
+ float PrePadding_View_2168;
+ float PrePadding_View_2172;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2204;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2348;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2488;
+ float PrePadding_View_2492;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2648;
+ float PrePadding_View_2652;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2828;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2844;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2860;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2876;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_2892;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_StructuredBuffer_v4float
+{
+ float4 _m0[1];
+};
+
+constant float4 _142 = {};
+
+struct main0_out
+{
+ float4 out_var_COLOR0;
+ uint out_var_LIGHTMAP_ID;
+ float3 out_var_PN_DisplacementScales;
+ spvUnsafeArray<float4, 3> out_var_PN_POSITION;
+ float out_var_PN_TessellationMultiplier;
+ float out_var_PN_WorldDisplacementMultiplier;
+ uint out_var_PRIMITIVE_ID;
+ spvUnsafeArray<float4, 1> out_var_TEXCOORD0;
+ float4 out_var_TEXCOORD10_centroid;
+ float4 out_var_TEXCOORD11_centroid;
+ float4 out_var_TEXCOORD4;
+ float4 out_var_VS_To_DS_Position;
+};
+
+struct main0_patchOut
+{
+ float4 out_var_PN_POSITION9;
+};
+
+struct main0_in
+{
+ float4 in_var_TEXCOORD10_centroid [[attribute(0)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(1)]];
+ float4 in_var_COLOR0 [[attribute(2)]];
+ float4 in_var_TEXCOORD0_0 [[attribute(3)]];
+ float4 in_var_TEXCOORD4 [[attribute(4)]];
+ uint in_var_PRIMITIVE_ID [[attribute(5)]];
+ uint in_var_LIGHTMAP_ID [[attribute(6)]];
+ float4 in_var_VS_To_DS_Position [[attribute(7)]];
+};
+
+kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], const device type_StructuredBuffer_v4float& View_PrimitiveSceneData [[buffer(1)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
+{
+ threadgroup FPNTessellationHSToDS temp_var_hullMainRetVal[3];
+ device main0_out* gl_out = &spvOut[gl_PrimitiveID * 3];
+ device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID];
+ if (gl_InvocationID < spvIndirectParams[0])
+ gl_in[gl_InvocationID] = in;
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+ if (gl_InvocationID >= 3)
+ return;
+ spvUnsafeArray<float4, 12> _144 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD10_centroid, gl_in[1].in_var_TEXCOORD10_centroid, gl_in[2].in_var_TEXCOORD10_centroid, gl_in[3].in_var_TEXCOORD10_centroid, gl_in[4].in_var_TEXCOORD10_centroid, gl_in[5].in_var_TEXCOORD10_centroid, gl_in[6].in_var_TEXCOORD10_centroid, gl_in[7].in_var_TEXCOORD10_centroid, gl_in[8].in_var_TEXCOORD10_centroid, gl_in[9].in_var_TEXCOORD10_centroid, gl_in[10].in_var_TEXCOORD10_centroid, gl_in[11].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 12> _145 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD11_centroid, gl_in[1].in_var_TEXCOORD11_centroid, gl_in[2].in_var_TEXCOORD11_centroid, gl_in[3].in_var_TEXCOORD11_centroid, gl_in[4].in_var_TEXCOORD11_centroid, gl_in[5].in_var_TEXCOORD11_centroid, gl_in[6].in_var_TEXCOORD11_centroid, gl_in[7].in_var_TEXCOORD11_centroid, gl_in[8].in_var_TEXCOORD11_centroid, gl_in[9].in_var_TEXCOORD11_centroid, gl_in[10].in_var_TEXCOORD11_centroid, gl_in[11].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<float4, 12> _146 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_COLOR0, gl_in[1].in_var_COLOR0, gl_in[2].in_var_COLOR0, gl_in[3].in_var_COLOR0, gl_in[4].in_var_COLOR0, gl_in[5].in_var_COLOR0, gl_in[6].in_var_COLOR0, gl_in[7].in_var_COLOR0, gl_in[8].in_var_COLOR0, gl_in[9].in_var_COLOR0, gl_in[10].in_var_COLOR0, gl_in[11].in_var_COLOR0 });
+ spvUnsafeArray<spvUnsafeArray<float4, 1>, 12> _147 = spvUnsafeArray<spvUnsafeArray<float4, 1>, 12>({ spvUnsafeArray<float4, 1>({ gl_in[0].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[1].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[2].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[3].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[4].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[5].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[6].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[7].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[8].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[9].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[10].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ gl_in[11].in_var_TEXCOORD0_0 }) });
+ spvUnsafeArray<float4, 12> _148 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD4, gl_in[1].in_var_TEXCOORD4, gl_in[2].in_var_TEXCOORD4, gl_in[3].in_var_TEXCOORD4, gl_in[4].in_var_TEXCOORD4, gl_in[5].in_var_TEXCOORD4, gl_in[6].in_var_TEXCOORD4, gl_in[7].in_var_TEXCOORD4, gl_in[8].in_var_TEXCOORD4, gl_in[9].in_var_TEXCOORD4, gl_in[10].in_var_TEXCOORD4, gl_in[11].in_var_TEXCOORD4 });
+ spvUnsafeArray<uint, 12> _149 = spvUnsafeArray<uint, 12>({ gl_in[0].in_var_PRIMITIVE_ID, gl_in[1].in_var_PRIMITIVE_ID, gl_in[2].in_var_PRIMITIVE_ID, gl_in[3].in_var_PRIMITIVE_ID, gl_in[4].in_var_PRIMITIVE_ID, gl_in[5].in_var_PRIMITIVE_ID, gl_in[6].in_var_PRIMITIVE_ID, gl_in[7].in_var_PRIMITIVE_ID, gl_in[8].in_var_PRIMITIVE_ID, gl_in[9].in_var_PRIMITIVE_ID, gl_in[10].in_var_PRIMITIVE_ID, gl_in[11].in_var_PRIMITIVE_ID });
+ spvUnsafeArray<uint, 12> _150 = spvUnsafeArray<uint, 12>({ gl_in[0].in_var_LIGHTMAP_ID, gl_in[1].in_var_LIGHTMAP_ID, gl_in[2].in_var_LIGHTMAP_ID, gl_in[3].in_var_LIGHTMAP_ID, gl_in[4].in_var_LIGHTMAP_ID, gl_in[5].in_var_LIGHTMAP_ID, gl_in[6].in_var_LIGHTMAP_ID, gl_in[7].in_var_LIGHTMAP_ID, gl_in[8].in_var_LIGHTMAP_ID, gl_in[9].in_var_LIGHTMAP_ID, gl_in[10].in_var_LIGHTMAP_ID, gl_in[11].in_var_LIGHTMAP_ID });
+ spvUnsafeArray<float4, 12> _259 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_VS_To_DS_Position, gl_in[1].in_var_VS_To_DS_Position, gl_in[2].in_var_VS_To_DS_Position, gl_in[3].in_var_VS_To_DS_Position, gl_in[4].in_var_VS_To_DS_Position, gl_in[5].in_var_VS_To_DS_Position, gl_in[6].in_var_VS_To_DS_Position, gl_in[7].in_var_VS_To_DS_Position, gl_in[8].in_var_VS_To_DS_Position, gl_in[9].in_var_VS_To_DS_Position, gl_in[10].in_var_VS_To_DS_Position, gl_in[11].in_var_VS_To_DS_Position });
+ spvUnsafeArray<FBasePassVSToDS, 12> _284 = spvUnsafeArray<FBasePassVSToDS, 12>({ FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[0], _145[0], _146[0], _147[0], _148[0], _149[0], _150[0] } }, FBasePassInterpolantsVSToDS{ { } }, _259[0] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[1], _145[1], _146[1], _147[1], _148[1], _149[1], _150[1] } }, FBasePassInterpolantsVSToDS{ { } }, _259[1] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[2], _145[2], _146[2], _147[2], _148[2], _149[2], _150[2] } }, FBasePassInterpolantsVSToDS{ { } }, _259[2] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[3], _145[3], _146[3], _147[3], _148[3], _149[3], _150[3] } }, FBasePassInterpolantsVSToDS{ { } }, _259[3] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[4], _145[4], _146[4], _147[4], _148[4], _149[4], _150[4] } }, FBasePassInterpolantsVSToDS{ { } }, _259[4] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[5], _145[5], _146[5], _147[5], _148[5], _149[5], _150[5] } }, FBasePassInterpolantsVSToDS{ { } }, _259[5] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[6], _145[6], _146[6], _147[6], _148[6], _149[6], _150[6] } }, FBasePassInterpolantsVSToDS{ { } }, _259[6] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[7], _145[7], _146[7], _147[7], _148[7], _149[7], _150[7] } }, FBasePassInterpolantsVSToDS{ { } }, _259[7] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[8], _145[8], _146[8], _147[8], _148[8], _149[8], _150[8] } }, FBasePassInterpolantsVSToDS{ { } }, _259[8] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[9], _145[9], _146[9], _147[9], _148[9], _149[9], _150[9] } }, FBasePassInterpolantsVSToDS{ { } }, _259[9] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[10], _145[10], _146[10], _147[10], _148[10], _149[10], _150[10] } }, FBasePassInterpolantsVSToDS{ { } }, _259[10] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _144[11], _145[11], _146[11], _147[11], _148[11], _149[11], _150[11] } }, FBasePassInterpolantsVSToDS{ { } }, _259[11] } });
+ spvUnsafeArray<FBasePassVSToDS, 12> param_var_I;
+ param_var_I = _284;
+ float4 _301 = float4(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float3 _310 = View_PrimitiveSceneData._m0[(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.PrimitiveId * 26u) + 22u].xyz * float3x3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz, cross(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz) * float3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.w), param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz);
+ uint _313 = (gl_InvocationID < 2u) ? (gl_InvocationID + 1u) : 0u;
+ uint _314 = 2u * gl_InvocationID;
+ uint _315 = 3u + _314;
+ uint _316 = _314 + 4u;
+ float4 _328 = float4(param_var_I[_313].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float4 _336 = float4(param_var_I[_315].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float4 _344 = float4(param_var_I[_316].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ spvUnsafeArray<float4, 3> _392 = spvUnsafeArray<float4, 3>({ param_var_I[gl_InvocationID].Position, (((((float4(2.0) * param_var_I[gl_InvocationID].Position) + param_var_I[_313].Position) - (float4(dot(param_var_I[_313].Position - param_var_I[gl_InvocationID].Position, _301)) * _301)) * float4(0.3333333432674407958984375)) + ((((float4(2.0) * param_var_I[_315].Position) + param_var_I[_316].Position) - (float4(dot(param_var_I[_316].Position - param_var_I[_315].Position, _336)) * _336)) * float4(0.3333333432674407958984375))) * float4(0.5), (((((float4(2.0) * param_var_I[_313].Position) + param_var_I[gl_InvocationID].Position) - (float4(dot(param_var_I[gl_InvocationID].Position - param_var_I[_313].Position, _328)) * _328)) * float4(0.3333333432674407958984375)) + ((((float4(2.0) * param_var_I[_316].Position) + param_var_I[_315].Position) - (float4(dot(param_var_I[_315].Position - param_var_I[_316].Position, _344)) * _344)) * float4(0.3333333432674407958984375))) * float4(0.5) });
+ gl_out[gl_InvocationID].out_var_TEXCOORD10_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ gl_out[gl_InvocationID].out_var_TEXCOORD11_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ gl_out[gl_InvocationID].out_var_COLOR0 = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.Color;
+ gl_out[gl_InvocationID].out_var_TEXCOORD0 = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TexCoords;
+ gl_out[gl_InvocationID].out_var_TEXCOORD4 = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.LightMapCoordinate;
+ gl_out[gl_InvocationID].out_var_PRIMITIVE_ID = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.PrimitiveId;
+ gl_out[gl_InvocationID].out_var_LIGHTMAP_ID = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.LightmapDataIndex;
+ gl_out[gl_InvocationID].out_var_VS_To_DS_Position = param_var_I[gl_InvocationID].Position;
+ gl_out[gl_InvocationID].out_var_PN_POSITION = _392;
+ gl_out[gl_InvocationID].out_var_PN_DisplacementScales = _310;
+ gl_out[gl_InvocationID].out_var_PN_TessellationMultiplier = 1.0;
+ gl_out[gl_InvocationID].out_var_PN_WorldDisplacementMultiplier = 1.0;
+ temp_var_hullMainRetVal[gl_InvocationID] = FPNTessellationHSToDS{ param_var_I[gl_InvocationID], _392, _310, 1.0, 1.0 };
+ threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup);
+ if (gl_InvocationID == 0u)
+ {
+ float4 _450 = (((((temp_var_hullMainRetVal[0u].WorldPosition[1] + temp_var_hullMainRetVal[0u].WorldPosition[2]) + temp_var_hullMainRetVal[1u].WorldPosition[1]) + temp_var_hullMainRetVal[1u].WorldPosition[2]) + temp_var_hullMainRetVal[2u].WorldPosition[1]) + temp_var_hullMainRetVal[2u].WorldPosition[2]) * float4(0.16666667163372039794921875);
+ float4 _463 = _142;
+ _463.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _469 = _463;
+ _469.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ float4 _474 = _469;
+ _474.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ float4 _481 = _474;
+ _481.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _589;
+ for (;;)
+ {
+ float4 _489 = View.View_ViewToClip * float4(0.0);
+ float4 _494 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[0u].WorldPosition[0].xyz, 1.0);
+ float3 _495 = _494.xyz;
+ float3 _496 = _489.xyz;
+ float _498 = _494.w;
+ float _499 = _489.w;
+ float4 _516 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[1u].WorldPosition[0].xyz, 1.0);
+ float3 _517 = _516.xyz;
+ float _519 = _516.w;
+ float4 _537 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[2u].WorldPosition[0].xyz, 1.0);
+ float3 _538 = _537.xyz;
+ float _540 = _537.w;
+ if (any((((select(int3(0), int3(1), (_495 - _496) < float3(_498 + _499)) + (int3(2) * select(int3(0), int3(1), (_495 + _496) > float3((-_498) - _499)))) | (select(int3(0), int3(1), (_517 - _496) < float3(_519 + _499)) + (int3(2) * select(int3(0), int3(1), (_517 + _496) > float3((-_519) - _499))))) | (select(int3(0), int3(1), (_538 - _496) < float3(_540 + _499)) + (int3(2) * select(int3(0), int3(1), (_538 + _496) > float3((-_540) - _499))))) != int3(3)))
+ {
+ _589 = float4(0.0);
+ break;
+ }
+ float3 _558 = temp_var_hullMainRetVal[0u].WorldPosition[0].xyz - temp_var_hullMainRetVal[1u].WorldPosition[0].xyz;
+ float3 _559 = temp_var_hullMainRetVal[1u].WorldPosition[0].xyz - temp_var_hullMainRetVal[2u].WorldPosition[0].xyz;
+ float3 _560 = temp_var_hullMainRetVal[2u].WorldPosition[0].xyz - temp_var_hullMainRetVal[0u].WorldPosition[0].xyz;
+ float3 _563 = (float3(0.5) * (temp_var_hullMainRetVal[0u].WorldPosition[0].xyz + temp_var_hullMainRetVal[1u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float3 _566 = (float3(0.5) * (temp_var_hullMainRetVal[1u].WorldPosition[0].xyz + temp_var_hullMainRetVal[2u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float3 _569 = (float3(0.5) * (temp_var_hullMainRetVal[2u].WorldPosition[0].xyz + temp_var_hullMainRetVal[0u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float _573 = sqrt(dot(_559, _559) / dot(_566, _566));
+ float _577 = sqrt(dot(_560, _560) / dot(_569, _569));
+ float _581 = sqrt(dot(_558, _558) / dot(_563, _563));
+ float4 _586 = float4(_573, _577, _581, 1.0);
+ _586.w = 0.333000004291534423828125 * ((_573 + _577) + _581);
+ _589 = float4(View.View_AdaptiveTessellationFactor) * _586;
+ break;
+ }
+ float4 _591 = fast::clamp(_481 * _589, float4(1.0), float4(15.0));
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_591.x);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_591.y);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_591.z);
+ spvTessLevel[gl_PrimitiveID].insideTessellationFactor = half(_591.w);
+ patchOut.out_var_PN_POSITION9 = _450 + ((_450 - (((temp_var_hullMainRetVal[2u].WorldPosition[0] + temp_var_hullMainRetVal[1u].WorldPosition[0]) + temp_var_hullMainRetVal[0u].WorldPosition[0]) * float4(0.3333333432674407958984375))) * float4(0.5));
+ }
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/hs-input-array-access.asm.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/hs-input-array-access.asm.tesc
new file mode 100644
index 00000000000..2ec930609f9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/hs-input-array-access.asm.tesc
@@ -0,0 +1,467 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct FVertexFactoryInterpolantsVSToPS
+{
+ float4 TangentToWorld0;
+ float4 TangentToWorld2;
+};
+
+struct FVertexFactoryInterpolantsVSToDS
+{
+ FVertexFactoryInterpolantsVSToPS InterpolantsVSToPS;
+};
+
+struct FHitProxyVSToDS
+{
+ FVertexFactoryInterpolantsVSToDS FactoryInterpolants;
+ float4 Position;
+ uint VertexID;
+};
+
+struct FHullShaderConstantDominantVertexData
+{
+ float2 UV;
+ float4 Normal;
+ float3 Tangent;
+};
+
+struct FHullShaderConstantDominantEdgeData
+{
+ float2 UV0;
+ float2 UV1;
+ float4 Normal0;
+ float4 Normal1;
+ float3 Tangent0;
+ float3 Tangent1;
+};
+
+struct FPNTessellationHSToDS
+{
+ FHitProxyVSToDS PassSpecificData;
+ spvUnsafeArray<float4, 3> WorldPosition;
+ float3 DisplacementScale;
+ float TessellationMultiplier;
+ float WorldDisplacementMultiplier;
+ FHullShaderConstantDominantVertexData DominantVertex;
+ FHullShaderConstantDominantEdgeData DominantEdge;
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_ClipToWorld;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_908;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_924;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_940;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_956;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_972;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_1020;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_1036;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_1052;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1068;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1724;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1740;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1756;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2076;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2148;
+ float PrePadding_View_2152;
+ float PrePadding_View_2156;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2228;
+ float PrePadding_View_2232;
+ float PrePadding_View_2236;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2268;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2412;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ float View_AtmosphericFogSunDiscHalfApexAngleRadian;
+ float PrePadding_View_2492;
+ float4 View_AtmosphericFogSunDiscLuminance;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ uint PrePadding_View_2520;
+ uint PrePadding_View_2524;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2584;
+ float PrePadding_View_2588;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2744;
+ float PrePadding_View_2748;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float PrePadding_View_2908;
+ int2 View_CursorPosition;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ float PrePadding_View_2924;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2940;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2956;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2972;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2988;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_3004;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_Primitive
+{
+ float4x4 Primitive_LocalToWorld;
+ float4 Primitive_InvNonUniformScaleAndDeterminantSign;
+ float4 Primitive_ObjectWorldPositionAndRadius;
+ float4x4 Primitive_WorldToLocal;
+ float4x4 Primitive_PreviousLocalToWorld;
+ float4x4 Primitive_PreviousWorldToLocal;
+ packed_float3 Primitive_ActorWorldPosition;
+ float Primitive_UseSingleSampleShadowFromStationaryLights;
+ packed_float3 Primitive_ObjectBounds;
+ float Primitive_LpvBiasMultiplier;
+ float Primitive_DecalReceiverMask;
+ float Primitive_PerObjectGBufferData;
+ float Primitive_UseVolumetricLightmapShadowFromStationaryLights;
+ float Primitive_DrawsVelocity;
+ float4 Primitive_ObjectOrientation;
+ float4 Primitive_NonUniformScale;
+ packed_float3 Primitive_LocalObjectBoundsMin;
+ uint Primitive_LightingChannelMask;
+ packed_float3 Primitive_LocalObjectBoundsMax;
+ uint Primitive_LightmapDataIndex;
+ packed_float3 Primitive_PreSkinnedLocalBounds;
+ int Primitive_SingleCaptureIndex;
+ uint Primitive_OutputVelocity;
+ uint PrePadding_Primitive_420;
+ uint PrePadding_Primitive_424;
+ uint PrePadding_Primitive_428;
+ float4 Primitive_CustomPrimitiveData[4];
+};
+
+constant float4 _140 = {};
+
+struct main0_out
+{
+ float3 out_var_PN_DisplacementScales;
+ float2 out_var_PN_DominantEdge;
+ float2 out_var_PN_DominantEdge1;
+ float4 out_var_PN_DominantEdge2;
+ float4 out_var_PN_DominantEdge3;
+ float3 out_var_PN_DominantEdge4;
+ float3 out_var_PN_DominantEdge5;
+ float2 out_var_PN_DominantVertex;
+ float4 out_var_PN_DominantVertex1;
+ float3 out_var_PN_DominantVertex2;
+ spvUnsafeArray<float4, 3> out_var_PN_POSITION;
+ float out_var_PN_TessellationMultiplier;
+ float out_var_PN_WorldDisplacementMultiplier;
+ float4 out_var_TEXCOORD10_centroid;
+ float4 out_var_TEXCOORD11_centroid;
+ float4 out_var_VS_To_DS_Position;
+ uint out_var_VS_To_DS_VertexID;
+};
+
+struct main0_patchOut
+{
+ float4 out_var_PN_POSITION9;
+};
+
+struct main0_in
+{
+ float4 in_var_TEXCOORD10_centroid [[attribute(0)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(1)]];
+ float4 in_var_VS_To_DS_Position [[attribute(2)]];
+ uint in_var_VS_To_DS_VertexID [[attribute(3)]];
+};
+
+kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_Primitive& Primitive [[buffer(1)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
+{
+ threadgroup FPNTessellationHSToDS temp_var_hullMainRetVal[3];
+ device main0_out* gl_out = &spvOut[gl_PrimitiveID * 3];
+ device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID];
+ if (gl_InvocationID < spvIndirectParams[0])
+ gl_in[gl_InvocationID] = in;
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+ if (gl_InvocationID >= 3)
+ return;
+ spvUnsafeArray<float4, 12> _142 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD10_centroid, gl_in[1].in_var_TEXCOORD10_centroid, gl_in[2].in_var_TEXCOORD10_centroid, gl_in[3].in_var_TEXCOORD10_centroid, gl_in[4].in_var_TEXCOORD10_centroid, gl_in[5].in_var_TEXCOORD10_centroid, gl_in[6].in_var_TEXCOORD10_centroid, gl_in[7].in_var_TEXCOORD10_centroid, gl_in[8].in_var_TEXCOORD10_centroid, gl_in[9].in_var_TEXCOORD10_centroid, gl_in[10].in_var_TEXCOORD10_centroid, gl_in[11].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 12> _143 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD11_centroid, gl_in[1].in_var_TEXCOORD11_centroid, gl_in[2].in_var_TEXCOORD11_centroid, gl_in[3].in_var_TEXCOORD11_centroid, gl_in[4].in_var_TEXCOORD11_centroid, gl_in[5].in_var_TEXCOORD11_centroid, gl_in[6].in_var_TEXCOORD11_centroid, gl_in[7].in_var_TEXCOORD11_centroid, gl_in[8].in_var_TEXCOORD11_centroid, gl_in[9].in_var_TEXCOORD11_centroid, gl_in[10].in_var_TEXCOORD11_centroid, gl_in[11].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<float4, 12> _192 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_VS_To_DS_Position, gl_in[1].in_var_VS_To_DS_Position, gl_in[2].in_var_VS_To_DS_Position, gl_in[3].in_var_VS_To_DS_Position, gl_in[4].in_var_VS_To_DS_Position, gl_in[5].in_var_VS_To_DS_Position, gl_in[6].in_var_VS_To_DS_Position, gl_in[7].in_var_VS_To_DS_Position, gl_in[8].in_var_VS_To_DS_Position, gl_in[9].in_var_VS_To_DS_Position, gl_in[10].in_var_VS_To_DS_Position, gl_in[11].in_var_VS_To_DS_Position });
+ spvUnsafeArray<uint, 12> _193 = spvUnsafeArray<uint, 12>({ gl_in[0].in_var_VS_To_DS_VertexID, gl_in[1].in_var_VS_To_DS_VertexID, gl_in[2].in_var_VS_To_DS_VertexID, gl_in[3].in_var_VS_To_DS_VertexID, gl_in[4].in_var_VS_To_DS_VertexID, gl_in[5].in_var_VS_To_DS_VertexID, gl_in[6].in_var_VS_To_DS_VertexID, gl_in[7].in_var_VS_To_DS_VertexID, gl_in[8].in_var_VS_To_DS_VertexID, gl_in[9].in_var_VS_To_DS_VertexID, gl_in[10].in_var_VS_To_DS_VertexID, gl_in[11].in_var_VS_To_DS_VertexID });
+ spvUnsafeArray<FHitProxyVSToDS, 12> _230 = spvUnsafeArray<FHitProxyVSToDS, 12>({ FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[0], _143[0] } }, _192[0], _193[0] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[1], _143[1] } }, _192[1], _193[1] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[2], _143[2] } }, _192[2], _193[2] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[3], _143[3] } }, _192[3], _193[3] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[4], _143[4] } }, _192[4], _193[4] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[5], _143[5] } }, _192[5], _193[5] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[6], _143[6] } }, _192[6], _193[6] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[7], _143[7] } }, _192[7], _193[7] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[8], _143[8] } }, _192[8], _193[8] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[9], _143[9] } }, _192[9], _193[9] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[10], _143[10] } }, _192[10], _193[10] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[11], _143[11] } }, _192[11], _193[11] } });
+ spvUnsafeArray<FHitProxyVSToDS, 12> param_var_I;
+ param_var_I = _230;
+ float4 _247 = float4(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float3 _251 = Primitive.Primitive_NonUniformScale.xyz * float3x3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz, cross(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz) * float3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.w), param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz);
+ uint _254 = (gl_InvocationID < 2u) ? (gl_InvocationID + 1u) : 0u;
+ uint _255 = 2u * gl_InvocationID;
+ uint _256 = 3u + _255;
+ uint _257 = _255 + 4u;
+ uint _264 = (_254 < 2u) ? (_254 + 1u) : 0u;
+ uint _265 = 2u * _254;
+ uint _266 = 3u + _265;
+ uint _267 = _265 + 4u;
+ float4 _279 = float4(param_var_I[9u + gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float4 _315;
+ float4 _316;
+ float4 _317;
+ float4 _318;
+ if ((param_var_I[_266].VertexID < param_var_I[_254].VertexID) || ((param_var_I[_266].VertexID == param_var_I[_254].VertexID) && (param_var_I[_267].VertexID < param_var_I[_264].VertexID)))
+ {
+ _315 = param_var_I[_267].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ _316 = param_var_I[_267].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ _317 = param_var_I[_266].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ _318 = param_var_I[_266].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ }
+ else
+ {
+ _315 = param_var_I[_264].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ _316 = param_var_I[_264].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ _317 = param_var_I[_254].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ _318 = param_var_I[_254].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ }
+ float4 _324 = float4(_318.xyz, 0.0);
+ float4 _328 = float4(_316.xyz, 0.0);
+ float4 _336 = float4(param_var_I[_254].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float4 _344 = float4(param_var_I[_256].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float4 _352 = float4(param_var_I[_257].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ spvUnsafeArray<float4, 3> _402 = spvUnsafeArray<float4, 3>({ param_var_I[gl_InvocationID].Position, (((((float4(2.0) * param_var_I[gl_InvocationID].Position) + param_var_I[_254].Position) - (float4(dot(param_var_I[_254].Position - param_var_I[gl_InvocationID].Position, _247)) * _247)) * float4(0.3333333432674407958984375)) + ((((float4(2.0) * param_var_I[_256].Position) + param_var_I[_257].Position) - (float4(dot(param_var_I[_257].Position - param_var_I[_256].Position, _344)) * _344)) * float4(0.3333333432674407958984375))) * float4(0.5), (((((float4(2.0) * param_var_I[_254].Position) + param_var_I[gl_InvocationID].Position) - (float4(dot(param_var_I[gl_InvocationID].Position - param_var_I[_254].Position, _336)) * _336)) * float4(0.3333333432674407958984375)) + ((((float4(2.0) * param_var_I[_257].Position) + param_var_I[_256].Position) - (float4(dot(param_var_I[_256].Position - param_var_I[_257].Position, _352)) * _352)) * float4(0.3333333432674407958984375))) * float4(0.5) });
+ gl_out[gl_InvocationID].out_var_TEXCOORD10_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ gl_out[gl_InvocationID].out_var_TEXCOORD11_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ gl_out[gl_InvocationID].out_var_VS_To_DS_Position = param_var_I[gl_InvocationID].Position;
+ gl_out[gl_InvocationID].out_var_VS_To_DS_VertexID = param_var_I[gl_InvocationID].VertexID;
+ gl_out[gl_InvocationID].out_var_PN_POSITION = _402;
+ gl_out[gl_InvocationID].out_var_PN_DisplacementScales = _251;
+ gl_out[gl_InvocationID].out_var_PN_TessellationMultiplier = 1.0;
+ gl_out[gl_InvocationID].out_var_PN_WorldDisplacementMultiplier = 1.0;
+ gl_out[gl_InvocationID].out_var_PN_DominantVertex = float2(0.0);
+ gl_out[gl_InvocationID].out_var_PN_DominantVertex1 = _279;
+ gl_out[gl_InvocationID].out_var_PN_DominantVertex2 = param_var_I[9u + gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz;
+ gl_out[gl_InvocationID].out_var_PN_DominantEdge = float2(0.0);
+ gl_out[gl_InvocationID].out_var_PN_DominantEdge1 = float2(0.0);
+ gl_out[gl_InvocationID].out_var_PN_DominantEdge2 = _324;
+ gl_out[gl_InvocationID].out_var_PN_DominantEdge3 = _328;
+ gl_out[gl_InvocationID].out_var_PN_DominantEdge4 = _317.xyz;
+ gl_out[gl_InvocationID].out_var_PN_DominantEdge5 = _315.xyz;
+ temp_var_hullMainRetVal[gl_InvocationID] = FPNTessellationHSToDS{ param_var_I[gl_InvocationID], _402, _251, 1.0, 1.0, FHullShaderConstantDominantVertexData{ float2(0.0), _279, param_var_I[9u + gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz }, FHullShaderConstantDominantEdgeData{ float2(0.0), float2(0.0), _324, _328, _317.xyz, _315.xyz } };
+ threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup);
+ if (gl_InvocationID == 0u)
+ {
+ float4 _461 = (((((temp_var_hullMainRetVal[0u].WorldPosition[1] + temp_var_hullMainRetVal[0u].WorldPosition[2]) + temp_var_hullMainRetVal[1u].WorldPosition[1]) + temp_var_hullMainRetVal[1u].WorldPosition[2]) + temp_var_hullMainRetVal[2u].WorldPosition[1]) + temp_var_hullMainRetVal[2u].WorldPosition[2]) * float4(0.16666667163372039794921875);
+ float4 _474 = _140;
+ _474.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _480 = _474;
+ _480.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ float4 _485 = _480;
+ _485.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ float4 _492 = _485;
+ _492.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _600;
+ for (;;)
+ {
+ float4 _500 = View.View_ViewToClip * float4(0.0);
+ float4 _505 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[0u].WorldPosition[0].xyz, 1.0);
+ float3 _506 = _505.xyz;
+ float3 _507 = _500.xyz;
+ float _509 = _505.w;
+ float _510 = _500.w;
+ float4 _527 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[1u].WorldPosition[0].xyz, 1.0);
+ float3 _528 = _527.xyz;
+ float _530 = _527.w;
+ float4 _548 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[2u].WorldPosition[0].xyz, 1.0);
+ float3 _549 = _548.xyz;
+ float _551 = _548.w;
+ if (any((((select(int3(0), int3(1), (_506 - _507) < float3(_509 + _510)) + (int3(2) * select(int3(0), int3(1), (_506 + _507) > float3((-_509) - _510)))) | (select(int3(0), int3(1), (_528 - _507) < float3(_530 + _510)) + (int3(2) * select(int3(0), int3(1), (_528 + _507) > float3((-_530) - _510))))) | (select(int3(0), int3(1), (_549 - _507) < float3(_551 + _510)) + (int3(2) * select(int3(0), int3(1), (_549 + _507) > float3((-_551) - _510))))) != int3(3)))
+ {
+ _600 = float4(0.0);
+ break;
+ }
+ float3 _569 = temp_var_hullMainRetVal[0u].WorldPosition[0].xyz - temp_var_hullMainRetVal[1u].WorldPosition[0].xyz;
+ float3 _570 = temp_var_hullMainRetVal[1u].WorldPosition[0].xyz - temp_var_hullMainRetVal[2u].WorldPosition[0].xyz;
+ float3 _571 = temp_var_hullMainRetVal[2u].WorldPosition[0].xyz - temp_var_hullMainRetVal[0u].WorldPosition[0].xyz;
+ float3 _574 = (float3(0.5) * (temp_var_hullMainRetVal[0u].WorldPosition[0].xyz + temp_var_hullMainRetVal[1u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float3 _577 = (float3(0.5) * (temp_var_hullMainRetVal[1u].WorldPosition[0].xyz + temp_var_hullMainRetVal[2u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float3 _580 = (float3(0.5) * (temp_var_hullMainRetVal[2u].WorldPosition[0].xyz + temp_var_hullMainRetVal[0u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float _584 = sqrt(dot(_570, _570) / dot(_577, _577));
+ float _588 = sqrt(dot(_571, _571) / dot(_580, _580));
+ float _592 = sqrt(dot(_569, _569) / dot(_574, _574));
+ float4 _597 = float4(_584, _588, _592, 1.0);
+ _597.w = 0.333000004291534423828125 * ((_584 + _588) + _592);
+ _600 = float4(View.View_AdaptiveTessellationFactor) * _597;
+ break;
+ }
+ float4 _602 = fast::clamp(_492 * _600, float4(1.0), float4(15.0));
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_602.x);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_602.y);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_602.z);
+ spvTessLevel[gl_PrimitiveID].insideTessellationFactor = half(_602.w);
+ patchOut.out_var_PN_POSITION9 = _461 + ((_461 - (((temp_var_hullMainRetVal[2u].WorldPosition[0] + temp_var_hullMainRetVal[1u].WorldPosition[0]) + temp_var_hullMainRetVal[0u].WorldPosition[0]) * float4(0.3333333432674407958984375))) * float4(0.5));
+ }
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/hs-texcoord-array.asm.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/hs-texcoord-array.asm.tesc
new file mode 100644
index 00000000000..833122cde54
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/hs-texcoord-array.asm.tesc
@@ -0,0 +1,411 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct FVertexFactoryInterpolantsVSToPS
+{
+ float4 TangentToWorld0;
+ float4 TangentToWorld2;
+ float4 Color;
+ spvUnsafeArray<float2, 2> TexCoords;
+};
+
+struct FVertexFactoryInterpolantsVSToDS
+{
+ FVertexFactoryInterpolantsVSToPS InterpolantsVSToPS;
+};
+
+struct FHitProxyVSToDS
+{
+ FVertexFactoryInterpolantsVSToDS FactoryInterpolants;
+ float4 Position;
+};
+
+struct FPNTessellationHSToDS
+{
+ FHitProxyVSToDS PassSpecificData;
+ spvUnsafeArray<float4, 3> WorldPosition;
+ float3 DisplacementScale;
+ float TessellationMultiplier;
+ float WorldDisplacementMultiplier;
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_ClipToWorld;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_908;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_924;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_940;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_956;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_972;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_1020;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_1036;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_1052;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1068;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1724;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1740;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1756;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2076;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2148;
+ float PrePadding_View_2152;
+ float PrePadding_View_2156;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2228;
+ float PrePadding_View_2232;
+ float PrePadding_View_2236;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2268;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2412;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ float View_AtmosphericFogSunDiscHalfApexAngleRadian;
+ float PrePadding_View_2492;
+ float4 View_AtmosphericFogSunDiscLuminance;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ uint PrePadding_View_2520;
+ uint PrePadding_View_2524;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2584;
+ float PrePadding_View_2588;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2744;
+ float PrePadding_View_2748;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float PrePadding_View_2908;
+ int2 View_CursorPosition;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ float PrePadding_View_2924;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2940;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2956;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2972;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2988;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_3004;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_Primitive
+{
+ float4x4 Primitive_LocalToWorld;
+ float4 Primitive_InvNonUniformScaleAndDeterminantSign;
+ float4 Primitive_ObjectWorldPositionAndRadius;
+ float4x4 Primitive_WorldToLocal;
+ float4x4 Primitive_PreviousLocalToWorld;
+ float4x4 Primitive_PreviousWorldToLocal;
+ packed_float3 Primitive_ActorWorldPosition;
+ float Primitive_UseSingleSampleShadowFromStationaryLights;
+ packed_float3 Primitive_ObjectBounds;
+ float Primitive_LpvBiasMultiplier;
+ float Primitive_DecalReceiverMask;
+ float Primitive_PerObjectGBufferData;
+ float Primitive_UseVolumetricLightmapShadowFromStationaryLights;
+ float Primitive_DrawsVelocity;
+ float4 Primitive_ObjectOrientation;
+ float4 Primitive_NonUniformScale;
+ packed_float3 Primitive_LocalObjectBoundsMin;
+ uint Primitive_LightingChannelMask;
+ packed_float3 Primitive_LocalObjectBoundsMax;
+ uint Primitive_LightmapDataIndex;
+ packed_float3 Primitive_PreSkinnedLocalBounds;
+ int Primitive_SingleCaptureIndex;
+ uint Primitive_OutputVelocity;
+ uint PrePadding_Primitive_420;
+ uint PrePadding_Primitive_424;
+ uint PrePadding_Primitive_428;
+ float4 Primitive_CustomPrimitiveData[4];
+};
+
+constant float4 _127 = {};
+
+struct main0_out
+{
+ float4 out_var_COLOR0;
+ float3 out_var_PN_DisplacementScales;
+ spvUnsafeArray<float4, 3> out_var_PN_POSITION;
+ float out_var_PN_TessellationMultiplier;
+ float out_var_PN_WorldDisplacementMultiplier;
+ spvUnsafeArray<float2, 2> out_var_TEXCOORD0;
+ float4 out_var_TEXCOORD10_centroid;
+ float4 out_var_TEXCOORD11_centroid;
+ float4 out_var_VS_To_DS_Position;
+};
+
+struct main0_patchOut
+{
+ float4 out_var_PN_POSITION9;
+};
+
+struct main0_in
+{
+ float4 in_var_TEXCOORD10_centroid [[attribute(0)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(1)]];
+ float4 in_var_COLOR0 [[attribute(2)]];
+ float2 in_var_TEXCOORD0_0 [[attribute(3)]];
+ float2 in_var_TEXCOORD0_1 [[attribute(4)]];
+ float4 in_var_VS_To_DS_Position [[attribute(5)]];
+};
+
+kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_Primitive& Primitive [[buffer(1)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
+{
+ threadgroup FPNTessellationHSToDS temp_var_hullMainRetVal[3];
+ device main0_out* gl_out = &spvOut[gl_PrimitiveID * 3];
+ device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID];
+ if (gl_InvocationID < spvIndirectParams[0])
+ gl_in[gl_InvocationID] = in;
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+ if (gl_InvocationID >= 3)
+ return;
+ spvUnsafeArray<float4, 12> _129 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD10_centroid, gl_in[1].in_var_TEXCOORD10_centroid, gl_in[2].in_var_TEXCOORD10_centroid, gl_in[3].in_var_TEXCOORD10_centroid, gl_in[4].in_var_TEXCOORD10_centroid, gl_in[5].in_var_TEXCOORD10_centroid, gl_in[6].in_var_TEXCOORD10_centroid, gl_in[7].in_var_TEXCOORD10_centroid, gl_in[8].in_var_TEXCOORD10_centroid, gl_in[9].in_var_TEXCOORD10_centroid, gl_in[10].in_var_TEXCOORD10_centroid, gl_in[11].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 12> _130 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD11_centroid, gl_in[1].in_var_TEXCOORD11_centroid, gl_in[2].in_var_TEXCOORD11_centroid, gl_in[3].in_var_TEXCOORD11_centroid, gl_in[4].in_var_TEXCOORD11_centroid, gl_in[5].in_var_TEXCOORD11_centroid, gl_in[6].in_var_TEXCOORD11_centroid, gl_in[7].in_var_TEXCOORD11_centroid, gl_in[8].in_var_TEXCOORD11_centroid, gl_in[9].in_var_TEXCOORD11_centroid, gl_in[10].in_var_TEXCOORD11_centroid, gl_in[11].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<float4, 12> _131 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_COLOR0, gl_in[1].in_var_COLOR0, gl_in[2].in_var_COLOR0, gl_in[3].in_var_COLOR0, gl_in[4].in_var_COLOR0, gl_in[5].in_var_COLOR0, gl_in[6].in_var_COLOR0, gl_in[7].in_var_COLOR0, gl_in[8].in_var_COLOR0, gl_in[9].in_var_COLOR0, gl_in[10].in_var_COLOR0, gl_in[11].in_var_COLOR0 });
+ spvUnsafeArray<spvUnsafeArray<float2, 2>, 12> _132 = spvUnsafeArray<spvUnsafeArray<float2, 2>, 12>({ spvUnsafeArray<float2, 2>({ gl_in[0].in_var_TEXCOORD0_0, gl_in[0].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[1].in_var_TEXCOORD0_0, gl_in[1].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[2].in_var_TEXCOORD0_0, gl_in[2].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[3].in_var_TEXCOORD0_0, gl_in[3].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[4].in_var_TEXCOORD0_0, gl_in[4].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[5].in_var_TEXCOORD0_0, gl_in[5].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[6].in_var_TEXCOORD0_0, gl_in[6].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[7].in_var_TEXCOORD0_0, gl_in[7].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[8].in_var_TEXCOORD0_0, gl_in[8].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[9].in_var_TEXCOORD0_0, gl_in[9].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[10].in_var_TEXCOORD0_0, gl_in[10].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[11].in_var_TEXCOORD0_0, gl_in[11].in_var_TEXCOORD0_1 }) });
+ spvUnsafeArray<float4, 12> _205 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_VS_To_DS_Position, gl_in[1].in_var_VS_To_DS_Position, gl_in[2].in_var_VS_To_DS_Position, gl_in[3].in_var_VS_To_DS_Position, gl_in[4].in_var_VS_To_DS_Position, gl_in[5].in_var_VS_To_DS_Position, gl_in[6].in_var_VS_To_DS_Position, gl_in[7].in_var_VS_To_DS_Position, gl_in[8].in_var_VS_To_DS_Position, gl_in[9].in_var_VS_To_DS_Position, gl_in[10].in_var_VS_To_DS_Position, gl_in[11].in_var_VS_To_DS_Position });
+ spvUnsafeArray<FHitProxyVSToDS, 12> _230 = spvUnsafeArray<FHitProxyVSToDS, 12>({ FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[0], _130[0], _131[0], _132[0] } }, _205[0] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[1], _130[1], _131[1], _132[1] } }, _205[1] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[2], _130[2], _131[2], _132[2] } }, _205[2] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[3], _130[3], _131[3], _132[3] } }, _205[3] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[4], _130[4], _131[4], _132[4] } }, _205[4] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[5], _130[5], _131[5], _132[5] } }, _205[5] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[6], _130[6], _131[6], _132[6] } }, _205[6] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[7], _130[7], _131[7], _132[7] } }, _205[7] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[8], _130[8], _131[8], _132[8] } }, _205[8] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[9], _130[9], _131[9], _132[9] } }, _205[9] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[10], _130[10], _131[10], _132[10] } }, _205[10] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[11], _130[11], _131[11], _132[11] } }, _205[11] } });
+ spvUnsafeArray<FHitProxyVSToDS, 12> param_var_I;
+ param_var_I = _230;
+ float4 _247 = float4(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float3 _251 = Primitive.Primitive_NonUniformScale.xyz * float3x3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz, cross(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz) * float3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.w), param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz);
+ uint _254 = (gl_InvocationID < 2u) ? (gl_InvocationID + 1u) : 0u;
+ uint _255 = 2u * gl_InvocationID;
+ uint _256 = 3u + _255;
+ uint _257 = _255 + 4u;
+ float4 _269 = float4(param_var_I[_254].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float4 _277 = float4(param_var_I[_256].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ float4 _285 = float4(param_var_I[_257].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0);
+ spvUnsafeArray<float4, 3> _333 = spvUnsafeArray<float4, 3>({ param_var_I[gl_InvocationID].Position, (((((float4(2.0) * param_var_I[gl_InvocationID].Position) + param_var_I[_254].Position) - (float4(dot(param_var_I[_254].Position - param_var_I[gl_InvocationID].Position, _247)) * _247)) * float4(0.3333333432674407958984375)) + ((((float4(2.0) * param_var_I[_256].Position) + param_var_I[_257].Position) - (float4(dot(param_var_I[_257].Position - param_var_I[_256].Position, _277)) * _277)) * float4(0.3333333432674407958984375))) * float4(0.5), (((((float4(2.0) * param_var_I[_254].Position) + param_var_I[gl_InvocationID].Position) - (float4(dot(param_var_I[gl_InvocationID].Position - param_var_I[_254].Position, _269)) * _269)) * float4(0.3333333432674407958984375)) + ((((float4(2.0) * param_var_I[_257].Position) + param_var_I[_256].Position) - (float4(dot(param_var_I[_256].Position - param_var_I[_257].Position, _285)) * _285)) * float4(0.3333333432674407958984375))) * float4(0.5) });
+ gl_out[gl_InvocationID].out_var_TEXCOORD10_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ gl_out[gl_InvocationID].out_var_TEXCOORD11_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ gl_out[gl_InvocationID].out_var_COLOR0 = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.Color;
+ gl_out[gl_InvocationID].out_var_TEXCOORD0 = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TexCoords;
+ gl_out[gl_InvocationID].out_var_VS_To_DS_Position = param_var_I[gl_InvocationID].Position;
+ gl_out[gl_InvocationID].out_var_PN_POSITION = _333;
+ gl_out[gl_InvocationID].out_var_PN_DisplacementScales = _251;
+ gl_out[gl_InvocationID].out_var_PN_TessellationMultiplier = 1.0;
+ gl_out[gl_InvocationID].out_var_PN_WorldDisplacementMultiplier = 1.0;
+ temp_var_hullMainRetVal[gl_InvocationID] = FPNTessellationHSToDS{ param_var_I[gl_InvocationID], _333, _251, 1.0, 1.0 };
+ threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup);
+ if (gl_InvocationID == 0u)
+ {
+ float4 _385 = (((((temp_var_hullMainRetVal[0u].WorldPosition[1] + temp_var_hullMainRetVal[0u].WorldPosition[2]) + temp_var_hullMainRetVal[1u].WorldPosition[1]) + temp_var_hullMainRetVal[1u].WorldPosition[2]) + temp_var_hullMainRetVal[2u].WorldPosition[1]) + temp_var_hullMainRetVal[2u].WorldPosition[2]) * float4(0.16666667163372039794921875);
+ float4 _398 = _127;
+ _398.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _404 = _398;
+ _404.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ float4 _409 = _404;
+ _409.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ float4 _416 = _409;
+ _416.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _524;
+ for (;;)
+ {
+ float4 _424 = View.View_ViewToClip * float4(0.0);
+ float4 _429 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[0u].WorldPosition[0].xyz, 1.0);
+ float3 _430 = _429.xyz;
+ float3 _431 = _424.xyz;
+ float _433 = _429.w;
+ float _434 = _424.w;
+ float4 _451 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[1u].WorldPosition[0].xyz, 1.0);
+ float3 _452 = _451.xyz;
+ float _454 = _451.w;
+ float4 _472 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[2u].WorldPosition[0].xyz, 1.0);
+ float3 _473 = _472.xyz;
+ float _475 = _472.w;
+ if (any((((select(int3(0), int3(1), (_430 - _431) < float3(_433 + _434)) + (int3(2) * select(int3(0), int3(1), (_430 + _431) > float3((-_433) - _434)))) | (select(int3(0), int3(1), (_452 - _431) < float3(_454 + _434)) + (int3(2) * select(int3(0), int3(1), (_452 + _431) > float3((-_454) - _434))))) | (select(int3(0), int3(1), (_473 - _431) < float3(_475 + _434)) + (int3(2) * select(int3(0), int3(1), (_473 + _431) > float3((-_475) - _434))))) != int3(3)))
+ {
+ _524 = float4(0.0);
+ break;
+ }
+ float3 _493 = temp_var_hullMainRetVal[0u].WorldPosition[0].xyz - temp_var_hullMainRetVal[1u].WorldPosition[0].xyz;
+ float3 _494 = temp_var_hullMainRetVal[1u].WorldPosition[0].xyz - temp_var_hullMainRetVal[2u].WorldPosition[0].xyz;
+ float3 _495 = temp_var_hullMainRetVal[2u].WorldPosition[0].xyz - temp_var_hullMainRetVal[0u].WorldPosition[0].xyz;
+ float3 _498 = (float3(0.5) * (temp_var_hullMainRetVal[0u].WorldPosition[0].xyz + temp_var_hullMainRetVal[1u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float3 _501 = (float3(0.5) * (temp_var_hullMainRetVal[1u].WorldPosition[0].xyz + temp_var_hullMainRetVal[2u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float3 _504 = (float3(0.5) * (temp_var_hullMainRetVal[2u].WorldPosition[0].xyz + temp_var_hullMainRetVal[0u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin);
+ float _508 = sqrt(dot(_494, _494) / dot(_501, _501));
+ float _512 = sqrt(dot(_495, _495) / dot(_504, _504));
+ float _516 = sqrt(dot(_493, _493) / dot(_498, _498));
+ float4 _521 = float4(_508, _512, _516, 1.0);
+ _521.w = 0.333000004291534423828125 * ((_508 + _512) + _516);
+ _524 = float4(View.View_AdaptiveTessellationFactor) * _521;
+ break;
+ }
+ float4 _526 = fast::clamp(_416 * _524, float4(1.0), float4(15.0));
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_526.x);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_526.y);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_526.z);
+ spvTessLevel[gl_PrimitiveID].insideTessellationFactor = half(_526.w);
+ patchOut.out_var_PN_POSITION9 = _385 + ((_385 - (((temp_var_hullMainRetVal[2u].WorldPosition[0] + temp_var_hullMainRetVal[1u].WorldPosition[0]) + temp_var_hullMainRetVal[0u].WorldPosition[0]) * float4(0.3333333432674407958984375))) * float4(0.5));
+ }
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.asm.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.asm.tesc
new file mode 100644
index 00000000000..04f5a1d384d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.asm.tesc
@@ -0,0 +1,178 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct FVertexFactoryInterpolantsVSToPS
+{
+ float4 TangentToWorld0;
+ float4 TangentToWorld2;
+};
+
+struct FVertexFactoryInterpolantsVSToDS
+{
+ FVertexFactoryInterpolantsVSToPS InterpolantsVSToPS;
+};
+
+struct FSharedBasePassInterpolants
+{
+};
+struct FBasePassInterpolantsVSToDS
+{
+ FSharedBasePassInterpolants _m0;
+};
+
+struct FBasePassVSToDS
+{
+ FVertexFactoryInterpolantsVSToDS FactoryInterpolants;
+ FBasePassInterpolantsVSToDS BasePassInterpolants;
+ float4 Position;
+};
+
+struct FFlatTessellationHSToDS
+{
+ FBasePassVSToDS PassSpecificData;
+ float3 DisplacementScale;
+ float TessellationMultiplier;
+ float WorldDisplacementMultiplier;
+};
+
+struct type_Primitive
+{
+ float4x4 Primitive_LocalToWorld;
+ float4 Primitive_InvNonUniformScaleAndDeterminantSign;
+ float4 Primitive_ObjectWorldPositionAndRadius;
+ float4x4 Primitive_WorldToLocal;
+ float4x4 Primitive_PreviousLocalToWorld;
+ float4x4 Primitive_PreviousWorldToLocal;
+ packed_float3 Primitive_ActorWorldPosition;
+ float Primitive_UseSingleSampleShadowFromStationaryLights;
+ packed_float3 Primitive_ObjectBounds;
+ float Primitive_LpvBiasMultiplier;
+ float Primitive_DecalReceiverMask;
+ float Primitive_PerObjectGBufferData;
+ float Primitive_UseVolumetricLightmapShadowFromStationaryLights;
+ float Primitive_DrawsVelocity;
+ float4 Primitive_ObjectOrientation;
+ float4 Primitive_NonUniformScale;
+ packed_float3 Primitive_LocalObjectBoundsMin;
+ uint Primitive_LightingChannelMask;
+ packed_float3 Primitive_LocalObjectBoundsMax;
+ uint Primitive_LightmapDataIndex;
+ packed_float3 Primitive_PreSkinnedLocalBounds;
+ int Primitive_SingleCaptureIndex;
+ uint Primitive_OutputVelocity;
+ uint PrePadding_Primitive_420;
+ uint PrePadding_Primitive_424;
+ uint PrePadding_Primitive_428;
+ float4 Primitive_CustomPrimitiveData[4];
+};
+
+struct type_Material
+{
+ float4 Material_VectorExpressions[3];
+ float4 Material_ScalarExpressions[1];
+};
+
+constant float4 _88 = {};
+
+struct main0_out
+{
+ float3 out_var_Flat_DisplacementScales;
+ float out_var_Flat_TessellationMultiplier;
+ float out_var_Flat_WorldDisplacementMultiplier;
+ float4 out_var_TEXCOORD10_centroid;
+ float4 out_var_TEXCOORD11_centroid;
+ float4 out_var_VS_To_DS_Position;
+};
+
+struct main0_in
+{
+ float4 in_var_TEXCOORD10_centroid [[attribute(0)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(1)]];
+ float4 in_var_VS_To_DS_Position [[attribute(2)]];
+};
+
+kernel void main0(main0_in in [[stage_in]], constant type_Primitive& Primitive [[buffer(0)]], constant type_Material& Material [[buffer(1)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
+{
+ threadgroup FFlatTessellationHSToDS temp_var_hullMainRetVal[3];
+ device main0_out* gl_out = &spvOut[gl_PrimitiveID * 3];
+ if (gl_InvocationID < spvIndirectParams[0])
+ gl_in[gl_InvocationID] = in;
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+ if (gl_InvocationID >= 3)
+ return;
+ spvUnsafeArray<float4, 3> _90 = spvUnsafeArray<float4, 3>({ gl_in[0].in_var_TEXCOORD10_centroid, gl_in[1].in_var_TEXCOORD10_centroid, gl_in[2].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 3> _91 = spvUnsafeArray<float4, 3>({ gl_in[0].in_var_TEXCOORD11_centroid, gl_in[1].in_var_TEXCOORD11_centroid, gl_in[2].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<float4, 3> _104 = spvUnsafeArray<float4, 3>({ gl_in[0].in_var_VS_To_DS_Position, gl_in[1].in_var_VS_To_DS_Position, gl_in[2].in_var_VS_To_DS_Position });
+ spvUnsafeArray<FBasePassVSToDS, 3> _111 = spvUnsafeArray<FBasePassVSToDS, 3>({ FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _90[0], _91[0] } }, FBasePassInterpolantsVSToDS{ { } }, _104[0] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _90[1], _91[1] } }, FBasePassInterpolantsVSToDS{ { } }, _104[1] }, FBasePassVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _90[2], _91[2] } }, FBasePassInterpolantsVSToDS{ { } }, _104[2] } });
+ spvUnsafeArray<FBasePassVSToDS, 3> param_var_I;
+ param_var_I = _111;
+ float3 _128 = Primitive.Primitive_NonUniformScale.xyz * float3x3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz, cross(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz) * float3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.w), param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz);
+ gl_out[gl_InvocationID].out_var_TEXCOORD10_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0;
+ gl_out[gl_InvocationID].out_var_TEXCOORD11_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2;
+ gl_out[gl_InvocationID].out_var_VS_To_DS_Position = param_var_I[gl_InvocationID].Position;
+ gl_out[gl_InvocationID].out_var_Flat_DisplacementScales = _128;
+ gl_out[gl_InvocationID].out_var_Flat_TessellationMultiplier = Material.Material_ScalarExpressions[0].x;
+ gl_out[gl_InvocationID].out_var_Flat_WorldDisplacementMultiplier = 1.0;
+ temp_var_hullMainRetVal[gl_InvocationID] = FFlatTessellationHSToDS{ param_var_I[gl_InvocationID], _128, Material.Material_ScalarExpressions[0].x, 1.0 };
+ threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup);
+ if (gl_InvocationID == 0u)
+ {
+ float4 _154 = _88;
+ _154.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _160 = _154;
+ _160.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ float4 _165 = _160;
+ _165.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ float4 _172 = _165;
+ _172.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _173 = fast::clamp(_172, float4(1.0), float4(15.0));
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_173.x);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_173.y);
+ spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_173.z);
+ spvTessLevel[gl_PrimitiveID].insideTessellationFactor = half(_173.w);
+ }
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese
new file mode 100644
index 00000000000..b2e5eccac26
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese
@@ -0,0 +1,420 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_ClipToWorld;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_908;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_924;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_940;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_956;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_972;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_1020;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_1036;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_1052;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1068;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1724;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1740;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1756;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2076;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2148;
+ float PrePadding_View_2152;
+ float PrePadding_View_2156;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2228;
+ float PrePadding_View_2232;
+ float PrePadding_View_2236;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2268;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2412;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ float View_AtmosphericFogSunDiscHalfApexAngleRadian;
+ float PrePadding_View_2492;
+ float4 View_AtmosphericFogSunDiscLuminance;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ uint PrePadding_View_2520;
+ uint PrePadding_View_2524;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2584;
+ float PrePadding_View_2588;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2744;
+ float PrePadding_View_2748;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float PrePadding_View_2908;
+ int2 View_CursorPosition;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ float PrePadding_View_2924;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2940;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2956;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2972;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2988;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_3004;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_ShadowDepthPass
+{
+ float PrePadding_ShadowDepthPass_LPV_0;
+ float PrePadding_ShadowDepthPass_LPV_4;
+ float PrePadding_ShadowDepthPass_LPV_8;
+ float PrePadding_ShadowDepthPass_LPV_12;
+ float PrePadding_ShadowDepthPass_LPV_16;
+ float PrePadding_ShadowDepthPass_LPV_20;
+ float PrePadding_ShadowDepthPass_LPV_24;
+ float PrePadding_ShadowDepthPass_LPV_28;
+ float PrePadding_ShadowDepthPass_LPV_32;
+ float PrePadding_ShadowDepthPass_LPV_36;
+ float PrePadding_ShadowDepthPass_LPV_40;
+ float PrePadding_ShadowDepthPass_LPV_44;
+ float PrePadding_ShadowDepthPass_LPV_48;
+ float PrePadding_ShadowDepthPass_LPV_52;
+ float PrePadding_ShadowDepthPass_LPV_56;
+ float PrePadding_ShadowDepthPass_LPV_60;
+ float PrePadding_ShadowDepthPass_LPV_64;
+ float PrePadding_ShadowDepthPass_LPV_68;
+ float PrePadding_ShadowDepthPass_LPV_72;
+ float PrePadding_ShadowDepthPass_LPV_76;
+ float PrePadding_ShadowDepthPass_LPV_80;
+ float PrePadding_ShadowDepthPass_LPV_84;
+ float PrePadding_ShadowDepthPass_LPV_88;
+ float PrePadding_ShadowDepthPass_LPV_92;
+ float PrePadding_ShadowDepthPass_LPV_96;
+ float PrePadding_ShadowDepthPass_LPV_100;
+ float PrePadding_ShadowDepthPass_LPV_104;
+ float PrePadding_ShadowDepthPass_LPV_108;
+ float PrePadding_ShadowDepthPass_LPV_112;
+ float PrePadding_ShadowDepthPass_LPV_116;
+ float PrePadding_ShadowDepthPass_LPV_120;
+ float PrePadding_ShadowDepthPass_LPV_124;
+ float PrePadding_ShadowDepthPass_LPV_128;
+ float PrePadding_ShadowDepthPass_LPV_132;
+ float PrePadding_ShadowDepthPass_LPV_136;
+ float PrePadding_ShadowDepthPass_LPV_140;
+ float PrePadding_ShadowDepthPass_LPV_144;
+ float PrePadding_ShadowDepthPass_LPV_148;
+ float PrePadding_ShadowDepthPass_LPV_152;
+ float PrePadding_ShadowDepthPass_LPV_156;
+ float PrePadding_ShadowDepthPass_LPV_160;
+ float PrePadding_ShadowDepthPass_LPV_164;
+ float PrePadding_ShadowDepthPass_LPV_168;
+ float PrePadding_ShadowDepthPass_LPV_172;
+ float PrePadding_ShadowDepthPass_LPV_176;
+ float PrePadding_ShadowDepthPass_LPV_180;
+ float PrePadding_ShadowDepthPass_LPV_184;
+ float PrePadding_ShadowDepthPass_LPV_188;
+ float PrePadding_ShadowDepthPass_LPV_192;
+ float PrePadding_ShadowDepthPass_LPV_196;
+ float PrePadding_ShadowDepthPass_LPV_200;
+ float PrePadding_ShadowDepthPass_LPV_204;
+ float PrePadding_ShadowDepthPass_LPV_208;
+ float PrePadding_ShadowDepthPass_LPV_212;
+ float PrePadding_ShadowDepthPass_LPV_216;
+ float PrePadding_ShadowDepthPass_LPV_220;
+ float PrePadding_ShadowDepthPass_LPV_224;
+ float PrePadding_ShadowDepthPass_LPV_228;
+ float PrePadding_ShadowDepthPass_LPV_232;
+ float PrePadding_ShadowDepthPass_LPV_236;
+ float PrePadding_ShadowDepthPass_LPV_240;
+ float PrePadding_ShadowDepthPass_LPV_244;
+ float PrePadding_ShadowDepthPass_LPV_248;
+ float PrePadding_ShadowDepthPass_LPV_252;
+ float PrePadding_ShadowDepthPass_LPV_256;
+ float PrePadding_ShadowDepthPass_LPV_260;
+ float PrePadding_ShadowDepthPass_LPV_264;
+ float PrePadding_ShadowDepthPass_LPV_268;
+ float4x4 ShadowDepthPass_LPV_mRsmToWorld;
+ float4 ShadowDepthPass_LPV_mLightColour;
+ float4 ShadowDepthPass_LPV_GeometryVolumeCaptureLightDirection;
+ float4 ShadowDepthPass_LPV_mEyePos;
+ packed_int3 ShadowDepthPass_LPV_mOldGridOffset;
+ int PrePadding_ShadowDepthPass_LPV_396;
+ packed_int3 ShadowDepthPass_LPV_mLpvGridOffset;
+ float ShadowDepthPass_LPV_ClearMultiplier;
+ float ShadowDepthPass_LPV_LpvScale;
+ float ShadowDepthPass_LPV_OneOverLpvScale;
+ float ShadowDepthPass_LPV_DirectionalOcclusionIntensity;
+ float ShadowDepthPass_LPV_DirectionalOcclusionRadius;
+ float ShadowDepthPass_LPV_RsmAreaIntensityMultiplier;
+ float ShadowDepthPass_LPV_RsmPixelToTexcoordMultiplier;
+ float ShadowDepthPass_LPV_SecondaryOcclusionStrength;
+ float ShadowDepthPass_LPV_SecondaryBounceStrength;
+ float ShadowDepthPass_LPV_VplInjectionBias;
+ float ShadowDepthPass_LPV_GeometryVolumeInjectionBias;
+ float ShadowDepthPass_LPV_EmissiveInjectionMultiplier;
+ int ShadowDepthPass_LPV_PropagationIndex;
+ float4x4 ShadowDepthPass_ProjectionMatrix;
+ float4x4 ShadowDepthPass_ViewMatrix;
+ float4 ShadowDepthPass_ShadowParams;
+ float ShadowDepthPass_bClampToNearPlane;
+ float PrePadding_ShadowDepthPass_612;
+ float PrePadding_ShadowDepthPass_616;
+ float PrePadding_ShadowDepthPass_620;
+ float4x4 ShadowDepthPass_ShadowViewProjectionMatrices[6];
+ float4x4 ShadowDepthPass_ShadowViewMatrices[6];
+};
+
+constant float4 _113 = {};
+
+struct main0_out
+{
+ float4 out_var_TEXCOORD10_centroid [[user(locn0)]];
+ float4 out_var_TEXCOORD11_centroid [[user(locn1)]];
+ float4 out_var_COLOR0 [[user(locn2)]];
+ float4 out_var_TEXCOORD0_0 [[user(locn3)]];
+ uint out_var_PRIMITIVE_ID [[user(locn4)]];
+ float out_var_TEXCOORD6 [[user(locn5)]];
+ float out_var_TEXCOORD8 [[user(locn6)]];
+ float3 out_var_TEXCOORD7 [[user(locn7)]];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 in_var_COLOR0 [[attribute(0)]];
+ float4 in_var_PN_POSITION_0 [[attribute(2)]];
+ float4 in_var_PN_POSITION_1 [[attribute(3)]];
+ float4 in_var_PN_POSITION_2 [[attribute(4)]];
+ float in_var_PN_WorldDisplacementMultiplier [[attribute(7)]];
+ uint in_var_PRIMITIVE_ID [[attribute(8)]];
+ float4 in_var_TEXCOORD0_0 [[attribute(9)]];
+ float4 in_var_TEXCOORD10_centroid [[attribute(10)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(11)]];
+};
+
+struct main0_patchIn
+{
+ float4 in_var_PN_POSITION9 [[attribute(5)]];
+ patch_control_point<main0_in> gl_in;
+};
+
+[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], constant type_View& View [[buffer(0)]], constant type_ShadowDepthPass& ShadowDepthPass [[buffer(1)]], texture2d<float> Material_Texture2D_3 [[texture(0)]], sampler Material_Texture2D_3Sampler [[sampler(0)]], float3 gl_TessCoord [[position_in_patch]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 1> out_var_TEXCOORD0 = {};
+ spvUnsafeArray<float4, 3> _117 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD10_centroid, patchIn.gl_in[1].in_var_TEXCOORD10_centroid, patchIn.gl_in[2].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 3> _118 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD11_centroid, patchIn.gl_in[1].in_var_TEXCOORD11_centroid, patchIn.gl_in[2].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<float4, 3> _119 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_COLOR0, patchIn.gl_in[1].in_var_COLOR0, patchIn.gl_in[2].in_var_COLOR0 });
+ spvUnsafeArray<spvUnsafeArray<float4, 1>, 3> _120 = spvUnsafeArray<spvUnsafeArray<float4, 1>, 3>({ spvUnsafeArray<float4, 1>({ patchIn.gl_in[0].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ patchIn.gl_in[1].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ patchIn.gl_in[2].in_var_TEXCOORD0_0 }) });
+ spvUnsafeArray<spvUnsafeArray<float4, 3>, 3> _135 = spvUnsafeArray<spvUnsafeArray<float4, 3>, 3>({ spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_POSITION_0, patchIn.gl_in[0].in_var_PN_POSITION_1, patchIn.gl_in[0].in_var_PN_POSITION_2 }), spvUnsafeArray<float4, 3>({ patchIn.gl_in[1].in_var_PN_POSITION_0, patchIn.gl_in[1].in_var_PN_POSITION_1, patchIn.gl_in[1].in_var_PN_POSITION_2 }), spvUnsafeArray<float4, 3>({ patchIn.gl_in[2].in_var_PN_POSITION_0, patchIn.gl_in[2].in_var_PN_POSITION_1, patchIn.gl_in[2].in_var_PN_POSITION_2 }) });
+ spvUnsafeArray<float, 3> _136 = spvUnsafeArray<float, 3>({ patchIn.gl_in[0].in_var_PN_WorldDisplacementMultiplier, patchIn.gl_in[1].in_var_PN_WorldDisplacementMultiplier, patchIn.gl_in[2].in_var_PN_WorldDisplacementMultiplier });
+ float _157 = gl_TessCoord.x * gl_TessCoord.x;
+ float _158 = gl_TessCoord.y * gl_TessCoord.y;
+ float _159 = gl_TessCoord.z * gl_TessCoord.z;
+ float4 _165 = float4(gl_TessCoord.x);
+ float4 _169 = float4(gl_TessCoord.y);
+ float4 _174 = float4(gl_TessCoord.z);
+ float4 _177 = float4(_157 * 3.0);
+ float4 _181 = float4(_158 * 3.0);
+ float4 _188 = float4(_159 * 3.0);
+ float4 _202 = ((((((((((_135[0][0] * float4(_157)) * _165) + ((_135[1][0] * float4(_158)) * _169)) + ((_135[2][0] * float4(_159)) * _174)) + ((_135[0][1] * _177) * _169)) + ((_135[0][2] * _181) * _165)) + ((_135[1][1] * _181) * _174)) + ((_135[1][2] * _188) * _169)) + ((_135[2][1] * _188) * _165)) + ((_135[2][2] * _177) * _174)) + ((((patchIn.in_var_PN_POSITION9 * float4(6.0)) * _174) * _165) * _169);
+ float3 _226 = ((_117[0].xyz * float3(gl_TessCoord.x)) + (_117[1].xyz * float3(gl_TessCoord.y))).xyz + (_117[2].xyz * float3(gl_TessCoord.z));
+ float4 _229 = ((_118[0] * _165) + (_118[1] * _169)) + (_118[2] * _174);
+ float4 _231 = ((_119[0] * _165) + (_119[1] * _169)) + (_119[2] * _174);
+ float4 _233 = ((_120[0][0] * _165) + (_120[1][0] * _169)) + (_120[2][0] * _174);
+ spvUnsafeArray<float4, 1> _234 = spvUnsafeArray<float4, 1>({ _233 });
+ float3 _236 = _229.xyz;
+ float3 _264 = _202.xyz + (((float3((Material_Texture2D_3.sample(Material_Texture2D_3Sampler, (float2(View.View_GameTime * 0.20000000298023223876953125, View.View_GameTime * (-0.699999988079071044921875)) + (_233.zw * float2(1.0, 2.0))), level(-1.0)).x * 10.0) * (1.0 - _231.x)) * _236) * float3(0.5)) * float3(((_136[0] * gl_TessCoord.x) + (_136[1] * gl_TessCoord.y)) + (_136[2] * gl_TessCoord.z)));
+ float4x4 _116 = ShadowDepthPass.ShadowDepthPass_ViewMatrix;
+ float4 _270 = ShadowDepthPass.ShadowDepthPass_ProjectionMatrix * float4(_264.x, _264.y, _264.z, _202.w);
+ float4 _281;
+ if ((ShadowDepthPass.ShadowDepthPass_bClampToNearPlane > 0.0) && (_270.z < 0.0))
+ {
+ float4 _279 = _270;
+ _279.z = 9.9999999747524270787835121154785e-07;
+ float4 _280 = _279;
+ _280.w = 1.0;
+ _281 = _280;
+ }
+ else
+ {
+ _281 = _270;
+ }
+ float _290 = abs(dot(float3(_116[0u].z, _116[1u].z, _116[2u].z), _236));
+ out.out_var_TEXCOORD10_centroid = float4(_226.x, _226.y, _226.z, _113.w);
+ out.out_var_TEXCOORD11_centroid = _229;
+ out.out_var_COLOR0 = _231;
+ out_var_TEXCOORD0 = _234;
+ out.out_var_PRIMITIVE_ID = patchIn.gl_in[0u].in_var_PRIMITIVE_ID;
+ out.out_var_TEXCOORD6 = _281.z;
+ out.out_var_TEXCOORD8 = (ShadowDepthPass.ShadowDepthPass_ShadowParams.y * fast::clamp((abs(_290) > 0.0) ? (sqrt(fast::clamp(1.0 - (_290 * _290), 0.0, 1.0)) / _290) : ShadowDepthPass.ShadowDepthPass_ShadowParams.z, 0.0, ShadowDepthPass.ShadowDepthPass_ShadowParams.z)) + ShadowDepthPass.ShadowDepthPass_ShadowParams.x;
+ out.out_var_TEXCOORD7 = _264.xyz;
+ out.gl_Position = _281;
+ out.out_var_TEXCOORD0_0 = out_var_TEXCOORD0[0];
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese
new file mode 100644
index 00000000000..d8921bb8e03
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese
@@ -0,0 +1,415 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_ClipToWorld;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_908;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_924;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_940;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_956;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_972;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_1020;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_1036;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_1052;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1068;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1724;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1740;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1756;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2076;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2148;
+ float PrePadding_View_2152;
+ float PrePadding_View_2156;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2228;
+ float PrePadding_View_2232;
+ float PrePadding_View_2236;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2268;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2412;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ float View_AtmosphericFogSunDiscHalfApexAngleRadian;
+ float PrePadding_View_2492;
+ float4 View_AtmosphericFogSunDiscLuminance;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ uint PrePadding_View_2520;
+ uint PrePadding_View_2524;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2584;
+ float PrePadding_View_2588;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2744;
+ float PrePadding_View_2748;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float PrePadding_View_2908;
+ int2 View_CursorPosition;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ float PrePadding_View_2924;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2940;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2956;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2972;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2988;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_3004;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+ float PrePadding_View_3048;
+ float PrePadding_View_3052;
+ float4x4 View_WorldToVirtualTexture;
+ float4 View_VirtualTextureParams;
+ float4 View_XRPassthroughCameraUVs[2];
+};
+
+struct type_Material
+{
+ float4 Material_VectorExpressions[5];
+ float4 Material_ScalarExpressions[2];
+};
+
+constant float4 _118 = {};
+
+struct main0_out
+{
+ float4 out_var_TEXCOORD6 [[user(locn0)]];
+ float4 out_var_TEXCOORD7 [[user(locn1)]];
+ float4 out_var_TEXCOORD10_centroid [[user(locn2)]];
+ float4 out_var_TEXCOORD11_centroid [[user(locn3)]];
+ float gl_ClipDistance [[clip_distance]] [1];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 in_var_PN_DominantEdge2 [[attribute(3)]];
+ float4 in_var_PN_DominantEdge3 [[attribute(4)]];
+ float3 in_var_PN_DominantEdge4 [[attribute(5)]];
+ float3 in_var_PN_DominantEdge5 [[attribute(6)]];
+ float4 in_var_PN_DominantVertex1 [[attribute(8)]];
+ float3 in_var_PN_DominantVertex2 [[attribute(9)]];
+ float4 in_var_PN_POSITION_0 [[attribute(10)]];
+ float4 in_var_PN_POSITION_1 [[attribute(11)]];
+ float4 in_var_PN_POSITION_2 [[attribute(12)]];
+ float in_var_PN_WorldDisplacementMultiplier [[attribute(15)]];
+ float4 in_var_TEXCOORD10_centroid [[attribute(16)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(17)]];
+ float4 in_var_TEXCOORD6 [[attribute(18)]];
+ float4 in_var_TEXCOORD8 [[attribute(19)]];
+};
+
+struct main0_patchIn
+{
+ float4 in_var_PN_POSITION9 [[attribute(13)]];
+ patch_control_point<main0_in> gl_in;
+};
+
+[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], constant type_View& View [[buffer(0)]], constant type_Material& Material [[buffer(1)]], texture3d<float> View_GlobalDistanceFieldTexture0 [[texture(0)]], texture3d<float> View_GlobalDistanceFieldTexture1 [[texture(1)]], texture3d<float> View_GlobalDistanceFieldTexture2 [[texture(2)]], texture3d<float> View_GlobalDistanceFieldTexture3 [[texture(3)]], sampler View_GlobalDistanceFieldSampler0 [[sampler(0)]], float3 gl_TessCoord [[position_in_patch]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 3> _120 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD6, patchIn.gl_in[1].in_var_TEXCOORD6, patchIn.gl_in[2].in_var_TEXCOORD6 });
+ spvUnsafeArray<float4, 3> _121 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD8, patchIn.gl_in[1].in_var_TEXCOORD8, patchIn.gl_in[2].in_var_TEXCOORD8 });
+ spvUnsafeArray<float4, 3> _128 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD10_centroid, patchIn.gl_in[1].in_var_TEXCOORD10_centroid, patchIn.gl_in[2].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 3> _129 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD11_centroid, patchIn.gl_in[1].in_var_TEXCOORD11_centroid, patchIn.gl_in[2].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<spvUnsafeArray<float4, 3>, 3> _136 = spvUnsafeArray<spvUnsafeArray<float4, 3>, 3>({ spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_POSITION_0, patchIn.gl_in[0].in_var_PN_POSITION_1, patchIn.gl_in[0].in_var_PN_POSITION_2 }), spvUnsafeArray<float4, 3>({ patchIn.gl_in[1].in_var_PN_POSITION_0, patchIn.gl_in[1].in_var_PN_POSITION_1, patchIn.gl_in[1].in_var_PN_POSITION_2 }), spvUnsafeArray<float4, 3>({ patchIn.gl_in[2].in_var_PN_POSITION_0, patchIn.gl_in[2].in_var_PN_POSITION_1, patchIn.gl_in[2].in_var_PN_POSITION_2 }) });
+ spvUnsafeArray<float, 3> _137 = spvUnsafeArray<float, 3>({ patchIn.gl_in[0].in_var_PN_WorldDisplacementMultiplier, patchIn.gl_in[1].in_var_PN_WorldDisplacementMultiplier, patchIn.gl_in[2].in_var_PN_WorldDisplacementMultiplier });
+ spvUnsafeArray<float4, 3> _138 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_DominantVertex1, patchIn.gl_in[1].in_var_PN_DominantVertex1, patchIn.gl_in[2].in_var_PN_DominantVertex1 });
+ spvUnsafeArray<float3, 3> _139 = spvUnsafeArray<float3, 3>({ patchIn.gl_in[0].in_var_PN_DominantVertex2, patchIn.gl_in[1].in_var_PN_DominantVertex2, patchIn.gl_in[2].in_var_PN_DominantVertex2 });
+ spvUnsafeArray<float4, 3> _146 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_DominantEdge2, patchIn.gl_in[1].in_var_PN_DominantEdge2, patchIn.gl_in[2].in_var_PN_DominantEdge2 });
+ spvUnsafeArray<float4, 3> _147 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_DominantEdge3, patchIn.gl_in[1].in_var_PN_DominantEdge3, patchIn.gl_in[2].in_var_PN_DominantEdge3 });
+ spvUnsafeArray<float3, 3> _148 = spvUnsafeArray<float3, 3>({ patchIn.gl_in[0].in_var_PN_DominantEdge4, patchIn.gl_in[1].in_var_PN_DominantEdge4, patchIn.gl_in[2].in_var_PN_DominantEdge4 });
+ spvUnsafeArray<float3, 3> _149 = spvUnsafeArray<float3, 3>({ patchIn.gl_in[0].in_var_PN_DominantEdge5, patchIn.gl_in[1].in_var_PN_DominantEdge5, patchIn.gl_in[2].in_var_PN_DominantEdge5 });
+ float _190 = gl_TessCoord.x * gl_TessCoord.x;
+ float _191 = gl_TessCoord.y * gl_TessCoord.y;
+ float _192 = gl_TessCoord.z * gl_TessCoord.z;
+ float4 _198 = float4(gl_TessCoord.x);
+ float4 _202 = float4(gl_TessCoord.y);
+ float4 _207 = float4(gl_TessCoord.z);
+ float4 _210 = float4(_190 * 3.0);
+ float4 _214 = float4(_191 * 3.0);
+ float4 _221 = float4(_192 * 3.0);
+ float4 _235 = ((((((((((_136[0][0] * float4(_190)) * _198) + ((_136[1][0] * float4(_191)) * _202)) + ((_136[2][0] * float4(_192)) * _207)) + ((_136[0][1] * _210) * _202)) + ((_136[0][2] * _214) * _198)) + ((_136[1][1] * _214) * _207)) + ((_136[1][2] * _221) * _202)) + ((_136[2][1] * _221) * _198)) + ((_136[2][2] * _210) * _207)) + ((((patchIn.in_var_PN_POSITION9 * float4(6.0)) * _207) * _198) * _202);
+ float3 _237 = float3(gl_TessCoord.x);
+ float3 _240 = float3(gl_TessCoord.y);
+ float3 _254 = float3(gl_TessCoord.z);
+ float3 _256 = ((_128[0].xyz * _237) + (_128[1].xyz * _240)).xyz + (_128[2].xyz * _254);
+ float4 _259 = ((_129[0] * _198) + (_129[1] * _202)) + (_129[2] * _207);
+ float3 _264 = _235.xyz;
+ float3 _265 = _256.xyz;
+ float3 _266 = _259.xyz;
+ float3 _272 = _264 + float3(View.View_WorldCameraOrigin);
+ float _279 = float(int(gl_TessCoord.x == 0.0));
+ float _282 = float(int(gl_TessCoord.y == 0.0));
+ float _285 = float(int(gl_TessCoord.z == 0.0));
+ float _286 = _279 + _282;
+ float _287 = _286 + _285;
+ float4 _387;
+ float3 _388;
+ if (float(int(_287 == 2.0)) == 1.0)
+ {
+ float _363 = float(int((_282 + _285) == 2.0));
+ float _367 = float(int((_285 + _279) == 2.0));
+ float _370 = float(int(_286 == 2.0));
+ _387 = ((float4(_363) * _138[0]) + (float4(_367) * _138[1])) + (float4(_370) * _138[2]);
+ _388 = ((float3(_363) * _139[0]) + (float3(_367) * _139[1])) + (float3(_370) * _139[2]);
+ }
+ else
+ {
+ float4 _358;
+ float3 _359;
+ if (float(int(_287 == 1.0)) != 0.0)
+ {
+ float4 _304 = float4(_279);
+ float4 _306 = float4(_282);
+ float4 _309 = float4(_285);
+ float4 _311 = ((_304 * _146[0]) + (_306 * _146[1])) + (_309 * _146[2]);
+ float4 _316 = ((_304 * _147[0]) + (_306 * _147[1])) + (_309 * _147[2]);
+ float3 _331 = float3(_279);
+ float3 _333 = float3(_282);
+ float3 _336 = float3(_285);
+ float3 _338 = ((_331 * _148[0]) + (_333 * _148[1])) + (_336 * _148[2]);
+ float3 _343 = ((_331 * _149[0]) + (_333 * _149[1])) + (_336 * _149[2]);
+ _358 = ((_304 * ((_202 * _311) + (_207 * _316))) + (_306 * ((_207 * _311) + (_198 * _316)))) + (_309 * ((_198 * _311) + (_202 * _316)));
+ _359 = ((_331 * ((_240 * _338) + (_254 * _343))) + (_333 * ((_254 * _338) + (_237 * _343)))) + (_336 * ((_237 * _338) + (_240 * _343)));
+ }
+ else
+ {
+ _358 = float4(_259.xyz, 0.0);
+ _359 = _265;
+ }
+ _387 = _358;
+ _388 = _359;
+ }
+ float3x3 _398;
+ if (float(int(_287 == 0.0)) == 0.0)
+ {
+ _398 = float3x3(_388, cross(_387.xyz, _388) * float3(_387.w), _387.xyz);
+ }
+ else
+ {
+ _398 = float3x3(_265, cross(_266, _265) * float3(_259.w), _266);
+ }
+ float3 _411 = fast::min(fast::max((_272 - View.View_GlobalVolumeCenterAndExtent[0].xyz) + View.View_GlobalVolumeCenterAndExtent[0].www, float3(0.0)), fast::max((View.View_GlobalVolumeCenterAndExtent[0].xyz + View.View_GlobalVolumeCenterAndExtent[0].www) - _272, float3(0.0)));
+ float _547;
+ if (fast::min(_411.x, fast::min(_411.y, _411.z)) > (View.View_GlobalVolumeCenterAndExtent[0].w * View.View_GlobalVolumeTexelSize))
+ {
+ _547 = View_GlobalDistanceFieldTexture0.sample(View_GlobalDistanceFieldSampler0, ((_272 * View.View_GlobalVolumeWorldToUVAddAndMul[0u].www) + View.View_GlobalVolumeWorldToUVAddAndMul[0u].xyz), level(0.0)).x;
+ }
+ else
+ {
+ float3 _436 = fast::min(fast::max((_272 - View.View_GlobalVolumeCenterAndExtent[1].xyz) + View.View_GlobalVolumeCenterAndExtent[1].www, float3(0.0)), fast::max((View.View_GlobalVolumeCenterAndExtent[1].xyz + View.View_GlobalVolumeCenterAndExtent[1].www) - _272, float3(0.0)));
+ float _535;
+ if (fast::min(_436.x, fast::min(_436.y, _436.z)) > (View.View_GlobalVolumeCenterAndExtent[1].w * View.View_GlobalVolumeTexelSize))
+ {
+ _535 = View_GlobalDistanceFieldTexture1.sample(View_GlobalDistanceFieldSampler0, ((_272 * View.View_GlobalVolumeWorldToUVAddAndMul[1u].www) + View.View_GlobalVolumeWorldToUVAddAndMul[1u].xyz), level(0.0)).x;
+ }
+ else
+ {
+ float3 _459 = fast::min(fast::max((_272 - View.View_GlobalVolumeCenterAndExtent[2].xyz) + View.View_GlobalVolumeCenterAndExtent[2].www, float3(0.0)), fast::max((View.View_GlobalVolumeCenterAndExtent[2].xyz + View.View_GlobalVolumeCenterAndExtent[2].www) - _272, float3(0.0)));
+ float3 _475 = fast::min(fast::max((_272 - View.View_GlobalVolumeCenterAndExtent[3].xyz) + View.View_GlobalVolumeCenterAndExtent[3].www, float3(0.0)), fast::max((View.View_GlobalVolumeCenterAndExtent[3].xyz + View.View_GlobalVolumeCenterAndExtent[3].www) - _272, float3(0.0)));
+ float _480 = fast::min(_475.x, fast::min(_475.y, _475.z));
+ float _523;
+ if (fast::min(_459.x, fast::min(_459.y, _459.z)) > (View.View_GlobalVolumeCenterAndExtent[2].w * View.View_GlobalVolumeTexelSize))
+ {
+ _523 = View_GlobalDistanceFieldTexture2.sample(View_GlobalDistanceFieldSampler0, ((_272 * View.View_GlobalVolumeWorldToUVAddAndMul[2u].www) + View.View_GlobalVolumeWorldToUVAddAndMul[2u].xyz), level(0.0)).x;
+ }
+ else
+ {
+ float _511;
+ if (_480 > (View.View_GlobalVolumeCenterAndExtent[3].w * View.View_GlobalVolumeTexelSize))
+ {
+ _511 = mix(View.View_MaxGlobalDistance, View_GlobalDistanceFieldTexture3.sample(View_GlobalDistanceFieldSampler0, ((_272 * View.View_GlobalVolumeWorldToUVAddAndMul[3u].www) + View.View_GlobalVolumeWorldToUVAddAndMul[3u].xyz), level(0.0)).x, fast::clamp((_480 * 10.0) * View.View_GlobalVolumeWorldToUVAddAndMul[3].w, 0.0, 1.0));
+ }
+ else
+ {
+ _511 = View.View_MaxGlobalDistance;
+ }
+ _523 = _511;
+ }
+ _535 = _523;
+ }
+ _547 = _535;
+ }
+ float3 _565 = _264 + ((_398[2] * float3(fast::min(_547 + Material.Material_ScalarExpressions[0].z, 0.0) * Material.Material_ScalarExpressions[0].w)) * float3(((_137[0] * gl_TessCoord.x) + (_137[1] * gl_TessCoord.y)) + (_137[2] * gl_TessCoord.z)));
+ float4 _574 = View.View_TranslatedWorldToClip * float4(_565.x, _565.y, _565.z, _235.w);
+ float4 _579 = _574;
+ _579.z = _574.z + (0.001000000047497451305389404296875 * _574.w);
+ out.gl_Position = _579;
+ out.out_var_TEXCOORD6 = ((_120[0] * _198) + (_120[1] * _202)) + (_120[2] * _207);
+ out.out_var_TEXCOORD7 = ((_121[0] * _198) + (_121[1] * _202)) + (_121[2] * _207);
+ out.out_var_TEXCOORD10_centroid = float4(_256.x, _256.y, _256.z, _118.w);
+ out.out_var_TEXCOORD11_centroid = _259;
+ out.gl_ClipDistance[0u] = dot(View.View_GlobalClippingPlane, float4(_565.xyz - float3(View.View_PreViewTranslation), 1.0));
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese
new file mode 100644
index 00000000000..d0b6fbdd9a2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese
@@ -0,0 +1,217 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_ShadowDepthPass
+{
+ float PrePadding_ShadowDepthPass_LPV_0;
+ float PrePadding_ShadowDepthPass_LPV_4;
+ float PrePadding_ShadowDepthPass_LPV_8;
+ float PrePadding_ShadowDepthPass_LPV_12;
+ float PrePadding_ShadowDepthPass_LPV_16;
+ float PrePadding_ShadowDepthPass_LPV_20;
+ float PrePadding_ShadowDepthPass_LPV_24;
+ float PrePadding_ShadowDepthPass_LPV_28;
+ float PrePadding_ShadowDepthPass_LPV_32;
+ float PrePadding_ShadowDepthPass_LPV_36;
+ float PrePadding_ShadowDepthPass_LPV_40;
+ float PrePadding_ShadowDepthPass_LPV_44;
+ float PrePadding_ShadowDepthPass_LPV_48;
+ float PrePadding_ShadowDepthPass_LPV_52;
+ float PrePadding_ShadowDepthPass_LPV_56;
+ float PrePadding_ShadowDepthPass_LPV_60;
+ float PrePadding_ShadowDepthPass_LPV_64;
+ float PrePadding_ShadowDepthPass_LPV_68;
+ float PrePadding_ShadowDepthPass_LPV_72;
+ float PrePadding_ShadowDepthPass_LPV_76;
+ float PrePadding_ShadowDepthPass_LPV_80;
+ float PrePadding_ShadowDepthPass_LPV_84;
+ float PrePadding_ShadowDepthPass_LPV_88;
+ float PrePadding_ShadowDepthPass_LPV_92;
+ float PrePadding_ShadowDepthPass_LPV_96;
+ float PrePadding_ShadowDepthPass_LPV_100;
+ float PrePadding_ShadowDepthPass_LPV_104;
+ float PrePadding_ShadowDepthPass_LPV_108;
+ float PrePadding_ShadowDepthPass_LPV_112;
+ float PrePadding_ShadowDepthPass_LPV_116;
+ float PrePadding_ShadowDepthPass_LPV_120;
+ float PrePadding_ShadowDepthPass_LPV_124;
+ float PrePadding_ShadowDepthPass_LPV_128;
+ float PrePadding_ShadowDepthPass_LPV_132;
+ float PrePadding_ShadowDepthPass_LPV_136;
+ float PrePadding_ShadowDepthPass_LPV_140;
+ float PrePadding_ShadowDepthPass_LPV_144;
+ float PrePadding_ShadowDepthPass_LPV_148;
+ float PrePadding_ShadowDepthPass_LPV_152;
+ float PrePadding_ShadowDepthPass_LPV_156;
+ float PrePadding_ShadowDepthPass_LPV_160;
+ float PrePadding_ShadowDepthPass_LPV_164;
+ float PrePadding_ShadowDepthPass_LPV_168;
+ float PrePadding_ShadowDepthPass_LPV_172;
+ float PrePadding_ShadowDepthPass_LPV_176;
+ float PrePadding_ShadowDepthPass_LPV_180;
+ float PrePadding_ShadowDepthPass_LPV_184;
+ float PrePadding_ShadowDepthPass_LPV_188;
+ float PrePadding_ShadowDepthPass_LPV_192;
+ float PrePadding_ShadowDepthPass_LPV_196;
+ float PrePadding_ShadowDepthPass_LPV_200;
+ float PrePadding_ShadowDepthPass_LPV_204;
+ float PrePadding_ShadowDepthPass_LPV_208;
+ float PrePadding_ShadowDepthPass_LPV_212;
+ float PrePadding_ShadowDepthPass_LPV_216;
+ float PrePadding_ShadowDepthPass_LPV_220;
+ float PrePadding_ShadowDepthPass_LPV_224;
+ float PrePadding_ShadowDepthPass_LPV_228;
+ float PrePadding_ShadowDepthPass_LPV_232;
+ float PrePadding_ShadowDepthPass_LPV_236;
+ float PrePadding_ShadowDepthPass_LPV_240;
+ float PrePadding_ShadowDepthPass_LPV_244;
+ float PrePadding_ShadowDepthPass_LPV_248;
+ float PrePadding_ShadowDepthPass_LPV_252;
+ float PrePadding_ShadowDepthPass_LPV_256;
+ float PrePadding_ShadowDepthPass_LPV_260;
+ float PrePadding_ShadowDepthPass_LPV_264;
+ float PrePadding_ShadowDepthPass_LPV_268;
+ float4x4 ShadowDepthPass_LPV_mRsmToWorld;
+ float4 ShadowDepthPass_LPV_mLightColour;
+ float4 ShadowDepthPass_LPV_GeometryVolumeCaptureLightDirection;
+ float4 ShadowDepthPass_LPV_mEyePos;
+ packed_int3 ShadowDepthPass_LPV_mOldGridOffset;
+ int PrePadding_ShadowDepthPass_LPV_396;
+ packed_int3 ShadowDepthPass_LPV_mLpvGridOffset;
+ float ShadowDepthPass_LPV_ClearMultiplier;
+ float ShadowDepthPass_LPV_LpvScale;
+ float ShadowDepthPass_LPV_OneOverLpvScale;
+ float ShadowDepthPass_LPV_DirectionalOcclusionIntensity;
+ float ShadowDepthPass_LPV_DirectionalOcclusionRadius;
+ float ShadowDepthPass_LPV_RsmAreaIntensityMultiplier;
+ float ShadowDepthPass_LPV_RsmPixelToTexcoordMultiplier;
+ float ShadowDepthPass_LPV_SecondaryOcclusionStrength;
+ float ShadowDepthPass_LPV_SecondaryBounceStrength;
+ float ShadowDepthPass_LPV_VplInjectionBias;
+ float ShadowDepthPass_LPV_GeometryVolumeInjectionBias;
+ float ShadowDepthPass_LPV_EmissiveInjectionMultiplier;
+ int ShadowDepthPass_LPV_PropagationIndex;
+ float4x4 ShadowDepthPass_ProjectionMatrix;
+ float4x4 ShadowDepthPass_ViewMatrix;
+ float4 ShadowDepthPass_ShadowParams;
+ float ShadowDepthPass_bClampToNearPlane;
+ float PrePadding_ShadowDepthPass_612;
+ float PrePadding_ShadowDepthPass_616;
+ float PrePadding_ShadowDepthPass_620;
+ float4x4 ShadowDepthPass_ShadowViewProjectionMatrices[6];
+ float4x4 ShadowDepthPass_ShadowViewMatrices[6];
+};
+
+constant float4 _90 = {};
+
+struct main0_out
+{
+ float4 out_var_TEXCOORD10_centroid [[user(locn0)]];
+ float4 out_var_TEXCOORD11_centroid [[user(locn1)]];
+ float out_var_TEXCOORD6 [[user(locn2)]];
+ float3 out_var_TEXCOORD7 [[user(locn3)]];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 in_var_PN_POSITION_0 [[attribute(10)]];
+ float4 in_var_PN_POSITION_1 [[attribute(11)]];
+ float4 in_var_PN_POSITION_2 [[attribute(12)]];
+ float4 in_var_TEXCOORD10_centroid [[attribute(16)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(17)]];
+};
+
+struct main0_patchIn
+{
+ float4 in_var_PN_POSITION9 [[attribute(13)]];
+ patch_control_point<main0_in> gl_in;
+};
+
+[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], constant type_ShadowDepthPass& ShadowDepthPass [[buffer(0)]], float3 gl_TessCoord [[position_in_patch]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 3> _93 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD10_centroid, patchIn.gl_in[1].in_var_TEXCOORD10_centroid, patchIn.gl_in[2].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 3> _94 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD11_centroid, patchIn.gl_in[1].in_var_TEXCOORD11_centroid, patchIn.gl_in[2].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<spvUnsafeArray<float4, 3>, 3> _101 = spvUnsafeArray<spvUnsafeArray<float4, 3>, 3>({ spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_POSITION_0, patchIn.gl_in[0].in_var_PN_POSITION_1, patchIn.gl_in[0].in_var_PN_POSITION_2 }), spvUnsafeArray<float4, 3>({ patchIn.gl_in[1].in_var_PN_POSITION_0, patchIn.gl_in[1].in_var_PN_POSITION_1, patchIn.gl_in[1].in_var_PN_POSITION_2 }), spvUnsafeArray<float4, 3>({ patchIn.gl_in[2].in_var_PN_POSITION_0, patchIn.gl_in[2].in_var_PN_POSITION_1, patchIn.gl_in[2].in_var_PN_POSITION_2 }) });
+ float _119 = gl_TessCoord.x * gl_TessCoord.x;
+ float _120 = gl_TessCoord.y * gl_TessCoord.y;
+ float _121 = gl_TessCoord.z * gl_TessCoord.z;
+ float4 _127 = float4(gl_TessCoord.x);
+ float4 _131 = float4(gl_TessCoord.y);
+ float4 _136 = float4(gl_TessCoord.z);
+ float4 _139 = float4(_119 * 3.0);
+ float4 _143 = float4(_120 * 3.0);
+ float4 _150 = float4(_121 * 3.0);
+ float4 _164 = ((((((((((_101[0][0] * float4(_119)) * _127) + ((_101[1][0] * float4(_120)) * _131)) + ((_101[2][0] * float4(_121)) * _136)) + ((_101[0][1] * _139) * _131)) + ((_101[0][2] * _143) * _127)) + ((_101[1][1] * _143) * _136)) + ((_101[1][2] * _150) * _131)) + ((_101[2][1] * _150) * _127)) + ((_101[2][2] * _139) * _136)) + ((((patchIn.in_var_PN_POSITION9 * float4(6.0)) * _136) * _127) * _131);
+ float3 _179 = ((_93[0].xyz * float3(gl_TessCoord.x)) + (_93[1].xyz * float3(gl_TessCoord.y))).xyz + (_93[2].xyz * float3(gl_TessCoord.z));
+ float4 _182 = ((_94[0] * _127) + (_94[1] * _131)) + (_94[2] * _136);
+ float4x4 _92 = ShadowDepthPass.ShadowDepthPass_ViewMatrix;
+ float4 _189 = ShadowDepthPass.ShadowDepthPass_ProjectionMatrix * float4(_164.x, _164.y, _164.z, _164.w);
+ float4 _200;
+ if ((ShadowDepthPass.ShadowDepthPass_bClampToNearPlane > 0.0) && (_189.z < 0.0))
+ {
+ float4 _198 = _189;
+ _198.z = 9.9999999747524270787835121154785e-07;
+ float4 _199 = _198;
+ _199.w = 1.0;
+ _200 = _199;
+ }
+ else
+ {
+ _200 = _189;
+ }
+ float _209 = abs(dot(float3(_92[0u].z, _92[1u].z, _92[2u].z), _182.xyz));
+ float4 _234 = _200;
+ _234.z = ((_200.z * ShadowDepthPass.ShadowDepthPass_ShadowParams.w) + ((ShadowDepthPass.ShadowDepthPass_ShadowParams.y * fast::clamp((abs(_209) > 0.0) ? (sqrt(fast::clamp(1.0 - (_209 * _209), 0.0, 1.0)) / _209) : ShadowDepthPass.ShadowDepthPass_ShadowParams.z, 0.0, ShadowDepthPass.ShadowDepthPass_ShadowParams.z)) + ShadowDepthPass.ShadowDepthPass_ShadowParams.x)) * _200.w;
+ out.out_var_TEXCOORD10_centroid = float4(_179.x, _179.y, _179.z, _90.w);
+ out.out_var_TEXCOORD11_centroid = _182;
+ out.out_var_TEXCOORD6 = 0.0;
+ out.out_var_TEXCOORD7 = _164.xyz;
+ out.gl_Position = _234;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-texcoord-array.asm.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-texcoord-array.asm.tese
new file mode 100644
index 00000000000..346d7e3fc95
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-texcoord-array.asm.tese
@@ -0,0 +1,318 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_ClipToWorld;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_908;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_924;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_940;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_956;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_972;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_1020;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_1036;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_1052;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1068;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1724;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1740;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1756;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2076;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2148;
+ float PrePadding_View_2152;
+ float PrePadding_View_2156;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2228;
+ float PrePadding_View_2232;
+ float PrePadding_View_2236;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2268;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2412;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ float View_AtmosphericFogSunDiscHalfApexAngleRadian;
+ float PrePadding_View_2492;
+ float4 View_AtmosphericFogSunDiscLuminance;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ uint PrePadding_View_2520;
+ uint PrePadding_View_2524;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2584;
+ float PrePadding_View_2588;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2744;
+ float PrePadding_View_2748;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float PrePadding_View_2908;
+ int2 View_CursorPosition;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ float PrePadding_View_2924;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2940;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2956;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2972;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2988;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_3004;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+ float PrePadding_View_3048;
+ float PrePadding_View_3052;
+ float4x4 View_WorldToVirtualTexture;
+ float4 View_VirtualTextureParams;
+ float4 View_XRPassthroughCameraUVs[2];
+};
+
+constant float4 _68 = {};
+
+struct main0_out
+{
+ float4 out_var_TEXCOORD10_centroid [[user(locn0)]];
+ float4 out_var_TEXCOORD11_centroid [[user(locn1)]];
+ float4 out_var_TEXCOORD0_0 [[user(locn2)]];
+ float4 out_var_COLOR1 [[user(locn3)]];
+ float4 out_var_COLOR2 [[user(locn4)]];
+ float4 out_var_TEXCOORD6 [[user(locn5)]];
+ float3 out_var_TEXCOORD7 [[user(locn6)]];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 in_var_COLOR1 [[attribute(0)]];
+ float4 in_var_COLOR2 [[attribute(1)]];
+ float4 in_var_TEXCOORD0_0 [[attribute(5)]];
+ float4 in_var_TEXCOORD10_centroid [[attribute(6)]];
+ float4 in_var_TEXCOORD11_centroid [[attribute(7)]];
+ float3 in_var_TEXCOORD7 [[attribute(8)]];
+ float4 in_var_VS_To_DS_Position [[attribute(9)]];
+};
+
+struct main0_patchIn
+{
+ patch_control_point<main0_in> gl_in;
+};
+
+[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], constant type_View& View [[buffer(0)]], float3 gl_TessCoord [[position_in_patch]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 1> out_var_TEXCOORD0 = {};
+ spvUnsafeArray<float4, 3> _77 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD10_centroid, patchIn.gl_in[1].in_var_TEXCOORD10_centroid, patchIn.gl_in[2].in_var_TEXCOORD10_centroid });
+ spvUnsafeArray<float4, 3> _78 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD11_centroid, patchIn.gl_in[1].in_var_TEXCOORD11_centroid, patchIn.gl_in[2].in_var_TEXCOORD11_centroid });
+ spvUnsafeArray<spvUnsafeArray<float4, 1>, 3> _79 = spvUnsafeArray<spvUnsafeArray<float4, 1>, 3>({ spvUnsafeArray<float4, 1>({ patchIn.gl_in[0].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ patchIn.gl_in[1].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ patchIn.gl_in[2].in_var_TEXCOORD0_0 }) });
+ spvUnsafeArray<float4, 3> _80 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_COLOR1, patchIn.gl_in[1].in_var_COLOR1, patchIn.gl_in[2].in_var_COLOR1 });
+ spvUnsafeArray<float4, 3> _81 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_COLOR2, patchIn.gl_in[1].in_var_COLOR2, patchIn.gl_in[2].in_var_COLOR2 });
+ spvUnsafeArray<float4, 3> _97 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_VS_To_DS_Position, patchIn.gl_in[1].in_var_VS_To_DS_Position, patchIn.gl_in[2].in_var_VS_To_DS_Position });
+ spvUnsafeArray<float3, 3> _98 = spvUnsafeArray<float3, 3>({ patchIn.gl_in[0].in_var_TEXCOORD7, patchIn.gl_in[1].in_var_TEXCOORD7, patchIn.gl_in[2].in_var_TEXCOORD7 });
+ float4 _111 = float4(gl_TessCoord.x);
+ float4 _113 = float4(gl_TessCoord.y);
+ float4 _116 = float4(gl_TessCoord.z);
+ float4 _118 = ((_97[0] * _111) + (_97[1] * _113)) + (_97[2] * _116);
+ spvUnsafeArray<float4, 1> _72;
+ _72 = _79[0];
+ spvUnsafeArray<float4, 1> _71;
+ _71 = _79[1];
+ float3 _120 = float3(gl_TessCoord.x);
+ float3 _123 = float3(gl_TessCoord.y);
+ spvUnsafeArray<float4, 1> _73;
+ for (int _133 = 0; _133 < 1; )
+ {
+ _73[_133] = (_72[_133] * _111) + (_71[_133] * _113);
+ _133++;
+ continue;
+ }
+ spvUnsafeArray<float4, 1> _75;
+ _75 = _73;
+ spvUnsafeArray<float4, 1> _74;
+ _74 = _79[2];
+ float3 _155 = float3(gl_TessCoord.z);
+ float3 _157 = ((_77[0].xyz * _120) + (_77[1].xyz * _123)).xyz + (_77[2].xyz * _155);
+ spvUnsafeArray<float4, 1> _76;
+ for (int _164 = 0; _164 < 1; )
+ {
+ _76[_164] = _75[_164] + (_74[_164] * _116);
+ _164++;
+ continue;
+ }
+ float4 _181 = float4(_118.x, _118.y, _118.z, _118.w);
+ out.out_var_TEXCOORD10_centroid = float4(_157.x, _157.y, _157.z, _68.w);
+ out.out_var_TEXCOORD11_centroid = ((_78[0] * _111) + (_78[1] * _113)) + (_78[2] * _116);
+ out_var_TEXCOORD0 = _76;
+ out.out_var_COLOR1 = ((_80[0] * _111) + (_80[1] * _113)) + (_80[2] * _116);
+ out.out_var_COLOR2 = ((_81[0] * _111) + (_81[1] * _113)) + (_81[2] * _116);
+ out.out_var_TEXCOORD6 = _181;
+ out.out_var_TEXCOORD7 = ((_98[0] * _120) + (_98[1] * _123)) + (_98[2] * _155);
+ out.gl_Position = View.View_TranslatedWorldToClip * _181;
+ out.out_var_TEXCOORD0_0 = out_var_TEXCOORD0[0];
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/vert/array-missing-copies.asm.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/vert/array-missing-copies.asm.vert
new file mode 100644
index 00000000000..3d3e0e51f57
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/vert/array-missing-copies.asm.vert
@@ -0,0 +1,466 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_844;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_860;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_876;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_892;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_908;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_956;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_972;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_988;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1004;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1660;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1676;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1692;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2012;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2084;
+ float PrePadding_View_2088;
+ float PrePadding_View_2092;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2164;
+ float PrePadding_View_2168;
+ float PrePadding_View_2172;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2204;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2348;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2488;
+ float PrePadding_View_2492;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2648;
+ float PrePadding_View_2652;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2828;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2844;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2860;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2876;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_2892;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_MobileBasePass
+{
+ float4 MobileBasePass_Fog_ExponentialFogParameters;
+ float4 MobileBasePass_Fog_ExponentialFogParameters2;
+ float4 MobileBasePass_Fog_ExponentialFogColorParameter;
+ float4 MobileBasePass_Fog_ExponentialFogParameters3;
+ float4 MobileBasePass_Fog_InscatteringLightDirection;
+ float4 MobileBasePass_Fog_DirectionalInscatteringColor;
+ float2 MobileBasePass_Fog_SinCosInscatteringColorCubemapRotation;
+ float PrePadding_MobileBasePass_Fog_104;
+ float PrePadding_MobileBasePass_Fog_108;
+ packed_float3 MobileBasePass_Fog_FogInscatteringTextureParameters;
+ float MobileBasePass_Fog_ApplyVolumetricFog;
+ float PrePadding_MobileBasePass_PlanarReflection_128;
+ float PrePadding_MobileBasePass_PlanarReflection_132;
+ float PrePadding_MobileBasePass_PlanarReflection_136;
+ float PrePadding_MobileBasePass_PlanarReflection_140;
+ float PrePadding_MobileBasePass_PlanarReflection_144;
+ float PrePadding_MobileBasePass_PlanarReflection_148;
+ float PrePadding_MobileBasePass_PlanarReflection_152;
+ float PrePadding_MobileBasePass_PlanarReflection_156;
+ float4 MobileBasePass_PlanarReflection_ReflectionPlane;
+ float4 MobileBasePass_PlanarReflection_PlanarReflectionOrigin;
+ float4 MobileBasePass_PlanarReflection_PlanarReflectionXAxis;
+ float4 MobileBasePass_PlanarReflection_PlanarReflectionYAxis;
+ float3x4 MobileBasePass_PlanarReflection_InverseTransposeMirrorMatrix;
+ packed_float3 MobileBasePass_PlanarReflection_PlanarReflectionParameters;
+ float PrePadding_MobileBasePass_PlanarReflection_284;
+ float2 MobileBasePass_PlanarReflection_PlanarReflectionParameters2;
+ float PrePadding_MobileBasePass_PlanarReflection_296;
+ float PrePadding_MobileBasePass_PlanarReflection_300;
+ float4x4 MobileBasePass_PlanarReflection_ProjectionWithExtraFOV[2];
+ float4 MobileBasePass_PlanarReflection_PlanarReflectionScreenScaleBias[2];
+ float2 MobileBasePass_PlanarReflection_PlanarReflectionScreenBound;
+ uint MobileBasePass_PlanarReflection_bIsStereo;
+};
+
+struct type_Primitive
+{
+ float4x4 Primitive_LocalToWorld;
+ float4 Primitive_InvNonUniformScaleAndDeterminantSign;
+ float4 Primitive_ObjectWorldPositionAndRadius;
+ float4x4 Primitive_WorldToLocal;
+ float4x4 Primitive_PreviousLocalToWorld;
+ float4x4 Primitive_PreviousWorldToLocal;
+ packed_float3 Primitive_ActorWorldPosition;
+ float Primitive_UseSingleSampleShadowFromStationaryLights;
+ packed_float3 Primitive_ObjectBounds;
+ float Primitive_LpvBiasMultiplier;
+ float Primitive_DecalReceiverMask;
+ float Primitive_PerObjectGBufferData;
+ float Primitive_UseVolumetricLightmapShadowFromStationaryLights;
+ float Primitive_UseEditorDepthTest;
+ float4 Primitive_ObjectOrientation;
+ float4 Primitive_NonUniformScale;
+ packed_float3 Primitive_LocalObjectBoundsMin;
+ float PrePadding_Primitive_380;
+ packed_float3 Primitive_LocalObjectBoundsMax;
+ uint Primitive_LightingChannelMask;
+ uint Primitive_LightmapDataIndex;
+ int Primitive_SingleCaptureIndex;
+};
+
+struct type_LandscapeParameters
+{
+ float4 LandscapeParameters_HeightmapUVScaleBias;
+ float4 LandscapeParameters_WeightmapUVScaleBias;
+ float4 LandscapeParameters_LandscapeLightmapScaleBias;
+ float4 LandscapeParameters_SubsectionSizeVertsLayerUVPan;
+ float4 LandscapeParameters_SubsectionOffsetParams;
+ float4 LandscapeParameters_LightmapSubsectionOffsetParams;
+ float4x4 LandscapeParameters_LocalToWorldNoScaling;
+};
+
+struct type_Globals
+{
+ float4 LodBias;
+ float4 LodValues;
+ float4 SectionLods;
+ float4 NeighborSectionLod[4];
+};
+
+struct main0_out
+{
+ float2 out_var_TEXCOORD0 [[user(locn0)]];
+ float2 out_var_TEXCOORD1 [[user(locn1)]];
+ float4 out_var_TEXCOORD2 [[user(locn2)]];
+ float4 out_var_TEXCOORD3 [[user(locn3)]];
+ float4 out_var_TEXCOORD8 [[user(locn4)]];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float4 in_var_ATTRIBUTE0 [[attribute(0)]];
+ float4 in_var_ATTRIBUTE1_0 [[attribute(1)]];
+ float4 in_var_ATTRIBUTE1_1 [[attribute(2)]];
+};
+
+vertex main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_MobileBasePass& MobileBasePass [[buffer(1)]], constant type_Primitive& Primitive [[buffer(2)]], constant type_LandscapeParameters& LandscapeParameters [[buffer(3)]], constant type_Globals& _Globals [[buffer(4)]])
+{
+ main0_out out = {};
+ spvUnsafeArray<float4, 2> in_var_ATTRIBUTE1 = {};
+ in_var_ATTRIBUTE1[0] = in.in_var_ATTRIBUTE1_0;
+ in_var_ATTRIBUTE1[1] = in.in_var_ATTRIBUTE1_1;
+ spvUnsafeArray<float4, 1> _97;
+ for (int _107 = 0; _107 < 1; )
+ {
+ _97[_107] = float4(0.0);
+ _107++;
+ continue;
+ }
+ float4 _115 = in.in_var_ATTRIBUTE0 * float4(255.0);
+ float2 _116 = _115.zw;
+ float2 _119 = fract(_116 * float2(0.5)) * float2(2.0);
+ float2 _121 = (_116 - _119) * float2(0.0039215688593685626983642578125);
+ float2 _122 = _115.xy;
+ float2 _126 = _122 * float2(_Globals.LodValues.w);
+ float _127 = _126.y;
+ float _128 = _126.x;
+ float4 _132 = float4(_127, _128, 1.0 - _128, 1.0 - _127) * float4(2.0);
+ float4 _186;
+ if (_119.y > 0.5)
+ {
+ float4 _161;
+ if (_119.x > 0.5)
+ {
+ _161 = (_132 * float4(_Globals.SectionLods.w)) + ((float4(1.0) - _132) * _Globals.NeighborSectionLod[3]);
+ }
+ else
+ {
+ _161 = (_132 * float4(_Globals.SectionLods.z)) + ((float4(1.0) - _132) * _Globals.NeighborSectionLod[2]);
+ }
+ _186 = _161;
+ }
+ else
+ {
+ float4 _185;
+ if (_119.x > 0.5)
+ {
+ _185 = (_132 * float4(_Globals.SectionLods.y)) + ((float4(1.0) - _132) * _Globals.NeighborSectionLod[1]);
+ }
+ else
+ {
+ _185 = (_132 * float4(_Globals.SectionLods.x)) + ((float4(1.0) - _132) * _Globals.NeighborSectionLod[0]);
+ }
+ _186 = _185;
+ }
+ float _206;
+ if ((_128 + _127) > 1.0)
+ {
+ float _198;
+ if (_128 < _127)
+ {
+ _198 = _186.w;
+ }
+ else
+ {
+ _198 = _186.z;
+ }
+ _206 = _198;
+ }
+ else
+ {
+ float _205;
+ if (_128 < _127)
+ {
+ _205 = _186.y;
+ }
+ else
+ {
+ _205 = _186.x;
+ }
+ _206 = _205;
+ }
+ float _207 = floor(_206);
+ float _220 = _121.x;
+ float3 _235 = select(select(select(select(select(float3(0.03125, _121.yy), float3(0.0625, _220, _121.y), bool3(_207 < 5.0)), float3(0.125, in_var_ATTRIBUTE1[1].w, _220), bool3(_207 < 4.0)), float3(0.25, in_var_ATTRIBUTE1[1].zw), bool3(_207 < 3.0)), float3(0.5, in_var_ATTRIBUTE1[1].yz), bool3(_207 < 2.0)), float3(1.0, in_var_ATTRIBUTE1[1].xy), bool3(_207 < 1.0));
+ float _236 = _235.x;
+ float _245 = (((in_var_ATTRIBUTE1[0].x * 65280.0) + (in_var_ATTRIBUTE1[0].y * 255.0)) - 32768.0) * 0.0078125;
+ float _252 = (((in_var_ATTRIBUTE1[0].z * 65280.0) + (in_var_ATTRIBUTE1[0].w * 255.0)) - 32768.0) * 0.0078125;
+ float2 _257 = floor(_122 * float2(_236));
+ float2 _271 = float2((LandscapeParameters.LandscapeParameters_SubsectionSizeVertsLayerUVPan.x * _236) - 1.0, fast::max((LandscapeParameters.LandscapeParameters_SubsectionSizeVertsLayerUVPan.x * 0.5) * _236, 2.0) - 1.0) * float2(LandscapeParameters.LandscapeParameters_SubsectionSizeVertsLayerUVPan.y);
+ float3 _287 = mix(float3(_257 / float2(_271.x), mix(_245, _252, _235.y)), float3(floor(_257 * float2(0.5)) / float2(_271.y), mix(_245, _252, _235.z)), float3(_206 - _207));
+ float2 _288 = _119.xy;
+ float2 _292 = _288 * LandscapeParameters.LandscapeParameters_SubsectionOffsetParams.ww;
+ float3 _296 = _287 + float3(_292, 0.0);
+ float4 _322 = float4((((Primitive.Primitive_LocalToWorld[0u].xyz * _296.xxx) + (Primitive.Primitive_LocalToWorld[1u].xyz * _296.yyy)) + (Primitive.Primitive_LocalToWorld[2u].xyz * _296.zzz)) + (Primitive.Primitive_LocalToWorld[3u].xyz + float3(View.View_PreViewTranslation)), 1.0);
+ float2 _323 = _287.xy;
+ float4 _338 = float4(_322.x, _322.y, _322.z, _322.w);
+ float4 _339 = View.View_TranslatedWorldToClip * _338;
+ float3 _341 = _322.xyz - float3(View.View_TranslatedWorldCameraOrigin);
+ float _345 = dot(_341, _341);
+ float _346 = rsqrt(_345);
+ float _347 = _345 * _346;
+ float _354 = _341.z;
+ float _357 = fast::max(0.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters.w);
+ float _393;
+ float _394;
+ float _395;
+ float _396;
+ if (_357 > 0.0)
+ {
+ float _361 = _357 * _346;
+ float _362 = _361 * _354;
+ float _365 = View.View_WorldCameraOrigin[2] + _362;
+ _393 = (1.0 - _361) * _347;
+ _394 = MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.z * exp2(-fast::max(-127.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.y * (_365 - MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.w)));
+ _395 = MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.x * exp2(-fast::max(-127.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters.y * (_365 - MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.y)));
+ _396 = _354 - _362;
+ }
+ else
+ {
+ _393 = _347;
+ _394 = MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.x;
+ _395 = MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters.x;
+ _396 = _354;
+ }
+ float _400 = fast::max(-127.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters.y * _396);
+ float _405 = log(2.0);
+ float _407 = 0.5 * (_405 * _405);
+ float _417 = fast::max(-127.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.y * _396);
+ float _428 = (_395 * ((abs(_400) > 0.00999999977648258209228515625) ? ((1.0 - exp2(-_400)) / _400) : (_405 - (_407 * _400)))) + (_394 * ((abs(_417) > 0.00999999977648258209228515625) ? ((1.0 - exp2(-_417)) / _417) : (_405 - (_407 * _417))));
+ float3 _459;
+ if (MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.w >= 0.0)
+ {
+ _459 = (MobileBasePass.MobileBasePass_Fog_DirectionalInscatteringColor.xyz * float3(pow(fast::clamp(dot(_341 * float3(_346), MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.xyz), 0.0, 1.0), MobileBasePass.MobileBasePass_Fog_DirectionalInscatteringColor.w))) * float3(1.0 - fast::clamp(exp2(-(_428 * fast::max(_393 - MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.w, 0.0))), 0.0, 1.0));
+ }
+ else
+ {
+ _459 = float3(0.0);
+ }
+ bool _468 = (MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.w > 0.0) && (_347 > MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.w);
+ float _471 = _468 ? 1.0 : fast::max(fast::clamp(exp2(-(_428 * _393)), 0.0, 1.0), MobileBasePass.MobileBasePass_Fog_ExponentialFogColorParameter.w);
+ _97[0] = float4((MobileBasePass.MobileBasePass_Fog_ExponentialFogColorParameter.xyz * float3(1.0 - _471)) + select(_459, float3(0.0), bool3(_468)), _471);
+ float4 _482 = _338;
+ _482.w = _339.w;
+ out.out_var_TEXCOORD0 = ((_323 + LandscapeParameters.LandscapeParameters_SubsectionSizeVertsLayerUVPan.zw) + _292).xy;
+ out.out_var_TEXCOORD1 = ((_323 * LandscapeParameters.LandscapeParameters_WeightmapUVScaleBias.xy) + LandscapeParameters.LandscapeParameters_WeightmapUVScaleBias.zw) + (_288 * LandscapeParameters.LandscapeParameters_SubsectionOffsetParams.zz);
+ out.out_var_TEXCOORD2 = float4(float4(0.0).x, float4(0.0).y, _97[0].x, _97[0].y);
+ out.out_var_TEXCOORD3 = float4(float4(0.0).x, float4(0.0).y, _97[0].z, _97[0].w);
+ out.out_var_TEXCOORD8 = _482;
+ out.gl_Position = _339;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert
new file mode 100644
index 00000000000..b1298b7e683
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert
@@ -0,0 +1,122 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+ T elements[Num ? Num : 1];
+
+ thread T& operator [] (size_t pos) thread
+ {
+ return elements[pos];
+ }
+ constexpr const thread T& operator [] (size_t pos) const thread
+ {
+ return elements[pos];
+ }
+
+ device T& operator [] (size_t pos) device
+ {
+ return elements[pos];
+ }
+ constexpr const device T& operator [] (size_t pos) const device
+ {
+ return elements[pos];
+ }
+
+ constexpr const constant T& operator [] (size_t pos) const constant
+ {
+ return elements[pos];
+ }
+
+ threadgroup T& operator [] (size_t pos) threadgroup
+ {
+ return elements[pos];
+ }
+ constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+ {
+ return elements[pos];
+ }
+};
+
+struct type_Globals
+{
+ float4 ViewportSize;
+ float ScatteringScaling;
+ float CocRadiusToCircumscribedRadius;
+};
+
+struct type_StructuredBuffer_v4float
+{
+ float4 _m0[1];
+};
+
+struct main0_out
+{
+ float2 out_var_TEXCOORD0 [[user(locn0)]];
+ float4 out_var_TEXCOORD1 [[user(locn1)]];
+ float4 out_var_TEXCOORD2 [[user(locn2)]];
+ float4 out_var_TEXCOORD3 [[user(locn3)]];
+ float4 out_var_TEXCOORD4 [[user(locn4)]];
+ float4 out_var_TEXCOORD5 [[user(locn5)]];
+ float4 out_var_TEXCOORD6 [[user(locn6)]];
+ float4 gl_Position [[position]];
+};
+
+vertex main0_out main0(constant type_Globals& _Globals [[buffer(0)]], const device type_StructuredBuffer_v4float& ScatterDrawList [[buffer(1)]], uint gl_VertexIndex [[vertex_id]], uint gl_InstanceIndex [[instance_id]])
+{
+ main0_out out = {};
+ uint _66 = gl_VertexIndex / 4u;
+ uint _68 = gl_VertexIndex - (_66 * 4u);
+ uint _70 = (16u * gl_InstanceIndex) + _66;
+ float _72;
+ _72 = 0.0;
+ spvUnsafeArray<float4, 4> _61;
+ spvUnsafeArray<float, 4> _62;
+ spvUnsafeArray<float2, 4> _63;
+ float _73;
+ uint _75 = 0u;
+ for (;;)
+ {
+ if (_75 < 4u)
+ {
+ uint _82 = ((5u * _70) + _75) + 1u;
+ _61[_75] = float4(ScatterDrawList._m0[_82].xyz, 0.0);
+ _62[_75] = ScatterDrawList._m0[_82].w;
+ if (_75 == 0u)
+ {
+ _73 = _62[_75];
+ }
+ else
+ {
+ _73 = fast::max(_72, _62[_75]);
+ }
+ _63[_75].x = (-0.5) / _62[_75];
+ _63[_75].y = (0.5 * _62[_75]) + 0.5;
+ _72 = _73;
+ _75++;
+ continue;
+ }
+ else
+ {
+ break;
+ }
+ }
+ float2 _144 = float2(_Globals.ScatteringScaling) * ScatterDrawList._m0[5u * _70].xy;
+ float2 _173 = (((float2((_72 * _Globals.CocRadiusToCircumscribedRadius) + 1.0) * ((float2(float(_68 % 2u), float(_68 / 2u)) * float2(2.0)) - float2(1.0))) + _144) + float2(0.5)) * _Globals.ViewportSize.zw;
+ out.out_var_TEXCOORD0 = _144;
+ out.out_var_TEXCOORD1 = float4(_61[0].xyz, _62[0]);
+ out.out_var_TEXCOORD2 = float4(_61[1].xyz, _62[1]);
+ out.out_var_TEXCOORD3 = float4(_61[2].xyz, _62[2]);
+ out.out_var_TEXCOORD4 = float4(_61[3].xyz, _62[3]);
+ out.out_var_TEXCOORD5 = float4(_63[0].x, _63[0].y, _63[1].x, _63[1].y);
+ out.out_var_TEXCOORD6 = float4(_63[2].x, _63[2].y, _63[3].x, _63[3].y);
+ out.gl_Position = float4((_173.x * 2.0) - 1.0, 1.0 - (_173.y * 2.0), 0.0, 1.0);
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/vert/texture-buffer.asm.vert b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/vert/texture-buffer.asm.vert
new file mode 100644
index 00000000000..6384e1b9d40
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-ue4/asm/vert/texture-buffer.asm.vert
@@ -0,0 +1,387 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct type_View
+{
+ float4x4 View_TranslatedWorldToClip;
+ float4x4 View_WorldToClip;
+ float4x4 View_TranslatedWorldToView;
+ float4x4 View_ViewToTranslatedWorld;
+ float4x4 View_TranslatedWorldToCameraView;
+ float4x4 View_CameraViewToTranslatedWorld;
+ float4x4 View_ViewToClip;
+ float4x4 View_ViewToClipNoAA;
+ float4x4 View_ClipToView;
+ float4x4 View_ClipToTranslatedWorld;
+ float4x4 View_SVPositionToTranslatedWorld;
+ float4x4 View_ScreenToWorld;
+ float4x4 View_ScreenToTranslatedWorld;
+ packed_float3 View_ViewForward;
+ float PrePadding_View_844;
+ packed_float3 View_ViewUp;
+ float PrePadding_View_860;
+ packed_float3 View_ViewRight;
+ float PrePadding_View_876;
+ packed_float3 View_HMDViewNoRollUp;
+ float PrePadding_View_892;
+ packed_float3 View_HMDViewNoRollRight;
+ float PrePadding_View_908;
+ float4 View_InvDeviceZToWorldZTransform;
+ float4 View_ScreenPositionScaleBias;
+ packed_float3 View_WorldCameraOrigin;
+ float PrePadding_View_956;
+ packed_float3 View_TranslatedWorldCameraOrigin;
+ float PrePadding_View_972;
+ packed_float3 View_WorldViewOrigin;
+ float PrePadding_View_988;
+ packed_float3 View_PreViewTranslation;
+ float PrePadding_View_1004;
+ float4x4 View_PrevProjection;
+ float4x4 View_PrevViewProj;
+ float4x4 View_PrevViewRotationProj;
+ float4x4 View_PrevViewToClip;
+ float4x4 View_PrevClipToView;
+ float4x4 View_PrevTranslatedWorldToClip;
+ float4x4 View_PrevTranslatedWorldToView;
+ float4x4 View_PrevViewToTranslatedWorld;
+ float4x4 View_PrevTranslatedWorldToCameraView;
+ float4x4 View_PrevCameraViewToTranslatedWorld;
+ packed_float3 View_PrevWorldCameraOrigin;
+ float PrePadding_View_1660;
+ packed_float3 View_PrevWorldViewOrigin;
+ float PrePadding_View_1676;
+ packed_float3 View_PrevPreViewTranslation;
+ float PrePadding_View_1692;
+ float4x4 View_PrevInvViewProj;
+ float4x4 View_PrevScreenToTranslatedWorld;
+ float4x4 View_ClipToPrevClip;
+ float4 View_TemporalAAJitter;
+ float4 View_GlobalClippingPlane;
+ float2 View_FieldOfViewWideAngles;
+ float2 View_PrevFieldOfViewWideAngles;
+ float4 View_ViewRectMin;
+ float4 View_ViewSizeAndInvSize;
+ float4 View_BufferSizeAndInvSize;
+ float4 View_BufferBilinearUVMinMax;
+ int View_NumSceneColorMSAASamples;
+ float View_PreExposure;
+ float View_OneOverPreExposure;
+ float PrePadding_View_2012;
+ float4 View_DiffuseOverrideParameter;
+ float4 View_SpecularOverrideParameter;
+ float4 View_NormalOverrideParameter;
+ float2 View_RoughnessOverrideParameter;
+ float View_PrevFrameGameTime;
+ float View_PrevFrameRealTime;
+ float View_OutOfBoundsMask;
+ float PrePadding_View_2084;
+ float PrePadding_View_2088;
+ float PrePadding_View_2092;
+ packed_float3 View_WorldCameraMovementSinceLastFrame;
+ float View_CullingSign;
+ float View_NearPlane;
+ float View_AdaptiveTessellationFactor;
+ float View_GameTime;
+ float View_RealTime;
+ float View_DeltaTime;
+ float View_MaterialTextureMipBias;
+ float View_MaterialTextureDerivativeMultiply;
+ uint View_Random;
+ uint View_FrameNumber;
+ uint View_StateFrameIndexMod8;
+ uint View_StateFrameIndex;
+ float View_CameraCut;
+ float View_UnlitViewmodeMask;
+ float PrePadding_View_2164;
+ float PrePadding_View_2168;
+ float PrePadding_View_2172;
+ float4 View_DirectionalLightColor;
+ packed_float3 View_DirectionalLightDirection;
+ float PrePadding_View_2204;
+ float4 View_TranslucencyLightingVolumeMin[2];
+ float4 View_TranslucencyLightingVolumeInvSize[2];
+ float4 View_TemporalAAParams;
+ float4 View_CircleDOFParams;
+ float View_DepthOfFieldSensorWidth;
+ float View_DepthOfFieldFocalDistance;
+ float View_DepthOfFieldScale;
+ float View_DepthOfFieldFocalLength;
+ float View_DepthOfFieldFocalRegion;
+ float View_DepthOfFieldNearTransitionRegion;
+ float View_DepthOfFieldFarTransitionRegion;
+ float View_MotionBlurNormalizedToPixel;
+ float View_bSubsurfacePostprocessEnabled;
+ float View_GeneralPurposeTweak;
+ float View_DemosaicVposOffset;
+ float PrePadding_View_2348;
+ packed_float3 View_IndirectLightingColorScale;
+ float View_HDR32bppEncodingMode;
+ packed_float3 View_AtmosphericFogSunDirection;
+ float View_AtmosphericFogSunPower;
+ float View_AtmosphericFogPower;
+ float View_AtmosphericFogDensityScale;
+ float View_AtmosphericFogDensityOffset;
+ float View_AtmosphericFogGroundOffset;
+ float View_AtmosphericFogDistanceScale;
+ float View_AtmosphericFogAltitudeScale;
+ float View_AtmosphericFogHeightScaleRayleigh;
+ float View_AtmosphericFogStartDistance;
+ float View_AtmosphericFogDistanceOffset;
+ float View_AtmosphericFogSunDiscScale;
+ uint View_AtmosphericFogRenderMask;
+ uint View_AtmosphericFogInscatterAltitudeSampleNum;
+ float4 View_AtmosphericFogSunColor;
+ packed_float3 View_NormalCurvatureToRoughnessScaleBias;
+ float View_RenderingReflectionCaptureMask;
+ float4 View_AmbientCubemapTint;
+ float View_AmbientCubemapIntensity;
+ float View_SkyLightParameters;
+ float PrePadding_View_2488;
+ float PrePadding_View_2492;
+ float4 View_SkyLightColor;
+ float4 View_SkyIrradianceEnvironmentMap[7];
+ float View_MobilePreviewMode;
+ float View_HMDEyePaddingOffset;
+ float View_ReflectionCubemapMaxMip;
+ float View_ShowDecalsMask;
+ uint View_DistanceFieldAOSpecularOcclusionMode;
+ float View_IndirectCapsuleSelfShadowingIntensity;
+ float PrePadding_View_2648;
+ float PrePadding_View_2652;
+ packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
+ int View_StereoPassIndex;
+ float4 View_GlobalVolumeCenterAndExtent[4];
+ float4 View_GlobalVolumeWorldToUVAddAndMul[4];
+ float View_GlobalVolumeDimension;
+ float View_GlobalVolumeTexelSize;
+ float View_MaxGlobalDistance;
+ float View_bCheckerboardSubsurfaceProfileRendering;
+ packed_float3 View_VolumetricFogInvGridSize;
+ float PrePadding_View_2828;
+ packed_float3 View_VolumetricFogGridZParams;
+ float PrePadding_View_2844;
+ float2 View_VolumetricFogSVPosToVolumeUV;
+ float View_VolumetricFogMaxDistance;
+ float PrePadding_View_2860;
+ packed_float3 View_VolumetricLightmapWorldToUVScale;
+ float PrePadding_View_2876;
+ packed_float3 View_VolumetricLightmapWorldToUVAdd;
+ float PrePadding_View_2892;
+ packed_float3 View_VolumetricLightmapIndirectionTextureSize;
+ float View_VolumetricLightmapBrickSize;
+ packed_float3 View_VolumetricLightmapBrickTexelSize;
+ float View_StereoIPD;
+ float View_IndirectLightingCacheShowFlag;
+ float View_EyeToPixelSpreadAngle;
+};
+
+struct type_Primitive
+{
+ float4x4 Primitive_LocalToWorld;
+ float4 Primitive_InvNonUniformScaleAndDeterminantSign;
+ float4 Primitive_ObjectWorldPositionAndRadius;
+ float4x4 Primitive_WorldToLocal;
+ float4x4 Primitive_PreviousLocalToWorld;
+ float4x4 Primitive_PreviousWorldToLocal;
+ packed_float3 Primitive_ActorWorldPosition;
+ float Primitive_UseSingleSampleShadowFromStationaryLights;
+ packed_float3 Primitive_ObjectBounds;
+ float Primitive_LpvBiasMultiplier;
+ float Primitive_DecalReceiverMask;
+ float Primitive_PerObjectGBufferData;
+ float Primitive_UseVolumetricLightmapShadowFromStationaryLights;
+ float Primitive_UseEditorDepthTest;
+ float4 Primitive_ObjectOrientation;
+ float4 Primitive_NonUniformScale;
+ packed_float3 Primitive_LocalObjectBoundsMin;
+ float PrePadding_Primitive_380;
+ packed_float3 Primitive_LocalObjectBoundsMax;
+ uint Primitive_LightingChannelMask;
+ uint Primitive_LightmapDataIndex;
+ int Primitive_SingleCaptureIndex;
+};
+
+struct type_MobileShadowDepthPass
+{
+ float PrePadding_MobileShadowDepthPass_0;
+ float PrePadding_MobileShadowDepthPass_4;
+ float PrePadding_MobileShadowDepthPass_8;
+ float PrePadding_MobileShadowDepthPass_12;
+ float PrePadding_MobileShadowDepthPass_16;
+ float PrePadding_MobileShadowDepthPass_20;
+ float PrePadding_MobileShadowDepthPass_24;
+ float PrePadding_MobileShadowDepthPass_28;
+ float PrePadding_MobileShadowDepthPass_32;
+ float PrePadding_MobileShadowDepthPass_36;
+ float PrePadding_MobileShadowDepthPass_40;
+ float PrePadding_MobileShadowDepthPass_44;
+ float PrePadding_MobileShadowDepthPass_48;
+ float PrePadding_MobileShadowDepthPass_52;
+ float PrePadding_MobileShadowDepthPass_56;
+ float PrePadding_MobileShadowDepthPass_60;
+ float PrePadding_MobileShadowDepthPass_64;
+ float PrePadding_MobileShadowDepthPass_68;
+ float PrePadding_MobileShadowDepthPass_72;
+ float PrePadding_MobileShadowDepthPass_76;
+ float4x4 MobileShadowDepthPass_ProjectionMatrix;
+ float2 MobileShadowDepthPass_ShadowParams;
+ float MobileShadowDepthPass_bClampToNearPlane;
+ float PrePadding_MobileShadowDepthPass_156;
+ float4x4 MobileShadowDepthPass_ShadowViewProjectionMatrices[6];
+};
+
+struct type_EmitterDynamicUniforms
+{
+ float2 EmitterDynamicUniforms_LocalToWorldScale;
+ float EmitterDynamicUniforms_EmitterInstRandom;
+ float PrePadding_EmitterDynamicUniforms_12;
+ float4 EmitterDynamicUniforms_AxisLockRight;
+ float4 EmitterDynamicUniforms_AxisLockUp;
+ float4 EmitterDynamicUniforms_DynamicColor;
+ float4 EmitterDynamicUniforms_MacroUVParameters;
+};
+
+struct type_EmitterUniforms
+{
+ float4 EmitterUniforms_ColorCurve;
+ float4 EmitterUniforms_ColorScale;
+ float4 EmitterUniforms_ColorBias;
+ float4 EmitterUniforms_MiscCurve;
+ float4 EmitterUniforms_MiscScale;
+ float4 EmitterUniforms_MiscBias;
+ float4 EmitterUniforms_SizeBySpeed;
+ float4 EmitterUniforms_SubImageSize;
+ float4 EmitterUniforms_TangentSelector;
+ packed_float3 EmitterUniforms_CameraFacingBlend;
+ float EmitterUniforms_RemoveHMDRoll;
+ float EmitterUniforms_RotationRateScale;
+ float EmitterUniforms_RotationBias;
+ float EmitterUniforms_CameraMotionBlurAmount;
+ float PrePadding_EmitterUniforms_172;
+ float2 EmitterUniforms_PivotOffset;
+};
+
+struct type_Globals
+{
+ uint ParticleIndicesOffset;
+};
+
+struct main0_out
+{
+ float out_var_TEXCOORD6 [[user(locn0)]];
+ float4 gl_Position [[position]];
+};
+
+struct main0_in
+{
+ float2 in_var_ATTRIBUTE0 [[attribute(0)]];
+};
+
+// Returns 2D texture coords corresponding to 1D texel buffer coords
+static inline __attribute__((always_inline))
+uint2 spvTexelBufferCoord(uint tc)
+{
+ return uint2(tc % 4096, tc / 4096);
+}
+
+vertex main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_Primitive& Primitive [[buffer(1)]], constant type_MobileShadowDepthPass& MobileShadowDepthPass [[buffer(2)]], constant type_EmitterDynamicUniforms& EmitterDynamicUniforms [[buffer(3)]], constant type_EmitterUniforms& EmitterUniforms [[buffer(4)]], constant type_Globals& _Globals [[buffer(5)]], texture2d<float> ParticleIndices [[texture(0)]], texture2d<float> PositionTexture [[texture(1)]], texture2d<float> VelocityTexture [[texture(2)]], texture2d<float> AttributesTexture [[texture(3)]], texture2d<float> CurveTexture [[texture(4)]], sampler PositionTextureSampler [[sampler(0)]], sampler VelocityTextureSampler [[sampler(1)]], sampler AttributesTextureSampler [[sampler(2)]], sampler CurveTextureSampler [[sampler(3)]], uint gl_VertexIndex [[vertex_id]], uint gl_InstanceIndex [[instance_id]])
+{
+ main0_out out = {};
+ float2 _133 = ParticleIndices.read(spvTexelBufferCoord((_Globals.ParticleIndicesOffset + ((gl_InstanceIndex * 16u) + (gl_VertexIndex / 4u))))).xy;
+ float4 _137 = PositionTexture.sample(PositionTextureSampler, _133, level(0.0));
+ float4 _145 = AttributesTexture.sample(AttributesTextureSampler, _133, level(0.0));
+ float _146 = _137.w;
+ float3 _158 = float3x3(Primitive.Primitive_LocalToWorld[0].xyz, Primitive.Primitive_LocalToWorld[1].xyz, Primitive.Primitive_LocalToWorld[2].xyz) * VelocityTexture.sample(VelocityTextureSampler, _133, level(0.0)).xyz;
+ float3 _160 = normalize(_158 + float3(0.0, 0.0, 9.9999997473787516355514526367188e-05));
+ float2 _204 = ((((_145.xy + float2((_145.x < 0.5) ? 0.0 : (-0.5), (_145.y < 0.5) ? 0.0 : (-0.5))) * float2(2.0)) * (((CurveTexture.sample(CurveTextureSampler, (EmitterUniforms.EmitterUniforms_MiscCurve.xy + (EmitterUniforms.EmitterUniforms_MiscCurve.zw * float2(_146))), level(0.0)) * EmitterUniforms.EmitterUniforms_MiscScale) + EmitterUniforms.EmitterUniforms_MiscBias).xy * EmitterDynamicUniforms.EmitterDynamicUniforms_LocalToWorldScale)) * fast::min(fast::max(EmitterUniforms.EmitterUniforms_SizeBySpeed.xy * float2(length(_158)), float2(1.0)), EmitterUniforms.EmitterUniforms_SizeBySpeed.zw)) * float2(step(_146, 1.0));
+ float3 _239 = float4((((Primitive.Primitive_LocalToWorld[0u].xyz * _137.xxx) + (Primitive.Primitive_LocalToWorld[1u].xyz * _137.yyy)) + (Primitive.Primitive_LocalToWorld[2u].xyz * _137.zzz)) + (Primitive.Primitive_LocalToWorld[3u].xyz + float3(View.View_PreViewTranslation)), 1.0).xyz;
+ float3 _242 = float3(EmitterUniforms.EmitterUniforms_RemoveHMDRoll);
+ float3 _251 = mix(mix(float3(View.View_ViewRight), float3(View.View_HMDViewNoRollRight), _242), EmitterDynamicUniforms.EmitterDynamicUniforms_AxisLockRight.xyz, float3(EmitterDynamicUniforms.EmitterDynamicUniforms_AxisLockRight.w));
+ float3 _259 = mix(-mix(float3(View.View_ViewUp), float3(View.View_HMDViewNoRollUp), _242), EmitterDynamicUniforms.EmitterDynamicUniforms_AxisLockUp.xyz, float3(EmitterDynamicUniforms.EmitterDynamicUniforms_AxisLockUp.w));
+ float3 _260 = float3(View.View_TranslatedWorldCameraOrigin) - _239;
+ float _261 = dot(_260, _260);
+ float3 _265 = _260 / float3(sqrt(fast::max(_261, 0.00999999977648258209228515625)));
+ float3 _335;
+ float3 _336;
+ if (EmitterUniforms.EmitterUniforms_CameraFacingBlend[0] > 0.0)
+ {
+ float3 _279 = cross(_265, float3(0.0, 0.0, 1.0));
+ float3 _284 = _279 / float3(sqrt(fast::max(dot(_279, _279), 0.00999999977648258209228515625)));
+ float3 _286 = float3(fast::clamp((_261 * EmitterUniforms.EmitterUniforms_CameraFacingBlend[1]) - EmitterUniforms.EmitterUniforms_CameraFacingBlend[2], 0.0, 1.0));
+ _335 = normalize(mix(_251, _284, _286));
+ _336 = normalize(mix(_259, cross(_265, _284), _286));
+ }
+ else
+ {
+ float3 _333;
+ float3 _334;
+ if (EmitterUniforms.EmitterUniforms_TangentSelector.y > 0.0)
+ {
+ float3 _297 = cross(_265, _160);
+ _333 = _297 / float3(sqrt(fast::max(dot(_297, _297), 0.00999999977648258209228515625)));
+ _334 = -_160;
+ }
+ else
+ {
+ float3 _331;
+ float3 _332;
+ if (EmitterUniforms.EmitterUniforms_TangentSelector.z > 0.0)
+ {
+ float3 _310 = cross(EmitterDynamicUniforms.EmitterDynamicUniforms_AxisLockRight.xyz, _265);
+ _331 = EmitterDynamicUniforms.EmitterDynamicUniforms_AxisLockRight.xyz;
+ _332 = -(_310 / float3(sqrt(fast::max(dot(_310, _310), 0.00999999977648258209228515625))));
+ }
+ else
+ {
+ float3 _329;
+ float3 _330;
+ if (EmitterUniforms.EmitterUniforms_TangentSelector.w > 0.0)
+ {
+ float3 _322 = cross(_265, float3(0.0, 0.0, 1.0));
+ float3 _327 = _322 / float3(sqrt(fast::max(dot(_322, _322), 0.00999999977648258209228515625)));
+ _329 = _327;
+ _330 = cross(_265, _327);
+ }
+ else
+ {
+ _329 = _251;
+ _330 = _259;
+ }
+ _331 = _329;
+ _332 = _330;
+ }
+ _333 = _331;
+ _334 = _332;
+ }
+ _335 = _333;
+ _336 = _334;
+ }
+ float _339 = ((_145.z + ((_145.w * EmitterUniforms.EmitterUniforms_RotationRateScale) * _146)) * 6.283185482025146484375) + EmitterUniforms.EmitterUniforms_RotationBias;
+ float3 _342 = float3(sin(_339));
+ float3 _344 = float3(cos(_339));
+ float4 _371 = float4(_239 + ((float3(_204.x * (in.in_var_ATTRIBUTE0.x + EmitterUniforms.EmitterUniforms_PivotOffset.x)) * ((_342 * _336) + (_344 * _335))) + (float3(_204.y * (in.in_var_ATTRIBUTE0.y + EmitterUniforms.EmitterUniforms_PivotOffset.y)) * ((_344 * _336) - (_342 * _335)))), 1.0);
+ float4 _375 = MobileShadowDepthPass.MobileShadowDepthPass_ProjectionMatrix * float4(_371.x, _371.y, _371.z, _371.w);
+ float4 _386;
+ if ((MobileShadowDepthPass.MobileShadowDepthPass_bClampToNearPlane > 0.0) && (_375.z < 0.0))
+ {
+ float4 _384 = _375;
+ _384.z = 9.9999999747524270787835121154785e-07;
+ float4 _385 = _384;
+ _385.w = 1.0;
+ _386 = _385;
+ }
+ else
+ {
+ _386 = _375;
+ }
+ float4 _396 = _386;
+ _396.z = ((_386.z * MobileShadowDepthPass.MobileShadowDepthPass_ShadowParams.y) + MobileShadowDepthPass.MobileShadowDepthPass_ShadowParams.x) * _386.w;
+ out.out_var_TEXCOORD6 = 0.0;
+ out.gl_Position = _396;
+ return out;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/asm/comp/bitcast_icmp.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/asm/comp/bitcast_icmp.asm.comp
new file mode 100644
index 00000000000..bed3b90a7b2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/asm/comp/bitcast_icmp.asm.comp
@@ -0,0 +1,27 @@
+#version 310 es
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+
+layout(binding = 0, std430) restrict buffer _3_5
+{
+ ivec4 _m0;
+ uvec4 _m1;
+} _5;
+
+layout(binding = 1, std430) restrict buffer _4_6
+{
+ uvec4 _m0;
+ ivec4 _m1;
+} _6;
+
+void main()
+{
+ _6._m0 = mix(uvec4(0u), uvec4(1u), lessThan(ivec4(_5._m1), _5._m0));
+ _6._m0 = mix(uvec4(0u), uvec4(1u), lessThanEqual(ivec4(_5._m1), _5._m0));
+ _6._m0 = mix(uvec4(0u), uvec4(1u), lessThan(_5._m1, uvec4(_5._m0)));
+ _6._m0 = mix(uvec4(0u), uvec4(1u), lessThanEqual(_5._m1, uvec4(_5._m0)));
+ _6._m0 = mix(uvec4(0u), uvec4(1u), greaterThan(ivec4(_5._m1), _5._m0));
+ _6._m0 = mix(uvec4(0u), uvec4(1u), greaterThanEqual(ivec4(_5._m1), _5._m0));
+ _6._m0 = mix(uvec4(0u), uvec4(1u), greaterThan(_5._m1, uvec4(_5._m0)));
+ _6._m0 = mix(uvec4(0u), uvec4(1u), greaterThanEqual(_5._m1, uvec4(_5._m0)));
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/asm/comp/phi-temporary-copy-loop-variable.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/asm/comp/phi-temporary-copy-loop-variable.asm.comp
index 4f8d2ffa720..f8650b5e5c2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/asm/comp/phi-temporary-copy-loop-variable.asm.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/asm/comp/phi-temporary-copy-loop-variable.asm.comp
@@ -5,9 +5,9 @@ layout(binding = 1, rgba32f) uniform writeonly image2D outImageTexture;
void main()
{
+ int _27_copy;
int _30;
_30 = 7;
- int _27_copy;
for (int _27 = 7; _27 >= 0; _27_copy = _27, _27--, _30 = _27_copy)
{
if (5.0 > float(_27))
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/frag/struct-type-unrelated-alias.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/frag/struct-type-unrelated-alias.frag
new file mode 100644
index 00000000000..524a8d3c0b6
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/frag/struct-type-unrelated-alias.frag
@@ -0,0 +1,23 @@
+#version 450
+
+struct T
+{
+ float a;
+};
+
+struct T_1
+{
+ float b;
+};
+
+layout(location = 0) out float FragColor;
+
+void main()
+{
+ T foo;
+ foo.a = 10.0;
+ T_1 bar;
+ bar.b = 20.0;
+ FragColor = foo.a + bar.b;
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/tese/load-array-of-array.tese b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/tese/load-array-of-array.tese
new file mode 100644
index 00000000000..7fab08ef66e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders/tese/load-array-of-array.tese
@@ -0,0 +1,16 @@
+#version 450
+layout(quads, ccw, equal_spacing) in;
+
+layout(location = 0) in vec4 vTexCoord[][1];
+
+void main()
+{
+ vec4 _17_unrolled[32][1];
+ for (int i = 0; i < int(32); i++)
+ {
+ _17_unrolled[i] = vTexCoord[i];
+ }
+ vec4 tmp[32][1] = _17_unrolled;
+ gl_Position = (tmp[0][0] + tmp[2][0]) + tmp[3][0];
+}
+
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp
new file mode 100644
index 00000000000..87aee2db54f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 7
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ OpSource GLSL 450
+ OpName %main "main"
+ OpName %T "T"
+ OpMemberName %T 0 "a"
+ OpName %v "v"
+ OpName %T_0 "T"
+ OpMemberName %T_0 0 "b"
+ OpName %SSBO1 "SSBO1"
+ OpMemberName %SSBO1 0 "foo"
+ OpName %_ ""
+ OpName %T_1 "T"
+ OpMemberName %T_1 0 "c"
+ OpName %SSBO2 "SSBO2"
+ OpMemberName %SSBO2 0 "bar"
+ OpName %__0 ""
+ OpMemberDecorate %T_0 0 Offset 0
+ OpDecorate %_runtimearr_T_0 ArrayStride 4
+ OpMemberDecorate %SSBO1 0 Offset 0
+ OpDecorate %SSBO1 BufferBlock
+ OpDecorate %_ DescriptorSet 0
+ OpDecorate %_ Binding 0
+ OpMemberDecorate %T_1 0 Offset 0
+ OpDecorate %_runtimearr_T_1 ArrayStride 16
+ OpMemberDecorate %SSBO2 0 Offset 0
+ OpDecorate %SSBO2 BufferBlock
+ OpDecorate %__0 DescriptorSet 0
+ OpDecorate %__0 Binding 1
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %T = OpTypeStruct %float
+%_ptr_Function_T = OpTypePointer Function %T
+ %float_40 = OpConstant %float 40
+ %11 = OpConstantComposite %T %float_40
+ %T_0 = OpTypeStruct %float
+%_runtimearr_T_0 = OpTypeRuntimeArray %T_0
+ %SSBO1 = OpTypeStruct %_runtimearr_T_0
+%_ptr_Uniform_SSBO1 = OpTypePointer Uniform %SSBO1
+ %_ = OpVariable %_ptr_Uniform_SSBO1 Uniform
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %int_10 = OpConstant %int 10
+%_ptr_Uniform_T_0 = OpTypePointer Uniform %T_0
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+ %T_1 = OpTypeStruct %float
+%_runtimearr_T_1 = OpTypeRuntimeArray %T_1
+ %SSBO2 = OpTypeStruct %_runtimearr_T_1
+%_ptr_Uniform_SSBO2 = OpTypePointer Uniform %SSBO2
+ %__0 = OpVariable %_ptr_Uniform_SSBO2 Uniform
+ %int_30 = OpConstant %int 30
+%_ptr_Uniform_T_1 = OpTypePointer Uniform %T_1
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %v = OpVariable %_ptr_Function_T Function
+ OpStore %v %11
+ %20 = OpLoad %T %v
+ %22 = OpAccessChain %_ptr_Uniform_T_0 %_ %int_0 %int_10
+ %23 = OpCompositeExtract %float %20 0
+ %25 = OpAccessChain %_ptr_Uniform_float %22 %int_0
+ OpStore %25 %23
+ %32 = OpLoad %T %v
+ %34 = OpAccessChain %_ptr_Uniform_T_1 %__0 %int_0 %int_30
+ %35 = OpCompositeExtract %float %32 0
+ %36 = OpAccessChain %_ptr_Uniform_float %34 %int_0
+ OpStore %36 %35
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/frag/empty-struct-in-struct.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/frag/empty-struct-in-struct.asm.frag
new file mode 100644
index 00000000000..a9650ddbb6b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/frag/empty-struct-in-struct.asm.frag
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.2
+; Generator: Khronos; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %EntryPoint_Main "main"
+ OpExecutionMode %EntryPoint_Main OriginUpperLeft
+ OpSource Unknown 100
+ OpName %EmptyStructTest "EmptyStructTest"
+ OpName %EmptyStruct2Test "EmptyStruct2Test"
+ OpName %GetValue "GetValue"
+ OpName %GetValue2 "GetValue"
+ OpName %self "self"
+ OpName %self2 "self"
+ OpName %emptyStruct "emptyStruct"
+ OpName %value "value"
+ OpName %EntryPoint_Main "EntryPoint_Main"
+
+%EmptyStructTest = OpTypeStruct
+%EmptyStruct2Test = OpTypeStruct %EmptyStructTest
+%_ptr_Function_EmptyStruct2Test = OpTypePointer Function %EmptyStruct2Test
+ %float = OpTypeFloat 32
+%_ptr_Function_float = OpTypePointer Function %float
+ %5 = OpTypeFunction %float %_ptr_Function_EmptyStruct2Test
+ %6 = OpTypeFunction %float %EmptyStruct2Test
+ %void = OpTypeVoid
+%_ptr_Function_void = OpTypePointer Function %void
+ %8 = OpTypeFunction %void %_ptr_Function_EmptyStruct2Test
+ %9 = OpTypeFunction %void
+ %float_0 = OpConstant %float 0
+ %value4 = OpConstantNull %EmptyStruct2Test
+
+ %GetValue = OpFunction %float None %5
+ %self = OpFunctionParameter %_ptr_Function_EmptyStruct2Test
+ %13 = OpLabel
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ %GetValue2 = OpFunction %float None %6
+ %self2 = OpFunctionParameter %EmptyStruct2Test
+ %14 = OpLabel
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+%EntryPoint_Main = OpFunction %void None %9
+ %37 = OpLabel
+ %emptyStruct = OpVariable %_ptr_Function_EmptyStruct2Test Function
+ %18 = OpVariable %_ptr_Function_EmptyStruct2Test Function
+ %value = OpVariable %_ptr_Function_float Function
+ %value2 = OpCompositeConstruct %EmptyStructTest
+ %value3 = OpCompositeConstruct %EmptyStruct2Test %value2
+ %22 = OpFunctionCall %float %GetValue %emptyStruct
+ %23 = OpFunctionCall %float %GetValue2 %value3
+ %24 = OpFunctionCall %float %GetValue2 %value4
+ OpStore %value %22
+ OpStore %value %23
+ OpStore %value %24
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/frag/unordered-compare.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/frag/unordered-compare.asm.frag
new file mode 100644
index 00000000000..4ad8fc5abb8
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/frag/unordered-compare.asm.frag
@@ -0,0 +1,177 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 7
+; Bound: 132
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %A %B %FragColor
+ OpExecutionMode %main OriginUpperLeft
+ OpSource GLSL 450
+ OpName %main "main"
+ OpName %test_vector_ "test_vector("
+ OpName %test_scalar_ "test_scalar("
+ OpName %le "le"
+ OpName %A "A"
+ OpName %B "B"
+ OpName %leq "leq"
+ OpName %ge "ge"
+ OpName %geq "geq"
+ OpName %eq "eq"
+ OpName %neq "neq"
+ OpName %le_0 "le"
+ OpName %leq_0 "leq"
+ OpName %ge_0 "ge"
+ OpName %geq_0 "geq"
+ OpName %eq_0 "eq"
+ OpName %neq_0 "neq"
+ OpName %FragColor "FragColor"
+ OpDecorate %A Location 0
+ OpDecorate %B Location 1
+ OpDecorate %FragColor Location 0
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %8 = OpTypeFunction %v4float
+ %11 = OpTypeFunction %float
+ %bool = OpTypeBool
+ %v4bool = OpTypeVector %bool 4
+%_ptr_Function_v4bool = OpTypePointer Function %v4bool
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+ %A = OpVariable %_ptr_Input_v4float Input
+ %B = OpVariable %_ptr_Input_v4float Input
+ %float_0 = OpConstant %float 0
+ %float_1 = OpConstant %float 1
+ %47 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+ %48 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_bool = OpTypePointer Function %bool
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_Input_float = OpTypePointer Input %float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %FragColor = OpVariable %_ptr_Output_v4float Output
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %128 = OpFunctionCall %v4float %test_vector_
+ %129 = OpFunctionCall %float %test_scalar_
+ %130 = OpCompositeConstruct %v4float %129 %129 %129 %129
+ %131 = OpFAdd %v4float %128 %130
+ OpStore %FragColor %131
+ OpReturn
+ OpFunctionEnd
+%test_vector_ = OpFunction %v4float None %8
+ %10 = OpLabel
+ %le = OpVariable %_ptr_Function_v4bool Function
+ %leq = OpVariable %_ptr_Function_v4bool Function
+ %ge = OpVariable %_ptr_Function_v4bool Function
+ %geq = OpVariable %_ptr_Function_v4bool Function
+ %eq = OpVariable %_ptr_Function_v4bool Function
+ %neq = OpVariable %_ptr_Function_v4bool Function
+ %20 = OpLoad %v4float %A
+ %22 = OpLoad %v4float %B
+ %23 = OpFUnordLessThan %v4bool %20 %22
+ OpStore %le %23
+ %25 = OpLoad %v4float %A
+ %26 = OpLoad %v4float %B
+ %27 = OpFUnordLessThanEqual %v4bool %25 %26
+ OpStore %leq %27
+ %29 = OpLoad %v4float %A
+ %30 = OpLoad %v4float %B
+ %31 = OpFUnordGreaterThan %v4bool %29 %30
+ OpStore %ge %31
+ %33 = OpLoad %v4float %A
+ %34 = OpLoad %v4float %B
+ %35 = OpFUnordGreaterThanEqual %v4bool %33 %34
+ OpStore %geq %35
+ %37 = OpLoad %v4float %A
+ %38 = OpLoad %v4float %B
+ %39 = OpFUnordEqual %v4bool %37 %38
+ OpStore %eq %39
+ %41 = OpLoad %v4float %A
+ %42 = OpLoad %v4float %B
+ %43 = OpFUnordNotEqual %v4bool %41 %42
+ OpStore %neq %43
+ %44 = OpLoad %v4bool %le
+ %49 = OpSelect %v4float %44 %48 %47
+ %50 = OpLoad %v4bool %leq
+ %51 = OpSelect %v4float %50 %48 %47
+ %52 = OpFAdd %v4float %49 %51
+ %53 = OpLoad %v4bool %ge
+ %54 = OpSelect %v4float %53 %48 %47
+ %55 = OpFAdd %v4float %52 %54
+ %56 = OpLoad %v4bool %geq
+ %57 = OpSelect %v4float %56 %48 %47
+ %58 = OpFAdd %v4float %55 %57
+ %59 = OpLoad %v4bool %eq
+ %60 = OpSelect %v4float %59 %48 %47
+ %61 = OpFAdd %v4float %58 %60
+ %62 = OpLoad %v4bool %neq
+ %63 = OpSelect %v4float %62 %48 %47
+ %64 = OpFAdd %v4float %61 %63
+ OpReturnValue %64
+ OpFunctionEnd
+%test_scalar_ = OpFunction %float None %11
+ %13 = OpLabel
+ %le_0 = OpVariable %_ptr_Function_bool Function
+ %leq_0 = OpVariable %_ptr_Function_bool Function
+ %ge_0 = OpVariable %_ptr_Function_bool Function
+ %geq_0 = OpVariable %_ptr_Function_bool Function
+ %eq_0 = OpVariable %_ptr_Function_bool Function
+ %neq_0 = OpVariable %_ptr_Function_bool Function
+ %72 = OpAccessChain %_ptr_Input_float %A %uint_0
+ %73 = OpLoad %float %72
+ %74 = OpAccessChain %_ptr_Input_float %B %uint_0
+ %75 = OpLoad %float %74
+ %76 = OpFUnordLessThan %bool %73 %75
+ OpStore %le_0 %76
+ %78 = OpAccessChain %_ptr_Input_float %A %uint_0
+ %79 = OpLoad %float %78
+ %80 = OpAccessChain %_ptr_Input_float %B %uint_0
+ %81 = OpLoad %float %80
+ %82 = OpFUnordLessThanEqual %bool %79 %81
+ OpStore %leq_0 %82
+ %84 = OpAccessChain %_ptr_Input_float %A %uint_0
+ %85 = OpLoad %float %84
+ %86 = OpAccessChain %_ptr_Input_float %B %uint_0
+ %87 = OpLoad %float %86
+ %88 = OpFUnordGreaterThan %bool %85 %87
+ OpStore %ge_0 %88
+ %90 = OpAccessChain %_ptr_Input_float %A %uint_0
+ %91 = OpLoad %float %90
+ %92 = OpAccessChain %_ptr_Input_float %B %uint_0
+ %93 = OpLoad %float %92
+ %94 = OpFUnordGreaterThanEqual %bool %91 %93
+ OpStore %geq_0 %94
+ %96 = OpAccessChain %_ptr_Input_float %A %uint_0
+ %97 = OpLoad %float %96
+ %98 = OpAccessChain %_ptr_Input_float %B %uint_0
+ %99 = OpLoad %float %98
+ %100 = OpFUnordEqual %bool %97 %99
+ OpStore %eq_0 %100
+ %102 = OpAccessChain %_ptr_Input_float %A %uint_0
+ %103 = OpLoad %float %102
+ %104 = OpAccessChain %_ptr_Input_float %B %uint_0
+ %105 = OpLoad %float %104
+ %106 = OpFUnordNotEqual %bool %103 %105
+ OpStore %neq_0 %106
+ %107 = OpLoad %bool %le_0
+ %108 = OpSelect %float %107 %float_1 %float_0
+ %109 = OpLoad %bool %leq_0
+ %110 = OpSelect %float %109 %float_1 %float_0
+ %111 = OpFAdd %float %108 %110
+ %112 = OpLoad %bool %ge_0
+ %113 = OpSelect %float %112 %float_1 %float_0
+ %114 = OpFAdd %float %111 %113
+ %115 = OpLoad %bool %geq_0
+ %116 = OpSelect %float %115 %float_1 %float_0
+ %117 = OpFAdd %float %114 %116
+ %118 = OpLoad %bool %eq_0
+ %119 = OpSelect %float %118 %float_1 %float_0
+ %120 = OpFAdd %float %117 %119
+ %121 = OpLoad %bool %neq_0
+ %122 = OpSelect %float %121 %float_1 %float_0
+ %123 = OpFAdd %float %120 %122
+ OpReturnValue %123
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl/asm/comp/bitcast_icmp.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl/asm/comp/bitcast_icmp.asm.comp
new file mode 100644
index 00000000000..b7b4e0b2e1e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-hlsl/asm/comp/bitcast_icmp.asm.comp
@@ -0,0 +1,101 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 1
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %func "main"
+ OpExecutionMode %func LocalSize 1 1 1
+ OpSource ESSL 310
+ OpSourceExtension "GL_GOOGLE_cpp_style_line_directive"
+ OpSourceExtension "GL_GOOGLE_include_directive"
+ OpMemberDecorate %input_struct 0 Offset 0
+ OpMemberDecorate %input_struct 1 Offset 16
+ OpMemberDecorate %output_struct 0 Offset 0
+ OpMemberDecorate %output_struct 1 Offset 16
+ OpDecorate %input_struct BufferBlock
+ OpDecorate %inputs DescriptorSet 0
+ OpDecorate %inputs Binding 0
+ OpDecorate %inputs Restrict
+ OpDecorate %output_struct BufferBlock
+ OpDecorate %outputs DescriptorSet 0
+ OpDecorate %outputs Binding 1
+ OpDecorate %outputs Restrict
+
+ %void = OpTypeVoid
+ %main_func = OpTypeFunction %void
+
+ %bool = OpTypeBool
+ %bvec4 = OpTypeVector %bool 4
+
+ %uint = OpTypeInt 32 0
+ %uvec4 = OpTypeVector %uint 4
+
+ %int = OpTypeInt 32 1
+ %ivec4 = OpTypeVector %int 4
+
+ %ivec4_ptr = OpTypePointer Uniform %ivec4
+ %uvec4_ptr = OpTypePointer Uniform %uvec4
+
+ %zero = OpConstant %int 0
+ %one = OpConstant %int 1
+ %uzero = OpConstant %uint 0
+ %uone = OpConstant %uint 1
+ %utrue = OpConstantComposite %uvec4 %uone %uone %uone %uone
+ %ufalse = OpConstantComposite %uvec4 %uzero %uzero %uzero %uzero
+
+ %input_struct = OpTypeStruct %ivec4 %uvec4
+ %input_struct_ptr = OpTypePointer Uniform %input_struct
+ %inputs = OpVariable %input_struct_ptr Uniform
+ %output_struct = OpTypeStruct %uvec4 %ivec4
+ %output_struct_ptr = OpTypePointer Uniform %output_struct
+ %outputs = OpVariable %output_struct_ptr Uniform
+
+ %func = OpFunction %void None %main_func
+ %block = OpLabel
+
+ %input1_ptr = OpAccessChain %ivec4_ptr %inputs %zero
+ %input0_ptr = OpAccessChain %uvec4_ptr %inputs %one
+ %input1 = OpLoad %ivec4 %input1_ptr
+ %input0 = OpLoad %uvec4 %input0_ptr
+
+ %output_ptr_uvec4 = OpAccessChain %uvec4_ptr %outputs %zero
+
+ %result_slt = OpSLessThan %bvec4 %input0 %input1
+ %result_sle = OpSLessThanEqual %bvec4 %input0 %input1
+ %result_ult = OpULessThan %bvec4 %input0 %input1
+ %result_ule = OpULessThanEqual %bvec4 %input0 %input1
+ %result_sgt = OpSGreaterThan %bvec4 %input0 %input1
+ %result_sge = OpSGreaterThanEqual %bvec4 %input0 %input1
+ %result_ugt = OpUGreaterThan %bvec4 %input0 %input1
+ %result_uge = OpUGreaterThanEqual %bvec4 %input0 %input1
+
+ %int_slt = OpSelect %uvec4 %result_slt %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_slt
+
+ %int_sle = OpSelect %uvec4 %result_sle %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_sle
+
+ %int_ult = OpSelect %uvec4 %result_ult %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_ult
+
+ %int_ule = OpSelect %uvec4 %result_ule %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_ule
+
+ %int_sgt = OpSelect %uvec4 %result_sgt %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_sgt
+
+ %int_sge = OpSelect %uvec4 %result_sge %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_sge
+
+ %int_ugt = OpSelect %uvec4 %result_ugt %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_ugt
+
+ %int_uge = OpSelect %uvec4 %result_uge %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_uge
+
+
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp
new file mode 100644
index 00000000000..87aee2db54f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 7
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ OpSource GLSL 450
+ OpName %main "main"
+ OpName %T "T"
+ OpMemberName %T 0 "a"
+ OpName %v "v"
+ OpName %T_0 "T"
+ OpMemberName %T_0 0 "b"
+ OpName %SSBO1 "SSBO1"
+ OpMemberName %SSBO1 0 "foo"
+ OpName %_ ""
+ OpName %T_1 "T"
+ OpMemberName %T_1 0 "c"
+ OpName %SSBO2 "SSBO2"
+ OpMemberName %SSBO2 0 "bar"
+ OpName %__0 ""
+ OpMemberDecorate %T_0 0 Offset 0
+ OpDecorate %_runtimearr_T_0 ArrayStride 4
+ OpMemberDecorate %SSBO1 0 Offset 0
+ OpDecorate %SSBO1 BufferBlock
+ OpDecorate %_ DescriptorSet 0
+ OpDecorate %_ Binding 0
+ OpMemberDecorate %T_1 0 Offset 0
+ OpDecorate %_runtimearr_T_1 ArrayStride 16
+ OpMemberDecorate %SSBO2 0 Offset 0
+ OpDecorate %SSBO2 BufferBlock
+ OpDecorate %__0 DescriptorSet 0
+ OpDecorate %__0 Binding 1
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %T = OpTypeStruct %float
+%_ptr_Function_T = OpTypePointer Function %T
+ %float_40 = OpConstant %float 40
+ %11 = OpConstantComposite %T %float_40
+ %T_0 = OpTypeStruct %float
+%_runtimearr_T_0 = OpTypeRuntimeArray %T_0
+ %SSBO1 = OpTypeStruct %_runtimearr_T_0
+%_ptr_Uniform_SSBO1 = OpTypePointer Uniform %SSBO1
+ %_ = OpVariable %_ptr_Uniform_SSBO1 Uniform
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %int_10 = OpConstant %int 10
+%_ptr_Uniform_T_0 = OpTypePointer Uniform %T_0
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+ %T_1 = OpTypeStruct %float
+%_runtimearr_T_1 = OpTypeRuntimeArray %T_1
+ %SSBO2 = OpTypeStruct %_runtimearr_T_1
+%_ptr_Uniform_SSBO2 = OpTypePointer Uniform %SSBO2
+ %__0 = OpVariable %_ptr_Uniform_SSBO2 Uniform
+ %int_30 = OpConstant %int 30
+%_ptr_Uniform_T_1 = OpTypePointer Uniform %T_1
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %v = OpVariable %_ptr_Function_T Function
+ OpStore %v %11
+ %20 = OpLoad %T %v
+ %22 = OpAccessChain %_ptr_Uniform_T_0 %_ %int_0 %int_10
+ %23 = OpCompositeExtract %float %20 0
+ %25 = OpAccessChain %_ptr_Uniform_float %22 %int_0
+ OpStore %25 %23
+ %32 = OpLoad %T %v
+ %34 = OpAccessChain %_ptr_Uniform_T_1 %__0 %int_0 %int_30
+ %35 = OpCompositeExtract %float %32 0
+ %36 = OpAccessChain %_ptr_Uniform_float %34 %int_0
+ OpStore %36 %35
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/asm/frag/empty-struct-in-struct.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/asm/frag/empty-struct-in-struct.asm.frag
new file mode 100644
index 00000000000..a9650ddbb6b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/asm/frag/empty-struct-in-struct.asm.frag
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.2
+; Generator: Khronos; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %EntryPoint_Main "main"
+ OpExecutionMode %EntryPoint_Main OriginUpperLeft
+ OpSource Unknown 100
+ OpName %EmptyStructTest "EmptyStructTest"
+ OpName %EmptyStruct2Test "EmptyStruct2Test"
+ OpName %GetValue "GetValue"
+ OpName %GetValue2 "GetValue"
+ OpName %self "self"
+ OpName %self2 "self"
+ OpName %emptyStruct "emptyStruct"
+ OpName %value "value"
+ OpName %EntryPoint_Main "EntryPoint_Main"
+
+%EmptyStructTest = OpTypeStruct
+%EmptyStruct2Test = OpTypeStruct %EmptyStructTest
+%_ptr_Function_EmptyStruct2Test = OpTypePointer Function %EmptyStruct2Test
+ %float = OpTypeFloat 32
+%_ptr_Function_float = OpTypePointer Function %float
+ %5 = OpTypeFunction %float %_ptr_Function_EmptyStruct2Test
+ %6 = OpTypeFunction %float %EmptyStruct2Test
+ %void = OpTypeVoid
+%_ptr_Function_void = OpTypePointer Function %void
+ %8 = OpTypeFunction %void %_ptr_Function_EmptyStruct2Test
+ %9 = OpTypeFunction %void
+ %float_0 = OpConstant %float 0
+ %value4 = OpConstantNull %EmptyStruct2Test
+
+ %GetValue = OpFunction %float None %5
+ %self = OpFunctionParameter %_ptr_Function_EmptyStruct2Test
+ %13 = OpLabel
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ %GetValue2 = OpFunction %float None %6
+ %self2 = OpFunctionParameter %EmptyStruct2Test
+ %14 = OpLabel
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+%EntryPoint_Main = OpFunction %void None %9
+ %37 = OpLabel
+ %emptyStruct = OpVariable %_ptr_Function_EmptyStruct2Test Function
+ %18 = OpVariable %_ptr_Function_EmptyStruct2Test Function
+ %value = OpVariable %_ptr_Function_float Function
+ %value2 = OpCompositeConstruct %EmptyStructTest
+ %value3 = OpCompositeConstruct %EmptyStruct2Test %value2
+ %22 = OpFunctionCall %float %GetValue %emptyStruct
+ %23 = OpFunctionCall %float %GetValue2 %value3
+ %24 = OpFunctionCall %float %GetValue2 %value4
+ OpStore %value %22
+ OpStore %value %23
+ OpStore %value %24
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag
deleted file mode 100644
index 8b09e5b68f8..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag
+++ /dev/null
@@ -1,646 +0,0 @@
-; SPIR-V
-; Version: 1.0
-; Generator: Khronos Glslang Reference Front End; 3
-; Bound: 1532
-; Schema: 0
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %main "main" %IN_HPosition %IN_Uv_EdgeDistance1 %IN_UvStuds_EdgeDistance2 %IN_Color %IN_LightPosition_Fog %IN_View_Depth %IN_Normal_SpecPower %IN_Tangent %IN_PosLightSpace_Reflectance %IN_studIndex %_entryPointOutput
- OpExecutionMode %main OriginUpperLeft
- OpSource HLSL 500
- OpName %main "main"
- OpName %VertexOutput "VertexOutput"
- OpMemberName %VertexOutput 0 "HPosition"
- OpMemberName %VertexOutput 1 "Uv_EdgeDistance1"
- OpMemberName %VertexOutput 2 "UvStuds_EdgeDistance2"
- OpMemberName %VertexOutput 3 "Color"
- OpMemberName %VertexOutput 4 "LightPosition_Fog"
- OpMemberName %VertexOutput 5 "View_Depth"
- OpMemberName %VertexOutput 6 "Normal_SpecPower"
- OpMemberName %VertexOutput 7 "Tangent"
- OpMemberName %VertexOutput 8 "PosLightSpace_Reflectance"
- OpMemberName %VertexOutput 9 "studIndex"
- OpName %Surface "Surface"
- OpMemberName %Surface 0 "albedo"
- OpMemberName %Surface 1 "normal"
- OpMemberName %Surface 2 "specular"
- OpMemberName %Surface 3 "gloss"
- OpMemberName %Surface 4 "reflectance"
- OpMemberName %Surface 5 "opacity"
- OpName %SurfaceInput "SurfaceInput"
- OpMemberName %SurfaceInput 0 "Color"
- OpMemberName %SurfaceInput 1 "Uv"
- OpMemberName %SurfaceInput 2 "UvStuds"
- OpName %Globals "Globals"
- OpMemberName %Globals 0 "ViewProjection"
- OpMemberName %Globals 1 "ViewRight"
- OpMemberName %Globals 2 "ViewUp"
- OpMemberName %Globals 3 "ViewDir"
- OpMemberName %Globals 4 "CameraPosition"
- OpMemberName %Globals 5 "AmbientColor"
- OpMemberName %Globals 6 "Lamp0Color"
- OpMemberName %Globals 7 "Lamp0Dir"
- OpMemberName %Globals 8 "Lamp1Color"
- OpMemberName %Globals 9 "FogParams"
- OpMemberName %Globals 10 "FogColor"
- OpMemberName %Globals 11 "LightBorder"
- OpMemberName %Globals 12 "LightConfig0"
- OpMemberName %Globals 13 "LightConfig1"
- OpMemberName %Globals 14 "LightConfig2"
- OpMemberName %Globals 15 "LightConfig3"
- OpMemberName %Globals 16 "RefractionBias_FadeDistance_GlowFactor"
- OpMemberName %Globals 17 "OutlineBrightness_ShadowInfo"
- OpMemberName %Globals 18 "ShadowMatrix0"
- OpMemberName %Globals 19 "ShadowMatrix1"
- OpMemberName %Globals 20 "ShadowMatrix2"
- OpName %CB0 "CB0"
- OpMemberName %CB0 0 "CB0"
- OpName %_ ""
- OpName %LightMapTexture "LightMapTexture"
- OpName %LightMapSampler "LightMapSampler"
- OpName %ShadowMapSampler "ShadowMapSampler"
- OpName %ShadowMapTexture "ShadowMapTexture"
- OpName %EnvironmentMapTexture "EnvironmentMapTexture"
- OpName %EnvironmentMapSampler "EnvironmentMapSampler"
- OpName %IN_HPosition "IN.HPosition"
- OpName %IN_Uv_EdgeDistance1 "IN.Uv_EdgeDistance1"
- OpName %IN_UvStuds_EdgeDistance2 "IN.UvStuds_EdgeDistance2"
- OpName %IN_Color "IN.Color"
- OpName %IN_LightPosition_Fog "IN.LightPosition_Fog"
- OpName %IN_View_Depth "IN.View_Depth"
- OpName %IN_Normal_SpecPower "IN.Normal_SpecPower"
- OpName %IN_Tangent "IN.Tangent"
- OpName %IN_PosLightSpace_Reflectance "IN.PosLightSpace_Reflectance"
- OpName %IN_studIndex "IN.studIndex"
- OpName %_entryPointOutput "@entryPointOutput"
- OpName %DiffuseMapSampler "DiffuseMapSampler"
- OpName %DiffuseMapTexture "DiffuseMapTexture"
- OpName %NormalMapSampler "NormalMapSampler"
- OpName %NormalMapTexture "NormalMapTexture"
- OpName %NormalDetailMapTexture "NormalDetailMapTexture"
- OpName %NormalDetailMapSampler "NormalDetailMapSampler"
- OpName %StudsMapTexture "StudsMapTexture"
- OpName %StudsMapSampler "StudsMapSampler"
- OpName %SpecularMapSampler "SpecularMapSampler"
- OpName %SpecularMapTexture "SpecularMapTexture"
- OpName %Params "Params"
- OpMemberName %Params 0 "LqmatFarTilingFactor"
- OpName %CB2 "CB2"
- OpMemberName %CB2 0 "CB2"
- OpMemberDecorate %Globals 0 ColMajor
- OpMemberDecorate %Globals 0 Offset 0
- OpMemberDecorate %Globals 0 MatrixStride 16
- OpMemberDecorate %Globals 1 Offset 64
- OpMemberDecorate %Globals 2 Offset 80
- OpMemberDecorate %Globals 3 Offset 96
- OpMemberDecorate %Globals 4 Offset 112
- OpMemberDecorate %Globals 5 Offset 128
- OpMemberDecorate %Globals 6 Offset 144
- OpMemberDecorate %Globals 7 Offset 160
- OpMemberDecorate %Globals 8 Offset 176
- OpMemberDecorate %Globals 9 Offset 192
- OpMemberDecorate %Globals 10 Offset 208
- OpMemberDecorate %Globals 11 Offset 224
- OpMemberDecorate %Globals 12 Offset 240
- OpMemberDecorate %Globals 13 Offset 256
- OpMemberDecorate %Globals 14 Offset 272
- OpMemberDecorate %Globals 15 Offset 288
- OpMemberDecorate %Globals 16 Offset 304
- OpMemberDecorate %Globals 17 Offset 320
- OpMemberDecorate %Globals 18 Offset 336
- OpMemberDecorate %Globals 19 Offset 352
- OpMemberDecorate %Globals 20 Offset 368
- OpMemberDecorate %CB0 0 Offset 0
- OpDecorate %CB0 Block
- OpDecorate %_ DescriptorSet 0
- OpDecorate %_ Binding 0
- OpDecorate %LightMapTexture DescriptorSet 1
- OpDecorate %LightMapTexture Binding 6
- OpDecorate %LightMapSampler DescriptorSet 1
- OpDecorate %LightMapSampler Binding 6
- OpDecorate %ShadowMapSampler DescriptorSet 1
- OpDecorate %ShadowMapSampler Binding 1
- OpDecorate %ShadowMapTexture DescriptorSet 1
- OpDecorate %ShadowMapTexture Binding 1
- OpDecorate %EnvironmentMapTexture DescriptorSet 1
- OpDecorate %EnvironmentMapTexture Binding 2
- OpDecorate %EnvironmentMapSampler DescriptorSet 1
- OpDecorate %EnvironmentMapSampler Binding 2
- OpDecorate %IN_HPosition BuiltIn FragCoord
- OpDecorate %IN_Uv_EdgeDistance1 Location 0
- OpDecorate %IN_UvStuds_EdgeDistance2 Location 1
- OpDecorate %IN_Color Location 2
- OpDecorate %IN_LightPosition_Fog Location 3
- OpDecorate %IN_View_Depth Location 4
- OpDecorate %IN_Normal_SpecPower Location 5
- OpDecorate %IN_Tangent Location 6
- OpDecorate %IN_PosLightSpace_Reflectance Location 7
- OpDecorate %IN_studIndex Location 8
- OpDecorate %_entryPointOutput Location 0
- OpDecorate %DiffuseMapSampler DescriptorSet 1
- OpDecorate %DiffuseMapSampler Binding 3
- OpDecorate %DiffuseMapTexture DescriptorSet 1
- OpDecorate %DiffuseMapTexture Binding 3
- OpDecorate %NormalMapSampler DescriptorSet 1
- OpDecorate %NormalMapSampler Binding 4
- OpDecorate %NormalMapTexture DescriptorSet 1
- OpDecorate %NormalMapTexture Binding 4
- OpDecorate %NormalDetailMapTexture DescriptorSet 1
- OpDecorate %NormalDetailMapTexture Binding 8
- OpDecorate %NormalDetailMapSampler DescriptorSet 1
- OpDecorate %NormalDetailMapSampler Binding 8
- OpDecorate %StudsMapTexture DescriptorSet 1
- OpDecorate %StudsMapTexture Binding 0
- OpDecorate %StudsMapSampler DescriptorSet 1
- OpDecorate %StudsMapSampler Binding 0
- OpDecorate %SpecularMapSampler DescriptorSet 1
- OpDecorate %SpecularMapSampler Binding 5
- OpDecorate %SpecularMapTexture DescriptorSet 1
- OpDecorate %SpecularMapTexture Binding 5
- OpMemberDecorate %Params 0 Offset 0
- OpMemberDecorate %CB2 0 Offset 0
- OpDecorate %CB2 Block
- %void = OpTypeVoid
- %3 = OpTypeFunction %void
- %float = OpTypeFloat 32
-%_ptr_Function_float = OpTypePointer Function %float
- %8 = OpTypeFunction %float %_ptr_Function_float
- %v4float = OpTypeVector %float 4
-%_ptr_Function_v4float = OpTypePointer Function %v4float
- %v3float = OpTypeVector %float 3
- %18 = OpTypeFunction %v3float %_ptr_Function_v4float
-%_ptr_Function_v3float = OpTypePointer Function %v3float
- %23 = OpTypeFunction %v4float %_ptr_Function_v3float
- %27 = OpTypeFunction %float %_ptr_Function_v3float
- %31 = OpTypeFunction %float %_ptr_Function_float %_ptr_Function_float
- %36 = OpTypeSampler
-%_ptr_Function_36 = OpTypePointer Function %36
- %38 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_Function_38 = OpTypePointer Function %38
- %40 = OpTypeFunction %float %_ptr_Function_36 %_ptr_Function_38 %_ptr_Function_v3float %_ptr_Function_float
-%VertexOutput = OpTypeStruct %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v3float %v4float %float
-%_ptr_Function_VertexOutput = OpTypePointer Function %VertexOutput
- %Surface = OpTypeStruct %v3float %v3float %float %float %float %float
- %50 = OpTypeFunction %Surface %_ptr_Function_VertexOutput
- %54 = OpTypeFunction %v4float %_ptr_Function_VertexOutput
- %v2float = OpTypeVector %float 2
-%_ptr_Function_v2float = OpTypePointer Function %v2float
- %60 = OpTypeFunction %v4float %_ptr_Function_36 %_ptr_Function_38 %_ptr_Function_v2float %_ptr_Function_float %_ptr_Function_float
-%SurfaceInput = OpTypeStruct %v4float %v2float %v2float
-%_ptr_Function_SurfaceInput = OpTypePointer Function %SurfaceInput
- %70 = OpTypeFunction %Surface %_ptr_Function_SurfaceInput %_ptr_Function_v2float
- %float_0 = OpConstant %float 0
- %float_1 = OpConstant %float 1
- %float_2 = OpConstant %float 2
-%mat4v4float = OpTypeMatrix %v4float 4
- %Globals = OpTypeStruct %mat4v4float %v4float %v4float %v4float %v3float %v3float %v3float %v3float %v3float %v4float %v3float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float
- %CB0 = OpTypeStruct %Globals
-%_ptr_Uniform_CB0 = OpTypePointer Uniform %CB0
- %_ = OpVariable %_ptr_Uniform_CB0 Uniform
- %int = OpTypeInt 32 1
- %int_0 = OpConstant %int 0
- %int_15 = OpConstant %int 15
-%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
- %int_14 = OpConstant %int 14
- %128 = OpConstantComposite %v3float %float_1 %float_1 %float_1
- %133 = OpTypeImage %float 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_133 = OpTypePointer UniformConstant %133
-%LightMapTexture = OpVariable %_ptr_UniformConstant_133 UniformConstant
-%_ptr_UniformConstant_36 = OpTypePointer UniformConstant %36
-%LightMapSampler = OpVariable %_ptr_UniformConstant_36 UniformConstant
- %140 = OpTypeSampledImage %133
- %int_11 = OpConstant %int 11
- %uint = OpTypeInt 32 0
- %float_9 = OpConstant %float 9
- %float_20 = OpConstant %float 20
- %float_0_5 = OpConstant %float 0.5
- %183 = OpTypeSampledImage %38
- %uint_0 = OpConstant %uint 0
- %uint_1 = OpConstant %uint 1
- %int_17 = OpConstant %int 17
- %uint_3 = OpConstant %uint 3
-%_ptr_Uniform_float = OpTypePointer Uniform %float
- %float_0_25 = OpConstant %float 0.25
- %int_5 = OpConstant %int 5
-%float_0_00333333 = OpConstant %float 0.00333333
- %int_16 = OpConstant %int 16
-%_ptr_Function_Surface = OpTypePointer Function %Surface
- %int_6 = OpConstant %int 6
- %int_7 = OpConstant %int 7
-%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
- %int_8 = OpConstant %int 8
-%ShadowMapSampler = OpVariable %_ptr_UniformConstant_36 UniformConstant
-%_ptr_UniformConstant_38 = OpTypePointer UniformConstant %38
-%ShadowMapTexture = OpVariable %_ptr_UniformConstant_38 UniformConstant
- %367 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_367 = OpTypePointer UniformConstant %367
-%EnvironmentMapTexture = OpVariable %_ptr_UniformConstant_367 UniformConstant
-%EnvironmentMapSampler = OpVariable %_ptr_UniformConstant_36 UniformConstant
- %373 = OpTypeSampledImage %367
- %float_1_5 = OpConstant %float 1.5
- %int_10 = OpConstant %int 10
-%_ptr_Input_v4float = OpTypePointer Input %v4float
-%IN_HPosition = OpVariable %_ptr_Input_v4float Input
-%IN_Uv_EdgeDistance1 = OpVariable %_ptr_Input_v4float Input
-%IN_UvStuds_EdgeDistance2 = OpVariable %_ptr_Input_v4float Input
- %IN_Color = OpVariable %_ptr_Input_v4float Input
-%IN_LightPosition_Fog = OpVariable %_ptr_Input_v4float Input
-%IN_View_Depth = OpVariable %_ptr_Input_v4float Input
-%IN_Normal_SpecPower = OpVariable %_ptr_Input_v4float Input
-%_ptr_Input_v3float = OpTypePointer Input %v3float
- %IN_Tangent = OpVariable %_ptr_Input_v3float Input
-%IN_PosLightSpace_Reflectance = OpVariable %_ptr_Input_v4float Input
-%_ptr_Input_float = OpTypePointer Input %float
-%IN_studIndex = OpVariable %_ptr_Input_float Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_entryPointOutput = OpVariable %_ptr_Output_v4float Output
- %bool = OpTypeBool
-%DiffuseMapSampler = OpVariable %_ptr_UniformConstant_36 UniformConstant
-%DiffuseMapTexture = OpVariable %_ptr_UniformConstant_38 UniformConstant
-%NormalMapSampler = OpVariable %_ptr_UniformConstant_36 UniformConstant
-%NormalMapTexture = OpVariable %_ptr_UniformConstant_38 UniformConstant
-%NormalDetailMapTexture = OpVariable %_ptr_UniformConstant_38 UniformConstant
-%NormalDetailMapSampler = OpVariable %_ptr_UniformConstant_36 UniformConstant
- %float_0_3 = OpConstant %float 0.3
-%StudsMapTexture = OpVariable %_ptr_UniformConstant_38 UniformConstant
-%StudsMapSampler = OpVariable %_ptr_UniformConstant_36 UniformConstant
-%SpecularMapSampler = OpVariable %_ptr_UniformConstant_36 UniformConstant
-%SpecularMapTexture = OpVariable %_ptr_UniformConstant_38 UniformConstant
- %float_0_75 = OpConstant %float 0.75
- %float_256 = OpConstant %float 256
- %689 = OpConstantComposite %v2float %float_2 %float_256
- %float_0_01 = OpConstant %float 0.01
- %692 = OpConstantComposite %v2float %float_0 %float_0_01
- %float_0_8 = OpConstant %float 0.8
- %float_120 = OpConstant %float 120
- %697 = OpConstantComposite %v2float %float_0_8 %float_120
- %Params = OpTypeStruct %v4float
- %CB2 = OpTypeStruct %Params
-%_ptr_Uniform_CB2 = OpTypePointer Uniform %CB2
- %false = OpConstantFalse %bool
- %1509 = OpUndef %VertexOutput
- %1510 = OpUndef %SurfaceInput
- %1511 = OpUndef %v2float
- %1512 = OpUndef %v4float
- %1531 = OpUndef %Surface
- %main = OpFunction %void None %3
- %5 = OpLabel
- %501 = OpLoad %v4float %IN_HPosition
- %1378 = OpCompositeInsert %VertexOutput %501 %1509 0
- %504 = OpLoad %v4float %IN_Uv_EdgeDistance1
- %1380 = OpCompositeInsert %VertexOutput %504 %1378 1
- %507 = OpLoad %v4float %IN_UvStuds_EdgeDistance2
- %1382 = OpCompositeInsert %VertexOutput %507 %1380 2
- %510 = OpLoad %v4float %IN_Color
- %1384 = OpCompositeInsert %VertexOutput %510 %1382 3
- %513 = OpLoad %v4float %IN_LightPosition_Fog
- %1386 = OpCompositeInsert %VertexOutput %513 %1384 4
- %516 = OpLoad %v4float %IN_View_Depth
- %1388 = OpCompositeInsert %VertexOutput %516 %1386 5
- %519 = OpLoad %v4float %IN_Normal_SpecPower
- %1390 = OpCompositeInsert %VertexOutput %519 %1388 6
- %523 = OpLoad %v3float %IN_Tangent
- %1392 = OpCompositeInsert %VertexOutput %523 %1390 7
- %526 = OpLoad %v4float %IN_PosLightSpace_Reflectance
- %1394 = OpCompositeInsert %VertexOutput %526 %1392 8
- %530 = OpLoad %float %IN_studIndex
- %1396 = OpCompositeInsert %VertexOutput %530 %1394 9
- %1400 = OpCompositeInsert %SurfaceInput %510 %1510 0
- %954 = OpVectorShuffle %v2float %504 %504 0 1
- %1404 = OpCompositeInsert %SurfaceInput %954 %1400 1
- %958 = OpVectorShuffle %v2float %507 %507 0 1
- %1408 = OpCompositeInsert %SurfaceInput %958 %1404 2
- %1410 = OpCompositeExtract %float %1408 2 1
- %962 = OpExtInst %float %1 Fract %1410
- %965 = OpFAdd %float %962 %530
- %966 = OpFMul %float %965 %float_0_25
- %1414 = OpCompositeInsert %SurfaceInput %966 %1408 2 1
- %1416 = OpCompositeExtract %float %1396 5 3
- %970 = OpFMul %float %1416 %float_0_00333333
- %971 = OpFSub %float %float_1 %970
- %987 = OpExtInst %float %1 FClamp %971 %float_0 %float_1
- %976 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_16 %uint_1
- %977 = OpLoad %float %976
- %978 = OpFMul %float %1416 %977
- %979 = OpFSub %float %float_1 %978
- %990 = OpExtInst %float %1 FClamp %979 %float_0 %float_1
- %1024 = OpVectorTimesScalar %v2float %954 %float_1
- %1029 = OpLoad %36 %DiffuseMapSampler
- %1030 = OpLoad %38 %DiffuseMapTexture
- OpBranch %1119
- %1119 = OpLabel
- OpLoopMerge %1120 %1121 None
- OpBranch %1122
- %1122 = OpLabel
- %1124 = OpFOrdEqual %bool %float_0 %float_0
- OpSelectionMerge %1125 None
- OpBranchConditional %1124 %1126 %1127
- %1126 = OpLabel
- %1130 = OpSampledImage %183 %1030 %1029
- %1132 = OpImageSampleImplicitLod %v4float %1130 %1024
- OpBranch %1120
- %1127 = OpLabel
- %1134 = OpFSub %float %float_1 %float_0
- %1135 = OpFDiv %float %float_1 %1134
- %1138 = OpSampledImage %183 %1030 %1029
- %1140 = OpVectorTimesScalar %v2float %1024 %float_0_25
- %1141 = OpImageSampleImplicitLod %v4float %1138 %1140
- %1144 = OpSampledImage %183 %1030 %1029
- %1146 = OpImageSampleImplicitLod %v4float %1144 %1024
- %1149 = OpFMul %float %987 %1135
- %1152 = OpFMul %float %float_0 %1135
- %1153 = OpFSub %float %1149 %1152
- %1161 = OpExtInst %float %1 FClamp %1153 %float_0 %float_1
- %1155 = OpCompositeConstruct %v4float %1161 %1161 %1161 %1161
- %1156 = OpExtInst %v4float %1 FMix %1141 %1146 %1155
- OpBranch %1120
- %1125 = OpLabel
- %1157 = OpUndef %v4float
- OpBranch %1120
- %1121 = OpLabel
- OpBranchConditional %false %1119 %1120
- %1120 = OpLabel
- %1517 = OpPhi %v4float %1132 %1126 %1156 %1127 %1157 %1125 %1512 %1121
- %1035 = OpVectorTimesScalar %v4float %1517 %float_1
- %1036 = OpLoad %36 %NormalMapSampler
- %1037 = OpLoad %38 %NormalMapTexture
- OpBranch %1165
- %1165 = OpLabel
- OpLoopMerge %1166 %1167 None
- OpBranch %1168
- %1168 = OpLabel
- OpSelectionMerge %1171 None
- OpBranchConditional %1124 %1172 %1173
- %1172 = OpLabel
- %1176 = OpSampledImage %183 %1037 %1036
- %1178 = OpImageSampleImplicitLod %v4float %1176 %1024
- OpBranch %1166
- %1173 = OpLabel
- %1180 = OpFSub %float %float_1 %float_0
- %1181 = OpFDiv %float %float_1 %1180
- %1184 = OpSampledImage %183 %1037 %1036
- %1186 = OpVectorTimesScalar %v2float %1024 %float_0_25
- %1187 = OpImageSampleImplicitLod %v4float %1184 %1186
- %1190 = OpSampledImage %183 %1037 %1036
- %1192 = OpImageSampleImplicitLod %v4float %1190 %1024
- %1195 = OpFMul %float %990 %1181
- %1198 = OpFMul %float %float_0 %1181
- %1199 = OpFSub %float %1195 %1198
- %1206 = OpExtInst %float %1 FClamp %1199 %float_0 %float_1
- %1201 = OpCompositeConstruct %v4float %1206 %1206 %1206 %1206
- %1202 = OpExtInst %v4float %1 FMix %1187 %1192 %1201
- OpBranch %1166
- %1171 = OpLabel
- %1203 = OpUndef %v4float
- OpBranch %1166
- %1167 = OpLabel
- OpBranchConditional %false %1165 %1166
- %1166 = OpLabel
- %1523 = OpPhi %v4float %1178 %1172 %1202 %1173 %1203 %1171 %1512 %1167
- %1210 = OpVectorShuffle %v2float %1523 %1523 3 1
- %1211 = OpVectorTimesScalar %v2float %1210 %float_2
- %1212 = OpCompositeConstruct %v2float %float_1 %float_1
- %1213 = OpFSub %v2float %1211 %1212
- %1216 = OpFNegate %v2float %1213
- %1218 = OpDot %float %1216 %1213
- %1219 = OpFAdd %float %float_1 %1218
- %1220 = OpExtInst %float %1 FClamp %1219 %float_0 %float_1
- %1221 = OpExtInst %float %1 Sqrt %1220
- %1222 = OpCompositeExtract %float %1213 0
- %1223 = OpCompositeExtract %float %1213 1
- %1224 = OpCompositeConstruct %v3float %1222 %1223 %1221
- %1042 = OpLoad %38 %NormalDetailMapTexture
- %1043 = OpLoad %36 %NormalDetailMapSampler
- %1044 = OpSampledImage %183 %1042 %1043
- %1046 = OpVectorTimesScalar %v2float %1024 %float_0
- %1047 = OpImageSampleImplicitLod %v4float %1044 %1046
- %1228 = OpVectorShuffle %v2float %1047 %1047 3 1
- %1229 = OpVectorTimesScalar %v2float %1228 %float_2
- %1231 = OpFSub %v2float %1229 %1212
- %1234 = OpFNegate %v2float %1231
- %1236 = OpDot %float %1234 %1231
- %1237 = OpFAdd %float %float_1 %1236
- %1238 = OpExtInst %float %1 FClamp %1237 %float_0 %float_1
- %1239 = OpExtInst %float %1 Sqrt %1238
- %1240 = OpCompositeExtract %float %1231 0
- %1241 = OpCompositeExtract %float %1231 1
- %1242 = OpCompositeConstruct %v3float %1240 %1241 %1239
- %1050 = OpVectorShuffle %v2float %1242 %1242 0 1
- %1051 = OpVectorTimesScalar %v2float %1050 %float_0
- %1053 = OpVectorShuffle %v2float %1224 %1224 0 1
- %1054 = OpFAdd %v2float %1053 %1051
- %1056 = OpVectorShuffle %v3float %1224 %1054 3 4 2
- %1059 = OpVectorShuffle %v2float %1056 %1056 0 1
- %1060 = OpVectorTimesScalar %v2float %1059 %990
- %1062 = OpVectorShuffle %v3float %1056 %1060 3 4 2
- %1430 = OpCompositeExtract %float %1062 0
- %1065 = OpFMul %float %1430 %float_0_3
- %1066 = OpFAdd %float %float_1 %1065
- %1069 = OpVectorShuffle %v3float %510 %510 0 1 2
- %1071 = OpVectorShuffle %v3float %1035 %1035 0 1 2
- %1072 = OpFMul %v3float %1069 %1071
- %1074 = OpVectorTimesScalar %v3float %1072 %1066
- %1075 = OpLoad %38 %StudsMapTexture
- %1076 = OpLoad %36 %StudsMapSampler
- %1077 = OpSampledImage %183 %1075 %1076
- %1434 = OpCompositeExtract %v2float %1414 2
- %1080 = OpImageSampleImplicitLod %v4float %1077 %1434
- %1436 = OpCompositeExtract %float %1080 0
- %1083 = OpFMul %float %1436 %float_2
- %1085 = OpVectorTimesScalar %v3float %1074 %1083
- %1086 = OpLoad %36 %SpecularMapSampler
- %1087 = OpLoad %38 %SpecularMapTexture
- OpBranch %1246
- %1246 = OpLabel
- OpLoopMerge %1247 %1248 None
- OpBranch %1249
- %1249 = OpLabel
- %1251 = OpFOrdEqual %bool %float_0_75 %float_0
- OpSelectionMerge %1252 None
- OpBranchConditional %1251 %1253 %1254
- %1253 = OpLabel
- %1257 = OpSampledImage %183 %1087 %1086
- %1259 = OpImageSampleImplicitLod %v4float %1257 %1024
- OpBranch %1247
- %1254 = OpLabel
- %1261 = OpFSub %float %float_1 %float_0_75
- %1262 = OpFDiv %float %float_1 %1261
- %1265 = OpSampledImage %183 %1087 %1086
- %1267 = OpVectorTimesScalar %v2float %1024 %float_0_25
- %1268 = OpImageSampleImplicitLod %v4float %1265 %1267
- %1271 = OpSampledImage %183 %1087 %1086
- %1273 = OpImageSampleImplicitLod %v4float %1271 %1024
- %1276 = OpFMul %float %990 %1262
- %1279 = OpFMul %float %float_0_75 %1262
- %1280 = OpFSub %float %1276 %1279
- %1287 = OpExtInst %float %1 FClamp %1280 %float_0 %float_1
- %1282 = OpCompositeConstruct %v4float %1287 %1287 %1287 %1287
- %1283 = OpExtInst %v4float %1 FMix %1268 %1273 %1282
- OpBranch %1247
- %1252 = OpLabel
- %1284 = OpUndef %v4float
- OpBranch %1247
- %1248 = OpLabel
- OpBranchConditional %false %1246 %1247
- %1247 = OpLabel
- %1530 = OpPhi %v4float %1259 %1253 %1283 %1254 %1284 %1252 %1512 %1248
- %1091 = OpVectorShuffle %v2float %1530 %1530 0 1
- %1093 = OpFMul %v2float %1091 %689
- %1094 = OpFAdd %v2float %1093 %692
- %1097 = OpCompositeConstruct %v2float %990 %990
- %1098 = OpExtInst %v2float %1 FMix %697 %1094 %1097
- %1438 = OpCompositeInsert %Surface %1085 %1531 0
- %1440 = OpCompositeInsert %Surface %1062 %1438 1
- %1442 = OpCompositeExtract %float %1098 0
- %1444 = OpCompositeInsert %Surface %1442 %1440 2
- %1446 = OpCompositeExtract %float %1098 1
- %1448 = OpCompositeInsert %Surface %1446 %1444 3
- %1450 = OpCompositeExtract %float %1091 1
- %1112 = OpFMul %float %1450 %990
- %1113 = OpFMul %float %1112 %float_0
- %1452 = OpCompositeInsert %Surface %1113 %1448 4
- %1456 = OpCompositeExtract %float %1396 3 3
- %764 = OpCompositeExtract %float %1085 0
- %765 = OpCompositeExtract %float %1085 1
- %766 = OpCompositeExtract %float %1085 2
- %767 = OpCompositeConstruct %v4float %764 %765 %766 %1456
- %770 = OpVectorShuffle %v3float %519 %519 0 1 2
- %773 = OpExtInst %v3float %1 Cross %770 %523
- %1462 = OpCompositeExtract %float %1452 1 0
- %778 = OpVectorTimesScalar %v3float %523 %1462
- %1466 = OpCompositeExtract %float %1452 1 1
- %782 = OpVectorTimesScalar %v3float %773 %1466
- %783 = OpFAdd %v3float %778 %782
- %1468 = OpCompositeExtract %float %1452 1 2
- %789 = OpVectorTimesScalar %v3float %770 %1468
- %790 = OpFAdd %v3float %783 %789
- %791 = OpExtInst %v3float %1 Normalize %790
- %793 = OpAccessChain %_ptr_Uniform_v3float %_ %int_0 %int_7
- %794 = OpLoad %v3float %793
- %795 = OpFNegate %v3float %794
- %796 = OpDot %float %791 %795
- %1290 = OpExtInst %float %1 FClamp %796 %float_0 %float_1
- %799 = OpAccessChain %_ptr_Uniform_v3float %_ %int_0 %int_6
- %800 = OpLoad %v3float %799
- %801 = OpVectorTimesScalar %v3float %800 %1290
- %803 = OpFNegate %float %796
- %804 = OpExtInst %float %1 FMax %803 %float_0
- %805 = OpAccessChain %_ptr_Uniform_v3float %_ %int_0 %int_8
- %806 = OpLoad %v3float %805
- %807 = OpVectorTimesScalar %v3float %806 %804
- %808 = OpFAdd %v3float %801 %807
- %810 = OpExtInst %float %1 Step %float_0 %796
- %813 = OpFMul %float %810 %1442
- %820 = OpVectorShuffle %v3float %513 %513 0 1 2
- %1296 = OpAccessChain %_ptr_Uniform_v4float %_ %int_0 %int_15
- %1297 = OpLoad %v4float %1296
- %1298 = OpVectorShuffle %v3float %1297 %1297 0 1 2
- %1300 = OpAccessChain %_ptr_Uniform_v4float %_ %int_0 %int_14
- %1301 = OpLoad %v4float %1300
- %1302 = OpVectorShuffle %v3float %1301 %1301 0 1 2
- %1303 = OpFSub %v3float %820 %1302
- %1304 = OpExtInst %v3float %1 FAbs %1303
- %1305 = OpExtInst %v3float %1 Step %1298 %1304
- %1307 = OpDot %float %1305 %128
- %1328 = OpExtInst %float %1 FClamp %1307 %float_0 %float_1
- %1309 = OpLoad %133 %LightMapTexture
- %1310 = OpLoad %36 %LightMapSampler
- %1311 = OpSampledImage %140 %1309 %1310
- %1313 = OpVectorShuffle %v3float %820 %820 1 2 0
- %1317 = OpVectorTimesScalar %v3float %1313 %1328
- %1318 = OpFSub %v3float %1313 %1317
- %1319 = OpImageSampleImplicitLod %v4float %1311 %1318
- %1321 = OpAccessChain %_ptr_Uniform_v4float %_ %int_0 %int_11
- %1322 = OpLoad %v4float %1321
- %1324 = OpCompositeConstruct %v4float %1328 %1328 %1328 %1328
- %1325 = OpExtInst %v4float %1 FMix %1319 %1322 %1324
- %822 = OpLoad %36 %ShadowMapSampler
- %823 = OpLoad %38 %ShadowMapTexture
- %826 = OpVectorShuffle %v3float %526 %526 0 1 2
- %1482 = OpCompositeExtract %float %1325 3
- %1337 = OpSampledImage %183 %823 %822
- %1339 = OpVectorShuffle %v2float %826 %826 0 1
- %1340 = OpImageSampleImplicitLod %v4float %1337 %1339
- %1341 = OpVectorShuffle %v2float %1340 %1340 0 1
- %1484 = OpCompositeExtract %float %826 2
- %1486 = OpCompositeExtract %float %1341 0
- %1363 = OpExtInst %float %1 Step %1486 %1484
- %1365 = OpFSub %float %1484 %float_0_5
- %1366 = OpExtInst %float %1 FAbs %1365
- %1367 = OpFMul %float %float_20 %1366
- %1368 = OpFSub %float %float_9 %1367
- %1369 = OpExtInst %float %1 FClamp %1368 %float_0 %float_1
- %1370 = OpFMul %float %1363 %1369
- %1488 = OpCompositeExtract %float %1341 1
- %1350 = OpFMul %float %1370 %1488
- %1351 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_17 %uint_3
- %1352 = OpLoad %float %1351
- %1353 = OpFMul %float %1350 %1352
- %1354 = OpFSub %float %float_1 %1353
- %1356 = OpFMul %float %1354 %1482
- %830 = OpLoad %367 %EnvironmentMapTexture
- %831 = OpLoad %36 %EnvironmentMapSampler
- %832 = OpSampledImage %373 %830 %831
- %835 = OpVectorShuffle %v3float %516 %516 0 1 2
- %836 = OpFNegate %v3float %835
- %838 = OpExtInst %v3float %1 Reflect %836 %791
- %839 = OpImageSampleImplicitLod %v4float %832 %838
- %840 = OpVectorShuffle %v3float %839 %839 0 1 2
- %842 = OpVectorShuffle %v3float %767 %767 0 1 2
- %845 = OpCompositeConstruct %v3float %1113 %1113 %1113
- %846 = OpExtInst %v3float %1 FMix %842 %840 %845
- %848 = OpVectorShuffle %v4float %767 %846 4 5 6 3
- %849 = OpAccessChain %_ptr_Uniform_v3float %_ %int_0 %int_5
- %850 = OpLoad %v3float %849
- %853 = OpVectorTimesScalar %v3float %808 %1356
- %854 = OpFAdd %v3float %850 %853
- %856 = OpVectorShuffle %v3float %1325 %1325 0 1 2
- %857 = OpFAdd %v3float %854 %856
- %859 = OpVectorShuffle %v3float %848 %848 0 1 2
- %860 = OpFMul %v3float %857 %859
- %865 = OpFMul %float %813 %1356
- %873 = OpExtInst %v3float %1 Normalize %835
- %874 = OpFAdd %v3float %795 %873
- %875 = OpExtInst %v3float %1 Normalize %874
- %876 = OpDot %float %791 %875
- %877 = OpExtInst %float %1 FClamp %876 %float_0 %float_1
- %879 = OpExtInst %float %1 Pow %877 %1446
- %880 = OpFMul %float %865 %879
- %881 = OpVectorTimesScalar %v3float %800 %880
- %884 = OpFAdd %v3float %860 %881
- %886 = OpVectorShuffle %v4float %1512 %884 4 5 6 3
- %1494 = OpCompositeExtract %float %848 3
- %1496 = OpCompositeInsert %v4float %1494 %886 3
- %896 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_17 %uint_0
- %897 = OpLoad %float %896
- %898 = OpFMul %float %978 %897
- %899 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_17 %uint_1
- %900 = OpLoad %float %899
- %901 = OpFAdd %float %898 %900
- %1373 = OpExtInst %float %1 FClamp %901 %float_0 %float_1
- %905 = OpVectorShuffle %v2float %504 %504 3 2
- %908 = OpVectorShuffle %v2float %507 %507 3 2
- %909 = OpExtInst %v2float %1 FMin %905 %908
- %1504 = OpCompositeExtract %float %909 0
- %1506 = OpCompositeExtract %float %909 1
- %914 = OpExtInst %float %1 FMin %1504 %1506
- %916 = OpFDiv %float %914 %978
- %919 = OpFSub %float %float_1_5 %916
- %920 = OpFMul %float %1373 %919
- %922 = OpFAdd %float %920 %916
- %1376 = OpExtInst %float %1 FClamp %922 %float_0 %float_1
- %925 = OpVectorShuffle %v3float %1496 %1496 0 1 2
- %926 = OpVectorTimesScalar %v3float %925 %1376
- %928 = OpVectorShuffle %v4float %1496 %926 4 5 6 3
- %1508 = OpCompositeExtract %float %1396 4 3
- %931 = OpExtInst %float %1 FClamp %1508 %float_0 %float_1
- %932 = OpAccessChain %_ptr_Uniform_v3float %_ %int_0 %int_10
- %933 = OpLoad %v3float %932
- %935 = OpVectorShuffle %v3float %928 %928 0 1 2
- %937 = OpCompositeConstruct %v3float %931 %931 %931
- %938 = OpExtInst %v3float %1 FMix %933 %935 %937
- %940 = OpVectorShuffle %v4float %928 %938 4 5 6 3
- OpStore %_entryPointOutput %940
- OpReturn
- OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/comp/std140-array-load-composite-construct.comp b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/comp/std140-array-load-composite-construct.comp
new file mode 100644
index 00000000000..af1c47b32ce
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/comp/std140-array-load-composite-construct.comp
@@ -0,0 +1,13 @@
+#version 450
+layout(local_size_x = 1) in;
+
+layout(std140, binding = 0) buffer SSBO
+{
+ float a[16];
+ vec4 b[16];
+};
+
+void main()
+{
+ b[gl_GlobalInvocationID.x] = vec4(a[gl_GlobalInvocationID.x]);
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/packing/array-of-vec3.comp b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/packing/array-of-vec3.comp
new file mode 100644
index 00000000000..61572122222
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/packing/array-of-vec3.comp
@@ -0,0 +1,13 @@
+#version 450
+#extension GL_EXT_scalar_block_layout : require
+layout(local_size_x = 1) in;
+
+layout(set = 0, binding = 0, scalar) buffer SSBO
+{
+ vec3 v[16];
+};
+
+void main()
+{
+ v[1] = v[0];
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/packing/array-of-vec4.comp b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/packing/array-of-vec4.comp
new file mode 100644
index 00000000000..c5bf5e8a3fa
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl-no-opt/packing/array-of-vec4.comp
@@ -0,0 +1,13 @@
+#version 450
+#extension GL_EXT_scalar_block_layout : require
+layout(local_size_x = 1) in;
+
+layout(set = 0, binding = 0, scalar) buffer SSBO
+{
+ vec4 v[16];
+};
+
+void main()
+{
+ v[1] = v[0];
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/asm/comp/bitcast_icmp.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/asm/comp/bitcast_icmp.asm.comp
new file mode 100644
index 00000000000..b7b4e0b2e1e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/asm/comp/bitcast_icmp.asm.comp
@@ -0,0 +1,101 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 1
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %func "main"
+ OpExecutionMode %func LocalSize 1 1 1
+ OpSource ESSL 310
+ OpSourceExtension "GL_GOOGLE_cpp_style_line_directive"
+ OpSourceExtension "GL_GOOGLE_include_directive"
+ OpMemberDecorate %input_struct 0 Offset 0
+ OpMemberDecorate %input_struct 1 Offset 16
+ OpMemberDecorate %output_struct 0 Offset 0
+ OpMemberDecorate %output_struct 1 Offset 16
+ OpDecorate %input_struct BufferBlock
+ OpDecorate %inputs DescriptorSet 0
+ OpDecorate %inputs Binding 0
+ OpDecorate %inputs Restrict
+ OpDecorate %output_struct BufferBlock
+ OpDecorate %outputs DescriptorSet 0
+ OpDecorate %outputs Binding 1
+ OpDecorate %outputs Restrict
+
+ %void = OpTypeVoid
+ %main_func = OpTypeFunction %void
+
+ %bool = OpTypeBool
+ %bvec4 = OpTypeVector %bool 4
+
+ %uint = OpTypeInt 32 0
+ %uvec4 = OpTypeVector %uint 4
+
+ %int = OpTypeInt 32 1
+ %ivec4 = OpTypeVector %int 4
+
+ %ivec4_ptr = OpTypePointer Uniform %ivec4
+ %uvec4_ptr = OpTypePointer Uniform %uvec4
+
+ %zero = OpConstant %int 0
+ %one = OpConstant %int 1
+ %uzero = OpConstant %uint 0
+ %uone = OpConstant %uint 1
+ %utrue = OpConstantComposite %uvec4 %uone %uone %uone %uone
+ %ufalse = OpConstantComposite %uvec4 %uzero %uzero %uzero %uzero
+
+ %input_struct = OpTypeStruct %ivec4 %uvec4
+ %input_struct_ptr = OpTypePointer Uniform %input_struct
+ %inputs = OpVariable %input_struct_ptr Uniform
+ %output_struct = OpTypeStruct %uvec4 %ivec4
+ %output_struct_ptr = OpTypePointer Uniform %output_struct
+ %outputs = OpVariable %output_struct_ptr Uniform
+
+ %func = OpFunction %void None %main_func
+ %block = OpLabel
+
+ %input1_ptr = OpAccessChain %ivec4_ptr %inputs %zero
+ %input0_ptr = OpAccessChain %uvec4_ptr %inputs %one
+ %input1 = OpLoad %ivec4 %input1_ptr
+ %input0 = OpLoad %uvec4 %input0_ptr
+
+ %output_ptr_uvec4 = OpAccessChain %uvec4_ptr %outputs %zero
+
+ %result_slt = OpSLessThan %bvec4 %input0 %input1
+ %result_sle = OpSLessThanEqual %bvec4 %input0 %input1
+ %result_ult = OpULessThan %bvec4 %input0 %input1
+ %result_ule = OpULessThanEqual %bvec4 %input0 %input1
+ %result_sgt = OpSGreaterThan %bvec4 %input0 %input1
+ %result_sge = OpSGreaterThanEqual %bvec4 %input0 %input1
+ %result_ugt = OpUGreaterThan %bvec4 %input0 %input1
+ %result_uge = OpUGreaterThanEqual %bvec4 %input0 %input1
+
+ %int_slt = OpSelect %uvec4 %result_slt %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_slt
+
+ %int_sle = OpSelect %uvec4 %result_sle %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_sle
+
+ %int_ult = OpSelect %uvec4 %result_ult %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_ult
+
+ %int_ule = OpSelect %uvec4 %result_ule %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_ule
+
+ %int_sgt = OpSelect %uvec4 %result_sgt %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_sgt
+
+ %int_sge = OpSelect %uvec4 %result_sge %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_sge
+
+ %int_ugt = OpSelect %uvec4 %result_ugt %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_ugt
+
+ %int_uge = OpSelect %uvec4 %result_uge %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_uge
+
+
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/comp/complex-composite-constant-array.comp b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/comp/complex-composite-constant-array.comp
new file mode 100644
index 00000000000..96a3f8951d0
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/comp/complex-composite-constant-array.comp
@@ -0,0 +1,19 @@
+#version 450
+
+layout(std430, set = 0, binding = 0) buffer SSBO
+{
+ mat4 a;
+ uint index;
+};
+
+const mat4 as[] = mat4[](mat4(1.0), mat4(2.0));
+
+void write_global()
+{
+ a = as[index];
+}
+
+void main()
+{
+ write_global();
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/array-of-array-lut.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/array-of-array-lut.frag
new file mode 100644
index 00000000000..c401a3fe372
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/array-of-array-lut.frag
@@ -0,0 +1,12 @@
+#version 450
+
+layout(location = 0) out float vOutput;
+layout(location = 0) flat in int vIndex1;
+layout(location = 1) flat in int vIndex2;
+
+const float FOO[2][3] = float[][](float[](1.0, 2.0, 3.0), float[](4.0, 5.0, 6.0));
+
+void main()
+{
+ vOutput = FOO[vIndex1][vIndex2];
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag
new file mode 100644
index 00000000000..28d2b4ae8df
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag
@@ -0,0 +1,26 @@
+#version 450
+
+layout(location = 0) out vec4 FragColor;
+layout(location = 0) in vec2 vUV;
+layout(set = 0, binding = 0) uniform sampler2D uSamplers[10000];
+layout(set = 2, binding = 0) uniform sampler2D uSampler;
+
+layout(set = 1, binding = 0) uniform UBO
+{
+ vec4 v;
+} vs[10000];
+
+vec4 samp_array()
+{
+ return texture(uSamplers[9999], vUV) + vs[5000].v;
+}
+
+vec4 samp_single()
+{
+ return texture(uSampler, vUV);
+}
+
+void main()
+{
+ FragColor = samp_array() + samp_single();
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag
new file mode 100644
index 00000000000..9a855ac7a80
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag
@@ -0,0 +1,29 @@
+#version 450
+
+layout(set = 0, binding = 0) uniform texture2D uTexture;
+layout(set = 0, binding = 1) uniform sampler uSampler;
+layout(set = 0, binding = 2) uniform samplerShadow uSamplerShadow;
+
+layout(location = 0) out float FragColor;
+layout(location = 0) in vec3 vUV;
+
+float sample_normal2(texture2D tex)
+{
+ return texture(sampler2D(tex, uSampler), vUV.xy).x;
+}
+
+float sample_normal(texture2D tex)
+{
+ return sample_normal2(tex);
+}
+
+float sample_comp(texture2D tex)
+{
+ return texture(sampler2DShadow(tex, uSamplerShadow), vUV);
+}
+
+void main()
+{
+ FragColor = sample_normal(uTexture);
+ FragColor += sample_comp(uTexture);
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/texture-cube-array.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/texture-cube-array.frag
new file mode 100644
index 00000000000..91a55f933bc
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/texture-cube-array.frag
@@ -0,0 +1,16 @@
+#version 450
+
+layout(set = 0, binding = 0) uniform samplerCube cubeSampler;
+layout(set = 0, binding = 1) uniform samplerCubeArray cubeArraySampler;
+layout(set = 0, binding = 2) uniform sampler2DArray texArraySampler;
+
+layout(location = 0) in vec4 vUV;
+layout(location = 0) out vec4 FragColor;
+
+void main()
+{
+ vec4 a = texture(cubeSampler, vUV.xyz);
+ vec4 b = texture(cubeArraySampler, vUV);
+ vec4 c = texture(texArraySampler, vUV.xyz);
+ FragColor = a + b + c;
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/texture-cube-array.ios.emulate-cube-array.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/texture-cube-array.ios.emulate-cube-array.frag
new file mode 100644
index 00000000000..91a55f933bc
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/frag/texture-cube-array.ios.emulate-cube-array.frag
@@ -0,0 +1,16 @@
+#version 450
+
+layout(set = 0, binding = 0) uniform samplerCube cubeSampler;
+layout(set = 0, binding = 1) uniform samplerCubeArray cubeArraySampler;
+layout(set = 0, binding = 2) uniform sampler2DArray texArraySampler;
+
+layout(location = 0) in vec4 vUV;
+layout(location = 0) out vec4 FragColor;
+
+void main()
+{
+ vec4 a = texture(cubeSampler, vUV.xyz);
+ vec4 b = texture(cubeArraySampler, vUV);
+ vec4 c = texture(texArraySampler, vUV.xyz);
+ FragColor = a + b + c;
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tesc/load-control-point-array-of-matrix.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tesc/load-control-point-array-of-matrix.tesc
new file mode 100644
index 00000000000..36b16681e28
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tesc/load-control-point-array-of-matrix.tesc
@@ -0,0 +1,12 @@
+#version 450
+
+layout(vertices = 4) out;
+
+layout(location = 0) in mat4 vInputs[gl_MaxPatchVertices];
+layout(location = 0) out mat4 vOutputs[4];
+
+void main()
+{
+ mat4 tmp[gl_MaxPatchVertices] = vInputs;
+ vOutputs[gl_InvocationID] = tmp[gl_InvocationID];
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tesc/load-control-point-array-of-struct.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tesc/load-control-point-array-of-struct.tesc
new file mode 100644
index 00000000000..4b4d5bfcd13
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tesc/load-control-point-array-of-struct.tesc
@@ -0,0 +1,21 @@
+#version 450
+
+layout(vertices = 4) out;
+
+struct VertexData
+{
+ mat4 a;
+ vec4 b[2];
+ vec4 c;
+};
+
+layout(location = 0) in VertexData vInputs[gl_MaxPatchVertices];
+layout(location = 0) out vec4 vOutputs[4];
+
+void main()
+{
+ VertexData tmp[gl_MaxPatchVertices] = vInputs;
+ VertexData tmp_single = vInputs[gl_InvocationID ^ 1];
+
+ vOutputs[gl_InvocationID] = tmp[gl_InvocationID].a[1] + tmp[gl_InvocationID].b[1] + tmp[gl_InvocationID].c + tmp_single.c;
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tesc/load-control-point-array.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tesc/load-control-point-array.tesc
new file mode 100644
index 00000000000..1a5924b895f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tesc/load-control-point-array.tesc
@@ -0,0 +1,12 @@
+#version 450
+
+layout(vertices = 4) out;
+
+layout(location = 0) in vec4 vInputs[gl_MaxPatchVertices];
+layout(location = 0) out vec4 vOutputs[4];
+
+void main()
+{
+ vec4 tmp[gl_MaxPatchVertices] = vInputs;
+ vOutputs[gl_InvocationID] = tmp[gl_InvocationID];
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tese/load-control-point-array-of-matrix.tese b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tese/load-control-point-array-of-matrix.tese
new file mode 100644
index 00000000000..479b3e651b7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tese/load-control-point-array-of-matrix.tese
@@ -0,0 +1,13 @@
+#version 450
+
+layout(cw, quads) in;
+layout(location = 0) in mat4 vInputs[gl_MaxPatchVertices];
+layout(location = 4) patch in vec4 vBoo[4];
+layout(location = 8) patch in int vIndex;
+
+void main()
+{
+ mat4 tmp[gl_MaxPatchVertices] = vInputs;
+ gl_Position = tmp[0][vIndex] + tmp[1][vIndex] + vBoo[vIndex];
+
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tese/load-control-point-array.tese b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tese/load-control-point-array.tese
new file mode 100644
index 00000000000..4fa0bb1242a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/tese/load-control-point-array.tese
@@ -0,0 +1,13 @@
+#version 450
+
+layout(cw, quads) in;
+layout(location = 0) in vec4 vInputs[gl_MaxPatchVertices];
+layout(location = 1) patch in vec4 vBoo[4];
+layout(location = 5) patch in int vIndex;
+
+void main()
+{
+ vec4 tmp[gl_MaxPatchVertices] = vInputs;
+ gl_Position = tmp[0] + tmp[1] + vBoo[vIndex];
+
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/vert/float-math.invariant-float-math.vert b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/vert/float-math.invariant-float-math.vert
new file mode 100644
index 00000000000..caa8639a895
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/vert/float-math.invariant-float-math.vert
@@ -0,0 +1,25 @@
+#version 450
+
+layout(set = 0, binding = 0) uniform Matrices
+{
+ mat4 vpMatrix;
+ mat4 wMatrix;
+ mat4x3 wMatrix4x3;
+ mat3x4 wMatrix3x4;
+};
+
+layout(location = 0) in vec3 InPos;
+layout(location = 1) in vec3 InNormal;
+
+layout(location = 0) out vec3 OutNormal;
+layout(location = 1) out vec4 OutWorldPos[4];
+
+void main()
+{
+ gl_Position = vpMatrix * wMatrix * vec4(InPos, 1);
+ OutWorldPos[0] = wMatrix * vec4(InPos, 1);
+ OutWorldPos[1] = vec4(InPos, 1) * wMatrix;
+ OutWorldPos[2] = wMatrix3x4 * InPos;
+ OutWorldPos[3] = InPos * wMatrix4x3;
+ OutNormal = (wMatrix * vec4(InNormal, 0)).xyz;
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/vert/float-math.vert b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/vert/float-math.vert
new file mode 100644
index 00000000000..caa8639a895
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-msl/vert/float-math.vert
@@ -0,0 +1,25 @@
+#version 450
+
+layout(set = 0, binding = 0) uniform Matrices
+{
+ mat4 vpMatrix;
+ mat4 wMatrix;
+ mat4x3 wMatrix4x3;
+ mat3x4 wMatrix3x4;
+};
+
+layout(location = 0) in vec3 InPos;
+layout(location = 1) in vec3 InNormal;
+
+layout(location = 0) out vec3 OutNormal;
+layout(location = 1) out vec4 OutWorldPos[4];
+
+void main()
+{
+ gl_Position = vpMatrix * wMatrix * vec4(InPos, 1);
+ OutWorldPos[0] = wMatrix * vec4(InPos, 1);
+ OutWorldPos[1] = vec4(InPos, 1) * wMatrix;
+ OutWorldPos[2] = wMatrix3x4 * InPos;
+ OutWorldPos[3] = InPos * wMatrix4x3;
+ OutNormal = (wMatrix * vec4(InNormal, 0)).xyz;
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/comp/access-tracking-function-call-result.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/comp/access-tracking-function-call-result.asm.comp
new file mode 100644
index 00000000000..c11d4cdd0a9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/comp/access-tracking-function-call-result.asm.comp
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.5
+; Generator: Khronos SPIR-V Tools Assembler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ OpSource GLSL 460
+ OpName %main "main"
+ OpName %foo_ "foo("
+ OpName %Output "Output"
+ OpMemberName %Output 0 "myout"
+ OpName %_ ""
+ OpMemberDecorate %Output 0 Offset 0
+ OpDecorate %Output BufferBlock
+ OpDecorate %_ DescriptorSet 0
+ OpDecorate %_ Binding 0
+ %void = OpTypeVoid
+ %7 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %9 = OpTypeFunction %int
+ %int_12 = OpConstant %int 12
+ %bool = OpTypeBool
+ %true = OpConstantTrue %bool
+ %Output = OpTypeStruct %int
+%_ptr_Uniform_Output = OpTypePointer Uniform %Output
+ %_ = OpVariable %_ptr_Uniform_Output Uniform
+ %int_0 = OpConstant %int 0
+%_ptr_Uniform_int = OpTypePointer Uniform %int
+ %main = OpFunction %void None %7
+ %16 = OpLabel
+ %17 = OpFunctionCall %int %foo_
+ OpBranch %18
+ %18 = OpLabel
+ OpLoopMerge %19 %20 None
+ OpBranchConditional %true %21 %19
+ %21 = OpLabel
+ %22 = OpAccessChain %_ptr_Uniform_int %_ %int_0
+ OpStore %22 %17
+ OpReturn
+ %20 = OpLabel
+ OpBranch %18
+ %19 = OpLabel
+ %23 = OpAccessChain %_ptr_Uniform_int %_ %int_0
+ OpStore %23 %17
+ OpReturn
+ OpFunctionEnd
+ %foo_ = OpFunction %int None %9
+ %24 = OpLabel
+ OpReturnValue %int_12
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp
new file mode 100644
index 00000000000..87aee2db54f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 7
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ OpSource GLSL 450
+ OpName %main "main"
+ OpName %T "T"
+ OpMemberName %T 0 "a"
+ OpName %v "v"
+ OpName %T_0 "T"
+ OpMemberName %T_0 0 "b"
+ OpName %SSBO1 "SSBO1"
+ OpMemberName %SSBO1 0 "foo"
+ OpName %_ ""
+ OpName %T_1 "T"
+ OpMemberName %T_1 0 "c"
+ OpName %SSBO2 "SSBO2"
+ OpMemberName %SSBO2 0 "bar"
+ OpName %__0 ""
+ OpMemberDecorate %T_0 0 Offset 0
+ OpDecorate %_runtimearr_T_0 ArrayStride 4
+ OpMemberDecorate %SSBO1 0 Offset 0
+ OpDecorate %SSBO1 BufferBlock
+ OpDecorate %_ DescriptorSet 0
+ OpDecorate %_ Binding 0
+ OpMemberDecorate %T_1 0 Offset 0
+ OpDecorate %_runtimearr_T_1 ArrayStride 16
+ OpMemberDecorate %SSBO2 0 Offset 0
+ OpDecorate %SSBO2 BufferBlock
+ OpDecorate %__0 DescriptorSet 0
+ OpDecorate %__0 Binding 1
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %T = OpTypeStruct %float
+%_ptr_Function_T = OpTypePointer Function %T
+ %float_40 = OpConstant %float 40
+ %11 = OpConstantComposite %T %float_40
+ %T_0 = OpTypeStruct %float
+%_runtimearr_T_0 = OpTypeRuntimeArray %T_0
+ %SSBO1 = OpTypeStruct %_runtimearr_T_0
+%_ptr_Uniform_SSBO1 = OpTypePointer Uniform %SSBO1
+ %_ = OpVariable %_ptr_Uniform_SSBO1 Uniform
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %int_10 = OpConstant %int 10
+%_ptr_Uniform_T_0 = OpTypePointer Uniform %T_0
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+ %T_1 = OpTypeStruct %float
+%_runtimearr_T_1 = OpTypeRuntimeArray %T_1
+ %SSBO2 = OpTypeStruct %_runtimearr_T_1
+%_ptr_Uniform_SSBO2 = OpTypePointer Uniform %SSBO2
+ %__0 = OpVariable %_ptr_Uniform_SSBO2 Uniform
+ %int_30 = OpConstant %int 30
+%_ptr_Uniform_T_1 = OpTypePointer Uniform %T_1
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %v = OpVariable %_ptr_Function_T Function
+ OpStore %v %11
+ %20 = OpLoad %T %v
+ %22 = OpAccessChain %_ptr_Uniform_T_0 %_ %int_0 %int_10
+ %23 = OpCompositeExtract %float %20 0
+ %25 = OpAccessChain %_ptr_Uniform_float %22 %int_0
+ OpStore %25 %23
+ %32 = OpLoad %T %v
+ %34 = OpAccessChain %_ptr_Uniform_T_1 %__0 %int_0 %int_30
+ %35 = OpCompositeExtract %float %32 0
+ %36 = OpAccessChain %_ptr_Uniform_float %34 %int_0
+ OpStore %36 %35
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/frag/empty-struct-in-struct.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/frag/empty-struct-in-struct.asm.frag
new file mode 100644
index 00000000000..a9650ddbb6b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/frag/empty-struct-in-struct.asm.frag
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.2
+; Generator: Khronos; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %EntryPoint_Main "main"
+ OpExecutionMode %EntryPoint_Main OriginUpperLeft
+ OpSource Unknown 100
+ OpName %EmptyStructTest "EmptyStructTest"
+ OpName %EmptyStruct2Test "EmptyStruct2Test"
+ OpName %GetValue "GetValue"
+ OpName %GetValue2 "GetValue"
+ OpName %self "self"
+ OpName %self2 "self"
+ OpName %emptyStruct "emptyStruct"
+ OpName %value "value"
+ OpName %EntryPoint_Main "EntryPoint_Main"
+
+%EmptyStructTest = OpTypeStruct
+%EmptyStruct2Test = OpTypeStruct %EmptyStructTest
+%_ptr_Function_EmptyStruct2Test = OpTypePointer Function %EmptyStruct2Test
+ %float = OpTypeFloat 32
+%_ptr_Function_float = OpTypePointer Function %float
+ %5 = OpTypeFunction %float %_ptr_Function_EmptyStruct2Test
+ %6 = OpTypeFunction %float %EmptyStruct2Test
+ %void = OpTypeVoid
+%_ptr_Function_void = OpTypePointer Function %void
+ %8 = OpTypeFunction %void %_ptr_Function_EmptyStruct2Test
+ %9 = OpTypeFunction %void
+ %float_0 = OpConstant %float 0
+ %value4 = OpConstantNull %EmptyStruct2Test
+
+ %GetValue = OpFunction %float None %5
+ %self = OpFunctionParameter %_ptr_Function_EmptyStruct2Test
+ %13 = OpLabel
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ %GetValue2 = OpFunction %float None %6
+ %self2 = OpFunctionParameter %EmptyStruct2Test
+ %14 = OpLabel
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+%EntryPoint_Main = OpFunction %void None %9
+ %37 = OpLabel
+ %emptyStruct = OpVariable %_ptr_Function_EmptyStruct2Test Function
+ %18 = OpVariable %_ptr_Function_EmptyStruct2Test Function
+ %value = OpVariable %_ptr_Function_float Function
+ %value2 = OpCompositeConstruct %EmptyStructTest
+ %value3 = OpCompositeConstruct %EmptyStruct2Test %value2
+ %22 = OpFunctionCall %float %GetValue %emptyStruct
+ %23 = OpFunctionCall %float %GetValue2 %value3
+ %24 = OpFunctionCall %float %GetValue2 %value4
+ OpStore %value %22
+ OpStore %value %23
+ OpStore %value %24
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/frag/unordered-compare.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/frag/unordered-compare.asm.frag
new file mode 100644
index 00000000000..4ad8fc5abb8
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/frag/unordered-compare.asm.frag
@@ -0,0 +1,177 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 7
+; Bound: 132
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %A %B %FragColor
+ OpExecutionMode %main OriginUpperLeft
+ OpSource GLSL 450
+ OpName %main "main"
+ OpName %test_vector_ "test_vector("
+ OpName %test_scalar_ "test_scalar("
+ OpName %le "le"
+ OpName %A "A"
+ OpName %B "B"
+ OpName %leq "leq"
+ OpName %ge "ge"
+ OpName %geq "geq"
+ OpName %eq "eq"
+ OpName %neq "neq"
+ OpName %le_0 "le"
+ OpName %leq_0 "leq"
+ OpName %ge_0 "ge"
+ OpName %geq_0 "geq"
+ OpName %eq_0 "eq"
+ OpName %neq_0 "neq"
+ OpName %FragColor "FragColor"
+ OpDecorate %A Location 0
+ OpDecorate %B Location 1
+ OpDecorate %FragColor Location 0
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %8 = OpTypeFunction %v4float
+ %11 = OpTypeFunction %float
+ %bool = OpTypeBool
+ %v4bool = OpTypeVector %bool 4
+%_ptr_Function_v4bool = OpTypePointer Function %v4bool
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+ %A = OpVariable %_ptr_Input_v4float Input
+ %B = OpVariable %_ptr_Input_v4float Input
+ %float_0 = OpConstant %float 0
+ %float_1 = OpConstant %float 1
+ %47 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+ %48 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_bool = OpTypePointer Function %bool
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_Input_float = OpTypePointer Input %float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %FragColor = OpVariable %_ptr_Output_v4float Output
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %128 = OpFunctionCall %v4float %test_vector_
+ %129 = OpFunctionCall %float %test_scalar_
+ %130 = OpCompositeConstruct %v4float %129 %129 %129 %129
+ %131 = OpFAdd %v4float %128 %130
+ OpStore %FragColor %131
+ OpReturn
+ OpFunctionEnd
+%test_vector_ = OpFunction %v4float None %8
+ %10 = OpLabel
+ %le = OpVariable %_ptr_Function_v4bool Function
+ %leq = OpVariable %_ptr_Function_v4bool Function
+ %ge = OpVariable %_ptr_Function_v4bool Function
+ %geq = OpVariable %_ptr_Function_v4bool Function
+ %eq = OpVariable %_ptr_Function_v4bool Function
+ %neq = OpVariable %_ptr_Function_v4bool Function
+ %20 = OpLoad %v4float %A
+ %22 = OpLoad %v4float %B
+ %23 = OpFUnordLessThan %v4bool %20 %22
+ OpStore %le %23
+ %25 = OpLoad %v4float %A
+ %26 = OpLoad %v4float %B
+ %27 = OpFUnordLessThanEqual %v4bool %25 %26
+ OpStore %leq %27
+ %29 = OpLoad %v4float %A
+ %30 = OpLoad %v4float %B
+ %31 = OpFUnordGreaterThan %v4bool %29 %30
+ OpStore %ge %31
+ %33 = OpLoad %v4float %A
+ %34 = OpLoad %v4float %B
+ %35 = OpFUnordGreaterThanEqual %v4bool %33 %34
+ OpStore %geq %35
+ %37 = OpLoad %v4float %A
+ %38 = OpLoad %v4float %B
+ %39 = OpFUnordEqual %v4bool %37 %38
+ OpStore %eq %39
+ %41 = OpLoad %v4float %A
+ %42 = OpLoad %v4float %B
+ %43 = OpFUnordNotEqual %v4bool %41 %42
+ OpStore %neq %43
+ %44 = OpLoad %v4bool %le
+ %49 = OpSelect %v4float %44 %48 %47
+ %50 = OpLoad %v4bool %leq
+ %51 = OpSelect %v4float %50 %48 %47
+ %52 = OpFAdd %v4float %49 %51
+ %53 = OpLoad %v4bool %ge
+ %54 = OpSelect %v4float %53 %48 %47
+ %55 = OpFAdd %v4float %52 %54
+ %56 = OpLoad %v4bool %geq
+ %57 = OpSelect %v4float %56 %48 %47
+ %58 = OpFAdd %v4float %55 %57
+ %59 = OpLoad %v4bool %eq
+ %60 = OpSelect %v4float %59 %48 %47
+ %61 = OpFAdd %v4float %58 %60
+ %62 = OpLoad %v4bool %neq
+ %63 = OpSelect %v4float %62 %48 %47
+ %64 = OpFAdd %v4float %61 %63
+ OpReturnValue %64
+ OpFunctionEnd
+%test_scalar_ = OpFunction %float None %11
+ %13 = OpLabel
+ %le_0 = OpVariable %_ptr_Function_bool Function
+ %leq_0 = OpVariable %_ptr_Function_bool Function
+ %ge_0 = OpVariable %_ptr_Function_bool Function
+ %geq_0 = OpVariable %_ptr_Function_bool Function
+ %eq_0 = OpVariable %_ptr_Function_bool Function
+ %neq_0 = OpVariable %_ptr_Function_bool Function
+ %72 = OpAccessChain %_ptr_Input_float %A %uint_0
+ %73 = OpLoad %float %72
+ %74 = OpAccessChain %_ptr_Input_float %B %uint_0
+ %75 = OpLoad %float %74
+ %76 = OpFUnordLessThan %bool %73 %75
+ OpStore %le_0 %76
+ %78 = OpAccessChain %_ptr_Input_float %A %uint_0
+ %79 = OpLoad %float %78
+ %80 = OpAccessChain %_ptr_Input_float %B %uint_0
+ %81 = OpLoad %float %80
+ %82 = OpFUnordLessThanEqual %bool %79 %81
+ OpStore %leq_0 %82
+ %84 = OpAccessChain %_ptr_Input_float %A %uint_0
+ %85 = OpLoad %float %84
+ %86 = OpAccessChain %_ptr_Input_float %B %uint_0
+ %87 = OpLoad %float %86
+ %88 = OpFUnordGreaterThan %bool %85 %87
+ OpStore %ge_0 %88
+ %90 = OpAccessChain %_ptr_Input_float %A %uint_0
+ %91 = OpLoad %float %90
+ %92 = OpAccessChain %_ptr_Input_float %B %uint_0
+ %93 = OpLoad %float %92
+ %94 = OpFUnordGreaterThanEqual %bool %91 %93
+ OpStore %geq_0 %94
+ %96 = OpAccessChain %_ptr_Input_float %A %uint_0
+ %97 = OpLoad %float %96
+ %98 = OpAccessChain %_ptr_Input_float %B %uint_0
+ %99 = OpLoad %float %98
+ %100 = OpFUnordEqual %bool %97 %99
+ OpStore %eq_0 %100
+ %102 = OpAccessChain %_ptr_Input_float %A %uint_0
+ %103 = OpLoad %float %102
+ %104 = OpAccessChain %_ptr_Input_float %B %uint_0
+ %105 = OpLoad %float %104
+ %106 = OpFUnordNotEqual %bool %103 %105
+ OpStore %neq_0 %106
+ %107 = OpLoad %bool %le_0
+ %108 = OpSelect %float %107 %float_1 %float_0
+ %109 = OpLoad %bool %leq_0
+ %110 = OpSelect %float %109 %float_1 %float_0
+ %111 = OpFAdd %float %108 %110
+ %112 = OpLoad %bool %ge_0
+ %113 = OpSelect %float %112 %float_1 %float_0
+ %114 = OpFAdd %float %111 %113
+ %115 = OpLoad %bool %geq_0
+ %116 = OpSelect %float %115 %float_1 %float_0
+ %117 = OpFAdd %float %114 %116
+ %118 = OpLoad %bool %eq_0
+ %119 = OpSelect %float %118 %float_1 %float_0
+ %120 = OpFAdd %float %117 %119
+ %121 = OpLoad %bool %neq_0
+ %122 = OpSelect %float %121 %float_1 %float_0
+ %123 = OpFAdd %float %120 %122
+ OpReturnValue %123
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/frag/vector-extract-dynamic-spec-constant.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/frag/vector-extract-dynamic-spec-constant.asm.frag
new file mode 100644
index 00000000000..dda5fc40340
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-no-opt/asm/frag/vector-extract-dynamic-spec-constant.asm.frag
@@ -0,0 +1,49 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 7
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %FragColor %vColor
+ OpExecutionMode %main OriginUpperLeft
+ OpSource GLSL 450
+ OpName %main "main"
+ OpName %FragColor "FragColor"
+ OpName %vColor "vColor"
+ OpName %omap_r "omap_r"
+ OpName %omap_g "omap_g"
+ OpName %omap_b "omap_b"
+ OpName %omap_a "omap_a"
+ OpDecorate %FragColor Location 0
+ OpDecorate %vColor Location 0
+ OpDecorate %omap_r SpecId 0
+ OpDecorate %omap_g SpecId 1
+ OpDecorate %omap_b SpecId 2
+ OpDecorate %omap_a SpecId 3
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %FragColor = OpVariable %_ptr_Output_v4float Output
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+ %vColor = OpVariable %_ptr_Input_v4float Input
+ %int = OpTypeInt 32 1
+ %omap_r = OpSpecConstant %int 0
+%_ptr_Input_float = OpTypePointer Input %float
+ %omap_g = OpSpecConstant %int 1
+ %omap_b = OpSpecConstant %int 2
+ %omap_a = OpSpecConstant %int 3
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %loaded = OpLoad %v4float %vColor
+ %r = OpVectorExtractDynamic %float %loaded %omap_r
+ %g = OpVectorExtractDynamic %float %loaded %omap_g
+ %b = OpVectorExtractDynamic %float %loaded %omap_b
+ %a = OpVectorExtractDynamic %float %loaded %omap_a
+ %rgba = OpCompositeConstruct %v4float %r %g %b %a
+ OpStore %FragColor %rgba
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag
new file mode 100644
index 00000000000..fae211f278d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag
@@ -0,0 +1,1087 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 572
+; Schema: 0
+ OpCapability Shader
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %Main "main" %in_var_TEXCOORD0 %in_var_TEXCOORD7 %in_var_TEXCOORD8 %gl_FragCoord %gl_FrontFacing %out_var_SV_Target0
+ OpExecutionMode %Main OriginUpperLeft
+ OpSource HLSL 600
+ OpName %type_View "type.View"
+ OpMemberName %type_View 0 "View_TranslatedWorldToClip"
+ OpMemberName %type_View 1 "View_WorldToClip"
+ OpMemberName %type_View 2 "View_TranslatedWorldToView"
+ OpMemberName %type_View 3 "View_ViewToTranslatedWorld"
+ OpMemberName %type_View 4 "View_TranslatedWorldToCameraView"
+ OpMemberName %type_View 5 "View_CameraViewToTranslatedWorld"
+ OpMemberName %type_View 6 "View_ViewToClip"
+ OpMemberName %type_View 7 "View_ViewToClipNoAA"
+ OpMemberName %type_View 8 "View_ClipToView"
+ OpMemberName %type_View 9 "View_ClipToTranslatedWorld"
+ OpMemberName %type_View 10 "View_SVPositionToTranslatedWorld"
+ OpMemberName %type_View 11 "View_ScreenToWorld"
+ OpMemberName %type_View 12 "View_ScreenToTranslatedWorld"
+ OpMemberName %type_View 13 "View_ViewForward"
+ OpMemberName %type_View 14 "PrePadding_View_844"
+ OpMemberName %type_View 15 "View_ViewUp"
+ OpMemberName %type_View 16 "PrePadding_View_860"
+ OpMemberName %type_View 17 "View_ViewRight"
+ OpMemberName %type_View 18 "PrePadding_View_876"
+ OpMemberName %type_View 19 "View_HMDViewNoRollUp"
+ OpMemberName %type_View 20 "PrePadding_View_892"
+ OpMemberName %type_View 21 "View_HMDViewNoRollRight"
+ OpMemberName %type_View 22 "PrePadding_View_908"
+ OpMemberName %type_View 23 "View_InvDeviceZToWorldZTransform"
+ OpMemberName %type_View 24 "View_ScreenPositionScaleBias"
+ OpMemberName %type_View 25 "View_WorldCameraOrigin"
+ OpMemberName %type_View 26 "PrePadding_View_956"
+ OpMemberName %type_View 27 "View_TranslatedWorldCameraOrigin"
+ OpMemberName %type_View 28 "PrePadding_View_972"
+ OpMemberName %type_View 29 "View_WorldViewOrigin"
+ OpMemberName %type_View 30 "PrePadding_View_988"
+ OpMemberName %type_View 31 "View_PreViewTranslation"
+ OpMemberName %type_View 32 "PrePadding_View_1004"
+ OpMemberName %type_View 33 "View_PrevProjection"
+ OpMemberName %type_View 34 "View_PrevViewProj"
+ OpMemberName %type_View 35 "View_PrevViewRotationProj"
+ OpMemberName %type_View 36 "View_PrevViewToClip"
+ OpMemberName %type_View 37 "View_PrevClipToView"
+ OpMemberName %type_View 38 "View_PrevTranslatedWorldToClip"
+ OpMemberName %type_View 39 "View_PrevTranslatedWorldToView"
+ OpMemberName %type_View 40 "View_PrevViewToTranslatedWorld"
+ OpMemberName %type_View 41 "View_PrevTranslatedWorldToCameraView"
+ OpMemberName %type_View 42 "View_PrevCameraViewToTranslatedWorld"
+ OpMemberName %type_View 43 "View_PrevWorldCameraOrigin"
+ OpMemberName %type_View 44 "PrePadding_View_1660"
+ OpMemberName %type_View 45 "View_PrevWorldViewOrigin"
+ OpMemberName %type_View 46 "PrePadding_View_1676"
+ OpMemberName %type_View 47 "View_PrevPreViewTranslation"
+ OpMemberName %type_View 48 "PrePadding_View_1692"
+ OpMemberName %type_View 49 "View_PrevInvViewProj"
+ OpMemberName %type_View 50 "View_PrevScreenToTranslatedWorld"
+ OpMemberName %type_View 51 "View_ClipToPrevClip"
+ OpMemberName %type_View 52 "View_TemporalAAJitter"
+ OpMemberName %type_View 53 "View_GlobalClippingPlane"
+ OpMemberName %type_View 54 "View_FieldOfViewWideAngles"
+ OpMemberName %type_View 55 "View_PrevFieldOfViewWideAngles"
+ OpMemberName %type_View 56 "View_ViewRectMin"
+ OpMemberName %type_View 57 "View_ViewSizeAndInvSize"
+ OpMemberName %type_View 58 "View_BufferSizeAndInvSize"
+ OpMemberName %type_View 59 "View_BufferBilinearUVMinMax"
+ OpMemberName %type_View 60 "View_NumSceneColorMSAASamples"
+ OpMemberName %type_View 61 "View_PreExposure"
+ OpMemberName %type_View 62 "View_OneOverPreExposure"
+ OpMemberName %type_View 63 "PrePadding_View_2012"
+ OpMemberName %type_View 64 "View_DiffuseOverrideParameter"
+ OpMemberName %type_View 65 "View_SpecularOverrideParameter"
+ OpMemberName %type_View 66 "View_NormalOverrideParameter"
+ OpMemberName %type_View 67 "View_RoughnessOverrideParameter"
+ OpMemberName %type_View 68 "View_PrevFrameGameTime"
+ OpMemberName %type_View 69 "View_PrevFrameRealTime"
+ OpMemberName %type_View 70 "View_OutOfBoundsMask"
+ OpMemberName %type_View 71 "PrePadding_View_2084"
+ OpMemberName %type_View 72 "PrePadding_View_2088"
+ OpMemberName %type_View 73 "PrePadding_View_2092"
+ OpMemberName %type_View 74 "View_WorldCameraMovementSinceLastFrame"
+ OpMemberName %type_View 75 "View_CullingSign"
+ OpMemberName %type_View 76 "View_NearPlane"
+ OpMemberName %type_View 77 "View_AdaptiveTessellationFactor"
+ OpMemberName %type_View 78 "View_GameTime"
+ OpMemberName %type_View 79 "View_RealTime"
+ OpMemberName %type_View 80 "View_DeltaTime"
+ OpMemberName %type_View 81 "View_MaterialTextureMipBias"
+ OpMemberName %type_View 82 "View_MaterialTextureDerivativeMultiply"
+ OpMemberName %type_View 83 "View_Random"
+ OpMemberName %type_View 84 "View_FrameNumber"
+ OpMemberName %type_View 85 "View_StateFrameIndexMod8"
+ OpMemberName %type_View 86 "View_StateFrameIndex"
+ OpMemberName %type_View 87 "View_CameraCut"
+ OpMemberName %type_View 88 "View_UnlitViewmodeMask"
+ OpMemberName %type_View 89 "PrePadding_View_2164"
+ OpMemberName %type_View 90 "PrePadding_View_2168"
+ OpMemberName %type_View 91 "PrePadding_View_2172"
+ OpMemberName %type_View 92 "View_DirectionalLightColor"
+ OpMemberName %type_View 93 "View_DirectionalLightDirection"
+ OpMemberName %type_View 94 "PrePadding_View_2204"
+ OpMemberName %type_View 95 "View_TranslucencyLightingVolumeMin"
+ OpMemberName %type_View 96 "View_TranslucencyLightingVolumeInvSize"
+ OpMemberName %type_View 97 "View_TemporalAAParams"
+ OpMemberName %type_View 98 "View_CircleDOFParams"
+ OpMemberName %type_View 99 "View_DepthOfFieldSensorWidth"
+ OpMemberName %type_View 100 "View_DepthOfFieldFocalDistance"
+ OpMemberName %type_View 101 "View_DepthOfFieldScale"
+ OpMemberName %type_View 102 "View_DepthOfFieldFocalLength"
+ OpMemberName %type_View 103 "View_DepthOfFieldFocalRegion"
+ OpMemberName %type_View 104 "View_DepthOfFieldNearTransitionRegion"
+ OpMemberName %type_View 105 "View_DepthOfFieldFarTransitionRegion"
+ OpMemberName %type_View 106 "View_MotionBlurNormalizedToPixel"
+ OpMemberName %type_View 107 "View_bSubsurfacePostprocessEnabled"
+ OpMemberName %type_View 108 "View_GeneralPurposeTweak"
+ OpMemberName %type_View 109 "View_DemosaicVposOffset"
+ OpMemberName %type_View 110 "PrePadding_View_2348"
+ OpMemberName %type_View 111 "View_IndirectLightingColorScale"
+ OpMemberName %type_View 112 "View_HDR32bppEncodingMode"
+ OpMemberName %type_View 113 "View_AtmosphericFogSunDirection"
+ OpMemberName %type_View 114 "View_AtmosphericFogSunPower"
+ OpMemberName %type_View 115 "View_AtmosphericFogPower"
+ OpMemberName %type_View 116 "View_AtmosphericFogDensityScale"
+ OpMemberName %type_View 117 "View_AtmosphericFogDensityOffset"
+ OpMemberName %type_View 118 "View_AtmosphericFogGroundOffset"
+ OpMemberName %type_View 119 "View_AtmosphericFogDistanceScale"
+ OpMemberName %type_View 120 "View_AtmosphericFogAltitudeScale"
+ OpMemberName %type_View 121 "View_AtmosphericFogHeightScaleRayleigh"
+ OpMemberName %type_View 122 "View_AtmosphericFogStartDistance"
+ OpMemberName %type_View 123 "View_AtmosphericFogDistanceOffset"
+ OpMemberName %type_View 124 "View_AtmosphericFogSunDiscScale"
+ OpMemberName %type_View 125 "View_AtmosphericFogRenderMask"
+ OpMemberName %type_View 126 "View_AtmosphericFogInscatterAltitudeSampleNum"
+ OpMemberName %type_View 127 "View_AtmosphericFogSunColor"
+ OpMemberName %type_View 128 "View_NormalCurvatureToRoughnessScaleBias"
+ OpMemberName %type_View 129 "View_RenderingReflectionCaptureMask"
+ OpMemberName %type_View 130 "View_AmbientCubemapTint"
+ OpMemberName %type_View 131 "View_AmbientCubemapIntensity"
+ OpMemberName %type_View 132 "View_SkyLightParameters"
+ OpMemberName %type_View 133 "PrePadding_View_2488"
+ OpMemberName %type_View 134 "PrePadding_View_2492"
+ OpMemberName %type_View 135 "View_SkyLightColor"
+ OpMemberName %type_View 136 "View_SkyIrradianceEnvironmentMap"
+ OpMemberName %type_View 137 "View_MobilePreviewMode"
+ OpMemberName %type_View 138 "View_HMDEyePaddingOffset"
+ OpMemberName %type_View 139 "View_ReflectionCubemapMaxMip"
+ OpMemberName %type_View 140 "View_ShowDecalsMask"
+ OpMemberName %type_View 141 "View_DistanceFieldAOSpecularOcclusionMode"
+ OpMemberName %type_View 142 "View_IndirectCapsuleSelfShadowingIntensity"
+ OpMemberName %type_View 143 "PrePadding_View_2648"
+ OpMemberName %type_View 144 "PrePadding_View_2652"
+ OpMemberName %type_View 145 "View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight"
+ OpMemberName %type_View 146 "View_StereoPassIndex"
+ OpMemberName %type_View 147 "View_GlobalVolumeCenterAndExtent"
+ OpMemberName %type_View 148 "View_GlobalVolumeWorldToUVAddAndMul"
+ OpMemberName %type_View 149 "View_GlobalVolumeDimension"
+ OpMemberName %type_View 150 "View_GlobalVolumeTexelSize"
+ OpMemberName %type_View 151 "View_MaxGlobalDistance"
+ OpMemberName %type_View 152 "View_bCheckerboardSubsurfaceProfileRendering"
+ OpMemberName %type_View 153 "View_VolumetricFogInvGridSize"
+ OpMemberName %type_View 154 "PrePadding_View_2828"
+ OpMemberName %type_View 155 "View_VolumetricFogGridZParams"
+ OpMemberName %type_View 156 "PrePadding_View_2844"
+ OpMemberName %type_View 157 "View_VolumetricFogSVPosToVolumeUV"
+ OpMemberName %type_View 158 "View_VolumetricFogMaxDistance"
+ OpMemberName %type_View 159 "PrePadding_View_2860"
+ OpMemberName %type_View 160 "View_VolumetricLightmapWorldToUVScale"
+ OpMemberName %type_View 161 "PrePadding_View_2876"
+ OpMemberName %type_View 162 "View_VolumetricLightmapWorldToUVAdd"
+ OpMemberName %type_View 163 "PrePadding_View_2892"
+ OpMemberName %type_View 164 "View_VolumetricLightmapIndirectionTextureSize"
+ OpMemberName %type_View 165 "View_VolumetricLightmapBrickSize"
+ OpMemberName %type_View 166 "View_VolumetricLightmapBrickTexelSize"
+ OpMemberName %type_View 167 "View_StereoIPD"
+ OpMemberName %type_View 168 "View_IndirectLightingCacheShowFlag"
+ OpMemberName %type_View 169 "View_EyeToPixelSpreadAngle"
+ OpName %View "View"
+ OpName %type_MobileDirectionalLight "type.MobileDirectionalLight"
+ OpMemberName %type_MobileDirectionalLight 0 "MobileDirectionalLight_DirectionalLightColor"
+ OpMemberName %type_MobileDirectionalLight 1 "MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition"
+ OpMemberName %type_MobileDirectionalLight 2 "MobileDirectionalLight_DirectionalLightShadowSize"
+ OpMemberName %type_MobileDirectionalLight 3 "MobileDirectionalLight_DirectionalLightDistanceFadeMAD"
+ OpMemberName %type_MobileDirectionalLight 4 "MobileDirectionalLight_DirectionalLightShadowDistances"
+ OpMemberName %type_MobileDirectionalLight 5 "MobileDirectionalLight_DirectionalLightScreenToShadow"
+ OpName %MobileDirectionalLight "MobileDirectionalLight"
+ OpName %type_2d_image "type.2d.image"
+ OpName %MobileDirectionalLight_DirectionalLightShadowTexture "MobileDirectionalLight_DirectionalLightShadowTexture"
+ OpName %type_sampler "type.sampler"
+ OpName %MobileDirectionalLight_DirectionalLightShadowSampler "MobileDirectionalLight_DirectionalLightShadowSampler"
+ OpName %Material_Texture2D_0 "Material_Texture2D_0"
+ OpName %Material_Texture2D_0Sampler "Material_Texture2D_0Sampler"
+ OpName %Material_Texture2D_1 "Material_Texture2D_1"
+ OpName %Material_Texture2D_1Sampler "Material_Texture2D_1Sampler"
+ OpName %type__Globals "type.$Globals"
+ OpMemberName %type__Globals 0 "NumDynamicPointLights"
+ OpMemberName %type__Globals 1 "LightPositionAndInvRadius"
+ OpMemberName %type__Globals 2 "LightColorAndFalloffExponent"
+ OpMemberName %type__Globals 3 "MobileReflectionParams"
+ OpName %_Globals "$Globals"
+ OpName %type_cube_image "type.cube.image"
+ OpName %ReflectionCubemap "ReflectionCubemap"
+ OpName %ReflectionCubemapSampler "ReflectionCubemapSampler"
+ OpName %in_var_TEXCOORD0 "in.var.TEXCOORD0"
+ OpName %in_var_TEXCOORD7 "in.var.TEXCOORD7"
+ OpName %in_var_TEXCOORD8 "in.var.TEXCOORD8"
+ OpName %out_var_SV_Target0 "out.var.SV_Target0"
+ OpName %Main "Main"
+ OpName %type_sampled_image "type.sampled.image"
+ OpName %type_sampled_image_0 "type.sampled.image"
+ OpDecorateString %in_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorateString %in_var_TEXCOORD7 UserSemantic "TEXCOORD7"
+ OpDecorateString %in_var_TEXCOORD8 UserSemantic "TEXCOORD8"
+ OpDecorate %gl_FragCoord BuiltIn FragCoord
+ OpDecorateString %gl_FragCoord UserSemantic "SV_Position"
+ OpDecorate %gl_FrontFacing BuiltIn FrontFacing
+ OpDecorateString %gl_FrontFacing UserSemantic "SV_IsFrontFace"
+ OpDecorate %gl_FrontFacing Flat
+ OpDecorateString %out_var_SV_Target0 UserSemantic "SV_Target0"
+ OpDecorate %in_var_TEXCOORD0 Location 0
+ OpDecorate %in_var_TEXCOORD7 Location 1
+ OpDecorate %in_var_TEXCOORD8 Location 2
+ OpDecorate %out_var_SV_Target0 Location 0
+ OpDecorate %View DescriptorSet 0
+ OpDecorate %View Binding 0
+ OpDecorate %MobileDirectionalLight DescriptorSet 0
+ OpDecorate %MobileDirectionalLight Binding 1
+ OpDecorate %MobileDirectionalLight_DirectionalLightShadowTexture DescriptorSet 0
+ OpDecorate %MobileDirectionalLight_DirectionalLightShadowTexture Binding 0
+ OpDecorate %MobileDirectionalLight_DirectionalLightShadowSampler DescriptorSet 0
+ OpDecorate %MobileDirectionalLight_DirectionalLightShadowSampler Binding 0
+ OpDecorate %Material_Texture2D_0 DescriptorSet 0
+ OpDecorate %Material_Texture2D_0 Binding 1
+ OpDecorate %Material_Texture2D_0Sampler DescriptorSet 0
+ OpDecorate %Material_Texture2D_0Sampler Binding 1
+ OpDecorate %Material_Texture2D_1 DescriptorSet 0
+ OpDecorate %Material_Texture2D_1 Binding 2
+ OpDecorate %Material_Texture2D_1Sampler DescriptorSet 0
+ OpDecorate %Material_Texture2D_1Sampler Binding 2
+ OpDecorate %_Globals DescriptorSet 0
+ OpDecorate %_Globals Binding 2
+ OpDecorate %ReflectionCubemap DescriptorSet 0
+ OpDecorate %ReflectionCubemap Binding 3
+ OpDecorate %ReflectionCubemapSampler DescriptorSet 0
+ OpDecorate %ReflectionCubemapSampler Binding 3
+ OpDecorate %_arr_v4float_uint_2 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_7 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpMemberDecorate %type_View 0 Offset 0
+ OpMemberDecorate %type_View 0 MatrixStride 16
+ OpMemberDecorate %type_View 0 ColMajor
+ OpMemberDecorate %type_View 1 Offset 64
+ OpMemberDecorate %type_View 1 MatrixStride 16
+ OpMemberDecorate %type_View 1 ColMajor
+ OpMemberDecorate %type_View 2 Offset 128
+ OpMemberDecorate %type_View 2 MatrixStride 16
+ OpMemberDecorate %type_View 2 ColMajor
+ OpMemberDecorate %type_View 3 Offset 192
+ OpMemberDecorate %type_View 3 MatrixStride 16
+ OpMemberDecorate %type_View 3 ColMajor
+ OpMemberDecorate %type_View 4 Offset 256
+ OpMemberDecorate %type_View 4 MatrixStride 16
+ OpMemberDecorate %type_View 4 ColMajor
+ OpMemberDecorate %type_View 5 Offset 320
+ OpMemberDecorate %type_View 5 MatrixStride 16
+ OpMemberDecorate %type_View 5 ColMajor
+ OpMemberDecorate %type_View 6 Offset 384
+ OpMemberDecorate %type_View 6 MatrixStride 16
+ OpMemberDecorate %type_View 6 ColMajor
+ OpMemberDecorate %type_View 7 Offset 448
+ OpMemberDecorate %type_View 7 MatrixStride 16
+ OpMemberDecorate %type_View 7 ColMajor
+ OpMemberDecorate %type_View 8 Offset 512
+ OpMemberDecorate %type_View 8 MatrixStride 16
+ OpMemberDecorate %type_View 8 ColMajor
+ OpMemberDecorate %type_View 9 Offset 576
+ OpMemberDecorate %type_View 9 MatrixStride 16
+ OpMemberDecorate %type_View 9 ColMajor
+ OpMemberDecorate %type_View 10 Offset 640
+ OpMemberDecorate %type_View 10 MatrixStride 16
+ OpMemberDecorate %type_View 10 ColMajor
+ OpMemberDecorate %type_View 11 Offset 704
+ OpMemberDecorate %type_View 11 MatrixStride 16
+ OpMemberDecorate %type_View 11 ColMajor
+ OpMemberDecorate %type_View 12 Offset 768
+ OpMemberDecorate %type_View 12 MatrixStride 16
+ OpMemberDecorate %type_View 12 ColMajor
+ OpMemberDecorate %type_View 13 Offset 832
+ OpMemberDecorate %type_View 14 Offset 844
+ OpMemberDecorate %type_View 15 Offset 848
+ OpMemberDecorate %type_View 16 Offset 860
+ OpMemberDecorate %type_View 17 Offset 864
+ OpMemberDecorate %type_View 18 Offset 876
+ OpMemberDecorate %type_View 19 Offset 880
+ OpMemberDecorate %type_View 20 Offset 892
+ OpMemberDecorate %type_View 21 Offset 896
+ OpMemberDecorate %type_View 22 Offset 908
+ OpMemberDecorate %type_View 23 Offset 912
+ OpMemberDecorate %type_View 24 Offset 928
+ OpMemberDecorate %type_View 25 Offset 944
+ OpMemberDecorate %type_View 26 Offset 956
+ OpMemberDecorate %type_View 27 Offset 960
+ OpMemberDecorate %type_View 28 Offset 972
+ OpMemberDecorate %type_View 29 Offset 976
+ OpMemberDecorate %type_View 30 Offset 988
+ OpMemberDecorate %type_View 31 Offset 992
+ OpMemberDecorate %type_View 32 Offset 1004
+ OpMemberDecorate %type_View 33 Offset 1008
+ OpMemberDecorate %type_View 33 MatrixStride 16
+ OpMemberDecorate %type_View 33 ColMajor
+ OpMemberDecorate %type_View 34 Offset 1072
+ OpMemberDecorate %type_View 34 MatrixStride 16
+ OpMemberDecorate %type_View 34 ColMajor
+ OpMemberDecorate %type_View 35 Offset 1136
+ OpMemberDecorate %type_View 35 MatrixStride 16
+ OpMemberDecorate %type_View 35 ColMajor
+ OpMemberDecorate %type_View 36 Offset 1200
+ OpMemberDecorate %type_View 36 MatrixStride 16
+ OpMemberDecorate %type_View 36 ColMajor
+ OpMemberDecorate %type_View 37 Offset 1264
+ OpMemberDecorate %type_View 37 MatrixStride 16
+ OpMemberDecorate %type_View 37 ColMajor
+ OpMemberDecorate %type_View 38 Offset 1328
+ OpMemberDecorate %type_View 38 MatrixStride 16
+ OpMemberDecorate %type_View 38 ColMajor
+ OpMemberDecorate %type_View 39 Offset 1392
+ OpMemberDecorate %type_View 39 MatrixStride 16
+ OpMemberDecorate %type_View 39 ColMajor
+ OpMemberDecorate %type_View 40 Offset 1456
+ OpMemberDecorate %type_View 40 MatrixStride 16
+ OpMemberDecorate %type_View 40 ColMajor
+ OpMemberDecorate %type_View 41 Offset 1520
+ OpMemberDecorate %type_View 41 MatrixStride 16
+ OpMemberDecorate %type_View 41 ColMajor
+ OpMemberDecorate %type_View 42 Offset 1584
+ OpMemberDecorate %type_View 42 MatrixStride 16
+ OpMemberDecorate %type_View 42 ColMajor
+ OpMemberDecorate %type_View 43 Offset 1648
+ OpMemberDecorate %type_View 44 Offset 1660
+ OpMemberDecorate %type_View 45 Offset 1664
+ OpMemberDecorate %type_View 46 Offset 1676
+ OpMemberDecorate %type_View 47 Offset 1680
+ OpMemberDecorate %type_View 48 Offset 1692
+ OpMemberDecorate %type_View 49 Offset 1696
+ OpMemberDecorate %type_View 49 MatrixStride 16
+ OpMemberDecorate %type_View 49 ColMajor
+ OpMemberDecorate %type_View 50 Offset 1760
+ OpMemberDecorate %type_View 50 MatrixStride 16
+ OpMemberDecorate %type_View 50 ColMajor
+ OpMemberDecorate %type_View 51 Offset 1824
+ OpMemberDecorate %type_View 51 MatrixStride 16
+ OpMemberDecorate %type_View 51 ColMajor
+ OpMemberDecorate %type_View 52 Offset 1888
+ OpMemberDecorate %type_View 53 Offset 1904
+ OpMemberDecorate %type_View 54 Offset 1920
+ OpMemberDecorate %type_View 55 Offset 1928
+ OpMemberDecorate %type_View 56 Offset 1936
+ OpMemberDecorate %type_View 57 Offset 1952
+ OpMemberDecorate %type_View 58 Offset 1968
+ OpMemberDecorate %type_View 59 Offset 1984
+ OpMemberDecorate %type_View 60 Offset 2000
+ OpMemberDecorate %type_View 61 Offset 2004
+ OpMemberDecorate %type_View 62 Offset 2008
+ OpMemberDecorate %type_View 63 Offset 2012
+ OpMemberDecorate %type_View 64 Offset 2016
+ OpMemberDecorate %type_View 65 Offset 2032
+ OpMemberDecorate %type_View 66 Offset 2048
+ OpMemberDecorate %type_View 67 Offset 2064
+ OpMemberDecorate %type_View 68 Offset 2072
+ OpMemberDecorate %type_View 69 Offset 2076
+ OpMemberDecorate %type_View 70 Offset 2080
+ OpMemberDecorate %type_View 71 Offset 2084
+ OpMemberDecorate %type_View 72 Offset 2088
+ OpMemberDecorate %type_View 73 Offset 2092
+ OpMemberDecorate %type_View 74 Offset 2096
+ OpMemberDecorate %type_View 75 Offset 2108
+ OpMemberDecorate %type_View 76 Offset 2112
+ OpMemberDecorate %type_View 77 Offset 2116
+ OpMemberDecorate %type_View 78 Offset 2120
+ OpMemberDecorate %type_View 79 Offset 2124
+ OpMemberDecorate %type_View 80 Offset 2128
+ OpMemberDecorate %type_View 81 Offset 2132
+ OpMemberDecorate %type_View 82 Offset 2136
+ OpMemberDecorate %type_View 83 Offset 2140
+ OpMemberDecorate %type_View 84 Offset 2144
+ OpMemberDecorate %type_View 85 Offset 2148
+ OpMemberDecorate %type_View 86 Offset 2152
+ OpMemberDecorate %type_View 87 Offset 2156
+ OpMemberDecorate %type_View 88 Offset 2160
+ OpMemberDecorate %type_View 89 Offset 2164
+ OpMemberDecorate %type_View 90 Offset 2168
+ OpMemberDecorate %type_View 91 Offset 2172
+ OpMemberDecorate %type_View 92 Offset 2176
+ OpMemberDecorate %type_View 93 Offset 2192
+ OpMemberDecorate %type_View 94 Offset 2204
+ OpMemberDecorate %type_View 95 Offset 2208
+ OpMemberDecorate %type_View 96 Offset 2240
+ OpMemberDecorate %type_View 97 Offset 2272
+ OpMemberDecorate %type_View 98 Offset 2288
+ OpMemberDecorate %type_View 99 Offset 2304
+ OpMemberDecorate %type_View 100 Offset 2308
+ OpMemberDecorate %type_View 101 Offset 2312
+ OpMemberDecorate %type_View 102 Offset 2316
+ OpMemberDecorate %type_View 103 Offset 2320
+ OpMemberDecorate %type_View 104 Offset 2324
+ OpMemberDecorate %type_View 105 Offset 2328
+ OpMemberDecorate %type_View 106 Offset 2332
+ OpMemberDecorate %type_View 107 Offset 2336
+ OpMemberDecorate %type_View 108 Offset 2340
+ OpMemberDecorate %type_View 109 Offset 2344
+ OpMemberDecorate %type_View 110 Offset 2348
+ OpMemberDecorate %type_View 111 Offset 2352
+ OpMemberDecorate %type_View 112 Offset 2364
+ OpMemberDecorate %type_View 113 Offset 2368
+ OpMemberDecorate %type_View 114 Offset 2380
+ OpMemberDecorate %type_View 115 Offset 2384
+ OpMemberDecorate %type_View 116 Offset 2388
+ OpMemberDecorate %type_View 117 Offset 2392
+ OpMemberDecorate %type_View 118 Offset 2396
+ OpMemberDecorate %type_View 119 Offset 2400
+ OpMemberDecorate %type_View 120 Offset 2404
+ OpMemberDecorate %type_View 121 Offset 2408
+ OpMemberDecorate %type_View 122 Offset 2412
+ OpMemberDecorate %type_View 123 Offset 2416
+ OpMemberDecorate %type_View 124 Offset 2420
+ OpMemberDecorate %type_View 125 Offset 2424
+ OpMemberDecorate %type_View 126 Offset 2428
+ OpMemberDecorate %type_View 127 Offset 2432
+ OpMemberDecorate %type_View 128 Offset 2448
+ OpMemberDecorate %type_View 129 Offset 2460
+ OpMemberDecorate %type_View 130 Offset 2464
+ OpMemberDecorate %type_View 131 Offset 2480
+ OpMemberDecorate %type_View 132 Offset 2484
+ OpMemberDecorate %type_View 133 Offset 2488
+ OpMemberDecorate %type_View 134 Offset 2492
+ OpMemberDecorate %type_View 135 Offset 2496
+ OpMemberDecorate %type_View 136 Offset 2512
+ OpMemberDecorate %type_View 137 Offset 2624
+ OpMemberDecorate %type_View 138 Offset 2628
+ OpMemberDecorate %type_View 139 Offset 2632
+ OpMemberDecorate %type_View 140 Offset 2636
+ OpMemberDecorate %type_View 141 Offset 2640
+ OpMemberDecorate %type_View 142 Offset 2644
+ OpMemberDecorate %type_View 143 Offset 2648
+ OpMemberDecorate %type_View 144 Offset 2652
+ OpMemberDecorate %type_View 145 Offset 2656
+ OpMemberDecorate %type_View 146 Offset 2668
+ OpMemberDecorate %type_View 147 Offset 2672
+ OpMemberDecorate %type_View 148 Offset 2736
+ OpMemberDecorate %type_View 149 Offset 2800
+ OpMemberDecorate %type_View 150 Offset 2804
+ OpMemberDecorate %type_View 151 Offset 2808
+ OpMemberDecorate %type_View 152 Offset 2812
+ OpMemberDecorate %type_View 153 Offset 2816
+ OpMemberDecorate %type_View 154 Offset 2828
+ OpMemberDecorate %type_View 155 Offset 2832
+ OpMemberDecorate %type_View 156 Offset 2844
+ OpMemberDecorate %type_View 157 Offset 2848
+ OpMemberDecorate %type_View 158 Offset 2856
+ OpMemberDecorate %type_View 159 Offset 2860
+ OpMemberDecorate %type_View 160 Offset 2864
+ OpMemberDecorate %type_View 161 Offset 2876
+ OpMemberDecorate %type_View 162 Offset 2880
+ OpMemberDecorate %type_View 163 Offset 2892
+ OpMemberDecorate %type_View 164 Offset 2896
+ OpMemberDecorate %type_View 165 Offset 2908
+ OpMemberDecorate %type_View 166 Offset 2912
+ OpMemberDecorate %type_View 167 Offset 2924
+ OpMemberDecorate %type_View 168 Offset 2928
+ OpMemberDecorate %type_View 169 Offset 2932
+ OpDecorate %type_View Block
+ OpDecorate %_arr_mat4v4float_uint_4 ArrayStride 64
+ OpMemberDecorate %type_MobileDirectionalLight 0 Offset 0
+ OpMemberDecorate %type_MobileDirectionalLight 1 Offset 16
+ OpMemberDecorate %type_MobileDirectionalLight 2 Offset 32
+ OpMemberDecorate %type_MobileDirectionalLight 3 Offset 48
+ OpMemberDecorate %type_MobileDirectionalLight 4 Offset 64
+ OpMemberDecorate %type_MobileDirectionalLight 5 Offset 80
+ OpMemberDecorate %type_MobileDirectionalLight 5 MatrixStride 16
+ OpMemberDecorate %type_MobileDirectionalLight 5 ColMajor
+ OpDecorate %type_MobileDirectionalLight Block
+ OpMemberDecorate %type__Globals 0 Offset 0
+ OpMemberDecorate %type__Globals 1 Offset 16
+ OpMemberDecorate %type__Globals 2 Offset 80
+ OpMemberDecorate %type__Globals 3 Offset 144
+ OpDecorate %type__Globals Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+ %int_1 = OpConstant %int 1
+ %int_2 = OpConstant %int 2
+ %int_4 = OpConstant %int 4
+ %float_0 = OpConstant %float 0
+ %int_3 = OpConstant %int 3
+ %47 = OpConstantComposite %v3float %float_0 %float_0 %float_0
+ %float_1 = OpConstant %float 1
+ %int_0 = OpConstant %int 0
+ %bool = OpTypeBool
+ %int_5 = OpConstant %int 5
+ %52 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+%float_0_999989986 = OpConstant %float 0.999989986
+%float_65000 = OpConstant %float 65000
+ %55 = OpConstantComposite %v3float %float_65000 %float_65000 %float_65000
+%float_0_318309873 = OpConstant %float 0.318309873
+ %57 = OpConstantComposite %v3float %float_0_318309873 %float_0_318309873 %float_0_318309873
+%float_65500 = OpConstant %float 65500
+ %float_0_5 = OpConstant %float 0.5
+ %60 = OpConstantComposite %v2float %float_0_5 %float_0_5
+ %float_2 = OpConstant %float 2
+ %float_n2 = OpConstant %float -2
+ %63 = OpConstantComposite %v2float %float_2 %float_n2
+ %64 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+%float_0_119999997 = OpConstant %float 0.119999997
+ %float_n1 = OpConstant %float -1
+%float_n0_0274999999 = OpConstant %float -0.0274999999
+ %68 = OpConstantComposite %v2float %float_n1 %float_n0_0274999999
+%float_0_0425000004 = OpConstant %float 0.0425000004
+ %70 = OpConstantComposite %v2float %float_1 %float_0_0425000004
+%float_n9_27999973 = OpConstant %float -9.27999973
+ %72 = OpConstantComposite %v2float %float_1 %float_1
+ %float_0_25 = OpConstant %float 0.25
+ %float_16 = OpConstant %float 16
+ %int_31 = OpConstant %int 31
+ %int_56 = OpConstant %int 56
+ %int_57 = OpConstant %int 57
+ %int_64 = OpConstant %int 64
+ %int_65 = OpConstant %int 65
+ %int_66 = OpConstant %int 66
+ %int_67 = OpConstant %int 67
+ %int_88 = OpConstant %int 88
+ %int_135 = OpConstant %int 135
+ %int_139 = OpConstant %int 139
+%mat3v3float = OpTypeMatrix %v3float 3
+ %86 = OpConstantComposite %v2float %float_2 %float_2
+%float_0_300000012 = OpConstant %float 0.300000012
+ %88 = OpConstantComposite %v3float %float_0_300000012 %float_0_300000012 %float_1
+ %float_20 = OpConstant %float 20
+ %90 = OpConstantComposite %v2float %float_20 %float_20
+%float_0_400000006 = OpConstant %float 0.400000006
+ %float_24 = OpConstant %float 24
+%float_0_294999987 = OpConstant %float 0.294999987
+%float_0_660000026 = OpConstant %float 0.660000026
+%float_0_699999988 = OpConstant %float 0.699999988
+%float_65504 = OpConstant %float 65504
+%float_1_20000005 = OpConstant %float 1.20000005
+ %98 = OpConstantComposite %v3float %float_2 %float_2 %float_2
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_arr_v4float_uint_7 = OpTypeArray %v4float %uint_7
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+ %type_View = OpTypeStruct %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %v3float %float %v3float %float %v4float %v4float %v3float %float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %v4float %v4float %v2float %v2float %v4float %v4float %v4float %v4float %int %float %float %float %v4float %v4float %v4float %v2float %float %float %float %float %float %float %v3float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %float %float %float %float %float %v4float %v3float %float %_arr_v4float_uint_2 %_arr_v4float_uint_2 %v4float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %v3float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %uint %uint %v4float %v3float %float %v4float %float %float %float %float %v4float %_arr_v4float_uint_7 %float %float %float %float %uint %float %float %float %v3float %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %float %float %float %float %v3float %float %v3float %float %v2float %float %float %v3float %float %v3float %float %v3float %float %v3float %float %float %float
+%_ptr_Uniform_type_View = OpTypePointer Uniform %type_View
+%_arr_mat4v4float_uint_4 = OpTypeArray %mat4v4float %uint_4
+%type_MobileDirectionalLight = OpTypeStruct %v4float %v4float %v4float %v4float %v4float %_arr_mat4v4float_uint_4
+%_ptr_Uniform_type_MobileDirectionalLight = OpTypePointer Uniform %type_MobileDirectionalLight
+%type_2d_image = OpTypeImage %float 2D 2 0 0 1 Unknown
+%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image
+%type_sampler = OpTypeSampler
+%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler
+%type__Globals = OpTypeStruct %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %v4float
+%_ptr_Uniform_type__Globals = OpTypePointer Uniform %type__Globals
+%type_cube_image = OpTypeImage %float Cube 2 0 0 1 Unknown
+%_ptr_UniformConstant_type_cube_image = OpTypePointer UniformConstant %type_cube_image
+%_ptr_Input_v2float = OpTypePointer Input %v2float
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Input_bool = OpTypePointer Input %bool
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %110 = OpTypeFunction %void
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+%_ptr_Uniform_int = OpTypePointer Uniform %int
+%type_sampled_image = OpTypeSampledImage %type_cube_image
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
+%type_sampled_image_0 = OpTypeSampledImage %type_2d_image
+ %View = OpVariable %_ptr_Uniform_type_View Uniform
+%MobileDirectionalLight = OpVariable %_ptr_Uniform_type_MobileDirectionalLight Uniform
+%MobileDirectionalLight_DirectionalLightShadowTexture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%MobileDirectionalLight_DirectionalLightShadowSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%Material_Texture2D_0 = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%Material_Texture2D_0Sampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%Material_Texture2D_1 = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%Material_Texture2D_1Sampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+ %_Globals = OpVariable %_ptr_Uniform_type__Globals Uniform
+%ReflectionCubemap = OpVariable %_ptr_UniformConstant_type_cube_image UniformConstant
+%ReflectionCubemapSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%in_var_TEXCOORD0 = OpVariable %_ptr_Input_v2float Input
+%in_var_TEXCOORD7 = OpVariable %_ptr_Input_v4float Input
+%in_var_TEXCOORD8 = OpVariable %_ptr_Input_v4float Input
+%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
+%gl_FrontFacing = OpVariable %_ptr_Input_bool Input
+%out_var_SV_Target0 = OpVariable %_ptr_Output_v4float Output
+ %117 = OpConstantComposite %v3float %float_1 %float_0 %float_0
+ %118 = OpConstantComposite %v3float %float_0 %float_1 %float_0
+ %119 = OpConstantComposite %v3float %float_0 %float_0 %float_1
+ %120 = OpConstantComposite %mat3v3float %117 %118 %119
+ %float_10 = OpConstant %float 10
+ %122 = OpConstantComposite %v2float %float_10 %float_10
+ %float_5 = OpConstant %float 5
+ %124 = OpConstantComposite %v2float %float_5 %float_5
+%float_0_00066666666 = OpConstant %float 0.00066666666
+ %float_n0_5 = OpConstant %float -0.5
+ %127 = OpConstantComposite %v2float %float_n0_5 %float_n0_5
+ %128 = OpConstantComposite %v2float %float_0_5 %float_n0_5
+ %float_1_5 = OpConstant %float 1.5
+ %130 = OpConstantComposite %v2float %float_1_5 %float_n0_5
+ %131 = OpConstantComposite %v2float %float_n0_5 %float_0_5
+ %132 = OpConstantComposite %v2float %float_1_5 %float_0_5
+ %133 = OpConstantComposite %v2float %float_n0_5 %float_1_5
+ %134 = OpConstantComposite %v2float %float_0_5 %float_1_5
+ %135 = OpConstantComposite %v2float %float_1_5 %float_1_5
+ %136 = OpUndef %v3float
+ %137 = OpUndef %v4float
+ %138 = OpUndef %float
+ %139 = OpUndef %v3float
+ %Main = OpFunction %void None %110
+ %140 = OpLabel
+ %141 = OpLoad %v2float %in_var_TEXCOORD0
+ %142 = OpLoad %v4float %in_var_TEXCOORD7
+ %143 = OpLoad %v4float %in_var_TEXCOORD8
+ %144 = OpLoad %v4float %gl_FragCoord
+ %145 = OpAccessChain %_ptr_Uniform_v3float %View %int_31
+ %146 = OpLoad %v3float %145
+ %147 = OpAccessChain %_ptr_Uniform_v4float %View %int_56
+ %148 = OpLoad %v4float %147
+ %149 = OpAccessChain %_ptr_Uniform_v4float %View %int_57
+ %150 = OpLoad %v4float %149
+ %151 = OpAccessChain %_ptr_Uniform_v4float %View %int_64
+ %152 = OpLoad %v4float %151
+ %153 = OpAccessChain %_ptr_Uniform_v4float %View %int_65
+ %154 = OpLoad %v4float %153
+ %155 = OpAccessChain %_ptr_Uniform_v4float %View %int_66
+ %156 = OpLoad %v4float %155
+ %157 = OpAccessChain %_ptr_Uniform_v2float %View %int_67
+ %158 = OpLoad %v2float %157
+ %159 = OpAccessChain %_ptr_Uniform_float %View %int_88
+ %160 = OpLoad %float %159
+ %161 = OpAccessChain %_ptr_Uniform_v4float %View %int_135
+ %162 = OpLoad %v4float %161
+ %163 = OpAccessChain %_ptr_Uniform_float %View %int_139
+ %164 = OpLoad %float %163
+ %165 = OpVectorShuffle %v2float %144 %144 0 1
+ %166 = OpVectorShuffle %v2float %148 %148 0 1
+ %167 = OpFSub %v2float %165 %166
+ %168 = OpVectorShuffle %v2float %150 %150 2 3
+ %169 = OpFMul %v2float %167 %168
+ %170 = OpFSub %v2float %169 %60
+ %171 = OpFMul %v2float %170 %63
+ %172 = OpCompositeExtract %float %171 0
+ %173 = OpCompositeExtract %float %171 1
+ %174 = OpCompositeConstruct %v4float %172 %173 %138 %float_1
+ %175 = OpCompositeExtract %float %144 3
+ %176 = OpCompositeConstruct %v4float %175 %175 %175 %175
+ %177 = OpFMul %v4float %174 %176
+ %178 = OpVectorShuffle %v3float %143 %143 0 1 2
+ %179 = OpFSub %v3float %178 %146
+ %180 = OpFNegate %v3float %178
+ %181 = OpExtInst %v3float %1 Normalize %180
+ %182 = OpFMul %v2float %141 %60
+ %183 = OpFMul %v2float %141 %122
+ %184 = OpLoad %type_2d_image %Material_Texture2D_0
+ %185 = OpLoad %type_sampler %Material_Texture2D_0Sampler
+ %186 = OpSampledImage %type_sampled_image_0 %184 %185
+ %187 = OpImageSampleImplicitLod %v4float %186 %183 None
+ %188 = OpVectorShuffle %v2float %187 %187 0 1
+ %189 = OpFMul %v2float %188 %86
+ %190 = OpFSub %v2float %189 %72
+ %191 = OpDot %float %190 %190
+ %192 = OpFSub %float %float_1 %191
+ %193 = OpExtInst %float %1 FClamp %192 %float_0 %float_1
+ %194 = OpExtInst %float %1 Sqrt %193
+ %195 = OpCompositeExtract %float %190 0
+ %196 = OpCompositeExtract %float %190 1
+ %197 = OpCompositeConstruct %v4float %195 %196 %194 %float_1
+ %198 = OpVectorShuffle %v3float %197 %197 0 1 2
+ %199 = OpFMul %v3float %198 %88
+ %200 = OpVectorShuffle %v3float %156 %156 0 1 2
+ %201 = OpCompositeExtract %float %156 3
+ %202 = OpCompositeConstruct %v3float %201 %201 %201
+ %203 = OpFMul %v3float %199 %202
+ %204 = OpFAdd %v3float %203 %200
+ %205 = OpMatrixTimesVector %v3float %120 %204
+ %206 = OpExtInst %v3float %1 Normalize %205
+ %207 = OpFNegate %v3float %181
+ %208 = OpDot %float %206 %181
+ %209 = OpCompositeConstruct %v3float %208 %208 %208
+ %210 = OpFMul %v3float %206 %209
+ %211 = OpFMul %v3float %210 %98
+ %212 = OpFAdd %v3float %207 %211
+ %213 = OpFMul %v2float %141 %90
+ %214 = OpLoad %type_2d_image %Material_Texture2D_1
+ %215 = OpLoad %type_sampler %Material_Texture2D_1Sampler
+ %216 = OpSampledImage %type_sampled_image_0 %214 %215
+ %217 = OpImageSampleImplicitLod %v4float %216 %213 None
+ %218 = OpCompositeExtract %float %217 0
+ %219 = OpExtInst %float %1 FMix %float_0_400000006 %float_1 %218
+ %220 = OpFSub %float %float_1 %219
+ %221 = OpFMul %v2float %141 %124
+ %222 = OpSampledImage %type_sampled_image_0 %214 %215
+ %223 = OpImageSampleImplicitLod %v4float %222 %221 None
+ %224 = OpCompositeExtract %float %177 3
+ %225 = OpFSub %float %224 %float_24
+ %226 = OpFMul %float %225 %float_0_00066666666
+ %227 = OpExtInst %float %1 FMax %226 %float_0
+ %228 = OpExtInst %float %1 FMin %227 %float_1
+ %229 = OpCompositeExtract %float %223 1
+ %230 = OpExtInst %float %1 FMix %229 %float_1 %228
+ %231 = OpExtInst %float %1 FMix %219 %220 %230
+ %232 = OpSampledImage %type_sampled_image_0 %214 %215
+ %233 = OpImageSampleImplicitLod %v4float %232 %182 None
+ %234 = OpExtInst %float %1 FMix %229 %float_0 %228
+ %235 = OpCompositeExtract %float %233 1
+ %236 = OpFAdd %float %235 %234
+ %237 = OpExtInst %float %1 FMix %236 %float_0_5 %float_0_5
+ %238 = OpExtInst %float %1 FMix %float_0_294999987 %float_0_660000026 %237
+ %239 = OpFMul %float %238 %float_0_5
+ %240 = OpFMul %float %231 %239
+ %241 = OpExtInst %float %1 FMix %float_0 %float_0_5 %235
+ %242 = OpExtInst %float %1 FMix %float_0_699999988 %float_1 %229
+ %243 = OpExtInst %float %1 FMix %242 %float_1 %228
+ %244 = OpFAdd %float %241 %243
+ %245 = OpExtInst %float %1 FMax %244 %float_0
+ %246 = OpExtInst %float %1 FMin %245 %float_1
+ %247 = OpCompositeConstruct %v3float %240 %240 %240
+ %248 = OpExtInst %v3float %1 FClamp %247 %47 %64
+ %249 = OpCompositeExtract %float %158 1
+ %250 = OpFMul %float %246 %249
+ %251 = OpCompositeExtract %float %158 0
+ %252 = OpFAdd %float %250 %251
+ %253 = OpExtInst %float %1 FClamp %252 %float_0_119999997 %float_1
+ %254 = OpExtInst %float %1 FMax %208 %float_0
+ %255 = OpCompositeConstruct %v2float %253 %253
+ %256 = OpFMul %v2float %255 %68
+ %257 = OpFAdd %v2float %256 %70
+ %258 = OpCompositeExtract %float %257 0
+ %259 = OpFMul %float %258 %258
+ %260 = OpFMul %float %float_n9_27999973 %254
+ %261 = OpExtInst %float %1 Exp2 %260
+ %262 = OpExtInst %float %1 FMin %259 %261
+ %263 = OpFMul %float %262 %258
+ %264 = OpCompositeExtract %float %257 1
+ %265 = OpFAdd %float %263 %264
+ %266 = OpCompositeExtract %float %152 3
+ %267 = OpCompositeConstruct %v3float %266 %266 %266
+ %268 = OpFMul %v3float %248 %267
+ %269 = OpVectorShuffle %v3float %152 %152 0 1 2
+ %270 = OpFAdd %v3float %268 %269
+ %271 = OpCompositeExtract %float %154 3
+ %272 = OpFMul %float %265 %271
+ %273 = OpCompositeConstruct %v3float %272 %272 %272
+ %274 = OpVectorShuffle %v3float %154 %154 0 1 2
+ %275 = OpFAdd %v3float %273 %274
+ %276 = OpCompositeExtract %float %275 0
+ %277 = OpExtInst %float %1 FClamp %float_1 %float_0 %float_1
+ %278 = OpLoad %type_2d_image %MobileDirectionalLight_DirectionalLightShadowTexture
+ %279 = OpLoad %type_sampler %MobileDirectionalLight_DirectionalLightShadowSampler
+ %280 = OpAccessChain %_ptr_Uniform_v4float %MobileDirectionalLight %int_1
+ %281 = OpAccessChain %_ptr_Uniform_float %MobileDirectionalLight %int_1 %int_3
+ %282 = OpLoad %float %281
+ %283 = OpAccessChain %_ptr_Uniform_v4float %MobileDirectionalLight %int_2
+ %284 = OpLoad %v4float %283
+ OpBranch %285
+ %285 = OpLabel
+ %286 = OpPhi %int %int_0 %140 %287 %288
+ %289 = OpSLessThan %bool %286 %int_2
+ OpLoopMerge %290 %288 None
+ OpBranchConditional %289 %291 %290
+ %291 = OpLabel
+ %292 = OpBitcast %uint %286
+ %293 = OpAccessChain %_ptr_Uniform_float %MobileDirectionalLight %int_4 %292
+ %294 = OpLoad %float %293
+ %295 = OpFOrdLessThan %bool %224 %294
+ OpSelectionMerge %288 None
+ OpBranchConditional %295 %296 %288
+ %296 = OpLabel
+ %297 = OpCompositeExtract %float %177 0
+ %298 = OpCompositeExtract %float %177 1
+ %299 = OpCompositeConstruct %v4float %297 %298 %224 %float_1
+ %300 = OpAccessChain %_ptr_Uniform_mat4v4float %MobileDirectionalLight %int_5 %286
+ %301 = OpLoad %mat4v4float %300
+ %302 = OpMatrixTimesVector %v4float %301 %299
+ OpBranch %290
+ %288 = OpLabel
+ %287 = OpIAdd %int %286 %int_1
+ OpBranch %285
+ %290 = OpLabel
+ %303 = OpPhi %v4float %52 %285 %302 %296
+ %304 = OpCompositeExtract %float %303 2
+ %305 = OpFOrdGreaterThan %bool %304 %float_0
+ OpSelectionMerge %306 None
+ OpBranchConditional %305 %307 %306
+ %307 = OpLabel
+ %308 = OpExtInst %float %1 FMin %304 %float_0_999989986
+ %309 = OpVectorShuffle %v2float %303 %303 0 1
+ %310 = OpVectorShuffle %v2float %284 %284 0 1
+ %311 = OpFMul %v2float %309 %310
+ %312 = OpExtInst %v2float %1 Fract %311
+ %313 = OpExtInst %v2float %1 Floor %311
+ %314 = OpFAdd %v2float %313 %127
+ %315 = OpVectorShuffle %v2float %284 %284 2 3
+ %316 = OpFMul %v2float %314 %315
+ %317 = OpSampledImage %type_sampled_image_0 %278 %279
+ %318 = OpImageSampleExplicitLod %v4float %317 %316 Lod %float_0
+ %319 = OpCompositeExtract %float %318 0
+ %320 = OpCompositeInsert %v3float %319 %139 0
+ %321 = OpFAdd %v2float %313 %128
+ %322 = OpFMul %v2float %321 %315
+ %323 = OpSampledImage %type_sampled_image_0 %278 %279
+ %324 = OpImageSampleExplicitLod %v4float %323 %322 Lod %float_0
+ %325 = OpCompositeExtract %float %324 0
+ %326 = OpCompositeInsert %v3float %325 %320 1
+ %327 = OpFAdd %v2float %313 %130
+ %328 = OpFMul %v2float %327 %315
+ %329 = OpSampledImage %type_sampled_image_0 %278 %279
+ %330 = OpImageSampleExplicitLod %v4float %329 %328 Lod %float_0
+ %331 = OpCompositeExtract %float %330 0
+ %332 = OpCompositeInsert %v3float %331 %326 2
+ %333 = OpFMul %float %308 %282
+ %334 = OpFSub %float %333 %float_1
+ %335 = OpCompositeConstruct %v3float %282 %282 %282
+ %336 = OpFMul %v3float %332 %335
+ %337 = OpCompositeConstruct %v3float %334 %334 %334
+ %338 = OpFSub %v3float %336 %337
+ %339 = OpExtInst %v3float %1 FClamp %338 %47 %64
+ %340 = OpFAdd %v2float %313 %131
+ %341 = OpFMul %v2float %340 %315
+ %342 = OpSampledImage %type_sampled_image_0 %278 %279
+ %343 = OpImageSampleExplicitLod %v4float %342 %341 Lod %float_0
+ %344 = OpCompositeExtract %float %343 0
+ %345 = OpCompositeInsert %v3float %344 %139 0
+ %346 = OpFAdd %v2float %313 %60
+ %347 = OpFMul %v2float %346 %315
+ %348 = OpSampledImage %type_sampled_image_0 %278 %279
+ %349 = OpImageSampleExplicitLod %v4float %348 %347 Lod %float_0
+ %350 = OpCompositeExtract %float %349 0
+ %351 = OpCompositeInsert %v3float %350 %345 1
+ %352 = OpFAdd %v2float %313 %132
+ %353 = OpFMul %v2float %352 %315
+ %354 = OpSampledImage %type_sampled_image_0 %278 %279
+ %355 = OpImageSampleExplicitLod %v4float %354 %353 Lod %float_0
+ %356 = OpCompositeExtract %float %355 0
+ %357 = OpCompositeInsert %v3float %356 %351 2
+ %358 = OpFMul %v3float %357 %335
+ %359 = OpFSub %v3float %358 %337
+ %360 = OpExtInst %v3float %1 FClamp %359 %47 %64
+ %361 = OpFAdd %v2float %313 %133
+ %362 = OpFMul %v2float %361 %315
+ %363 = OpSampledImage %type_sampled_image_0 %278 %279
+ %364 = OpImageSampleExplicitLod %v4float %363 %362 Lod %float_0
+ %365 = OpCompositeExtract %float %364 0
+ %366 = OpCompositeInsert %v3float %365 %139 0
+ %367 = OpFAdd %v2float %313 %134
+ %368 = OpFMul %v2float %367 %315
+ %369 = OpSampledImage %type_sampled_image_0 %278 %279
+ %370 = OpImageSampleExplicitLod %v4float %369 %368 Lod %float_0
+ %371 = OpCompositeExtract %float %370 0
+ %372 = OpCompositeInsert %v3float %371 %366 1
+ %373 = OpFAdd %v2float %313 %135
+ %374 = OpFMul %v2float %373 %315
+ %375 = OpSampledImage %type_sampled_image_0 %278 %279
+ %376 = OpImageSampleExplicitLod %v4float %375 %374 Lod %float_0
+ %377 = OpCompositeExtract %float %376 0
+ %378 = OpCompositeInsert %v3float %377 %372 2
+ %379 = OpFMul %v3float %378 %335
+ %380 = OpFSub %v3float %379 %337
+ %381 = OpExtInst %v3float %1 FClamp %380 %47 %64
+ %382 = OpCompositeExtract %float %339 0
+ %383 = OpCompositeExtract %float %312 0
+ %384 = OpFSub %float %float_1 %383
+ %385 = OpFMul %float %382 %384
+ %386 = OpCompositeExtract %float %360 0
+ %387 = OpFMul %float %386 %384
+ %388 = OpCompositeExtract %float %381 0
+ %389 = OpFMul %float %388 %384
+ %390 = OpCompositeExtract %float %339 1
+ %391 = OpFAdd %float %385 %390
+ %392 = OpCompositeExtract %float %360 1
+ %393 = OpFAdd %float %387 %392
+ %394 = OpCompositeExtract %float %381 1
+ %395 = OpFAdd %float %389 %394
+ %396 = OpCompositeExtract %float %339 2
+ %397 = OpFMul %float %396 %383
+ %398 = OpFAdd %float %391 %397
+ %399 = OpCompositeInsert %v3float %398 %136 0
+ %400 = OpCompositeExtract %float %360 2
+ %401 = OpFMul %float %400 %383
+ %402 = OpFAdd %float %393 %401
+ %403 = OpCompositeInsert %v3float %402 %399 1
+ %404 = OpCompositeExtract %float %381 2
+ %405 = OpFMul %float %404 %383
+ %406 = OpFAdd %float %395 %405
+ %407 = OpCompositeInsert %v3float %406 %403 2
+ %408 = OpCompositeExtract %float %312 1
+ %409 = OpFSub %float %float_1 %408
+ %410 = OpCompositeConstruct %v3float %409 %float_1 %408
+ %411 = OpDot %float %407 %410
+ %412 = OpFMul %float %float_0_25 %411
+ %413 = OpExtInst %float %1 FClamp %412 %float_0 %float_1
+ %414 = OpAccessChain %_ptr_Uniform_float %MobileDirectionalLight %int_3 %int_0
+ %415 = OpLoad %float %414
+ %416 = OpFMul %float %224 %415
+ %417 = OpAccessChain %_ptr_Uniform_float %MobileDirectionalLight %int_3 %int_1
+ %418 = OpLoad %float %417
+ %419 = OpFAdd %float %416 %418
+ %420 = OpExtInst %float %1 FClamp %419 %float_0 %float_1
+ %421 = OpFMul %float %420 %420
+ %422 = OpExtInst %float %1 FMix %413 %float_1 %421
+ OpBranch %306
+ %306 = OpLabel
+ %423 = OpPhi %float %float_1 %290 %422 %307
+ %424 = OpLoad %v4float %280
+ %425 = OpVectorShuffle %v3float %424 %424 0 1 2
+ %426 = OpDot %float %206 %425
+ %427 = OpExtInst %float %1 FMax %float_0 %426
+ %428 = OpFAdd %v3float %181 %425
+ %429 = OpExtInst %v3float %1 Normalize %428
+ %430 = OpDot %float %206 %429
+ %431 = OpExtInst %float %1 FMax %float_0 %430
+ %432 = OpFMul %float %423 %427
+ %433 = OpCompositeConstruct %v3float %432 %432 %432
+ %434 = OpAccessChain %_ptr_Uniform_v4float %MobileDirectionalLight %int_0
+ %435 = OpLoad %v4float %434
+ %436 = OpVectorShuffle %v3float %435 %435 0 1 2
+ %437 = OpFMul %v3float %433 %436
+ %438 = OpFMul %float %253 %float_0_25
+ %439 = OpFAdd %float %438 %float_0_25
+ %440 = OpExtInst %v3float %1 Cross %206 %429
+ %441 = OpDot %float %440 %440
+ %442 = OpFMul %float %253 %253
+ %443 = OpFMul %float %431 %442
+ %444 = OpFMul %float %443 %443
+ %445 = OpFAdd %float %441 %444
+ %446 = OpFDiv %float %442 %445
+ %447 = OpFMul %float %446 %446
+ %448 = OpExtInst %float %1 FMin %447 %float_65504
+ %449 = OpFMul %float %439 %448
+ %450 = OpFMul %float %276 %449
+ %451 = OpCompositeConstruct %v3float %450 %450 %450
+ %452 = OpFAdd %v3float %270 %451
+ %453 = OpFMul %v3float %437 %452
+ %454 = OpAccessChain %_ptr_Uniform_float %_Globals %int_3 %int_3
+ %455 = OpLoad %float %454
+ %456 = OpFOrdGreaterThan %bool %455 %float_0
+ %457 = OpSelect %float %456 %float_1 %float_0
+ %458 = OpFOrdNotEqual %bool %457 %float_0
+ %459 = OpSelect %float %458 %455 %164
+ %460 = OpExtInst %float %1 Log2 %253
+ %461 = OpFMul %float %float_1_20000005 %460
+ %462 = OpFSub %float %float_1 %461
+ %463 = OpFSub %float %459 %float_1
+ %464 = OpFSub %float %463 %462
+ %465 = OpLoad %type_cube_image %ReflectionCubemap
+ %466 = OpLoad %type_sampler %ReflectionCubemapSampler
+ %467 = OpSampledImage %type_sampled_image %465 %466
+ %468 = OpImageSampleExplicitLod %v4float %467 %212 Lod %464
+ OpSelectionMerge %469 None
+ OpBranchConditional %458 %470 %471
+ %471 = OpLabel
+ %472 = OpVectorShuffle %v3float %468 %468 0 1 2
+ %473 = OpCompositeExtract %float %468 3
+ %474 = OpFMul %float %473 %float_16
+ %475 = OpCompositeConstruct %v3float %474 %474 %474
+ %476 = OpFMul %v3float %472 %475
+ %477 = OpFMul %v3float %476 %476
+ OpBranch %469
+ %470 = OpLabel
+ %478 = OpVectorShuffle %v3float %468 %468 0 1 2
+ %479 = OpVectorShuffle %v3float %162 %162 0 1 2
+ %480 = OpFMul %v3float %478 %479
+ OpBranch %469
+ %469 = OpLabel
+ %481 = OpPhi %v3float %477 %471 %480 %470
+ %482 = OpCompositeConstruct %v3float %277 %277 %277
+ %483 = OpFMul %v3float %481 %482
+ %484 = OpCompositeConstruct %v3float %276 %276 %276
+ %485 = OpFMul %v3float %483 %484
+ %486 = OpFAdd %v3float %453 %485
+ OpBranch %487
+ %487 = OpLabel
+ %488 = OpPhi %v3float %486 %469 %489 %490
+ %491 = OpPhi %int %int_0 %469 %492 %490
+ %493 = OpAccessChain %_ptr_Uniform_int %_Globals %int_0
+ %494 = OpLoad %int %493
+ %495 = OpSLessThan %bool %491 %494
+ OpLoopMerge %496 %490 None
+ OpBranchConditional %495 %497 %496
+ %497 = OpLabel
+ %498 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_1 %491
+ %499 = OpLoad %v4float %498
+ %500 = OpVectorShuffle %v3float %499 %499 0 1 2
+ %501 = OpFSub %v3float %500 %179
+ %502 = OpDot %float %501 %501
+ %503 = OpExtInst %float %1 InverseSqrt %502
+ %504 = OpCompositeConstruct %v3float %503 %503 %503
+ %505 = OpFMul %v3float %501 %504
+ %506 = OpFAdd %v3float %181 %505
+ %507 = OpExtInst %v3float %1 Normalize %506
+ %508 = OpDot %float %206 %505
+ %509 = OpExtInst %float %1 FMax %float_0 %508
+ %510 = OpDot %float %206 %507
+ %511 = OpExtInst %float %1 FMax %float_0 %510
+ %512 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_2 %491
+ %513 = OpAccessChain %_ptr_Uniform_float %_Globals %int_2 %491 %int_3
+ %514 = OpLoad %float %513
+ %515 = OpFOrdEqual %bool %514 %float_0
+ OpSelectionMerge %490 None
+ OpBranchConditional %515 %516 %517
+ %517 = OpLabel
+ %518 = OpAccessChain %_ptr_Uniform_float %_Globals %int_1 %491 %int_3
+ %519 = OpLoad %float %518
+ %520 = OpCompositeConstruct %v3float %519 %519 %519
+ %521 = OpFMul %v3float %501 %520
+ %522 = OpDot %float %521 %521
+ %523 = OpExtInst %float %1 FClamp %522 %float_0 %float_1
+ %524 = OpFSub %float %float_1 %523
+ %525 = OpExtInst %float %1 Pow %524 %514
+ OpBranch %490
+ %516 = OpLabel
+ %526 = OpFAdd %float %502 %float_1
+ %527 = OpFDiv %float %float_1 %526
+ %528 = OpAccessChain %_ptr_Uniform_float %_Globals %int_1 %491 %int_3
+ %529 = OpLoad %float %528
+ %530 = OpFMul %float %529 %529
+ %531 = OpFMul %float %502 %530
+ %532 = OpFMul %float %531 %531
+ %533 = OpFSub %float %float_1 %532
+ %534 = OpExtInst %float %1 FClamp %533 %float_0 %float_1
+ %535 = OpFMul %float %534 %534
+ %536 = OpFMul %float %527 %535
+ OpBranch %490
+ %490 = OpLabel
+ %537 = OpPhi %float %525 %517 %536 %516
+ %538 = OpFMul %float %537 %509
+ %539 = OpCompositeConstruct %v3float %538 %538 %538
+ %540 = OpLoad %v4float %512
+ %541 = OpVectorShuffle %v3float %540 %540 0 1 2
+ %542 = OpFMul %v3float %539 %541
+ %543 = OpFMul %v3float %542 %57
+ %544 = OpExtInst %v3float %1 Cross %206 %507
+ %545 = OpDot %float %544 %544
+ %546 = OpFMul %float %511 %442
+ %547 = OpFMul %float %546 %546
+ %548 = OpFAdd %float %545 %547
+ %549 = OpFDiv %float %442 %548
+ %550 = OpFMul %float %549 %549
+ %551 = OpExtInst %float %1 FMin %550 %float_65504
+ %552 = OpFMul %float %439 %551
+ %553 = OpFMul %float %276 %552
+ %554 = OpCompositeConstruct %v3float %553 %553 %553
+ %555 = OpFAdd %v3float %270 %554
+ %556 = OpFMul %v3float %543 %555
+ %557 = OpExtInst %v3float %1 FMin %55 %556
+ %489 = OpFAdd %v3float %488 %557
+ %492 = OpIAdd %int %491 %int_1
+ OpBranch %487
+ %496 = OpLabel
+ %558 = OpExtInst %v3float %1 FMax %47 %47
+ %559 = OpFAdd %v3float %488 %558
+ %560 = OpFAdd %v3float %270 %484
+ %561 = OpCompositeConstruct %v3float %160 %160 %160
+ %562 = OpExtInst %v3float %1 FMix %559 %560 %561
+ %563 = OpCompositeExtract %float %142 3
+ %564 = OpCompositeConstruct %v3float %563 %563 %563
+ %565 = OpFMul %v3float %562 %564
+ %566 = OpVectorShuffle %v3float %142 %142 0 1 2
+ %567 = OpFAdd %v3float %565 %566
+ %568 = OpVectorShuffle %v4float %137 %567 4 5 6 3
+ %569 = OpCompositeExtract %float %143 3
+ %570 = OpExtInst %float %1 FMin %569 %float_65500
+ %571 = OpCompositeInsert %v4float %570 %568 3
+ OpStore %out_var_SV_Target0 %571
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/array-copy-error.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/array-copy-error.asm.frag
new file mode 100644
index 00000000000..eba220ba4e7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/array-copy-error.asm.frag
@@ -0,0 +1,878 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 353
+; Schema: 0
+ OpCapability Shader
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %MainPixelShader "main" %gl_FragCoord %in_var_TEXCOORD6 %in_var_TEXCOORD7 %in_var_TEXCOORD10_centroid %in_var_TEXCOORD11_centroid %in_var_TEXCOORD0 %in_var_PRIMITIVE_ID %gl_FrontFacing %gl_FragDepth %out_var_SV_Target0
+ OpExecutionMode %MainPixelShader OriginUpperLeft
+ OpExecutionMode %MainPixelShader DepthReplacing
+ OpExecutionMode %MainPixelShader DepthLess
+ OpSource HLSL 600
+ OpName %type_View "type.View"
+ OpMemberName %type_View 0 "View_TranslatedWorldToClip"
+ OpMemberName %type_View 1 "View_WorldToClip"
+ OpMemberName %type_View 2 "View_ClipToWorld"
+ OpMemberName %type_View 3 "View_TranslatedWorldToView"
+ OpMemberName %type_View 4 "View_ViewToTranslatedWorld"
+ OpMemberName %type_View 5 "View_TranslatedWorldToCameraView"
+ OpMemberName %type_View 6 "View_CameraViewToTranslatedWorld"
+ OpMemberName %type_View 7 "View_ViewToClip"
+ OpMemberName %type_View 8 "View_ViewToClipNoAA"
+ OpMemberName %type_View 9 "View_ClipToView"
+ OpMemberName %type_View 10 "View_ClipToTranslatedWorld"
+ OpMemberName %type_View 11 "View_SVPositionToTranslatedWorld"
+ OpMemberName %type_View 12 "View_ScreenToWorld"
+ OpMemberName %type_View 13 "View_ScreenToTranslatedWorld"
+ OpMemberName %type_View 14 "View_ViewForward"
+ OpMemberName %type_View 15 "PrePadding_View_908"
+ OpMemberName %type_View 16 "View_ViewUp"
+ OpMemberName %type_View 17 "PrePadding_View_924"
+ OpMemberName %type_View 18 "View_ViewRight"
+ OpMemberName %type_View 19 "PrePadding_View_940"
+ OpMemberName %type_View 20 "View_HMDViewNoRollUp"
+ OpMemberName %type_View 21 "PrePadding_View_956"
+ OpMemberName %type_View 22 "View_HMDViewNoRollRight"
+ OpMemberName %type_View 23 "PrePadding_View_972"
+ OpMemberName %type_View 24 "View_InvDeviceZToWorldZTransform"
+ OpMemberName %type_View 25 "View_ScreenPositionScaleBias"
+ OpMemberName %type_View 26 "View_WorldCameraOrigin"
+ OpMemberName %type_View 27 "PrePadding_View_1020"
+ OpMemberName %type_View 28 "View_TranslatedWorldCameraOrigin"
+ OpMemberName %type_View 29 "PrePadding_View_1036"
+ OpMemberName %type_View 30 "View_WorldViewOrigin"
+ OpMemberName %type_View 31 "PrePadding_View_1052"
+ OpMemberName %type_View 32 "View_PreViewTranslation"
+ OpMemberName %type_View 33 "PrePadding_View_1068"
+ OpMemberName %type_View 34 "View_PrevProjection"
+ OpMemberName %type_View 35 "View_PrevViewProj"
+ OpMemberName %type_View 36 "View_PrevViewRotationProj"
+ OpMemberName %type_View 37 "View_PrevViewToClip"
+ OpMemberName %type_View 38 "View_PrevClipToView"
+ OpMemberName %type_View 39 "View_PrevTranslatedWorldToClip"
+ OpMemberName %type_View 40 "View_PrevTranslatedWorldToView"
+ OpMemberName %type_View 41 "View_PrevViewToTranslatedWorld"
+ OpMemberName %type_View 42 "View_PrevTranslatedWorldToCameraView"
+ OpMemberName %type_View 43 "View_PrevCameraViewToTranslatedWorld"
+ OpMemberName %type_View 44 "View_PrevWorldCameraOrigin"
+ OpMemberName %type_View 45 "PrePadding_View_1724"
+ OpMemberName %type_View 46 "View_PrevWorldViewOrigin"
+ OpMemberName %type_View 47 "PrePadding_View_1740"
+ OpMemberName %type_View 48 "View_PrevPreViewTranslation"
+ OpMemberName %type_View 49 "PrePadding_View_1756"
+ OpMemberName %type_View 50 "View_PrevInvViewProj"
+ OpMemberName %type_View 51 "View_PrevScreenToTranslatedWorld"
+ OpMemberName %type_View 52 "View_ClipToPrevClip"
+ OpMemberName %type_View 53 "View_TemporalAAJitter"
+ OpMemberName %type_View 54 "View_GlobalClippingPlane"
+ OpMemberName %type_View 55 "View_FieldOfViewWideAngles"
+ OpMemberName %type_View 56 "View_PrevFieldOfViewWideAngles"
+ OpMemberName %type_View 57 "View_ViewRectMin"
+ OpMemberName %type_View 58 "View_ViewSizeAndInvSize"
+ OpMemberName %type_View 59 "View_BufferSizeAndInvSize"
+ OpMemberName %type_View 60 "View_BufferBilinearUVMinMax"
+ OpMemberName %type_View 61 "View_NumSceneColorMSAASamples"
+ OpMemberName %type_View 62 "View_PreExposure"
+ OpMemberName %type_View 63 "View_OneOverPreExposure"
+ OpMemberName %type_View 64 "PrePadding_View_2076"
+ OpMemberName %type_View 65 "View_DiffuseOverrideParameter"
+ OpMemberName %type_View 66 "View_SpecularOverrideParameter"
+ OpMemberName %type_View 67 "View_NormalOverrideParameter"
+ OpMemberName %type_View 68 "View_RoughnessOverrideParameter"
+ OpMemberName %type_View 69 "View_PrevFrameGameTime"
+ OpMemberName %type_View 70 "View_PrevFrameRealTime"
+ OpMemberName %type_View 71 "View_OutOfBoundsMask"
+ OpMemberName %type_View 72 "PrePadding_View_2148"
+ OpMemberName %type_View 73 "PrePadding_View_2152"
+ OpMemberName %type_View 74 "PrePadding_View_2156"
+ OpMemberName %type_View 75 "View_WorldCameraMovementSinceLastFrame"
+ OpMemberName %type_View 76 "View_CullingSign"
+ OpMemberName %type_View 77 "View_NearPlane"
+ OpMemberName %type_View 78 "View_AdaptiveTessellationFactor"
+ OpMemberName %type_View 79 "View_GameTime"
+ OpMemberName %type_View 80 "View_RealTime"
+ OpMemberName %type_View 81 "View_DeltaTime"
+ OpMemberName %type_View 82 "View_MaterialTextureMipBias"
+ OpMemberName %type_View 83 "View_MaterialTextureDerivativeMultiply"
+ OpMemberName %type_View 84 "View_Random"
+ OpMemberName %type_View 85 "View_FrameNumber"
+ OpMemberName %type_View 86 "View_StateFrameIndexMod8"
+ OpMemberName %type_View 87 "View_StateFrameIndex"
+ OpMemberName %type_View 88 "View_CameraCut"
+ OpMemberName %type_View 89 "View_UnlitViewmodeMask"
+ OpMemberName %type_View 90 "PrePadding_View_2228"
+ OpMemberName %type_View 91 "PrePadding_View_2232"
+ OpMemberName %type_View 92 "PrePadding_View_2236"
+ OpMemberName %type_View 93 "View_DirectionalLightColor"
+ OpMemberName %type_View 94 "View_DirectionalLightDirection"
+ OpMemberName %type_View 95 "PrePadding_View_2268"
+ OpMemberName %type_View 96 "View_TranslucencyLightingVolumeMin"
+ OpMemberName %type_View 97 "View_TranslucencyLightingVolumeInvSize"
+ OpMemberName %type_View 98 "View_TemporalAAParams"
+ OpMemberName %type_View 99 "View_CircleDOFParams"
+ OpMemberName %type_View 100 "View_DepthOfFieldSensorWidth"
+ OpMemberName %type_View 101 "View_DepthOfFieldFocalDistance"
+ OpMemberName %type_View 102 "View_DepthOfFieldScale"
+ OpMemberName %type_View 103 "View_DepthOfFieldFocalLength"
+ OpMemberName %type_View 104 "View_DepthOfFieldFocalRegion"
+ OpMemberName %type_View 105 "View_DepthOfFieldNearTransitionRegion"
+ OpMemberName %type_View 106 "View_DepthOfFieldFarTransitionRegion"
+ OpMemberName %type_View 107 "View_MotionBlurNormalizedToPixel"
+ OpMemberName %type_View 108 "View_bSubsurfacePostprocessEnabled"
+ OpMemberName %type_View 109 "View_GeneralPurposeTweak"
+ OpMemberName %type_View 110 "View_DemosaicVposOffset"
+ OpMemberName %type_View 111 "PrePadding_View_2412"
+ OpMemberName %type_View 112 "View_IndirectLightingColorScale"
+ OpMemberName %type_View 113 "View_HDR32bppEncodingMode"
+ OpMemberName %type_View 114 "View_AtmosphericFogSunDirection"
+ OpMemberName %type_View 115 "View_AtmosphericFogSunPower"
+ OpMemberName %type_View 116 "View_AtmosphericFogPower"
+ OpMemberName %type_View 117 "View_AtmosphericFogDensityScale"
+ OpMemberName %type_View 118 "View_AtmosphericFogDensityOffset"
+ OpMemberName %type_View 119 "View_AtmosphericFogGroundOffset"
+ OpMemberName %type_View 120 "View_AtmosphericFogDistanceScale"
+ OpMemberName %type_View 121 "View_AtmosphericFogAltitudeScale"
+ OpMemberName %type_View 122 "View_AtmosphericFogHeightScaleRayleigh"
+ OpMemberName %type_View 123 "View_AtmosphericFogStartDistance"
+ OpMemberName %type_View 124 "View_AtmosphericFogDistanceOffset"
+ OpMemberName %type_View 125 "View_AtmosphericFogSunDiscScale"
+ OpMemberName %type_View 126 "View_AtmosphericFogSunDiscHalfApexAngleRadian"
+ OpMemberName %type_View 127 "PrePadding_View_2492"
+ OpMemberName %type_View 128 "View_AtmosphericFogSunDiscLuminance"
+ OpMemberName %type_View 129 "View_AtmosphericFogRenderMask"
+ OpMemberName %type_View 130 "View_AtmosphericFogInscatterAltitudeSampleNum"
+ OpMemberName %type_View 131 "PrePadding_View_2520"
+ OpMemberName %type_View 132 "PrePadding_View_2524"
+ OpMemberName %type_View 133 "View_AtmosphericFogSunColor"
+ OpMemberName %type_View 134 "View_NormalCurvatureToRoughnessScaleBias"
+ OpMemberName %type_View 135 "View_RenderingReflectionCaptureMask"
+ OpMemberName %type_View 136 "View_AmbientCubemapTint"
+ OpMemberName %type_View 137 "View_AmbientCubemapIntensity"
+ OpMemberName %type_View 138 "View_SkyLightParameters"
+ OpMemberName %type_View 139 "PrePadding_View_2584"
+ OpMemberName %type_View 140 "PrePadding_View_2588"
+ OpMemberName %type_View 141 "View_SkyLightColor"
+ OpMemberName %type_View 142 "View_SkyIrradianceEnvironmentMap"
+ OpMemberName %type_View 143 "View_MobilePreviewMode"
+ OpMemberName %type_View 144 "View_HMDEyePaddingOffset"
+ OpMemberName %type_View 145 "View_ReflectionCubemapMaxMip"
+ OpMemberName %type_View 146 "View_ShowDecalsMask"
+ OpMemberName %type_View 147 "View_DistanceFieldAOSpecularOcclusionMode"
+ OpMemberName %type_View 148 "View_IndirectCapsuleSelfShadowingIntensity"
+ OpMemberName %type_View 149 "PrePadding_View_2744"
+ OpMemberName %type_View 150 "PrePadding_View_2748"
+ OpMemberName %type_View 151 "View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight"
+ OpMemberName %type_View 152 "View_StereoPassIndex"
+ OpMemberName %type_View 153 "View_GlobalVolumeCenterAndExtent"
+ OpMemberName %type_View 154 "View_GlobalVolumeWorldToUVAddAndMul"
+ OpMemberName %type_View 155 "View_GlobalVolumeDimension"
+ OpMemberName %type_View 156 "View_GlobalVolumeTexelSize"
+ OpMemberName %type_View 157 "View_MaxGlobalDistance"
+ OpMemberName %type_View 158 "PrePadding_View_2908"
+ OpMemberName %type_View 159 "View_CursorPosition"
+ OpMemberName %type_View 160 "View_bCheckerboardSubsurfaceProfileRendering"
+ OpMemberName %type_View 161 "PrePadding_View_2924"
+ OpMemberName %type_View 162 "View_VolumetricFogInvGridSize"
+ OpMemberName %type_View 163 "PrePadding_View_2940"
+ OpMemberName %type_View 164 "View_VolumetricFogGridZParams"
+ OpMemberName %type_View 165 "PrePadding_View_2956"
+ OpMemberName %type_View 166 "View_VolumetricFogSVPosToVolumeUV"
+ OpMemberName %type_View 167 "View_VolumetricFogMaxDistance"
+ OpMemberName %type_View 168 "PrePadding_View_2972"
+ OpMemberName %type_View 169 "View_VolumetricLightmapWorldToUVScale"
+ OpMemberName %type_View 170 "PrePadding_View_2988"
+ OpMemberName %type_View 171 "View_VolumetricLightmapWorldToUVAdd"
+ OpMemberName %type_View 172 "PrePadding_View_3004"
+ OpMemberName %type_View 173 "View_VolumetricLightmapIndirectionTextureSize"
+ OpMemberName %type_View 174 "View_VolumetricLightmapBrickSize"
+ OpMemberName %type_View 175 "View_VolumetricLightmapBrickTexelSize"
+ OpMemberName %type_View 176 "View_StereoIPD"
+ OpMemberName %type_View 177 "View_IndirectLightingCacheShowFlag"
+ OpMemberName %type_View 178 "View_EyeToPixelSpreadAngle"
+ OpName %View "View"
+ OpName %type_PrimitiveDither "type.PrimitiveDither"
+ OpMemberName %type_PrimitiveDither 0 "PrimitiveDither_LODFactor"
+ OpName %PrimitiveDither "PrimitiveDither"
+ OpName %type_PrimitiveFade "type.PrimitiveFade"
+ OpMemberName %type_PrimitiveFade 0 "PrimitiveFade_FadeTimeScaleBias"
+ OpName %PrimitiveFade "PrimitiveFade"
+ OpName %type_Material "type.Material"
+ OpMemberName %type_Material 0 "Material_VectorExpressions"
+ OpMemberName %type_Material 1 "Material_ScalarExpressions"
+ OpName %Material "Material"
+ OpName %type_2d_image "type.2d.image"
+ OpName %Material_Texture2D_0 "Material_Texture2D_0"
+ OpName %type_sampler "type.sampler"
+ OpName %Material_Texture2D_0Sampler "Material_Texture2D_0Sampler"
+ OpName %Material_Texture2D_3 "Material_Texture2D_3"
+ OpName %Material_Texture2D_3Sampler "Material_Texture2D_3Sampler"
+ OpName %in_var_TEXCOORD6 "in.var.TEXCOORD6"
+ OpName %in_var_TEXCOORD7 "in.var.TEXCOORD7"
+ OpName %in_var_TEXCOORD10_centroid "in.var.TEXCOORD10_centroid"
+ OpName %in_var_TEXCOORD11_centroid "in.var.TEXCOORD11_centroid"
+ OpName %in_var_TEXCOORD0 "in.var.TEXCOORD0"
+ OpName %in_var_PRIMITIVE_ID "in.var.PRIMITIVE_ID"
+ OpName %out_var_SV_Target0 "out.var.SV_Target0"
+ OpName %MainPixelShader "MainPixelShader"
+ OpName %type_sampled_image "type.sampled.image"
+ OpDecorate %gl_FragCoord BuiltIn FragCoord
+ OpDecorateString %gl_FragCoord UserSemantic "SV_Position"
+ OpDecorateString %in_var_TEXCOORD6 UserSemantic "TEXCOORD6"
+ OpDecorateString %in_var_TEXCOORD7 UserSemantic "TEXCOORD7"
+ OpDecorateString %in_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %in_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %in_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorateString %in_var_PRIMITIVE_ID UserSemantic "PRIMITIVE_ID"
+ OpDecorate %in_var_PRIMITIVE_ID Flat
+ OpDecorate %gl_FrontFacing BuiltIn FrontFacing
+ OpDecorateString %gl_FrontFacing UserSemantic "SV_IsFrontFace"
+ OpDecorate %gl_FrontFacing Flat
+ OpDecorate %gl_FragDepth BuiltIn FragDepth
+ OpDecorateString %gl_FragDepth UserSemantic "SV_DepthLessEqual"
+ OpDecorateString %out_var_SV_Target0 UserSemantic "SV_Target0"
+ OpDecorate %in_var_TEXCOORD6 Location 0
+ OpDecorate %in_var_TEXCOORD7 Location 1
+ OpDecorate %in_var_TEXCOORD10_centroid Location 2
+ OpDecorate %in_var_TEXCOORD11_centroid Location 3
+ OpDecorate %in_var_TEXCOORD0 Location 4
+ OpDecorate %in_var_PRIMITIVE_ID Location 5
+ OpDecorate %out_var_SV_Target0 Location 0
+ OpDecorate %View DescriptorSet 0
+ OpDecorate %View Binding 0
+ OpDecorate %PrimitiveDither DescriptorSet 0
+ OpDecorate %PrimitiveDither Binding 1
+ OpDecorate %PrimitiveFade DescriptorSet 0
+ OpDecorate %PrimitiveFade Binding 2
+ OpDecorate %Material DescriptorSet 0
+ OpDecorate %Material Binding 3
+ OpDecorate %Material_Texture2D_0 DescriptorSet 0
+ OpDecorate %Material_Texture2D_0 Binding 0
+ OpDecorate %Material_Texture2D_0Sampler DescriptorSet 0
+ OpDecorate %Material_Texture2D_0Sampler Binding 0
+ OpDecorate %Material_Texture2D_3 DescriptorSet 0
+ OpDecorate %Material_Texture2D_3 Binding 1
+ OpDecorate %Material_Texture2D_3Sampler DescriptorSet 0
+ OpDecorate %Material_Texture2D_3Sampler Binding 1
+ OpDecorate %_arr_v4float_uint_2 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_7 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpMemberDecorate %type_View 0 Offset 0
+ OpMemberDecorate %type_View 0 MatrixStride 16
+ OpMemberDecorate %type_View 0 ColMajor
+ OpMemberDecorate %type_View 1 Offset 64
+ OpMemberDecorate %type_View 1 MatrixStride 16
+ OpMemberDecorate %type_View 1 ColMajor
+ OpMemberDecorate %type_View 2 Offset 128
+ OpMemberDecorate %type_View 2 MatrixStride 16
+ OpMemberDecorate %type_View 2 ColMajor
+ OpMemberDecorate %type_View 3 Offset 192
+ OpMemberDecorate %type_View 3 MatrixStride 16
+ OpMemberDecorate %type_View 3 ColMajor
+ OpMemberDecorate %type_View 4 Offset 256
+ OpMemberDecorate %type_View 4 MatrixStride 16
+ OpMemberDecorate %type_View 4 ColMajor
+ OpMemberDecorate %type_View 5 Offset 320
+ OpMemberDecorate %type_View 5 MatrixStride 16
+ OpMemberDecorate %type_View 5 ColMajor
+ OpMemberDecorate %type_View 6 Offset 384
+ OpMemberDecorate %type_View 6 MatrixStride 16
+ OpMemberDecorate %type_View 6 ColMajor
+ OpMemberDecorate %type_View 7 Offset 448
+ OpMemberDecorate %type_View 7 MatrixStride 16
+ OpMemberDecorate %type_View 7 ColMajor
+ OpMemberDecorate %type_View 8 Offset 512
+ OpMemberDecorate %type_View 8 MatrixStride 16
+ OpMemberDecorate %type_View 8 ColMajor
+ OpMemberDecorate %type_View 9 Offset 576
+ OpMemberDecorate %type_View 9 MatrixStride 16
+ OpMemberDecorate %type_View 9 ColMajor
+ OpMemberDecorate %type_View 10 Offset 640
+ OpMemberDecorate %type_View 10 MatrixStride 16
+ OpMemberDecorate %type_View 10 ColMajor
+ OpMemberDecorate %type_View 11 Offset 704
+ OpMemberDecorate %type_View 11 MatrixStride 16
+ OpMemberDecorate %type_View 11 ColMajor
+ OpMemberDecorate %type_View 12 Offset 768
+ OpMemberDecorate %type_View 12 MatrixStride 16
+ OpMemberDecorate %type_View 12 ColMajor
+ OpMemberDecorate %type_View 13 Offset 832
+ OpMemberDecorate %type_View 13 MatrixStride 16
+ OpMemberDecorate %type_View 13 ColMajor
+ OpMemberDecorate %type_View 14 Offset 896
+ OpMemberDecorate %type_View 15 Offset 908
+ OpMemberDecorate %type_View 16 Offset 912
+ OpMemberDecorate %type_View 17 Offset 924
+ OpMemberDecorate %type_View 18 Offset 928
+ OpMemberDecorate %type_View 19 Offset 940
+ OpMemberDecorate %type_View 20 Offset 944
+ OpMemberDecorate %type_View 21 Offset 956
+ OpMemberDecorate %type_View 22 Offset 960
+ OpMemberDecorate %type_View 23 Offset 972
+ OpMemberDecorate %type_View 24 Offset 976
+ OpMemberDecorate %type_View 25 Offset 992
+ OpMemberDecorate %type_View 26 Offset 1008
+ OpMemberDecorate %type_View 27 Offset 1020
+ OpMemberDecorate %type_View 28 Offset 1024
+ OpMemberDecorate %type_View 29 Offset 1036
+ OpMemberDecorate %type_View 30 Offset 1040
+ OpMemberDecorate %type_View 31 Offset 1052
+ OpMemberDecorate %type_View 32 Offset 1056
+ OpMemberDecorate %type_View 33 Offset 1068
+ OpMemberDecorate %type_View 34 Offset 1072
+ OpMemberDecorate %type_View 34 MatrixStride 16
+ OpMemberDecorate %type_View 34 ColMajor
+ OpMemberDecorate %type_View 35 Offset 1136
+ OpMemberDecorate %type_View 35 MatrixStride 16
+ OpMemberDecorate %type_View 35 ColMajor
+ OpMemberDecorate %type_View 36 Offset 1200
+ OpMemberDecorate %type_View 36 MatrixStride 16
+ OpMemberDecorate %type_View 36 ColMajor
+ OpMemberDecorate %type_View 37 Offset 1264
+ OpMemberDecorate %type_View 37 MatrixStride 16
+ OpMemberDecorate %type_View 37 ColMajor
+ OpMemberDecorate %type_View 38 Offset 1328
+ OpMemberDecorate %type_View 38 MatrixStride 16
+ OpMemberDecorate %type_View 38 ColMajor
+ OpMemberDecorate %type_View 39 Offset 1392
+ OpMemberDecorate %type_View 39 MatrixStride 16
+ OpMemberDecorate %type_View 39 ColMajor
+ OpMemberDecorate %type_View 40 Offset 1456
+ OpMemberDecorate %type_View 40 MatrixStride 16
+ OpMemberDecorate %type_View 40 ColMajor
+ OpMemberDecorate %type_View 41 Offset 1520
+ OpMemberDecorate %type_View 41 MatrixStride 16
+ OpMemberDecorate %type_View 41 ColMajor
+ OpMemberDecorate %type_View 42 Offset 1584
+ OpMemberDecorate %type_View 42 MatrixStride 16
+ OpMemberDecorate %type_View 42 ColMajor
+ OpMemberDecorate %type_View 43 Offset 1648
+ OpMemberDecorate %type_View 43 MatrixStride 16
+ OpMemberDecorate %type_View 43 ColMajor
+ OpMemberDecorate %type_View 44 Offset 1712
+ OpMemberDecorate %type_View 45 Offset 1724
+ OpMemberDecorate %type_View 46 Offset 1728
+ OpMemberDecorate %type_View 47 Offset 1740
+ OpMemberDecorate %type_View 48 Offset 1744
+ OpMemberDecorate %type_View 49 Offset 1756
+ OpMemberDecorate %type_View 50 Offset 1760
+ OpMemberDecorate %type_View 50 MatrixStride 16
+ OpMemberDecorate %type_View 50 ColMajor
+ OpMemberDecorate %type_View 51 Offset 1824
+ OpMemberDecorate %type_View 51 MatrixStride 16
+ OpMemberDecorate %type_View 51 ColMajor
+ OpMemberDecorate %type_View 52 Offset 1888
+ OpMemberDecorate %type_View 52 MatrixStride 16
+ OpMemberDecorate %type_View 52 ColMajor
+ OpMemberDecorate %type_View 53 Offset 1952
+ OpMemberDecorate %type_View 54 Offset 1968
+ OpMemberDecorate %type_View 55 Offset 1984
+ OpMemberDecorate %type_View 56 Offset 1992
+ OpMemberDecorate %type_View 57 Offset 2000
+ OpMemberDecorate %type_View 58 Offset 2016
+ OpMemberDecorate %type_View 59 Offset 2032
+ OpMemberDecorate %type_View 60 Offset 2048
+ OpMemberDecorate %type_View 61 Offset 2064
+ OpMemberDecorate %type_View 62 Offset 2068
+ OpMemberDecorate %type_View 63 Offset 2072
+ OpMemberDecorate %type_View 64 Offset 2076
+ OpMemberDecorate %type_View 65 Offset 2080
+ OpMemberDecorate %type_View 66 Offset 2096
+ OpMemberDecorate %type_View 67 Offset 2112
+ OpMemberDecorate %type_View 68 Offset 2128
+ OpMemberDecorate %type_View 69 Offset 2136
+ OpMemberDecorate %type_View 70 Offset 2140
+ OpMemberDecorate %type_View 71 Offset 2144
+ OpMemberDecorate %type_View 72 Offset 2148
+ OpMemberDecorate %type_View 73 Offset 2152
+ OpMemberDecorate %type_View 74 Offset 2156
+ OpMemberDecorate %type_View 75 Offset 2160
+ OpMemberDecorate %type_View 76 Offset 2172
+ OpMemberDecorate %type_View 77 Offset 2176
+ OpMemberDecorate %type_View 78 Offset 2180
+ OpMemberDecorate %type_View 79 Offset 2184
+ OpMemberDecorate %type_View 80 Offset 2188
+ OpMemberDecorate %type_View 81 Offset 2192
+ OpMemberDecorate %type_View 82 Offset 2196
+ OpMemberDecorate %type_View 83 Offset 2200
+ OpMemberDecorate %type_View 84 Offset 2204
+ OpMemberDecorate %type_View 85 Offset 2208
+ OpMemberDecorate %type_View 86 Offset 2212
+ OpMemberDecorate %type_View 87 Offset 2216
+ OpMemberDecorate %type_View 88 Offset 2220
+ OpMemberDecorate %type_View 89 Offset 2224
+ OpMemberDecorate %type_View 90 Offset 2228
+ OpMemberDecorate %type_View 91 Offset 2232
+ OpMemberDecorate %type_View 92 Offset 2236
+ OpMemberDecorate %type_View 93 Offset 2240
+ OpMemberDecorate %type_View 94 Offset 2256
+ OpMemberDecorate %type_View 95 Offset 2268
+ OpMemberDecorate %type_View 96 Offset 2272
+ OpMemberDecorate %type_View 97 Offset 2304
+ OpMemberDecorate %type_View 98 Offset 2336
+ OpMemberDecorate %type_View 99 Offset 2352
+ OpMemberDecorate %type_View 100 Offset 2368
+ OpMemberDecorate %type_View 101 Offset 2372
+ OpMemberDecorate %type_View 102 Offset 2376
+ OpMemberDecorate %type_View 103 Offset 2380
+ OpMemberDecorate %type_View 104 Offset 2384
+ OpMemberDecorate %type_View 105 Offset 2388
+ OpMemberDecorate %type_View 106 Offset 2392
+ OpMemberDecorate %type_View 107 Offset 2396
+ OpMemberDecorate %type_View 108 Offset 2400
+ OpMemberDecorate %type_View 109 Offset 2404
+ OpMemberDecorate %type_View 110 Offset 2408
+ OpMemberDecorate %type_View 111 Offset 2412
+ OpMemberDecorate %type_View 112 Offset 2416
+ OpMemberDecorate %type_View 113 Offset 2428
+ OpMemberDecorate %type_View 114 Offset 2432
+ OpMemberDecorate %type_View 115 Offset 2444
+ OpMemberDecorate %type_View 116 Offset 2448
+ OpMemberDecorate %type_View 117 Offset 2452
+ OpMemberDecorate %type_View 118 Offset 2456
+ OpMemberDecorate %type_View 119 Offset 2460
+ OpMemberDecorate %type_View 120 Offset 2464
+ OpMemberDecorate %type_View 121 Offset 2468
+ OpMemberDecorate %type_View 122 Offset 2472
+ OpMemberDecorate %type_View 123 Offset 2476
+ OpMemberDecorate %type_View 124 Offset 2480
+ OpMemberDecorate %type_View 125 Offset 2484
+ OpMemberDecorate %type_View 126 Offset 2488
+ OpMemberDecorate %type_View 127 Offset 2492
+ OpMemberDecorate %type_View 128 Offset 2496
+ OpMemberDecorate %type_View 129 Offset 2512
+ OpMemberDecorate %type_View 130 Offset 2516
+ OpMemberDecorate %type_View 131 Offset 2520
+ OpMemberDecorate %type_View 132 Offset 2524
+ OpMemberDecorate %type_View 133 Offset 2528
+ OpMemberDecorate %type_View 134 Offset 2544
+ OpMemberDecorate %type_View 135 Offset 2556
+ OpMemberDecorate %type_View 136 Offset 2560
+ OpMemberDecorate %type_View 137 Offset 2576
+ OpMemberDecorate %type_View 138 Offset 2580
+ OpMemberDecorate %type_View 139 Offset 2584
+ OpMemberDecorate %type_View 140 Offset 2588
+ OpMemberDecorate %type_View 141 Offset 2592
+ OpMemberDecorate %type_View 142 Offset 2608
+ OpMemberDecorate %type_View 143 Offset 2720
+ OpMemberDecorate %type_View 144 Offset 2724
+ OpMemberDecorate %type_View 145 Offset 2728
+ OpMemberDecorate %type_View 146 Offset 2732
+ OpMemberDecorate %type_View 147 Offset 2736
+ OpMemberDecorate %type_View 148 Offset 2740
+ OpMemberDecorate %type_View 149 Offset 2744
+ OpMemberDecorate %type_View 150 Offset 2748
+ OpMemberDecorate %type_View 151 Offset 2752
+ OpMemberDecorate %type_View 152 Offset 2764
+ OpMemberDecorate %type_View 153 Offset 2768
+ OpMemberDecorate %type_View 154 Offset 2832
+ OpMemberDecorate %type_View 155 Offset 2896
+ OpMemberDecorate %type_View 156 Offset 2900
+ OpMemberDecorate %type_View 157 Offset 2904
+ OpMemberDecorate %type_View 158 Offset 2908
+ OpMemberDecorate %type_View 159 Offset 2912
+ OpMemberDecorate %type_View 160 Offset 2920
+ OpMemberDecorate %type_View 161 Offset 2924
+ OpMemberDecorate %type_View 162 Offset 2928
+ OpMemberDecorate %type_View 163 Offset 2940
+ OpMemberDecorate %type_View 164 Offset 2944
+ OpMemberDecorate %type_View 165 Offset 2956
+ OpMemberDecorate %type_View 166 Offset 2960
+ OpMemberDecorate %type_View 167 Offset 2968
+ OpMemberDecorate %type_View 168 Offset 2972
+ OpMemberDecorate %type_View 169 Offset 2976
+ OpMemberDecorate %type_View 170 Offset 2988
+ OpMemberDecorate %type_View 171 Offset 2992
+ OpMemberDecorate %type_View 172 Offset 3004
+ OpMemberDecorate %type_View 173 Offset 3008
+ OpMemberDecorate %type_View 174 Offset 3020
+ OpMemberDecorate %type_View 175 Offset 3024
+ OpMemberDecorate %type_View 176 Offset 3036
+ OpMemberDecorate %type_View 177 Offset 3040
+ OpMemberDecorate %type_View 178 Offset 3044
+ OpDecorate %type_View Block
+ OpMemberDecorate %type_PrimitiveDither 0 Offset 0
+ OpDecorate %type_PrimitiveDither Block
+ OpMemberDecorate %type_PrimitiveFade 0 Offset 0
+ OpDecorate %type_PrimitiveFade Block
+ OpDecorate %_arr_v4float_uint_9 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_3 ArrayStride 16
+ OpMemberDecorate %type_Material 0 Offset 0
+ OpMemberDecorate %type_Material 1 Offset 144
+ OpDecorate %type_Material Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+ %v2int = OpTypeVector %int 2
+%float_0_00100000005 = OpConstant %float 0.00100000005
+ %int_2 = OpConstant %int 2
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %float_0 = OpConstant %float 0
+ %49 = OpConstantComposite %v2float %float_0 %float_0
+ %float_1 = OpConstant %float 1
+ %int_4 = OpConstant %int 4
+ %int_11 = OpConstant %int 11
+%float_0_249500006 = OpConstant %float 0.249500006
+ %54 = OpConstantComposite %v2float %float_0_249500006 %float_0_249500006
+%float_0_499992371 = OpConstant %float 0.499992371
+ %56 = OpConstantComposite %v2float %float_0_499992371 %float_0_499992371
+ %int_32 = OpConstant %int 32
+ %int_53 = OpConstant %int 53
+ %int_57 = OpConstant %int 57
+ %int_80 = OpConstant %int 80
+ %int_82 = OpConstant %int 82
+ %int_98 = OpConstant %int 98
+ %uint_1 = OpConstant %uint 1
+%mat3v3float = OpTypeMatrix %v3float 3
+ %float_2 = OpConstant %float 2
+ %float_n1 = OpConstant %float -1
+ %67 = OpConstantComposite %v2float %float_n1 %float_n1
+ %bool = OpTypeBool
+ %float_n0_5 = OpConstant %float -0.5
+ %70 = OpConstantComposite %v3float %float_0 %float_0 %float_1
+%float_0_333299994 = OpConstant %float 0.333299994
+ %uint_5 = OpConstant %uint 5
+%float_347_834503 = OpConstant %float 347.834503
+%float_3343_28369 = OpConstant %float 3343.28369
+ %75 = OpConstantComposite %v2float %float_347_834503 %float_3343_28369
+ %float_1000 = OpConstant %float 1000
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_arr_v4float_uint_7 = OpTypeArray %v4float %uint_7
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+ %type_View = OpTypeStruct %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %v3float %float %v3float %float %v4float %v4float %v3float %float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %v4float %v4float %v2float %v2float %v4float %v4float %v4float %v4float %int %float %float %float %v4float %v4float %v4float %v2float %float %float %float %float %float %float %v3float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %float %float %float %float %float %v4float %v3float %float %_arr_v4float_uint_2 %_arr_v4float_uint_2 %v4float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %v3float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %float %float %v4float %uint %uint %uint %uint %v4float %v3float %float %v4float %float %float %float %float %v4float %_arr_v4float_uint_7 %float %float %float %float %uint %float %float %float %v3float %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %float %float %float %float %v2int %float %float %v3float %float %v3float %float %v2float %float %float %v3float %float %v3float %float %v3float %float %v3float %float %float %float
+%_ptr_Uniform_type_View = OpTypePointer Uniform %type_View
+%type_PrimitiveDither = OpTypeStruct %float
+%_ptr_Uniform_type_PrimitiveDither = OpTypePointer Uniform %type_PrimitiveDither
+%type_PrimitiveFade = OpTypeStruct %v2float
+%_ptr_Uniform_type_PrimitiveFade = OpTypePointer Uniform %type_PrimitiveFade
+ %uint_9 = OpConstant %uint 9
+%_arr_v4float_uint_9 = OpTypeArray %v4float %uint_9
+ %uint_3 = OpConstant %uint 3
+%_arr_v4float_uint_3 = OpTypeArray %v4float %uint_3
+%type_Material = OpTypeStruct %_arr_v4float_uint_9 %_arr_v4float_uint_3
+%_ptr_Uniform_type_Material = OpTypePointer Uniform %type_Material
+%type_2d_image = OpTypeImage %float 2D 2 0 0 1 Unknown
+%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image
+%type_sampler = OpTypeSampler
+%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_arr_v4float_uint_1 = OpTypeArray %v4float %uint_1
+%_ptr_Input__arr_v4float_uint_1 = OpTypePointer Input %_arr_v4float_uint_1
+%_ptr_Input_uint = OpTypePointer Input %uint
+%_ptr_Input_bool = OpTypePointer Input %bool
+%_ptr_Output_float = OpTypePointer Output %float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %93 = OpTypeFunction %void
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%type_sampled_image = OpTypeSampledImage %type_2d_image
+ %View = OpVariable %_ptr_Uniform_type_View Uniform
+%PrimitiveDither = OpVariable %_ptr_Uniform_type_PrimitiveDither Uniform
+%PrimitiveFade = OpVariable %_ptr_Uniform_type_PrimitiveFade Uniform
+ %Material = OpVariable %_ptr_Uniform_type_Material Uniform
+%Material_Texture2D_0 = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%Material_Texture2D_0Sampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%Material_Texture2D_3 = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%Material_Texture2D_3Sampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
+%in_var_TEXCOORD6 = OpVariable %_ptr_Input_v4float Input
+%in_var_TEXCOORD7 = OpVariable %_ptr_Input_v4float Input
+%in_var_TEXCOORD10_centroid = OpVariable %_ptr_Input_v4float Input
+%in_var_TEXCOORD11_centroid = OpVariable %_ptr_Input_v4float Input
+%in_var_TEXCOORD0 = OpVariable %_ptr_Input__arr_v4float_uint_1 Input
+%in_var_PRIMITIVE_ID = OpVariable %_ptr_Input_uint Input
+%gl_FrontFacing = OpVariable %_ptr_Input_bool Input
+%gl_FragDepth = OpVariable %_ptr_Output_float Output
+%out_var_SV_Target0 = OpVariable %_ptr_Output_v4float Output
+ %98 = OpUndef %float
+ %99 = OpConstantNull %v2float
+%float_0_015625 = OpConstant %float 0.015625
+ %101 = OpConstantComposite %v2float %float_0_015625 %float_0_015625
+%float_0_166666672 = OpConstant %float 0.166666672
+ %103 = OpUndef %float
+ %104 = OpConstantNull %v3float
+%MainPixelShader = OpFunction %void None %93
+ %105 = OpLabel
+ %106 = OpLoad %v4float %gl_FragCoord
+ %107 = OpLoad %v4float %in_var_TEXCOORD6
+ %108 = OpLoad %v4float %in_var_TEXCOORD7
+ %109 = OpLoad %v4float %in_var_TEXCOORD10_centroid
+ %110 = OpLoad %v4float %in_var_TEXCOORD11_centroid
+ %111 = OpLoad %_arr_v4float_uint_1 %in_var_TEXCOORD0
+ %112 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_4
+ %113 = OpLoad %mat4v4float %112
+ %114 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_11
+ %115 = OpLoad %mat4v4float %114
+ %116 = OpAccessChain %_ptr_Uniform_v3float %View %int_32
+ %117 = OpLoad %v3float %116
+ %118 = OpAccessChain %_ptr_Uniform_v4float %View %int_53
+ %119 = OpLoad %v4float %118
+ %120 = OpAccessChain %_ptr_Uniform_v4float %View %int_57
+ %121 = OpLoad %v4float %120
+ %122 = OpAccessChain %_ptr_Uniform_float %View %int_80
+ %123 = OpLoad %float %122
+ %124 = OpCompositeExtract %v4float %111 0
+ %125 = OpVectorShuffle %v2float %99 %124 2 3
+ %126 = OpVectorShuffle %v3float %109 %109 0 1 2
+ %127 = OpVectorShuffle %v3float %110 %110 0 1 2
+ %128 = OpExtInst %v3float %1 Cross %127 %126
+ %129 = OpCompositeExtract %float %110 3
+ %130 = OpCompositeConstruct %v3float %129 %129 %129
+ %131 = OpFMul %v3float %128 %130
+ %132 = OpCompositeConstruct %mat3v3float %126 %131 %127
+ %133 = OpVectorShuffle %v2float %106 %106 0 1
+ %134 = OpVectorShuffle %v2float %121 %121 0 1
+ %135 = OpFSub %v2float %133 %134
+ %136 = OpCompositeExtract %float %106 2
+ %137 = OpCompositeConstruct %v4float %103 %103 %136 %float_1
+ %138 = OpCompositeExtract %float %106 3
+ %139 = OpCompositeConstruct %v4float %138 %138 %138 %138
+ %140 = OpFMul %v4float %137 %139
+ %141 = OpCompositeExtract %float %106 0
+ %142 = OpCompositeExtract %float %106 1
+ %143 = OpCompositeConstruct %v4float %141 %142 %136 %float_1
+ %144 = OpMatrixTimesVector %v4float %115 %143
+ %145 = OpVectorShuffle %v3float %144 %144 0 1 2
+ %146 = OpCompositeExtract %float %144 3
+ %147 = OpCompositeConstruct %v3float %146 %146 %146
+ %148 = OpFDiv %v3float %145 %147
+ %149 = OpFSub %v3float %148 %117
+ %150 = OpFNegate %v3float %148
+ %151 = OpExtInst %v3float %1 Normalize %150
+ %152 = OpVectorTimesMatrix %v3float %151 %132
+ %153 = OpVectorShuffle %v2float %152 %152 0 1
+ %154 = OpFMul %v2float %153 %67
+ %155 = OpCompositeExtract %float %152 2
+ %156 = OpCompositeConstruct %v2float %155 %155
+ %157 = OpFDiv %v2float %154 %156
+ %158 = OpAccessChain %_ptr_Uniform_float %Material %int_1 %int_0 %int_0
+ %159 = OpLoad %float %158
+ %160 = OpCompositeConstruct %v2float %159 %159
+ %161 = OpFMul %v2float %160 %157
+ %162 = OpDot %float %151 %127
+ %163 = OpExtInst %float %1 FAbs %162
+ %164 = OpExtInst %float %1 FMax %163 %float_0
+ %165 = OpExtInst %float %1 FMin %164 %float_1
+ %166 = OpAccessChain %_ptr_Uniform_float %Material %int_1 %int_0 %int_1
+ %167 = OpLoad %float %166
+ %168 = OpAccessChain %_ptr_Uniform_float %Material %int_1 %int_0 %int_2
+ %169 = OpLoad %float %168
+ %170 = OpExtInst %float %1 FMix %167 %169 %165
+ %171 = OpExtInst %float %1 Floor %170
+ %172 = OpFDiv %float %float_1 %170
+ %173 = OpCompositeConstruct %v2float %172 %172
+ %174 = OpFMul %v2float %161 %173
+ %175 = OpDPdx %v2float %125
+ %176 = OpDPdy %v2float %125
+ %177 = OpLoad %type_2d_image %Material_Texture2D_0
+ %178 = OpLoad %type_sampler %Material_Texture2D_0Sampler
+ OpBranch %179
+ %179 = OpLabel
+ %180 = OpPhi %float %float_1 %105 %181 %182
+ %183 = OpPhi %v2float %49 %105 %184 %182
+ %185 = OpPhi %int %int_0 %105 %186 %182
+ %187 = OpPhi %float %float_1 %105 %188 %182
+ %189 = OpPhi %float %float_1 %105 %180 %182
+ %190 = OpConvertSToF %float %185
+ %191 = OpFAdd %float %171 %float_2
+ %192 = OpFOrdLessThan %bool %190 %191
+ OpLoopMerge %193 %182 None
+ OpBranchConditional %192 %194 %193
+ %194 = OpLabel
+ %195 = OpFAdd %v2float %125 %183
+ %196 = OpSampledImage %type_sampled_image %177 %178
+ %197 = OpImageSampleExplicitLod %v4float %196 %195 Grad %175 %176
+ %188 = OpCompositeExtract %float %197 1
+ %198 = OpFOrdLessThan %bool %180 %188
+ OpSelectionMerge %182 None
+ OpBranchConditional %198 %199 %182
+ %199 = OpLabel
+ %200 = OpFSub %float %189 %187
+ %201 = OpFSub %float %188 %180
+ %202 = OpFAdd %float %200 %201
+ %203 = OpFDiv %float %201 %202
+ %204 = OpFMul %float %189 %203
+ %205 = OpFSub %float %float_1 %203
+ %206 = OpFMul %float %180 %205
+ %207 = OpFAdd %float %204 %206
+ %208 = OpCompositeConstruct %v2float %203 %203
+ %209 = OpFMul %v2float %208 %174
+ %210 = OpFSub %v2float %183 %209
+ OpBranch %193
+ %182 = OpLabel
+ %181 = OpFSub %float %180 %172
+ %184 = OpFAdd %v2float %183 %174
+ %186 = OpIAdd %int %185 %int_1
+ OpBranch %179
+ %193 = OpLabel
+ %211 = OpPhi %float %98 %179 %207 %199
+ %212 = OpPhi %v2float %183 %179 %210 %199
+ %213 = OpVectorShuffle %v2float %212 %104 0 1
+ %214 = OpFAdd %v2float %125 %213
+ %215 = OpAccessChain %_ptr_Uniform_float %View %int_82
+ %216 = OpLoad %float %215
+ %217 = OpSampledImage %type_sampled_image %177 %178
+ %218 = OpImageSampleImplicitLod %v4float %217 %214 Bias %216
+ %219 = OpCompositeExtract %float %218 0
+ %220 = OpAccessChain %_ptr_Uniform_float %Material %int_1 %int_2 %int_1
+ %221 = OpLoad %float %220
+ %222 = OpFMul %float %219 %221
+ %223 = OpFSub %float %float_1 %222
+ %224 = OpExtInst %float %1 FMax %223 %float_0
+ %225 = OpExtInst %float %1 FMin %224 %float_1
+ %226 = OpAccessChain %_ptr_Uniform_float %View %int_98 %int_0
+ %227 = OpLoad %float %226
+ %228 = OpCompositeConstruct %v2float %227 %227
+ %229 = OpFAdd %v2float %135 %228
+ %230 = OpCompositeExtract %float %229 0
+ %231 = OpConvertFToU %uint %230
+ %232 = OpCompositeExtract %float %229 1
+ %233 = OpConvertFToU %uint %232
+ %234 = OpIMul %uint %uint_2 %233
+ %235 = OpIAdd %uint %231 %234
+ %236 = OpUMod %uint %235 %uint_5
+ %237 = OpConvertUToF %float %236
+ %238 = OpFMul %v2float %135 %101
+ %239 = OpLoad %type_2d_image %Material_Texture2D_3
+ %240 = OpLoad %type_sampler %Material_Texture2D_3Sampler
+ %241 = OpSampledImage %type_sampled_image %239 %240
+ %242 = OpImageSampleImplicitLod %v4float %241 %238 Bias %216
+ %243 = OpCompositeExtract %float %242 0
+ %244 = OpAccessChain %_ptr_Uniform_float %Material %int_1 %int_2 %int_2
+ %245 = OpLoad %float %244
+ %246 = OpFMul %float %243 %245
+ %247 = OpFAdd %float %237 %246
+ %248 = OpFMul %float %247 %float_0_166666672
+ %249 = OpFAdd %float %225 %248
+ %250 = OpFAdd %float %249 %float_n0_5
+ %251 = OpCompositeExtract %float %218 2
+ %252 = OpFAdd %float %251 %250
+ %253 = OpSampledImage %type_sampled_image %239 %240
+ %254 = OpImageSampleImplicitLod %v4float %253 %238 Bias %216
+ %255 = OpCompositeExtract %float %254 0
+ %256 = OpFAdd %float %237 %255
+ %257 = OpFMul %float %256 %float_0_166666672
+ %258 = OpAccessChain %_ptr_Uniform_float %PrimitiveFade %int_0 %int_0
+ %259 = OpLoad %float %258
+ %260 = OpFMul %float %123 %259
+ %261 = OpAccessChain %_ptr_Uniform_float %PrimitiveFade %int_0 %int_1
+ %262 = OpLoad %float %261
+ %263 = OpFAdd %float %260 %262
+ %264 = OpExtInst %float %1 FClamp %263 %float_0 %float_1
+ %265 = OpFAdd %float %264 %257
+ %266 = OpFAdd %float %265 %float_n0_5
+ %267 = OpFMul %float %252 %266
+ %268 = OpFSub %float %float_1 %211
+ %269 = OpFMul %float %268 %159
+ %270 = OpCompositeExtract %float %212 0
+ %271 = OpCompositeExtract %float %212 1
+ %272 = OpCompositeConstruct %v3float %270 %271 %269
+ %273 = OpDot %float %272 %272
+ %274 = OpExtInst %float %1 Sqrt %273
+ %275 = OpDPdx %v2float %125
+ %276 = OpExtInst %v2float %1 FAbs %275
+ %277 = OpDot %float %276 %276
+ %278 = OpExtInst %float %1 Sqrt %277
+ %279 = OpDPdx %v3float %149
+ %280 = OpDot %float %279 %279
+ %281 = OpExtInst %float %1 Sqrt %280
+ %282 = OpFDiv %float %278 %281
+ %283 = OpDPdy %v2float %125
+ %284 = OpExtInst %v2float %1 FAbs %283
+ %285 = OpDot %float %284 %284
+ %286 = OpExtInst %float %1 Sqrt %285
+ %287 = OpDPdy %v3float %149
+ %288 = OpDot %float %287 %287
+ %289 = OpExtInst %float %1 Sqrt %288
+ %290 = OpFDiv %float %286 %289
+ %291 = OpExtInst %float %1 FMax %282 %290
+ %292 = OpCompositeExtract %v4float %113 0
+ %293 = OpVectorShuffle %v3float %292 %292 0 1 2
+ %294 = OpCompositeExtract %v4float %113 1
+ %295 = OpVectorShuffle %v3float %294 %294 0 1 2
+ %296 = OpCompositeExtract %v4float %113 2
+ %297 = OpVectorShuffle %v3float %296 %296 0 1 2
+ %298 = OpCompositeConstruct %mat3v3float %293 %295 %297
+ %299 = OpMatrixTimesVector %v3float %298 %70
+ %300 = OpDot %float %299 %151
+ %301 = OpExtInst %float %1 FAbs %300
+ %302 = OpFDiv %float %291 %301
+ %303 = OpFDiv %float %274 %302
+ %304 = OpAccessChain %_ptr_Uniform_float %PrimitiveDither %int_0
+ %305 = OpLoad %float %304
+ %306 = OpFOrdNotEqual %bool %305 %float_0
+ OpSelectionMerge %307 None
+ OpBranchConditional %306 %308 %307
+ %308 = OpLabel
+ %309 = OpExtInst %float %1 FAbs %305
+ %310 = OpFOrdGreaterThan %bool %309 %float_0_00100000005
+ OpSelectionMerge %311 None
+ OpBranchConditional %310 %312 %311
+ %312 = OpLabel
+ %313 = OpExtInst %v2float %1 Floor %133
+ %314 = OpDot %float %313 %75
+ %315 = OpExtInst %float %1 Cos %314
+ %316 = OpFMul %float %315 %float_1000
+ %317 = OpExtInst %float %1 Fract %316
+ %318 = OpFOrdLessThan %bool %305 %float_0
+ %319 = OpFAdd %float %305 %float_1
+ %320 = OpFOrdGreaterThan %bool %319 %317
+ %321 = OpFOrdLessThan %bool %305 %317
+ %322 = OpSelect %bool %318 %320 %321
+ %323 = OpSelect %float %322 %float_1 %float_0
+ %324 = OpFSub %float %323 %float_0_00100000005
+ %325 = OpFOrdLessThan %bool %324 %float_0
+ OpSelectionMerge %326 None
+ OpBranchConditional %325 %327 %326
+ %327 = OpLabel
+ OpKill
+ %326 = OpLabel
+ OpBranch %311
+ %311 = OpLabel
+ OpBranch %307
+ %307 = OpLabel
+ %328 = OpFSub %float %267 %float_0_333299994
+ %329 = OpFOrdLessThan %bool %328 %float_0
+ OpSelectionMerge %330 None
+ OpBranchConditional %329 %331 %330
+ %331 = OpLabel
+ OpKill
+ %330 = OpLabel
+ %332 = OpCompositeExtract %float %140 2
+ %333 = OpCompositeExtract %float %140 3
+ %334 = OpFAdd %float %333 %303
+ %335 = OpFDiv %float %332 %334
+ %336 = OpExtInst %float %1 FMin %335 %136
+ %337 = OpVectorShuffle %v2float %107 %107 0 1
+ %338 = OpCompositeExtract %float %107 3
+ %339 = OpCompositeConstruct %v2float %338 %338
+ %340 = OpFDiv %v2float %337 %339
+ %341 = OpVectorShuffle %v2float %119 %119 0 1
+ %342 = OpFSub %v2float %340 %341
+ %343 = OpVectorShuffle %v2float %108 %108 0 1
+ %344 = OpCompositeExtract %float %108 3
+ %345 = OpCompositeConstruct %v2float %344 %344
+ %346 = OpFDiv %v2float %343 %345
+ %347 = OpVectorShuffle %v2float %119 %119 2 3
+ %348 = OpFSub %v2float %346 %347
+ %349 = OpFSub %v2float %342 %348
+ %350 = OpFMul %v2float %349 %54
+ %351 = OpFAdd %v2float %350 %56
+ %352 = OpVectorShuffle %v4float %351 %49 0 1 2 3
+ OpStore %gl_FragDepth %336
+ OpStore %out_var_SV_Target0 %352
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/depth-compare.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/depth-compare.asm.frag
new file mode 100644
index 00000000000..603d4f28c46
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/depth-compare.asm.frag
@@ -0,0 +1,961 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 452
+; Schema: 0
+ OpCapability Shader
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %MainOnePassPointLightPS "main" %gl_FragCoord %out_var_SV_Target0
+ OpExecutionMode %MainOnePassPointLightPS OriginUpperLeft
+ OpSource HLSL 600
+ OpName %type_View "type.View"
+ OpMemberName %type_View 0 "View_TranslatedWorldToClip"
+ OpMemberName %type_View 1 "View_WorldToClip"
+ OpMemberName %type_View 2 "View_TranslatedWorldToView"
+ OpMemberName %type_View 3 "View_ViewToTranslatedWorld"
+ OpMemberName %type_View 4 "View_TranslatedWorldToCameraView"
+ OpMemberName %type_View 5 "View_CameraViewToTranslatedWorld"
+ OpMemberName %type_View 6 "View_ViewToClip"
+ OpMemberName %type_View 7 "View_ViewToClipNoAA"
+ OpMemberName %type_View 8 "View_ClipToView"
+ OpMemberName %type_View 9 "View_ClipToTranslatedWorld"
+ OpMemberName %type_View 10 "View_SVPositionToTranslatedWorld"
+ OpMemberName %type_View 11 "View_ScreenToWorld"
+ OpMemberName %type_View 12 "View_ScreenToTranslatedWorld"
+ OpMemberName %type_View 13 "View_ViewForward"
+ OpMemberName %type_View 14 "PrePadding_View_844"
+ OpMemberName %type_View 15 "View_ViewUp"
+ OpMemberName %type_View 16 "PrePadding_View_860"
+ OpMemberName %type_View 17 "View_ViewRight"
+ OpMemberName %type_View 18 "PrePadding_View_876"
+ OpMemberName %type_View 19 "View_HMDViewNoRollUp"
+ OpMemberName %type_View 20 "PrePadding_View_892"
+ OpMemberName %type_View 21 "View_HMDViewNoRollRight"
+ OpMemberName %type_View 22 "PrePadding_View_908"
+ OpMemberName %type_View 23 "View_InvDeviceZToWorldZTransform"
+ OpMemberName %type_View 24 "View_ScreenPositionScaleBias"
+ OpMemberName %type_View 25 "View_WorldCameraOrigin"
+ OpMemberName %type_View 26 "PrePadding_View_956"
+ OpMemberName %type_View 27 "View_TranslatedWorldCameraOrigin"
+ OpMemberName %type_View 28 "PrePadding_View_972"
+ OpMemberName %type_View 29 "View_WorldViewOrigin"
+ OpMemberName %type_View 30 "PrePadding_View_988"
+ OpMemberName %type_View 31 "View_PreViewTranslation"
+ OpMemberName %type_View 32 "PrePadding_View_1004"
+ OpMemberName %type_View 33 "View_PrevProjection"
+ OpMemberName %type_View 34 "View_PrevViewProj"
+ OpMemberName %type_View 35 "View_PrevViewRotationProj"
+ OpMemberName %type_View 36 "View_PrevViewToClip"
+ OpMemberName %type_View 37 "View_PrevClipToView"
+ OpMemberName %type_View 38 "View_PrevTranslatedWorldToClip"
+ OpMemberName %type_View 39 "View_PrevTranslatedWorldToView"
+ OpMemberName %type_View 40 "View_PrevViewToTranslatedWorld"
+ OpMemberName %type_View 41 "View_PrevTranslatedWorldToCameraView"
+ OpMemberName %type_View 42 "View_PrevCameraViewToTranslatedWorld"
+ OpMemberName %type_View 43 "View_PrevWorldCameraOrigin"
+ OpMemberName %type_View 44 "PrePadding_View_1660"
+ OpMemberName %type_View 45 "View_PrevWorldViewOrigin"
+ OpMemberName %type_View 46 "PrePadding_View_1676"
+ OpMemberName %type_View 47 "View_PrevPreViewTranslation"
+ OpMemberName %type_View 48 "PrePadding_View_1692"
+ OpMemberName %type_View 49 "View_PrevInvViewProj"
+ OpMemberName %type_View 50 "View_PrevScreenToTranslatedWorld"
+ OpMemberName %type_View 51 "View_ClipToPrevClip"
+ OpMemberName %type_View 52 "View_TemporalAAJitter"
+ OpMemberName %type_View 53 "View_GlobalClippingPlane"
+ OpMemberName %type_View 54 "View_FieldOfViewWideAngles"
+ OpMemberName %type_View 55 "View_PrevFieldOfViewWideAngles"
+ OpMemberName %type_View 56 "View_ViewRectMin"
+ OpMemberName %type_View 57 "View_ViewSizeAndInvSize"
+ OpMemberName %type_View 58 "View_BufferSizeAndInvSize"
+ OpMemberName %type_View 59 "View_BufferBilinearUVMinMax"
+ OpMemberName %type_View 60 "View_NumSceneColorMSAASamples"
+ OpMemberName %type_View 61 "View_PreExposure"
+ OpMemberName %type_View 62 "View_OneOverPreExposure"
+ OpMemberName %type_View 63 "PrePadding_View_2012"
+ OpMemberName %type_View 64 "View_DiffuseOverrideParameter"
+ OpMemberName %type_View 65 "View_SpecularOverrideParameter"
+ OpMemberName %type_View 66 "View_NormalOverrideParameter"
+ OpMemberName %type_View 67 "View_RoughnessOverrideParameter"
+ OpMemberName %type_View 68 "View_PrevFrameGameTime"
+ OpMemberName %type_View 69 "View_PrevFrameRealTime"
+ OpMemberName %type_View 70 "View_OutOfBoundsMask"
+ OpMemberName %type_View 71 "PrePadding_View_2084"
+ OpMemberName %type_View 72 "PrePadding_View_2088"
+ OpMemberName %type_View 73 "PrePadding_View_2092"
+ OpMemberName %type_View 74 "View_WorldCameraMovementSinceLastFrame"
+ OpMemberName %type_View 75 "View_CullingSign"
+ OpMemberName %type_View 76 "View_NearPlane"
+ OpMemberName %type_View 77 "View_AdaptiveTessellationFactor"
+ OpMemberName %type_View 78 "View_GameTime"
+ OpMemberName %type_View 79 "View_RealTime"
+ OpMemberName %type_View 80 "View_DeltaTime"
+ OpMemberName %type_View 81 "View_MaterialTextureMipBias"
+ OpMemberName %type_View 82 "View_MaterialTextureDerivativeMultiply"
+ OpMemberName %type_View 83 "View_Random"
+ OpMemberName %type_View 84 "View_FrameNumber"
+ OpMemberName %type_View 85 "View_StateFrameIndexMod8"
+ OpMemberName %type_View 86 "View_StateFrameIndex"
+ OpMemberName %type_View 87 "View_CameraCut"
+ OpMemberName %type_View 88 "View_UnlitViewmodeMask"
+ OpMemberName %type_View 89 "PrePadding_View_2164"
+ OpMemberName %type_View 90 "PrePadding_View_2168"
+ OpMemberName %type_View 91 "PrePadding_View_2172"
+ OpMemberName %type_View 92 "View_DirectionalLightColor"
+ OpMemberName %type_View 93 "View_DirectionalLightDirection"
+ OpMemberName %type_View 94 "PrePadding_View_2204"
+ OpMemberName %type_View 95 "View_TranslucencyLightingVolumeMin"
+ OpMemberName %type_View 96 "View_TranslucencyLightingVolumeInvSize"
+ OpMemberName %type_View 97 "View_TemporalAAParams"
+ OpMemberName %type_View 98 "View_CircleDOFParams"
+ OpMemberName %type_View 99 "View_DepthOfFieldSensorWidth"
+ OpMemberName %type_View 100 "View_DepthOfFieldFocalDistance"
+ OpMemberName %type_View 101 "View_DepthOfFieldScale"
+ OpMemberName %type_View 102 "View_DepthOfFieldFocalLength"
+ OpMemberName %type_View 103 "View_DepthOfFieldFocalRegion"
+ OpMemberName %type_View 104 "View_DepthOfFieldNearTransitionRegion"
+ OpMemberName %type_View 105 "View_DepthOfFieldFarTransitionRegion"
+ OpMemberName %type_View 106 "View_MotionBlurNormalizedToPixel"
+ OpMemberName %type_View 107 "View_bSubsurfacePostprocessEnabled"
+ OpMemberName %type_View 108 "View_GeneralPurposeTweak"
+ OpMemberName %type_View 109 "View_DemosaicVposOffset"
+ OpMemberName %type_View 110 "PrePadding_View_2348"
+ OpMemberName %type_View 111 "View_IndirectLightingColorScale"
+ OpMemberName %type_View 112 "View_HDR32bppEncodingMode"
+ OpMemberName %type_View 113 "View_AtmosphericFogSunDirection"
+ OpMemberName %type_View 114 "View_AtmosphericFogSunPower"
+ OpMemberName %type_View 115 "View_AtmosphericFogPower"
+ OpMemberName %type_View 116 "View_AtmosphericFogDensityScale"
+ OpMemberName %type_View 117 "View_AtmosphericFogDensityOffset"
+ OpMemberName %type_View 118 "View_AtmosphericFogGroundOffset"
+ OpMemberName %type_View 119 "View_AtmosphericFogDistanceScale"
+ OpMemberName %type_View 120 "View_AtmosphericFogAltitudeScale"
+ OpMemberName %type_View 121 "View_AtmosphericFogHeightScaleRayleigh"
+ OpMemberName %type_View 122 "View_AtmosphericFogStartDistance"
+ OpMemberName %type_View 123 "View_AtmosphericFogDistanceOffset"
+ OpMemberName %type_View 124 "View_AtmosphericFogSunDiscScale"
+ OpMemberName %type_View 125 "View_AtmosphericFogRenderMask"
+ OpMemberName %type_View 126 "View_AtmosphericFogInscatterAltitudeSampleNum"
+ OpMemberName %type_View 127 "View_AtmosphericFogSunColor"
+ OpMemberName %type_View 128 "View_NormalCurvatureToRoughnessScaleBias"
+ OpMemberName %type_View 129 "View_RenderingReflectionCaptureMask"
+ OpMemberName %type_View 130 "View_AmbientCubemapTint"
+ OpMemberName %type_View 131 "View_AmbientCubemapIntensity"
+ OpMemberName %type_View 132 "View_SkyLightParameters"
+ OpMemberName %type_View 133 "PrePadding_View_2488"
+ OpMemberName %type_View 134 "PrePadding_View_2492"
+ OpMemberName %type_View 135 "View_SkyLightColor"
+ OpMemberName %type_View 136 "View_SkyIrradianceEnvironmentMap"
+ OpMemberName %type_View 137 "View_MobilePreviewMode"
+ OpMemberName %type_View 138 "View_HMDEyePaddingOffset"
+ OpMemberName %type_View 139 "View_ReflectionCubemapMaxMip"
+ OpMemberName %type_View 140 "View_ShowDecalsMask"
+ OpMemberName %type_View 141 "View_DistanceFieldAOSpecularOcclusionMode"
+ OpMemberName %type_View 142 "View_IndirectCapsuleSelfShadowingIntensity"
+ OpMemberName %type_View 143 "PrePadding_View_2648"
+ OpMemberName %type_View 144 "PrePadding_View_2652"
+ OpMemberName %type_View 145 "View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight"
+ OpMemberName %type_View 146 "View_StereoPassIndex"
+ OpMemberName %type_View 147 "View_GlobalVolumeCenterAndExtent"
+ OpMemberName %type_View 148 "View_GlobalVolumeWorldToUVAddAndMul"
+ OpMemberName %type_View 149 "View_GlobalVolumeDimension"
+ OpMemberName %type_View 150 "View_GlobalVolumeTexelSize"
+ OpMemberName %type_View 151 "View_MaxGlobalDistance"
+ OpMemberName %type_View 152 "View_bCheckerboardSubsurfaceProfileRendering"
+ OpMemberName %type_View 153 "View_VolumetricFogInvGridSize"
+ OpMemberName %type_View 154 "PrePadding_View_2828"
+ OpMemberName %type_View 155 "View_VolumetricFogGridZParams"
+ OpMemberName %type_View 156 "PrePadding_View_2844"
+ OpMemberName %type_View 157 "View_VolumetricFogSVPosToVolumeUV"
+ OpMemberName %type_View 158 "View_VolumetricFogMaxDistance"
+ OpMemberName %type_View 159 "PrePadding_View_2860"
+ OpMemberName %type_View 160 "View_VolumetricLightmapWorldToUVScale"
+ OpMemberName %type_View 161 "PrePadding_View_2876"
+ OpMemberName %type_View 162 "View_VolumetricLightmapWorldToUVAdd"
+ OpMemberName %type_View 163 "PrePadding_View_2892"
+ OpMemberName %type_View 164 "View_VolumetricLightmapIndirectionTextureSize"
+ OpMemberName %type_View 165 "View_VolumetricLightmapBrickSize"
+ OpMemberName %type_View 166 "View_VolumetricLightmapBrickTexelSize"
+ OpMemberName %type_View 167 "View_StereoIPD"
+ OpMemberName %type_View 168 "View_IndirectLightingCacheShowFlag"
+ OpMemberName %type_View 169 "View_EyeToPixelSpreadAngle"
+ OpName %View "View"
+ OpName %type_2d_image "type.2d.image"
+ OpName %SceneTexturesStruct_SceneDepthTexture "SceneTexturesStruct_SceneDepthTexture"
+ OpName %type_sampler "type.sampler"
+ OpName %SceneTexturesStruct_SceneDepthTextureSampler "SceneTexturesStruct_SceneDepthTextureSampler"
+ OpName %SceneTexturesStruct_GBufferATexture "SceneTexturesStruct_GBufferATexture"
+ OpName %SceneTexturesStruct_GBufferBTexture "SceneTexturesStruct_GBufferBTexture"
+ OpName %SceneTexturesStruct_GBufferDTexture "SceneTexturesStruct_GBufferDTexture"
+ OpName %SceneTexturesStruct_GBufferATextureSampler "SceneTexturesStruct_GBufferATextureSampler"
+ OpName %SceneTexturesStruct_GBufferBTextureSampler "SceneTexturesStruct_GBufferBTextureSampler"
+ OpName %SceneTexturesStruct_GBufferDTextureSampler "SceneTexturesStruct_GBufferDTextureSampler"
+ OpName %ShadowDepthTextureSampler "ShadowDepthTextureSampler"
+ OpName %type__Globals "type.$Globals"
+ OpMemberName %type__Globals 0 "SoftTransitionScale"
+ OpMemberName %type__Globals 1 "ShadowViewProjectionMatrices"
+ OpMemberName %type__Globals 2 "InvShadowmapResolution"
+ OpMemberName %type__Globals 3 "ShadowFadeFraction"
+ OpMemberName %type__Globals 4 "ShadowSharpen"
+ OpMemberName %type__Globals 5 "LightPositionAndInvRadius"
+ OpMemberName %type__Globals 6 "ProjectionDepthBiasParameters"
+ OpMemberName %type__Globals 7 "PointLightDepthBiasAndProjParameters"
+ OpName %_Globals "$Globals"
+ OpName %type_cube_image "type.cube.image"
+ OpName %ShadowDepthCubeTexture "ShadowDepthCubeTexture"
+ OpName %ShadowDepthCubeTextureSampler "ShadowDepthCubeTextureSampler"
+ OpName %SSProfilesTexture "SSProfilesTexture"
+ OpName %out_var_SV_Target0 "out.var.SV_Target0"
+ OpName %MainOnePassPointLightPS "MainOnePassPointLightPS"
+ OpName %type_sampled_image "type.sampled.image"
+ OpName %type_sampled_image_0 "type.sampled.image"
+ OpDecorate %gl_FragCoord BuiltIn FragCoord
+ OpDecorateString %gl_FragCoord UserSemantic "SV_POSITION"
+ OpDecorateString %out_var_SV_Target0 UserSemantic "SV_Target0"
+ OpDecorate %out_var_SV_Target0 Location 0
+ OpDecorate %View DescriptorSet 0
+ OpDecorate %View Binding 0
+ OpDecorate %SceneTexturesStruct_SceneDepthTexture DescriptorSet 0
+ OpDecorate %SceneTexturesStruct_SceneDepthTexture Binding 0
+ OpDecorate %SceneTexturesStruct_SceneDepthTextureSampler DescriptorSet 0
+ OpDecorate %SceneTexturesStruct_SceneDepthTextureSampler Binding 0
+ OpDecorate %SceneTexturesStruct_GBufferATexture DescriptorSet 0
+ OpDecorate %SceneTexturesStruct_GBufferATexture Binding 1
+ OpDecorate %SceneTexturesStruct_GBufferBTexture DescriptorSet 0
+ OpDecorate %SceneTexturesStruct_GBufferBTexture Binding 2
+ OpDecorate %SceneTexturesStruct_GBufferDTexture DescriptorSet 0
+ OpDecorate %SceneTexturesStruct_GBufferDTexture Binding 3
+ OpDecorate %SceneTexturesStruct_GBufferATextureSampler DescriptorSet 0
+ OpDecorate %SceneTexturesStruct_GBufferATextureSampler Binding 1
+ OpDecorate %SceneTexturesStruct_GBufferBTextureSampler DescriptorSet 0
+ OpDecorate %SceneTexturesStruct_GBufferBTextureSampler Binding 2
+ OpDecorate %SceneTexturesStruct_GBufferDTextureSampler DescriptorSet 0
+ OpDecorate %SceneTexturesStruct_GBufferDTextureSampler Binding 3
+ OpDecorate %ShadowDepthTextureSampler DescriptorSet 0
+ OpDecorate %ShadowDepthTextureSampler Binding 4
+ OpDecorate %_Globals DescriptorSet 0
+ OpDecorate %_Globals Binding 1
+ OpDecorate %ShadowDepthCubeTexture DescriptorSet 0
+ OpDecorate %ShadowDepthCubeTexture Binding 4
+ OpDecorate %ShadowDepthCubeTextureSampler DescriptorSet 0
+ OpDecorate %ShadowDepthCubeTextureSampler Binding 5
+ OpDecorate %SSProfilesTexture DescriptorSet 0
+ OpDecorate %SSProfilesTexture Binding 5
+ OpDecorate %_arr_v4float_uint_2 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_7 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpMemberDecorate %type_View 0 Offset 0
+ OpMemberDecorate %type_View 0 MatrixStride 16
+ OpMemberDecorate %type_View 0 ColMajor
+ OpMemberDecorate %type_View 1 Offset 64
+ OpMemberDecorate %type_View 1 MatrixStride 16
+ OpMemberDecorate %type_View 1 ColMajor
+ OpMemberDecorate %type_View 2 Offset 128
+ OpMemberDecorate %type_View 2 MatrixStride 16
+ OpMemberDecorate %type_View 2 ColMajor
+ OpMemberDecorate %type_View 3 Offset 192
+ OpMemberDecorate %type_View 3 MatrixStride 16
+ OpMemberDecorate %type_View 3 ColMajor
+ OpMemberDecorate %type_View 4 Offset 256
+ OpMemberDecorate %type_View 4 MatrixStride 16
+ OpMemberDecorate %type_View 4 ColMajor
+ OpMemberDecorate %type_View 5 Offset 320
+ OpMemberDecorate %type_View 5 MatrixStride 16
+ OpMemberDecorate %type_View 5 ColMajor
+ OpMemberDecorate %type_View 6 Offset 384
+ OpMemberDecorate %type_View 6 MatrixStride 16
+ OpMemberDecorate %type_View 6 ColMajor
+ OpMemberDecorate %type_View 7 Offset 448
+ OpMemberDecorate %type_View 7 MatrixStride 16
+ OpMemberDecorate %type_View 7 ColMajor
+ OpMemberDecorate %type_View 8 Offset 512
+ OpMemberDecorate %type_View 8 MatrixStride 16
+ OpMemberDecorate %type_View 8 ColMajor
+ OpMemberDecorate %type_View 9 Offset 576
+ OpMemberDecorate %type_View 9 MatrixStride 16
+ OpMemberDecorate %type_View 9 ColMajor
+ OpMemberDecorate %type_View 10 Offset 640
+ OpMemberDecorate %type_View 10 MatrixStride 16
+ OpMemberDecorate %type_View 10 ColMajor
+ OpMemberDecorate %type_View 11 Offset 704
+ OpMemberDecorate %type_View 11 MatrixStride 16
+ OpMemberDecorate %type_View 11 ColMajor
+ OpMemberDecorate %type_View 12 Offset 768
+ OpMemberDecorate %type_View 12 MatrixStride 16
+ OpMemberDecorate %type_View 12 ColMajor
+ OpMemberDecorate %type_View 13 Offset 832
+ OpMemberDecorate %type_View 14 Offset 844
+ OpMemberDecorate %type_View 15 Offset 848
+ OpMemberDecorate %type_View 16 Offset 860
+ OpMemberDecorate %type_View 17 Offset 864
+ OpMemberDecorate %type_View 18 Offset 876
+ OpMemberDecorate %type_View 19 Offset 880
+ OpMemberDecorate %type_View 20 Offset 892
+ OpMemberDecorate %type_View 21 Offset 896
+ OpMemberDecorate %type_View 22 Offset 908
+ OpMemberDecorate %type_View 23 Offset 912
+ OpMemberDecorate %type_View 24 Offset 928
+ OpMemberDecorate %type_View 25 Offset 944
+ OpMemberDecorate %type_View 26 Offset 956
+ OpMemberDecorate %type_View 27 Offset 960
+ OpMemberDecorate %type_View 28 Offset 972
+ OpMemberDecorate %type_View 29 Offset 976
+ OpMemberDecorate %type_View 30 Offset 988
+ OpMemberDecorate %type_View 31 Offset 992
+ OpMemberDecorate %type_View 32 Offset 1004
+ OpMemberDecorate %type_View 33 Offset 1008
+ OpMemberDecorate %type_View 33 MatrixStride 16
+ OpMemberDecorate %type_View 33 ColMajor
+ OpMemberDecorate %type_View 34 Offset 1072
+ OpMemberDecorate %type_View 34 MatrixStride 16
+ OpMemberDecorate %type_View 34 ColMajor
+ OpMemberDecorate %type_View 35 Offset 1136
+ OpMemberDecorate %type_View 35 MatrixStride 16
+ OpMemberDecorate %type_View 35 ColMajor
+ OpMemberDecorate %type_View 36 Offset 1200
+ OpMemberDecorate %type_View 36 MatrixStride 16
+ OpMemberDecorate %type_View 36 ColMajor
+ OpMemberDecorate %type_View 37 Offset 1264
+ OpMemberDecorate %type_View 37 MatrixStride 16
+ OpMemberDecorate %type_View 37 ColMajor
+ OpMemberDecorate %type_View 38 Offset 1328
+ OpMemberDecorate %type_View 38 MatrixStride 16
+ OpMemberDecorate %type_View 38 ColMajor
+ OpMemberDecorate %type_View 39 Offset 1392
+ OpMemberDecorate %type_View 39 MatrixStride 16
+ OpMemberDecorate %type_View 39 ColMajor
+ OpMemberDecorate %type_View 40 Offset 1456
+ OpMemberDecorate %type_View 40 MatrixStride 16
+ OpMemberDecorate %type_View 40 ColMajor
+ OpMemberDecorate %type_View 41 Offset 1520
+ OpMemberDecorate %type_View 41 MatrixStride 16
+ OpMemberDecorate %type_View 41 ColMajor
+ OpMemberDecorate %type_View 42 Offset 1584
+ OpMemberDecorate %type_View 42 MatrixStride 16
+ OpMemberDecorate %type_View 42 ColMajor
+ OpMemberDecorate %type_View 43 Offset 1648
+ OpMemberDecorate %type_View 44 Offset 1660
+ OpMemberDecorate %type_View 45 Offset 1664
+ OpMemberDecorate %type_View 46 Offset 1676
+ OpMemberDecorate %type_View 47 Offset 1680
+ OpMemberDecorate %type_View 48 Offset 1692
+ OpMemberDecorate %type_View 49 Offset 1696
+ OpMemberDecorate %type_View 49 MatrixStride 16
+ OpMemberDecorate %type_View 49 ColMajor
+ OpMemberDecorate %type_View 50 Offset 1760
+ OpMemberDecorate %type_View 50 MatrixStride 16
+ OpMemberDecorate %type_View 50 ColMajor
+ OpMemberDecorate %type_View 51 Offset 1824
+ OpMemberDecorate %type_View 51 MatrixStride 16
+ OpMemberDecorate %type_View 51 ColMajor
+ OpMemberDecorate %type_View 52 Offset 1888
+ OpMemberDecorate %type_View 53 Offset 1904
+ OpMemberDecorate %type_View 54 Offset 1920
+ OpMemberDecorate %type_View 55 Offset 1928
+ OpMemberDecorate %type_View 56 Offset 1936
+ OpMemberDecorate %type_View 57 Offset 1952
+ OpMemberDecorate %type_View 58 Offset 1968
+ OpMemberDecorate %type_View 59 Offset 1984
+ OpMemberDecorate %type_View 60 Offset 2000
+ OpMemberDecorate %type_View 61 Offset 2004
+ OpMemberDecorate %type_View 62 Offset 2008
+ OpMemberDecorate %type_View 63 Offset 2012
+ OpMemberDecorate %type_View 64 Offset 2016
+ OpMemberDecorate %type_View 65 Offset 2032
+ OpMemberDecorate %type_View 66 Offset 2048
+ OpMemberDecorate %type_View 67 Offset 2064
+ OpMemberDecorate %type_View 68 Offset 2072
+ OpMemberDecorate %type_View 69 Offset 2076
+ OpMemberDecorate %type_View 70 Offset 2080
+ OpMemberDecorate %type_View 71 Offset 2084
+ OpMemberDecorate %type_View 72 Offset 2088
+ OpMemberDecorate %type_View 73 Offset 2092
+ OpMemberDecorate %type_View 74 Offset 2096
+ OpMemberDecorate %type_View 75 Offset 2108
+ OpMemberDecorate %type_View 76 Offset 2112
+ OpMemberDecorate %type_View 77 Offset 2116
+ OpMemberDecorate %type_View 78 Offset 2120
+ OpMemberDecorate %type_View 79 Offset 2124
+ OpMemberDecorate %type_View 80 Offset 2128
+ OpMemberDecorate %type_View 81 Offset 2132
+ OpMemberDecorate %type_View 82 Offset 2136
+ OpMemberDecorate %type_View 83 Offset 2140
+ OpMemberDecorate %type_View 84 Offset 2144
+ OpMemberDecorate %type_View 85 Offset 2148
+ OpMemberDecorate %type_View 86 Offset 2152
+ OpMemberDecorate %type_View 87 Offset 2156
+ OpMemberDecorate %type_View 88 Offset 2160
+ OpMemberDecorate %type_View 89 Offset 2164
+ OpMemberDecorate %type_View 90 Offset 2168
+ OpMemberDecorate %type_View 91 Offset 2172
+ OpMemberDecorate %type_View 92 Offset 2176
+ OpMemberDecorate %type_View 93 Offset 2192
+ OpMemberDecorate %type_View 94 Offset 2204
+ OpMemberDecorate %type_View 95 Offset 2208
+ OpMemberDecorate %type_View 96 Offset 2240
+ OpMemberDecorate %type_View 97 Offset 2272
+ OpMemberDecorate %type_View 98 Offset 2288
+ OpMemberDecorate %type_View 99 Offset 2304
+ OpMemberDecorate %type_View 100 Offset 2308
+ OpMemberDecorate %type_View 101 Offset 2312
+ OpMemberDecorate %type_View 102 Offset 2316
+ OpMemberDecorate %type_View 103 Offset 2320
+ OpMemberDecorate %type_View 104 Offset 2324
+ OpMemberDecorate %type_View 105 Offset 2328
+ OpMemberDecorate %type_View 106 Offset 2332
+ OpMemberDecorate %type_View 107 Offset 2336
+ OpMemberDecorate %type_View 108 Offset 2340
+ OpMemberDecorate %type_View 109 Offset 2344
+ OpMemberDecorate %type_View 110 Offset 2348
+ OpMemberDecorate %type_View 111 Offset 2352
+ OpMemberDecorate %type_View 112 Offset 2364
+ OpMemberDecorate %type_View 113 Offset 2368
+ OpMemberDecorate %type_View 114 Offset 2380
+ OpMemberDecorate %type_View 115 Offset 2384
+ OpMemberDecorate %type_View 116 Offset 2388
+ OpMemberDecorate %type_View 117 Offset 2392
+ OpMemberDecorate %type_View 118 Offset 2396
+ OpMemberDecorate %type_View 119 Offset 2400
+ OpMemberDecorate %type_View 120 Offset 2404
+ OpMemberDecorate %type_View 121 Offset 2408
+ OpMemberDecorate %type_View 122 Offset 2412
+ OpMemberDecorate %type_View 123 Offset 2416
+ OpMemberDecorate %type_View 124 Offset 2420
+ OpMemberDecorate %type_View 125 Offset 2424
+ OpMemberDecorate %type_View 126 Offset 2428
+ OpMemberDecorate %type_View 127 Offset 2432
+ OpMemberDecorate %type_View 128 Offset 2448
+ OpMemberDecorate %type_View 129 Offset 2460
+ OpMemberDecorate %type_View 130 Offset 2464
+ OpMemberDecorate %type_View 131 Offset 2480
+ OpMemberDecorate %type_View 132 Offset 2484
+ OpMemberDecorate %type_View 133 Offset 2488
+ OpMemberDecorate %type_View 134 Offset 2492
+ OpMemberDecorate %type_View 135 Offset 2496
+ OpMemberDecorate %type_View 136 Offset 2512
+ OpMemberDecorate %type_View 137 Offset 2624
+ OpMemberDecorate %type_View 138 Offset 2628
+ OpMemberDecorate %type_View 139 Offset 2632
+ OpMemberDecorate %type_View 140 Offset 2636
+ OpMemberDecorate %type_View 141 Offset 2640
+ OpMemberDecorate %type_View 142 Offset 2644
+ OpMemberDecorate %type_View 143 Offset 2648
+ OpMemberDecorate %type_View 144 Offset 2652
+ OpMemberDecorate %type_View 145 Offset 2656
+ OpMemberDecorate %type_View 146 Offset 2668
+ OpMemberDecorate %type_View 147 Offset 2672
+ OpMemberDecorate %type_View 148 Offset 2736
+ OpMemberDecorate %type_View 149 Offset 2800
+ OpMemberDecorate %type_View 150 Offset 2804
+ OpMemberDecorate %type_View 151 Offset 2808
+ OpMemberDecorate %type_View 152 Offset 2812
+ OpMemberDecorate %type_View 153 Offset 2816
+ OpMemberDecorate %type_View 154 Offset 2828
+ OpMemberDecorate %type_View 155 Offset 2832
+ OpMemberDecorate %type_View 156 Offset 2844
+ OpMemberDecorate %type_View 157 Offset 2848
+ OpMemberDecorate %type_View 158 Offset 2856
+ OpMemberDecorate %type_View 159 Offset 2860
+ OpMemberDecorate %type_View 160 Offset 2864
+ OpMemberDecorate %type_View 161 Offset 2876
+ OpMemberDecorate %type_View 162 Offset 2880
+ OpMemberDecorate %type_View 163 Offset 2892
+ OpMemberDecorate %type_View 164 Offset 2896
+ OpMemberDecorate %type_View 165 Offset 2908
+ OpMemberDecorate %type_View 166 Offset 2912
+ OpMemberDecorate %type_View 167 Offset 2924
+ OpMemberDecorate %type_View 168 Offset 2928
+ OpMemberDecorate %type_View 169 Offset 2932
+ OpDecorate %type_View Block
+ OpDecorate %_arr_mat4v4float_uint_6 ArrayStride 64
+ OpMemberDecorate %type__Globals 0 Offset 0
+ OpMemberDecorate %type__Globals 1 Offset 16
+ OpMemberDecorate %type__Globals 1 MatrixStride 16
+ OpMemberDecorate %type__Globals 1 ColMajor
+ OpMemberDecorate %type__Globals 2 Offset 400
+ OpMemberDecorate %type__Globals 3 Offset 404
+ OpMemberDecorate %type__Globals 4 Offset 408
+ OpMemberDecorate %type__Globals 5 Offset 416
+ OpMemberDecorate %type__Globals 6 Offset 432
+ OpMemberDecorate %type__Globals 7 Offset 448
+ OpDecorate %type__Globals Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+ %float_0 = OpConstant %float 0
+ %float_2_5 = OpConstant %float 2.5
+%float_2_37764096 = OpConstant %float 2.37764096
+%float_0_772542 = OpConstant %float 0.772542
+%float_1_46946299 = OpConstant %float 1.46946299
+%float_n2_02254295 = OpConstant %float -2.02254295
+%float_n1_46946299 = OpConstant %float -1.46946299
+%float_n2_022542 = OpConstant %float -2.022542
+%float_n2_37764096 = OpConstant %float -2.37764096
+%float_0_772543013 = OpConstant %float 0.772543013
+ %float_1 = OpConstant %float 1
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %int_3 = OpConstant %int 3
+ %int_7 = OpConstant %int 7
+ %int_58 = OpConstant %int 58
+ %int_24 = OpConstant %int 24
+ %int_11 = OpConstant %int 11
+ %int_5 = OpConstant %int 5
+ %float_0_5 = OpConstant %float 0.5
+ %int_4 = OpConstant %int 4
+ %int_2 = OpConstant %int 2
+ %62 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+ %bool = OpTypeBool
+ %uint_5 = OpConstant %uint 5
+ %65 = OpConstantComposite %v3float %float_0 %float_0 %float_1
+ %66 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+ %float_10 = OpConstant %float 10
+ %float_5 = OpConstant %float 5
+ %uint_0 = OpConstant %uint 0
+ %int_23 = OpConstant %int 23
+ %uint_1 = OpConstant %uint 1
+ %uint_3 = OpConstant %uint 3
+ %uint_16 = OpConstant %uint 16
+%float_0_150000006 = OpConstant %float 0.150000006
+ %float_0_25 = OpConstant %float 0.25
+ %float_2 = OpConstant %float 2
+ %77 = OpConstantComposite %v3float %float_2 %float_2 %float_2
+ %float_255 = OpConstant %float 255
+ %uint_15 = OpConstant %uint 15
+%uint_4294967280 = OpConstant %uint 4294967280
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_arr_v4float_uint_7 = OpTypeArray %v4float %uint_7
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+ %type_View = OpTypeStruct %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %v3float %float %v3float %float %v4float %v4float %v3float %float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %v4float %v4float %v2float %v2float %v4float %v4float %v4float %v4float %int %float %float %float %v4float %v4float %v4float %v2float %float %float %float %float %float %float %v3float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %float %float %float %float %float %v4float %v3float %float %_arr_v4float_uint_2 %_arr_v4float_uint_2 %v4float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %v3float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %uint %uint %v4float %v3float %float %v4float %float %float %float %float %v4float %_arr_v4float_uint_7 %float %float %float %float %uint %float %float %float %v3float %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %float %float %float %float %v3float %float %v3float %float %v2float %float %float %v3float %float %v3float %float %v3float %float %v3float %float %float %float
+%_ptr_Uniform_type_View = OpTypePointer Uniform %type_View
+%type_2d_image = OpTypeImage %float 2D 2 0 0 1 Unknown
+%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image
+%type_sampler = OpTypeSampler
+%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler
+ %uint_6 = OpConstant %uint 6
+%_arr_mat4v4float_uint_6 = OpTypeArray %mat4v4float %uint_6
+%type__Globals = OpTypeStruct %v3float %_arr_mat4v4float_uint_6 %float %float %float %v4float %v2float %v4float
+%_ptr_Uniform_type__Globals = OpTypePointer Uniform %type__Globals
+%type_cube_image = OpTypeImage %float Cube 2 0 0 1 Unknown
+%_ptr_UniformConstant_type_cube_image = OpTypePointer UniformConstant %type_cube_image
+ %v2int = OpTypeVector %int 2
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %91 = OpTypeFunction %void
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%type_sampled_image = OpTypeSampledImage %type_cube_image
+ %v3int = OpTypeVector %int 3
+%type_sampled_image_0 = OpTypeSampledImage %type_2d_image
+ %v4bool = OpTypeVector %bool 4
+ %View = OpVariable %_ptr_Uniform_type_View Uniform
+%SceneTexturesStruct_SceneDepthTexture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%SceneTexturesStruct_SceneDepthTextureSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%SceneTexturesStruct_GBufferATexture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%SceneTexturesStruct_GBufferBTexture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%SceneTexturesStruct_GBufferDTexture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%SceneTexturesStruct_GBufferATextureSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%SceneTexturesStruct_GBufferBTextureSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%SceneTexturesStruct_GBufferDTextureSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%ShadowDepthTextureSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+ %_Globals = OpVariable %_ptr_Uniform_type__Globals Uniform
+%ShadowDepthCubeTexture = OpVariable %_ptr_UniformConstant_type_cube_image UniformConstant
+%ShadowDepthCubeTextureSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%SSProfilesTexture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
+%out_var_SV_Target0 = OpVariable %_ptr_Output_v4float Output
+%float_0_200000003 = OpConstant %float 0.200000003
+ %98 = OpConstantComposite %v3float %float_2_5 %float_2_5 %float_2_5
+ %99 = OpConstantComposite %v3float %float_2_37764096 %float_2_37764096 %float_2_37764096
+ %100 = OpConstantComposite %v3float %float_0_772542 %float_0_772542 %float_0_772542
+ %101 = OpConstantComposite %v3float %float_1_46946299 %float_1_46946299 %float_1_46946299
+ %102 = OpConstantComposite %v3float %float_n2_02254295 %float_n2_02254295 %float_n2_02254295
+ %103 = OpConstantComposite %v3float %float_n1_46946299 %float_n1_46946299 %float_n1_46946299
+ %104 = OpConstantComposite %v3float %float_n2_022542 %float_n2_022542 %float_n2_022542
+ %105 = OpConstantComposite %v3float %float_n2_37764096 %float_n2_37764096 %float_n2_37764096
+ %106 = OpConstantComposite %v3float %float_0_772543013 %float_0_772543013 %float_0_772543013
+ %107 = OpUndef %v4float
+%MainOnePassPointLightPS = OpFunction %void None %91
+ %108 = OpLabel
+ %109 = OpLoad %v4float %gl_FragCoord
+ %110 = OpVectorShuffle %v2float %109 %109 0 1
+ %111 = OpAccessChain %_ptr_Uniform_v4float %View %int_58
+ %112 = OpLoad %v4float %111
+ %113 = OpVectorShuffle %v2float %112 %112 2 3
+ %114 = OpFMul %v2float %110 %113
+ %115 = OpLoad %type_2d_image %SceneTexturesStruct_SceneDepthTexture
+ %116 = OpLoad %type_sampler %SceneTexturesStruct_SceneDepthTextureSampler
+ %117 = OpSampledImage %type_sampled_image_0 %115 %116
+ %118 = OpImageSampleExplicitLod %v4float %117 %114 Lod %float_0
+ %119 = OpCompositeExtract %float %118 0
+ %120 = OpAccessChain %_ptr_Uniform_float %View %int_23 %uint_0
+ %121 = OpLoad %float %120
+ %122 = OpFMul %float %119 %121
+ %123 = OpAccessChain %_ptr_Uniform_float %View %int_23 %uint_1
+ %124 = OpLoad %float %123
+ %125 = OpFAdd %float %122 %124
+ %126 = OpAccessChain %_ptr_Uniform_float %View %int_23 %uint_2
+ %127 = OpLoad %float %126
+ %128 = OpFMul %float %119 %127
+ %129 = OpAccessChain %_ptr_Uniform_float %View %int_23 %uint_3
+ %130 = OpLoad %float %129
+ %131 = OpFSub %float %128 %130
+ %132 = OpFDiv %float %float_1 %131
+ %133 = OpFAdd %float %125 %132
+ %134 = OpAccessChain %_ptr_Uniform_v4float %View %int_24
+ %135 = OpLoad %v4float %134
+ %136 = OpVectorShuffle %v2float %135 %135 3 2
+ %137 = OpFSub %v2float %114 %136
+ %138 = OpVectorShuffle %v2float %135 %135 0 1
+ %139 = OpFDiv %v2float %137 %138
+ %140 = OpCompositeConstruct %v2float %133 %133
+ %141 = OpFMul %v2float %139 %140
+ %142 = OpCompositeExtract %float %141 0
+ %143 = OpCompositeExtract %float %141 1
+ %144 = OpCompositeConstruct %v4float %142 %143 %133 %float_1
+ %145 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_11
+ %146 = OpLoad %mat4v4float %145
+ %147 = OpMatrixTimesVector %v4float %146 %144
+ %148 = OpVectorShuffle %v3float %147 %147 0 1 2
+ %149 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_5
+ %150 = OpLoad %v4float %149
+ %151 = OpVectorShuffle %v3float %150 %150 0 1 2
+ %152 = OpFSub %v3float %151 %148
+ %153 = OpAccessChain %_ptr_Uniform_float %_Globals %int_5 %int_3
+ %154 = OpLoad %float %153
+ %155 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_7
+ %156 = OpAccessChain %_ptr_Uniform_float %_Globals %int_7 %int_0
+ %157 = OpLoad %float %156
+ %158 = OpExtInst %float %1 Length %152
+ %159 = OpFMul %float %158 %154
+ %160 = OpFOrdLessThan %bool %159 %float_1
+ OpSelectionMerge %161 DontFlatten
+ OpBranchConditional %160 %162 %161
+ %162 = OpLabel
+ %163 = OpCompositeConstruct %v3float %158 %158 %158
+ %164 = OpFDiv %v3float %152 %163
+ %165 = OpExtInst %v3float %1 FAbs %152
+ %166 = OpCompositeExtract %float %165 0
+ %167 = OpCompositeExtract %float %165 1
+ %168 = OpCompositeExtract %float %165 2
+ %169 = OpExtInst %float %1 FMax %167 %168
+ %170 = OpExtInst %float %1 FMax %166 %169
+ %171 = OpFOrdEqual %bool %170 %166
+ OpSelectionMerge %172 None
+ OpBranchConditional %171 %173 %174
+ %174 = OpLabel
+ %175 = OpFOrdEqual %bool %170 %167
+ OpSelectionMerge %176 None
+ OpBranchConditional %175 %177 %178
+ %178 = OpLabel
+ %179 = OpCompositeExtract %float %152 2
+ %180 = OpFOrdEqual %bool %168 %179
+ %181 = OpSelect %int %180 %int_4 %int_5
+ OpBranch %176
+ %177 = OpLabel
+ %182 = OpCompositeExtract %float %152 1
+ %183 = OpFOrdEqual %bool %167 %182
+ %184 = OpSelect %int %183 %int_2 %int_3
+ OpBranch %176
+ %176 = OpLabel
+ %185 = OpPhi %int %184 %177 %181 %178
+ OpBranch %172
+ %173 = OpLabel
+ %186 = OpCompositeExtract %float %152 0
+ %187 = OpFOrdEqual %bool %166 %186
+ %188 = OpSelect %int %187 %int_0 %int_1
+ OpBranch %172
+ %172 = OpLabel
+ %189 = OpPhi %int %188 %173 %185 %176
+ %190 = OpCompositeExtract %float %147 0
+ %191 = OpCompositeExtract %float %147 1
+ %192 = OpCompositeExtract %float %147 2
+ %193 = OpCompositeConstruct %v4float %190 %191 %192 %float_1
+ %194 = OpAccessChain %_ptr_Uniform_mat4v4float %_Globals %int_1 %189
+ %195 = OpLoad %mat4v4float %194
+ %196 = OpMatrixTimesVector %v4float %195 %193
+ %197 = OpCompositeExtract %float %196 2
+ %198 = OpCompositeExtract %float %196 3
+ %199 = OpFDiv %float %197 %198
+ %200 = OpFNegate %float %157
+ %201 = OpFDiv %float %200 %198
+ %202 = OpLoad %type_cube_image %ShadowDepthCubeTexture
+ %203 = OpLoad %type_sampler %ShadowDepthCubeTextureSampler
+ %204 = OpFAdd %float %199 %201
+ %205 = OpSampledImage %type_sampled_image %202 %203
+ %206 = OpImageSampleDrefExplicitLod %float %205 %164 %204 Lod %float_0
+ OpBranch %161
+ %161 = OpLabel
+ %207 = OpPhi %float %float_1 %108 %206 %172
+ %208 = OpFSub %float %207 %float_0_5
+ %209 = OpAccessChain %_ptr_Uniform_float %_Globals %int_4
+ %210 = OpLoad %float %209
+ %211 = OpFMul %float %208 %210
+ %212 = OpFAdd %float %211 %float_0_5
+ %213 = OpExtInst %float %1 FClamp %212 %float_0 %float_1
+ %214 = OpFMul %float %213 %213
+ %215 = OpAccessChain %_ptr_Uniform_float %_Globals %int_3
+ %216 = OpLoad %float %215
+ %217 = OpExtInst %float %1 FMix %float_1 %214 %216
+ %218 = OpExtInst %float %1 Sqrt %217
+ %219 = OpCompositeInsert %v4float %218 %107 2
+ %220 = OpVectorShuffle %v4float %219 %62 4 5 2 6
+ %221 = OpLoad %type_2d_image %SceneTexturesStruct_GBufferATexture
+ %222 = OpLoad %type_sampler %SceneTexturesStruct_GBufferATextureSampler
+ %223 = OpSampledImage %type_sampled_image_0 %221 %222
+ %224 = OpImageSampleExplicitLod %v4float %223 %114 Lod %float_0
+ %225 = OpLoad %type_2d_image %SceneTexturesStruct_GBufferBTexture
+ %226 = OpLoad %type_sampler %SceneTexturesStruct_GBufferBTextureSampler
+ %227 = OpSampledImage %type_sampled_image_0 %225 %226
+ %228 = OpImageSampleExplicitLod %v4float %227 %114 Lod %float_0
+ %229 = OpLoad %type_2d_image %SceneTexturesStruct_GBufferDTexture
+ %230 = OpLoad %type_sampler %SceneTexturesStruct_GBufferDTextureSampler
+ %231 = OpSampledImage %type_sampled_image_0 %229 %230
+ %232 = OpImageSampleExplicitLod %v4float %231 %114 Lod %float_0
+ %233 = OpVectorShuffle %v3float %224 %224 0 1 2
+ %234 = OpFMul %v3float %233 %77
+ %235 = OpFSub %v3float %234 %62
+ %236 = OpExtInst %v3float %1 Normalize %235
+ %237 = OpCompositeExtract %float %228 3
+ %238 = OpFMul %float %237 %float_255
+ %239 = OpExtInst %float %1 Round %238
+ %240 = OpConvertFToU %uint %239
+ %241 = OpBitwiseAnd %uint %240 %uint_15
+ %242 = OpBitwiseAnd %uint %240 %uint_4294967280
+ %243 = OpBitwiseAnd %uint %242 %uint_16
+ %244 = OpINotEqual %bool %243 %uint_0
+ %245 = OpLogicalNot %bool %244
+ %246 = OpCompositeConstruct %v4bool %245 %245 %245 %245
+ %247 = OpSelect %v4float %246 %232 %66
+ %248 = OpIEqual %bool %241 %uint_5
+ OpSelectionMerge %249 None
+ OpBranchConditional %248 %250 %249
+ %250 = OpLabel
+ %251 = OpLoad %v4float %155
+ %252 = OpCompositeExtract %float %247 0
+ %253 = OpFMul %float %252 %float_255
+ %254 = OpFAdd %float %253 %float_0_5
+ %255 = OpConvertFToU %uint %254
+ %256 = OpBitcast %int %255
+ %257 = OpCompositeConstruct %v3int %int_1 %256 %int_0
+ %258 = OpVectorShuffle %v2int %257 %257 0 1
+ %259 = OpLoad %type_2d_image %SSProfilesTexture
+ %260 = OpImageFetch %v4float %259 %258 Lod %int_0
+ %261 = OpCompositeExtract %float %260 0
+ %262 = OpCompositeExtract %float %260 1
+ %263 = OpFMul %float %262 %float_0_5
+ %264 = OpCompositeConstruct %v3float %263 %263 %263
+ %265 = OpFMul %v3float %236 %264
+ %266 = OpFSub %v3float %148 %265
+ %267 = OpDot %float %152 %152
+ %268 = OpExtInst %float %1 InverseSqrt %267
+ %269 = OpCompositeConstruct %v3float %268 %268 %268
+ %270 = OpFMul %v3float %152 %269
+ %271 = OpFNegate %v3float %270
+ %272 = OpDot %float %271 %236
+ %273 = OpExtInst %float %1 FClamp %272 %float_0 %float_1
+ %274 = OpExtInst %float %1 Pow %273 %float_1
+ OpSelectionMerge %275 DontFlatten
+ OpBranchConditional %160 %276 %275
+ %276 = OpLabel
+ %277 = OpCompositeConstruct %v3float %158 %158 %158
+ %278 = OpFDiv %v3float %152 %277
+ %279 = OpExtInst %v3float %1 Cross %278 %65
+ %280 = OpExtInst %v3float %1 Normalize %279
+ %281 = OpExtInst %v3float %1 Cross %280 %278
+ %282 = OpAccessChain %_ptr_Uniform_float %_Globals %int_2
+ %283 = OpLoad %float %282
+ %284 = OpCompositeConstruct %v3float %283 %283 %283
+ %285 = OpFMul %v3float %280 %284
+ %286 = OpFMul %v3float %281 %284
+ %287 = OpExtInst %v3float %1 FAbs %278
+ %288 = OpCompositeExtract %float %287 0
+ %289 = OpCompositeExtract %float %287 1
+ %290 = OpCompositeExtract %float %287 2
+ %291 = OpExtInst %float %1 FMax %289 %290
+ %292 = OpExtInst %float %1 FMax %288 %291
+ %293 = OpFOrdEqual %bool %292 %288
+ OpSelectionMerge %294 None
+ OpBranchConditional %293 %295 %296
+ %296 = OpLabel
+ %297 = OpFOrdEqual %bool %292 %289
+ OpSelectionMerge %298 None
+ OpBranchConditional %297 %299 %300
+ %300 = OpLabel
+ %301 = OpCompositeExtract %float %278 2
+ %302 = OpFOrdEqual %bool %290 %301
+ %303 = OpSelect %int %302 %int_4 %int_5
+ OpBranch %298
+ %299 = OpLabel
+ %304 = OpCompositeExtract %float %278 1
+ %305 = OpFOrdEqual %bool %289 %304
+ %306 = OpSelect %int %305 %int_2 %int_3
+ OpBranch %298
+ %298 = OpLabel
+ %307 = OpPhi %int %306 %299 %303 %300
+ OpBranch %294
+ %295 = OpLabel
+ %308 = OpCompositeExtract %float %278 0
+ %309 = OpFOrdEqual %bool %288 %308
+ %310 = OpSelect %int %309 %int_0 %int_1
+ OpBranch %294
+ %294 = OpLabel
+ %311 = OpPhi %int %310 %295 %307 %298
+ %312 = OpCompositeExtract %float %266 0
+ %313 = OpCompositeExtract %float %266 1
+ %314 = OpCompositeExtract %float %266 2
+ %315 = OpCompositeConstruct %v4float %312 %313 %314 %float_1
+ %316 = OpAccessChain %_ptr_Uniform_mat4v4float %_Globals %int_1 %311
+ %317 = OpLoad %mat4v4float %316
+ %318 = OpMatrixTimesVector %v4float %317 %315
+ %319 = OpCompositeExtract %float %318 2
+ %320 = OpCompositeExtract %float %318 3
+ %321 = OpFDiv %float %319 %320
+ %322 = OpFDiv %float %float_10 %154
+ %323 = OpFMul %float %261 %322
+ %324 = OpCompositeExtract %float %251 2
+ %325 = OpFMul %float %321 %324
+ %326 = OpCompositeExtract %float %251 3
+ %327 = OpFSub %float %325 %326
+ %328 = OpFDiv %float %float_1 %327
+ %329 = OpFMul %float %328 %154
+ %330 = OpFMul %v3float %286 %98
+ %331 = OpFAdd %v3float %278 %330
+ %332 = OpLoad %type_cube_image %ShadowDepthCubeTexture
+ %333 = OpLoad %type_sampler %ShadowDepthTextureSampler
+ %334 = OpSampledImage %type_sampled_image %332 %333
+ %335 = OpImageSampleExplicitLod %v4float %334 %331 Lod %float_0
+ %336 = OpCompositeExtract %float %335 0
+ %337 = OpFMul %float %336 %324
+ %338 = OpFSub %float %337 %326
+ %339 = OpFDiv %float %float_1 %338
+ %340 = OpFMul %float %339 %154
+ %341 = OpFSub %float %329 %340
+ %342 = OpFMul %float %341 %323
+ %343 = OpFOrdGreaterThan %bool %342 %float_0
+ %344 = OpFAdd %float %342 %263
+ %345 = OpFMul %float %342 %274
+ %346 = OpFAdd %float %345 %263
+ %347 = OpExtInst %float %1 FMax %float_0 %346
+ %348 = OpSelect %float %343 %344 %347
+ %349 = OpExtInst %float %1 FAbs %348
+ %350 = OpExtInst %float %1 FClamp %349 %float_0_150000006 %float_5
+ %351 = OpFAdd %float %350 %float_0_25
+ %352 = OpFMul %v3float %285 %99
+ %353 = OpFAdd %v3float %278 %352
+ %354 = OpFMul %v3float %286 %100
+ %355 = OpFAdd %v3float %353 %354
+ %356 = OpSampledImage %type_sampled_image %332 %333
+ %357 = OpImageSampleExplicitLod %v4float %356 %355 Lod %float_0
+ %358 = OpCompositeExtract %float %357 0
+ %359 = OpFMul %float %358 %324
+ %360 = OpFSub %float %359 %326
+ %361 = OpFDiv %float %float_1 %360
+ %362 = OpFMul %float %361 %154
+ %363 = OpFSub %float %329 %362
+ %364 = OpFMul %float %363 %323
+ %365 = OpFOrdGreaterThan %bool %364 %float_0
+ %366 = OpFAdd %float %364 %263
+ %367 = OpFMul %float %364 %274
+ %368 = OpFAdd %float %367 %263
+ %369 = OpExtInst %float %1 FMax %float_0 %368
+ %370 = OpSelect %float %365 %366 %369
+ %371 = OpExtInst %float %1 FAbs %370
+ %372 = OpExtInst %float %1 FClamp %371 %float_0_150000006 %float_5
+ %373 = OpFAdd %float %372 %float_0_25
+ %374 = OpFAdd %float %351 %373
+ %375 = OpFMul %v3float %285 %101
+ %376 = OpFAdd %v3float %278 %375
+ %377 = OpFMul %v3float %286 %102
+ %378 = OpFAdd %v3float %376 %377
+ %379 = OpSampledImage %type_sampled_image %332 %333
+ %380 = OpImageSampleExplicitLod %v4float %379 %378 Lod %float_0
+ %381 = OpCompositeExtract %float %380 0
+ %382 = OpFMul %float %381 %324
+ %383 = OpFSub %float %382 %326
+ %384 = OpFDiv %float %float_1 %383
+ %385 = OpFMul %float %384 %154
+ %386 = OpFSub %float %329 %385
+ %387 = OpFMul %float %386 %323
+ %388 = OpFOrdGreaterThan %bool %387 %float_0
+ %389 = OpFAdd %float %387 %263
+ %390 = OpFMul %float %387 %274
+ %391 = OpFAdd %float %390 %263
+ %392 = OpExtInst %float %1 FMax %float_0 %391
+ %393 = OpSelect %float %388 %389 %392
+ %394 = OpExtInst %float %1 FAbs %393
+ %395 = OpExtInst %float %1 FClamp %394 %float_0_150000006 %float_5
+ %396 = OpFAdd %float %395 %float_0_25
+ %397 = OpFAdd %float %374 %396
+ %398 = OpFMul %v3float %285 %103
+ %399 = OpFAdd %v3float %278 %398
+ %400 = OpFMul %v3float %286 %104
+ %401 = OpFAdd %v3float %399 %400
+ %402 = OpSampledImage %type_sampled_image %332 %333
+ %403 = OpImageSampleExplicitLod %v4float %402 %401 Lod %float_0
+ %404 = OpCompositeExtract %float %403 0
+ %405 = OpFMul %float %404 %324
+ %406 = OpFSub %float %405 %326
+ %407 = OpFDiv %float %float_1 %406
+ %408 = OpFMul %float %407 %154
+ %409 = OpFSub %float %329 %408
+ %410 = OpFMul %float %409 %323
+ %411 = OpFOrdGreaterThan %bool %410 %float_0
+ %412 = OpFAdd %float %410 %263
+ %413 = OpFMul %float %410 %274
+ %414 = OpFAdd %float %413 %263
+ %415 = OpExtInst %float %1 FMax %float_0 %414
+ %416 = OpSelect %float %411 %412 %415
+ %417 = OpExtInst %float %1 FAbs %416
+ %418 = OpExtInst %float %1 FClamp %417 %float_0_150000006 %float_5
+ %419 = OpFAdd %float %418 %float_0_25
+ %420 = OpFAdd %float %397 %419
+ %421 = OpFMul %v3float %285 %105
+ %422 = OpFAdd %v3float %278 %421
+ %423 = OpFMul %v3float %286 %106
+ %424 = OpFAdd %v3float %422 %423
+ %425 = OpSampledImage %type_sampled_image %332 %333
+ %426 = OpImageSampleExplicitLod %v4float %425 %424 Lod %float_0
+ %427 = OpCompositeExtract %float %426 0
+ %428 = OpFMul %float %427 %324
+ %429 = OpFSub %float %428 %326
+ %430 = OpFDiv %float %float_1 %429
+ %431 = OpFMul %float %430 %154
+ %432 = OpFSub %float %329 %431
+ %433 = OpFMul %float %432 %323
+ %434 = OpFOrdGreaterThan %bool %433 %float_0
+ %435 = OpFAdd %float %433 %263
+ %436 = OpFMul %float %433 %274
+ %437 = OpFAdd %float %436 %263
+ %438 = OpExtInst %float %1 FMax %float_0 %437
+ %439 = OpSelect %float %434 %435 %438
+ %440 = OpExtInst %float %1 FAbs %439
+ %441 = OpExtInst %float %1 FClamp %440 %float_0_150000006 %float_5
+ %442 = OpFAdd %float %441 %float_0_25
+ %443 = OpFAdd %float %420 %442
+ %444 = OpFMul %float %443 %float_0_200000003
+ OpBranch %275
+ %275 = OpLabel
+ %445 = OpPhi %float %float_1 %250 %444 %294
+ %446 = OpFMul %float %445 %float_0_200000003
+ %447 = OpFSub %float %float_1 %446
+ OpBranch %249
+ %249 = OpLabel
+ %448 = OpPhi %float %float_1 %161 %447 %275
+ %449 = OpExtInst %float %1 Sqrt %448
+ %450 = OpSelect %float %248 %449 %218
+ %451 = OpCompositeInsert %v4float %450 %220 3
+ OpStore %out_var_SV_Target0 %451
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/global-constant-arrays.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/global-constant-arrays.asm.frag
new file mode 100644
index 00000000000..47db9ebc512
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/global-constant-arrays.asm.frag
@@ -0,0 +1,3556 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 3005
+; Schema: 0
+ OpCapability Shader
+ OpCapability Geometry
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %MainPS "main" %in_var_TEXCOORD0 %gl_FragCoord %gl_Layer %out_var_SV_Target0
+ OpExecutionMode %MainPS OriginUpperLeft
+ OpSource HLSL 600
+ OpName %type__Globals "type.$Globals"
+ OpMemberName %type__Globals 0 "MappingPolynomial"
+ OpMemberName %type__Globals 1 "InverseGamma"
+ OpMemberName %type__Globals 2 "ColorMatrixR_ColorCurveCd1"
+ OpMemberName %type__Globals 3 "ColorMatrixG_ColorCurveCd3Cm3"
+ OpMemberName %type__Globals 4 "ColorMatrixB_ColorCurveCm2"
+ OpMemberName %type__Globals 5 "ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3"
+ OpMemberName %type__Globals 6 "ColorCurve_Ch1_Ch2"
+ OpMemberName %type__Globals 7 "ColorShadow_Luma"
+ OpMemberName %type__Globals 8 "ColorShadow_Tint1"
+ OpMemberName %type__Globals 9 "ColorShadow_Tint2"
+ OpMemberName %type__Globals 10 "FilmSlope"
+ OpMemberName %type__Globals 11 "FilmToe"
+ OpMemberName %type__Globals 12 "FilmShoulder"
+ OpMemberName %type__Globals 13 "FilmBlackClip"
+ OpMemberName %type__Globals 14 "FilmWhiteClip"
+ OpMemberName %type__Globals 15 "ColorScale"
+ OpMemberName %type__Globals 16 "OverlayColor"
+ OpMemberName %type__Globals 17 "WhiteTemp"
+ OpMemberName %type__Globals 18 "WhiteTint"
+ OpMemberName %type__Globals 19 "ColorSaturation"
+ OpMemberName %type__Globals 20 "ColorContrast"
+ OpMemberName %type__Globals 21 "ColorGamma"
+ OpMemberName %type__Globals 22 "ColorGain"
+ OpMemberName %type__Globals 23 "ColorOffset"
+ OpMemberName %type__Globals 24 "ColorSaturationShadows"
+ OpMemberName %type__Globals 25 "ColorContrastShadows"
+ OpMemberName %type__Globals 26 "ColorGammaShadows"
+ OpMemberName %type__Globals 27 "ColorGainShadows"
+ OpMemberName %type__Globals 28 "ColorOffsetShadows"
+ OpMemberName %type__Globals 29 "ColorSaturationMidtones"
+ OpMemberName %type__Globals 30 "ColorContrastMidtones"
+ OpMemberName %type__Globals 31 "ColorGammaMidtones"
+ OpMemberName %type__Globals 32 "ColorGainMidtones"
+ OpMemberName %type__Globals 33 "ColorOffsetMidtones"
+ OpMemberName %type__Globals 34 "ColorSaturationHighlights"
+ OpMemberName %type__Globals 35 "ColorContrastHighlights"
+ OpMemberName %type__Globals 36 "ColorGammaHighlights"
+ OpMemberName %type__Globals 37 "ColorGainHighlights"
+ OpMemberName %type__Globals 38 "ColorOffsetHighlights"
+ OpMemberName %type__Globals 39 "ColorCorrectionShadowsMax"
+ OpMemberName %type__Globals 40 "ColorCorrectionHighlightsMin"
+ OpMemberName %type__Globals 41 "OutputDevice"
+ OpMemberName %type__Globals 42 "OutputGamut"
+ OpMemberName %type__Globals 43 "BlueCorrection"
+ OpMemberName %type__Globals 44 "ExpandGamut"
+ OpName %_Globals "$Globals"
+ OpName %in_var_TEXCOORD0 "in.var.TEXCOORD0"
+ OpName %out_var_SV_Target0 "out.var.SV_Target0"
+ OpName %MainPS "MainPS"
+ OpDecorateString %in_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorate %in_var_TEXCOORD0 NoPerspective
+ OpDecorate %gl_FragCoord BuiltIn FragCoord
+ OpDecorateString %gl_FragCoord UserSemantic "SV_POSITION"
+ OpDecorate %gl_Layer BuiltIn Layer
+ OpDecorateString %gl_Layer UserSemantic "SV_RenderTargetArrayIndex"
+ OpDecorate %gl_Layer Flat
+ OpDecorateString %out_var_SV_Target0 UserSemantic "SV_Target0"
+ OpDecorate %in_var_TEXCOORD0 Location 0
+ OpDecorate %out_var_SV_Target0 Location 0
+ OpDecorate %_Globals DescriptorSet 0
+ OpDecorate %_Globals Binding 0
+ OpMemberDecorate %type__Globals 0 Offset 0
+ OpMemberDecorate %type__Globals 1 Offset 16
+ OpMemberDecorate %type__Globals 2 Offset 32
+ OpMemberDecorate %type__Globals 3 Offset 48
+ OpMemberDecorate %type__Globals 4 Offset 64
+ OpMemberDecorate %type__Globals 5 Offset 80
+ OpMemberDecorate %type__Globals 6 Offset 96
+ OpMemberDecorate %type__Globals 7 Offset 112
+ OpMemberDecorate %type__Globals 8 Offset 128
+ OpMemberDecorate %type__Globals 9 Offset 144
+ OpMemberDecorate %type__Globals 10 Offset 160
+ OpMemberDecorate %type__Globals 11 Offset 164
+ OpMemberDecorate %type__Globals 12 Offset 168
+ OpMemberDecorate %type__Globals 13 Offset 172
+ OpMemberDecorate %type__Globals 14 Offset 176
+ OpMemberDecorate %type__Globals 15 Offset 180
+ OpMemberDecorate %type__Globals 16 Offset 192
+ OpMemberDecorate %type__Globals 17 Offset 208
+ OpMemberDecorate %type__Globals 18 Offset 212
+ OpMemberDecorate %type__Globals 19 Offset 224
+ OpMemberDecorate %type__Globals 20 Offset 240
+ OpMemberDecorate %type__Globals 21 Offset 256
+ OpMemberDecorate %type__Globals 22 Offset 272
+ OpMemberDecorate %type__Globals 23 Offset 288
+ OpMemberDecorate %type__Globals 24 Offset 304
+ OpMemberDecorate %type__Globals 25 Offset 320
+ OpMemberDecorate %type__Globals 26 Offset 336
+ OpMemberDecorate %type__Globals 27 Offset 352
+ OpMemberDecorate %type__Globals 28 Offset 368
+ OpMemberDecorate %type__Globals 29 Offset 384
+ OpMemberDecorate %type__Globals 30 Offset 400
+ OpMemberDecorate %type__Globals 31 Offset 416
+ OpMemberDecorate %type__Globals 32 Offset 432
+ OpMemberDecorate %type__Globals 33 Offset 448
+ OpMemberDecorate %type__Globals 34 Offset 464
+ OpMemberDecorate %type__Globals 35 Offset 480
+ OpMemberDecorate %type__Globals 36 Offset 496
+ OpMemberDecorate %type__Globals 37 Offset 512
+ OpMemberDecorate %type__Globals 38 Offset 528
+ OpMemberDecorate %type__Globals 39 Offset 544
+ OpMemberDecorate %type__Globals 40 Offset 548
+ OpMemberDecorate %type__Globals 41 Offset 552
+ OpMemberDecorate %type__Globals 42 Offset 556
+ OpMemberDecorate %type__Globals 43 Offset 560
+ OpMemberDecorate %type__Globals 44 Offset 564
+ OpDecorate %type__Globals Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+%float_0_952552378 = OpConstant %float 0.952552378
+ %float_0 = OpConstant %float 0
+
+; HACK: Needed to hack this constant since MSVC and GNU libc are off by 1 ULP when converting to string (it probably still works fine though in a roundtrip ...)
+%float_9_36786018en05 = OpConstant %float 9.25
+
+%float_0_343966454 = OpConstant %float 0.343966454
+%float_0_728166103 = OpConstant %float 0.728166103
+%float_n0_0721325427 = OpConstant %float -0.0721325427
+%float_1_00882518 = OpConstant %float 1.00882518
+%float_1_04981101 = OpConstant %float 1.04981101
+%float_n9_74845025en05 = OpConstant %float -9.74845025e-05
+%float_n0_495903015 = OpConstant %float -0.495903015
+%float_1_37331307 = OpConstant %float 1.37331307
+%float_0_0982400328 = OpConstant %float 0.0982400328
+%float_0_991252005 = OpConstant %float 0.991252005
+%float_0_662454188 = OpConstant %float 0.662454188
+%float_0_134004205 = OpConstant %float 0.134004205
+%float_0_156187683 = OpConstant %float 0.156187683
+%float_0_272228718 = OpConstant %float 0.272228718
+%float_0_674081743 = OpConstant %float 0.674081743
+%float_0_0536895171 = OpConstant %float 0.0536895171
+%float_n0_00557464967 = OpConstant %float -0.00557464967
+%float_0_0040607336 = OpConstant %float 0.0040607336
+%float_1_01033914 = OpConstant %float 1.01033914
+%float_1_6410234 = OpConstant %float 1.6410234
+%float_n0_324803293 = OpConstant %float -0.324803293
+%float_n0_236424699 = OpConstant %float -0.236424699
+%float_n0_663662851 = OpConstant %float -0.663662851
+%float_1_61533165 = OpConstant %float 1.61533165
+%float_0_0167563483 = OpConstant %float 0.0167563483
+%float_0_0117218941 = OpConstant %float 0.0117218941
+%float_n0_00828444213 = OpConstant %float -0.00828444213
+%float_0_988394856 = OpConstant %float 0.988394856
+%float_1_45143926 = OpConstant %float 1.45143926
+%float_n0_236510754 = OpConstant %float -0.236510754
+%float_n0_214928567 = OpConstant %float -0.214928567
+%float_n0_0765537769 = OpConstant %float -0.0765537769
+%float_1_17622972 = OpConstant %float 1.17622972
+%float_n0_0996759236 = OpConstant %float -0.0996759236
+%float_0_00831614807 = OpConstant %float 0.00831614807
+%float_n0_00603244966 = OpConstant %float -0.00603244966
+%float_0_997716308 = OpConstant %float 0.997716308
+%float_0_695452213 = OpConstant %float 0.695452213
+%float_0_140678704 = OpConstant %float 0.140678704
+%float_0_163869068 = OpConstant %float 0.163869068
+%float_0_0447945632 = OpConstant %float 0.0447945632
+%float_0_859671116 = OpConstant %float 0.859671116
+%float_0_0955343172 = OpConstant %float 0.0955343172
+%float_n0_00552588282 = OpConstant %float -0.00552588282
+%float_0_00402521016 = OpConstant %float 0.00402521016
+%float_1_00150073 = OpConstant %float 1.00150073
+ %67 = OpConstantComposite %v3float %float_0_272228718 %float_0_674081743 %float_0_0536895171
+%float_3_2409699 = OpConstant %float 3.2409699
+%float_n1_5373832 = OpConstant %float -1.5373832
+%float_n0_498610765 = OpConstant %float -0.498610765
+%float_n0_969243646 = OpConstant %float -0.969243646
+%float_1_8759675 = OpConstant %float 1.8759675
+%float_0_0415550582 = OpConstant %float 0.0415550582
+%float_0_0556300804 = OpConstant %float 0.0556300804
+%float_n0_203976959 = OpConstant %float -0.203976959
+%float_1_05697155 = OpConstant %float 1.05697155
+%float_0_412456393 = OpConstant %float 0.412456393
+%float_0_357576102 = OpConstant %float 0.357576102
+%float_0_180437505 = OpConstant %float 0.180437505
+%float_0_212672904 = OpConstant %float 0.212672904
+%float_0_715152204 = OpConstant %float 0.715152204
+%float_0_0721750036 = OpConstant %float 0.0721750036
+%float_0_0193339009 = OpConstant %float 0.0193339009
+%float_0_119191997 = OpConstant %float 0.119191997
+%float_0_950304091 = OpConstant %float 0.950304091
+%float_1_71660841 = OpConstant %float 1.71660841
+%float_n0_355662107 = OpConstant %float -0.355662107
+%float_n0_253360093 = OpConstant %float -0.253360093
+%float_n0_666682899 = OpConstant %float -0.666682899
+%float_1_61647761 = OpConstant %float 1.61647761
+%float_0_0157685 = OpConstant %float 0.0157685
+%float_0_0176422 = OpConstant %float 0.0176422
+%float_n0_0427763015 = OpConstant %float -0.0427763015
+%float_0_942228675 = OpConstant %float 0.942228675
+%float_2_49339628 = OpConstant %float 2.49339628
+%float_n0_93134588 = OpConstant %float -0.93134588
+%float_n0_402694494 = OpConstant %float -0.402694494
+%float_n0_829486787 = OpConstant %float -0.829486787
+%float_1_76265967 = OpConstant %float 1.76265967
+%float_0_0236246008 = OpConstant %float 0.0236246008
+%float_0_0358507 = OpConstant %float 0.0358507
+%float_n0_0761827007 = OpConstant %float -0.0761827007
+%float_0_957014024 = OpConstant %float 0.957014024
+%float_1_01303005 = OpConstant %float 1.01303005
+%float_0_00610530982 = OpConstant %float 0.00610530982
+%float_n0_0149710001 = OpConstant %float -0.0149710001
+%float_0_00769822998 = OpConstant %float 0.00769822998
+%float_0_998165011 = OpConstant %float 0.998165011
+%float_n0_00503202993 = OpConstant %float -0.00503202993
+%float_n0_00284131011 = OpConstant %float -0.00284131011
+%float_0_00468515977 = OpConstant %float 0.00468515977
+%float_0_924507022 = OpConstant %float 0.924507022
+%float_0_987223983 = OpConstant %float 0.987223983
+%float_n0_00611326983 = OpConstant %float -0.00611326983
+%float_0_0159533005 = OpConstant %float 0.0159533005
+%float_n0_00759836007 = OpConstant %float -0.00759836007
+%float_1_00186002 = OpConstant %float 1.00186002
+%float_0_0053300201 = OpConstant %float 0.0053300201
+%float_0_00307257008 = OpConstant %float 0.00307257008
+%float_n0_00509594986 = OpConstant %float -0.00509594986
+%float_1_08168006 = OpConstant %float 1.08168006
+ %float_0_5 = OpConstant %float 0.5
+ %float_n1 = OpConstant %float -1
+ %float_1 = OpConstant %float 1
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+%float_0_015625 = OpConstant %float 0.015625
+ %128 = OpConstantComposite %v2float %float_0_015625 %float_0_015625
+ %129 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+ %int_42 = OpConstant %int 42
+ %uint_3 = OpConstant %uint 3
+ %132 = OpConstantComposite %v3float %float_0 %float_0 %float_0
+ %int_9 = OpConstant %int 9
+ %int_3 = OpConstant %int 3
+ %135 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+ %float_n4 = OpConstant %float -4
+ %int_44 = OpConstant %int 44
+%float_0_544169128 = OpConstant %float 0.544169128
+%float_0_239592597 = OpConstant %float 0.239592597
+%float_0_166694298 = OpConstant %float 0.166694298
+%float_0_239465594 = OpConstant %float 0.239465594
+%float_0_702153027 = OpConstant %float 0.702153027
+%float_0_058381401 = OpConstant %float 0.058381401
+%float_n0_00234390004 = OpConstant %float -0.00234390004
+%float_0_0361833982 = OpConstant %float 0.0361833982
+%float_1_05521834 = OpConstant %float 1.05521834
+%float_0_940437257 = OpConstant %float 0.940437257
+%float_n0_0183068793 = OpConstant %float -0.0183068793
+%float_0_077869609 = OpConstant %float 0.077869609
+%float_0_00837869663 = OpConstant %float 0.00837869663
+%float_0_828660011 = OpConstant %float 0.828660011
+%float_0_162961304 = OpConstant %float 0.162961304
+%float_0_00054712611 = OpConstant %float 0.00054712611
+%float_n0_000883374596 = OpConstant %float -0.000883374596
+%float_1_00033629 = OpConstant %float 1.00033629
+%float_1_06317997 = OpConstant %float 1.06317997
+%float_0_0233955998 = OpConstant %float 0.0233955998
+%float_n0_0865726024 = OpConstant %float -0.0865726024
+%float_n0_0106336996 = OpConstant %float -0.0106336996
+%float_1_20632005 = OpConstant %float 1.20632005
+%float_n0_195690006 = OpConstant %float -0.195690006
+%float_n0_000590886979 = OpConstant %float -0.000590886979
+%float_0_00105247996 = OpConstant %float 0.00105247996
+%float_0_999538004 = OpConstant %float 0.999538004
+ %int_43 = OpConstant %int 43
+ %int_15 = OpConstant %int 15
+ %int_16 = OpConstant %int 16
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %uint_5 = OpConstant %uint 5
+ %uint_6 = OpConstant %uint 6
+ %int_2 = OpConstant %int 2
+%mat3v3float = OpTypeMatrix %v3float 3
+ %int_41 = OpConstant %int 41
+%float_0_159301758 = OpConstant %float 0.159301758
+%float_78_84375 = OpConstant %float 78.84375
+%float_0_8359375 = OpConstant %float 0.8359375
+%float_18_8515625 = OpConstant %float 18.8515625
+%float_18_6875 = OpConstant %float 18.6875
+%float_10000 = OpConstant %float 10000
+%float_0_0126833133 = OpConstant %float 0.0126833133
+ %182 = OpConstantComposite %v3float %float_0_0126833133 %float_0_0126833133 %float_0_0126833133
+ %183 = OpConstantComposite %v3float %float_0_8359375 %float_0_8359375 %float_0_8359375
+ %184 = OpConstantComposite %v3float %float_18_8515625 %float_18_8515625 %float_18_8515625
+ %185 = OpConstantComposite %v3float %float_18_6875 %float_18_6875 %float_18_6875
+%float_6_27739477 = OpConstant %float 6.27739477
+ %187 = OpConstantComposite %v3float %float_6_27739477 %float_6_27739477 %float_6_27739477
+ %188 = OpConstantComposite %v3float %float_10000 %float_10000 %float_10000
+ %float_14 = OpConstant %float 14
+%float_0_180000007 = OpConstant %float 0.180000007
+%float_0_434017599 = OpConstant %float 0.434017599
+ %192 = OpConstantComposite %v3float %float_0_434017599 %float_0_434017599 %float_0_434017599
+ %193 = OpConstantComposite %v3float %float_14 %float_14 %float_14
+ %194 = OpConstantComposite %v3float %float_0_180000007 %float_0_180000007 %float_0_180000007
+ %int_17 = OpConstant %int 17
+ %float_4000 = OpConstant %float 4000
+%float_0_312700003 = OpConstant %float 0.312700003
+%float_0_328999996 = OpConstant %float 0.328999996
+ %int_18 = OpConstant %int 18
+ %int_24 = OpConstant %int 24
+ %int_19 = OpConstant %int 19
+ %int_25 = OpConstant %int 25
+ %int_20 = OpConstant %int 20
+ %int_26 = OpConstant %int 26
+ %int_21 = OpConstant %int 21
+ %int_27 = OpConstant %int 27
+ %int_22 = OpConstant %int 22
+ %int_28 = OpConstant %int 28
+ %int_23 = OpConstant %int 23
+ %int_39 = OpConstant %int 39
+ %int_34 = OpConstant %int 34
+ %int_35 = OpConstant %int 35
+ %int_36 = OpConstant %int 36
+ %int_37 = OpConstant %int 37
+ %int_38 = OpConstant %int 38
+ %int_40 = OpConstant %int 40
+ %int_29 = OpConstant %int 29
+ %int_30 = OpConstant %int 30
+ %int_31 = OpConstant %int 31
+ %int_32 = OpConstant %int 32
+ %int_33 = OpConstant %int 33
+%float_0_0500000007 = OpConstant %float 0.0500000007
+ %float_1_75 = OpConstant %float 1.75
+%float_0_400000006 = OpConstant %float 0.400000006
+%float_0_0299999993 = OpConstant %float 0.0299999993
+ %float_2 = OpConstant %float 2
+%float_0_959999979 = OpConstant %float 0.959999979
+ %228 = OpConstantComposite %v3float %float_0_959999979 %float_0_959999979 %float_0_959999979
+ %int_13 = OpConstant %int 13
+ %int_11 = OpConstant %int 11
+ %int_14 = OpConstant %int 14
+ %int_12 = OpConstant %int 12
+%float_0_800000012 = OpConstant %float 0.800000012
+ %int_10 = OpConstant %int 10
+ %float_10 = OpConstant %float 10
+ %float_n2 = OpConstant %float -2
+ %float_3 = OpConstant %float 3
+ %238 = OpConstantComposite %v3float %float_3 %float_3 %float_3
+ %239 = OpConstantComposite %v3float %float_2 %float_2 %float_2
+%float_0_930000007 = OpConstant %float 0.930000007
+ %241 = OpConstantComposite %v3float %float_0_930000007 %float_0_930000007 %float_0_930000007
+ %int_4 = OpConstant %int 4
+ %int_8 = OpConstant %int 8
+ %int_7 = OpConstant %int 7
+ %int_5 = OpConstant %int 5
+ %int_6 = OpConstant %int 6
+%float_0_00200000009 = OpConstant %float 0.00200000009
+ %248 = OpConstantComposite %v3float %float_0_00200000009 %float_0_00200000009 %float_0_00200000009
+%float_6_10351999en05 = OpConstant %float 6.10351999e-05
+ %250 = OpConstantComposite %v3float %float_6_10351999en05 %float_6_10351999en05 %float_6_10351999en05
+ %float_4_5 = OpConstant %float 4.5
+ %252 = OpConstantComposite %v3float %float_4_5 %float_4_5 %float_4_5
+%float_0_0179999992 = OpConstant %float 0.0179999992
+ %254 = OpConstantComposite %v3float %float_0_0179999992 %float_0_0179999992 %float_0_0179999992
+%float_0_449999988 = OpConstant %float 0.449999988
+ %256 = OpConstantComposite %v3float %float_0_449999988 %float_0_449999988 %float_0_449999988
+%float_1_09899998 = OpConstant %float 1.09899998
+ %258 = OpConstantComposite %v3float %float_1_09899998 %float_1_09899998 %float_1_09899998
+%float_0_0989999995 = OpConstant %float 0.0989999995
+ %260 = OpConstantComposite %v3float %float_0_0989999995 %float_0_0989999995 %float_0_0989999995
+ %float_1_5 = OpConstant %float 1.5
+ %262 = OpConstantComposite %v3float %float_1_5 %float_1_5 %float_1_5
+ %263 = OpConstantComposite %v3float %float_0_159301758 %float_0_159301758 %float_0_159301758
+ %264 = OpConstantComposite %v3float %float_78_84375 %float_78_84375 %float_78_84375
+%float_1_00055635 = OpConstant %float 1.00055635
+ %float_7000 = OpConstant %float 7000
+%float_0_244063005 = OpConstant %float 0.244063005
+%float_99_1100006 = OpConstant %float 99.1100006
+%float_2967800 = OpConstant %float 2967800
+%float_0_237039998 = OpConstant %float 0.237039998
+%float_247_479996 = OpConstant %float 247.479996
+%float_1901800 = OpConstant %float 1901800
+ %float_n3 = OpConstant %float -3
+%float_2_86999989 = OpConstant %float 2.86999989
+%float_0_275000006 = OpConstant %float 0.275000006
+%float_0_860117733 = OpConstant %float 0.860117733
+%float_0_000154118257 = OpConstant %float 0.000154118257
+%float_1_28641219en07 = OpConstant %float 1.28641219e-07
+%float_0_00084242021 = OpConstant %float 0.00084242021
+%float_7_08145137en07 = OpConstant %float 7.08145137e-07
+%float_0_317398727 = OpConstant %float 0.317398727
+
+; HACK: Needed to hack this constant since MSVC and GNU libc are off by 1 ULP when converting to string (it probably still works fine though in a roundtrip ...)
+%float_4_22806261en05 = OpConstant %float 4.25
+
+%float_4_20481676en08 = OpConstant %float 4.20481676e-08
+%float_2_8974182en05 = OpConstant %float 2.8974182e-05
+%float_1_61456057en07 = OpConstant %float 1.61456057e-07
+ %float_8 = OpConstant %float 8
+ %float_4 = OpConstant %float 4
+%float_0_895099998 = OpConstant %float 0.895099998
+%float_0_266400009 = OpConstant %float 0.266400009
+%float_n0_161400005 = OpConstant %float -0.161400005
+%float_n0_750199974 = OpConstant %float -0.750199974
+%float_1_71350002 = OpConstant %float 1.71350002
+%float_0_0366999991 = OpConstant %float 0.0366999991
+%float_0_0388999991 = OpConstant %float 0.0388999991
+%float_n0_0684999973 = OpConstant %float -0.0684999973
+%float_1_02960002 = OpConstant %float 1.02960002
+%float_0_986992896 = OpConstant %float 0.986992896
+%float_n0_1470543 = OpConstant %float -0.1470543
+%float_0_159962699 = OpConstant %float 0.159962699
+%float_0_432305306 = OpConstant %float 0.432305306
+%float_0_518360317 = OpConstant %float 0.518360317
+%float_0_0492912009 = OpConstant %float 0.0492912009
+%float_n0_0085287001 = OpConstant %float -0.0085287001
+%float_0_040042799 = OpConstant %float 0.040042799
+%float_0_968486726 = OpConstant %float 0.968486726
+%float_5_55555534 = OpConstant %float 5.55555534
+ %307 = OpConstantComposite %v3float %float_5_55555534 %float_5_55555534 %float_5_55555534
+%float_1_00000001en10 = OpConstant %float 1.00000001e-10
+%float_0_00999999978 = OpConstant %float 0.00999999978
+%float_0_666666687 = OpConstant %float 0.666666687
+ %float_180 = OpConstant %float 180
+ %float_360 = OpConstant %float 360
+%float_65535 = OpConstant %float 65535
+ %314 = OpConstantComposite %v3float %float_65535 %float_65535 %float_65535
+%float_n4_97062206 = OpConstant %float -4.97062206
+%float_n3_02937818 = OpConstant %float -3.02937818
+%float_n2_12619996 = OpConstant %float -2.12619996
+%float_n1_51049995 = OpConstant %float -1.51049995
+%float_n1_05780005 = OpConstant %float -1.05780005
+%float_n0_466800004 = OpConstant %float -0.466800004
+%float_0_119379997 = OpConstant %float 0.119379997
+%float_0_708813429 = OpConstant %float 0.708813429
+%float_1_29118657 = OpConstant %float 1.29118657
+%float_0_808913231 = OpConstant %float 0.808913231
+%float_1_19108677 = OpConstant %float 1.19108677
+%float_1_56830001 = OpConstant %float 1.56830001
+%float_1_9483 = OpConstant %float 1.9483
+%float_2_30830002 = OpConstant %float 2.30830002
+%float_2_63840008 = OpConstant %float 2.63840008
+%float_2_85949993 = OpConstant %float 2.85949993
+%float_2_98726082 = OpConstant %float 2.98726082
+%float_3_01273918 = OpConstant %float 3.01273918
+%float_0_179999992 = OpConstant %float 0.179999992
+%float_9_99999975en05 = OpConstant %float 9.99999975e-05
+ %float_1000 = OpConstant %float 1000
+%float_0_0599999987 = OpConstant %float 0.0599999987
+%float_3_50738446en05 = OpConstant %float 3.50738446e-05
+ %338 = OpConstantComposite %v3float %float_3_50738446en05 %float_3_50738446en05 %float_3_50738446en05
+%float_n2_30102992 = OpConstant %float -2.30102992
+%float_n1_93120003 = OpConstant %float -1.93120003
+%float_n1_52049994 = OpConstant %float -1.52049994
+%float_0_801995218 = OpConstant %float 0.801995218
+%float_1_19800484 = OpConstant %float 1.19800484
+%float_1_59430003 = OpConstant %float 1.59430003
+%float_1_99730003 = OpConstant %float 1.99730003
+%float_2_37829995 = OpConstant %float 2.37829995
+%float_2_76839995 = OpConstant %float 2.76839995
+%float_3_05150008 = OpConstant %float 3.05150008
+%float_3_27462935 = OpConstant %float 3.27462935
+%float_3_32743073 = OpConstant %float 3.32743073
+%float_0_00499999989 = OpConstant %float 0.00499999989
+ %float_11 = OpConstant %float 11
+ %float_2000 = OpConstant %float 2000
+%float_0_119999997 = OpConstant %float 0.119999997
+%float_0_00313066994 = OpConstant %float 0.00313066994
+%float_12_9200001 = OpConstant %float 12.9200001
+%float_0_416666657 = OpConstant %float 0.416666657
+%float_1_05499995 = OpConstant %float 1.05499995
+%float_0_0549999997 = OpConstant %float 0.0549999997
+%float_n0_166666672 = OpConstant %float -0.166666672
+ %float_n0_5 = OpConstant %float -0.5
+%float_0_166666672 = OpConstant %float 0.166666672
+%float_n3_15737653 = OpConstant %float -3.15737653
+%float_n0_485249996 = OpConstant %float -0.485249996
+%float_1_84773242 = OpConstant %float 1.84773242
+%float_n0_718548238 = OpConstant %float -0.718548238
+%float_2_08103061 = OpConstant %float 2.08103061
+%float_3_6681242 = OpConstant %float 3.6681242
+ %float_18 = OpConstant %float 18
+ %float_7 = OpConstant %float 7
+%type__Globals = OpTypeStruct %v4float %v3float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %float %float %float %float %float %v3float %v4float %float %float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %float %float %uint %uint %float %float
+%_ptr_Uniform_type__Globals = OpTypePointer Uniform %type__Globals
+%_ptr_Input_v2float = OpTypePointer Input %v2float
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Input_uint = OpTypePointer Input %uint
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %377 = OpTypeFunction %void
+%_ptr_Function_float = OpTypePointer Function %float
+%_ptr_Uniform_uint = OpTypePointer Uniform %uint
+ %bool = OpTypeBool
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+ %v2bool = OpTypeVector %bool 2
+ %v3bool = OpTypeVector %bool 3
+ %uint_10 = OpConstant %uint 10
+%_arr_float_uint_10 = OpTypeArray %float %uint_10
+%_arr_float_uint_6 = OpTypeArray %float %uint_6
+ %_Globals = OpVariable %_ptr_Uniform_type__Globals Uniform
+%in_var_TEXCOORD0 = OpVariable %_ptr_Input_v2float Input
+%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
+ %gl_Layer = OpVariable %_ptr_Input_uint Input
+%out_var_SV_Target0 = OpVariable %_ptr_Output_v4float Output
+%_ptr_Function__arr_float_uint_6 = OpTypePointer Function %_arr_float_uint_6
+%_ptr_Function__arr_float_uint_10 = OpTypePointer Function %_arr_float_uint_10
+ %391 = OpUndef %v3float
+ %392 = OpConstantComposite %v3float %float_0_952552378 %float_0 %float_9_36786018en05
+ %393 = OpConstantComposite %v3float %float_0_343966454 %float_0_728166103 %float_n0_0721325427
+ %394 = OpConstantComposite %v3float %float_0 %float_0 %float_1_00882518
+ %395 = OpConstantComposite %mat3v3float %392 %393 %394
+ %396 = OpConstantComposite %v3float %float_1_04981101 %float_0 %float_n9_74845025en05
+ %397 = OpConstantComposite %v3float %float_n0_495903015 %float_1_37331307 %float_0_0982400328
+ %398 = OpConstantComposite %v3float %float_0 %float_0 %float_0_991252005
+ %399 = OpConstantComposite %mat3v3float %396 %397 %398
+ %400 = OpConstantComposite %v3float %float_0_662454188 %float_0_134004205 %float_0_156187683
+ %401 = OpConstantComposite %v3float %float_n0_00557464967 %float_0_0040607336 %float_1_01033914
+ %402 = OpConstantComposite %mat3v3float %400 %67 %401
+ %403 = OpConstantComposite %v3float %float_1_6410234 %float_n0_324803293 %float_n0_236424699
+ %404 = OpConstantComposite %v3float %float_n0_663662851 %float_1_61533165 %float_0_0167563483
+ %405 = OpConstantComposite %v3float %float_0_0117218941 %float_n0_00828444213 %float_0_988394856
+ %406 = OpConstantComposite %mat3v3float %403 %404 %405
+ %407 = OpConstantComposite %v3float %float_1_45143926 %float_n0_236510754 %float_n0_214928567
+ %408 = OpConstantComposite %v3float %float_n0_0765537769 %float_1_17622972 %float_n0_0996759236
+ %409 = OpConstantComposite %v3float %float_0_00831614807 %float_n0_00603244966 %float_0_997716308
+ %410 = OpConstantComposite %mat3v3float %407 %408 %409
+ %411 = OpConstantComposite %v3float %float_0_695452213 %float_0_140678704 %float_0_163869068
+ %412 = OpConstantComposite %v3float %float_0_0447945632 %float_0_859671116 %float_0_0955343172
+ %413 = OpConstantComposite %v3float %float_n0_00552588282 %float_0_00402521016 %float_1_00150073
+ %414 = OpConstantComposite %mat3v3float %411 %412 %413
+ %415 = OpConstantComposite %v3float %float_3_2409699 %float_n1_5373832 %float_n0_498610765
+ %416 = OpConstantComposite %v3float %float_n0_969243646 %float_1_8759675 %float_0_0415550582
+ %417 = OpConstantComposite %v3float %float_0_0556300804 %float_n0_203976959 %float_1_05697155
+ %418 = OpConstantComposite %mat3v3float %415 %416 %417
+ %419 = OpConstantComposite %v3float %float_0_412456393 %float_0_357576102 %float_0_180437505
+ %420 = OpConstantComposite %v3float %float_0_212672904 %float_0_715152204 %float_0_0721750036
+ %421 = OpConstantComposite %v3float %float_0_0193339009 %float_0_119191997 %float_0_950304091
+ %422 = OpConstantComposite %mat3v3float %419 %420 %421
+ %423 = OpConstantComposite %v3float %float_1_71660841 %float_n0_355662107 %float_n0_253360093
+ %424 = OpConstantComposite %v3float %float_n0_666682899 %float_1_61647761 %float_0_0157685
+ %425 = OpConstantComposite %v3float %float_0_0176422 %float_n0_0427763015 %float_0_942228675
+ %426 = OpConstantComposite %mat3v3float %423 %424 %425
+ %427 = OpConstantComposite %v3float %float_2_49339628 %float_n0_93134588 %float_n0_402694494
+ %428 = OpConstantComposite %v3float %float_n0_829486787 %float_1_76265967 %float_0_0236246008
+ %429 = OpConstantComposite %v3float %float_0_0358507 %float_n0_0761827007 %float_0_957014024
+ %430 = OpConstantComposite %mat3v3float %427 %428 %429
+ %431 = OpConstantComposite %v3float %float_1_01303005 %float_0_00610530982 %float_n0_0149710001
+ %432 = OpConstantComposite %v3float %float_0_00769822998 %float_0_998165011 %float_n0_00503202993
+ %433 = OpConstantComposite %v3float %float_n0_00284131011 %float_0_00468515977 %float_0_924507022
+ %434 = OpConstantComposite %mat3v3float %431 %432 %433
+ %435 = OpConstantComposite %v3float %float_0_987223983 %float_n0_00611326983 %float_0_0159533005
+ %436 = OpConstantComposite %v3float %float_n0_00759836007 %float_1_00186002 %float_0_0053300201
+ %437 = OpConstantComposite %v3float %float_0_00307257008 %float_n0_00509594986 %float_1_08168006
+ %438 = OpConstantComposite %mat3v3float %435 %436 %437
+ %439 = OpConstantComposite %v3float %float_0_5 %float_n1 %float_0_5
+ %440 = OpConstantComposite %v3float %float_n1 %float_1 %float_0_5
+ %441 = OpConstantComposite %v3float %float_0_5 %float_0 %float_0
+ %442 = OpConstantComposite %mat3v3float %439 %440 %441
+ %443 = OpConstantComposite %v3float %float_1 %float_0 %float_0
+ %444 = OpConstantComposite %v3float %float_0 %float_1 %float_0
+ %445 = OpConstantComposite %v3float %float_0 %float_0 %float_1
+ %446 = OpConstantComposite %mat3v3float %443 %444 %445
+%float_n6_07624626 = OpConstant %float -6.07624626
+ %448 = OpConstantComposite %v3float %float_n6_07624626 %float_n6_07624626 %float_n6_07624626
+ %449 = OpConstantComposite %v3float %float_0_895099998 %float_0_266400009 %float_n0_161400005
+ %450 = OpConstantComposite %v3float %float_n0_750199974 %float_1_71350002 %float_0_0366999991
+ %451 = OpConstantComposite %v3float %float_0_0388999991 %float_n0_0684999973 %float_1_02960002
+ %452 = OpConstantComposite %mat3v3float %449 %450 %451
+ %453 = OpConstantComposite %v3float %float_0_986992896 %float_n0_1470543 %float_0_159962699
+ %454 = OpConstantComposite %v3float %float_0_432305306 %float_0_518360317 %float_0_0492912009
+ %455 = OpConstantComposite %v3float %float_n0_0085287001 %float_0_040042799 %float_0_968486726
+ %456 = OpConstantComposite %mat3v3float %453 %454 %455
+%float_0_358299971 = OpConstant %float 0.358299971
+ %458 = OpConstantComposite %v3float %float_0_544169128 %float_0_239592597 %float_0_166694298
+ %459 = OpConstantComposite %v3float %float_0_239465594 %float_0_702153027 %float_0_058381401
+ %460 = OpConstantComposite %v3float %float_n0_00234390004 %float_0_0361833982 %float_1_05521834
+ %461 = OpConstantComposite %mat3v3float %458 %459 %460
+ %462 = OpConstantComposite %v3float %float_0_940437257 %float_n0_0183068793 %float_0_077869609
+ %463 = OpConstantComposite %v3float %float_0_00837869663 %float_0_828660011 %float_0_162961304
+ %464 = OpConstantComposite %v3float %float_0_00054712611 %float_n0_000883374596 %float_1_00033629
+ %465 = OpConstantComposite %mat3v3float %462 %463 %464
+ %466 = OpConstantComposite %v3float %float_1_06317997 %float_0_0233955998 %float_n0_0865726024
+ %467 = OpConstantComposite %v3float %float_n0_0106336996 %float_1_20632005 %float_n0_195690006
+ %468 = OpConstantComposite %v3float %float_n0_000590886979 %float_0_00105247996 %float_0_999538004
+ %469 = OpConstantComposite %mat3v3float %466 %467 %468
+%float_0_0533333346 = OpConstant %float 0.0533333346
+%float_0_159999996 = OpConstant %float 0.159999996
+%float_57_2957764 = OpConstant %float 57.2957764
+%float_n67_5 = OpConstant %float -67.5
+ %float_67_5 = OpConstant %float 67.5
+ %475 = OpConstantComposite %_arr_float_uint_6 %float_n4 %float_n4 %float_n3_15737653 %float_n0_485249996 %float_1_84773242 %float_1_84773242
+ %476 = OpConstantComposite %_arr_float_uint_6 %float_n0_718548238 %float_2_08103061 %float_3_6681242 %float_4 %float_4 %float_4
+ %float_n15 = OpConstant %float -15
+ %float_n14 = OpConstant %float -14
+ %479 = OpConstantComposite %_arr_float_uint_10 %float_n4_97062206 %float_n3_02937818 %float_n2_12619996 %float_n1_51049995 %float_n1_05780005 %float_n0_466800004 %float_0_119379997 %float_0_708813429 %float_1_29118657 %float_1_29118657
+ %480 = OpConstantComposite %_arr_float_uint_10 %float_0_808913231 %float_1_19108677 %float_1_56830001 %float_1_9483 %float_2_30830002 %float_2_63840008 %float_2_85949993 %float_2_98726082 %float_3_01273918 %float_3_01273918
+ %float_n12 = OpConstant %float -12
+ %482 = OpConstantComposite %_arr_float_uint_10 %float_n2_30102992 %float_n2_30102992 %float_n1_93120003 %float_n1_52049994 %float_n1_05780005 %float_n0_466800004 %float_0_119379997 %float_0_708813429 %float_1_29118657 %float_1_29118657
+ %483 = OpConstantComposite %_arr_float_uint_10 %float_0_801995218 %float_1_19800484 %float_1_59430003 %float_1_99730003 %float_2_37829995 %float_2_76839995 %float_3_05150008 %float_3_27462935 %float_3_32743073 %float_3_32743073
+%float_0_0322580636 = OpConstant %float 0.0322580636
+%float_1_03225803 = OpConstant %float 1.03225803
+ %486 = OpConstantComposite %v2float %float_1_03225803 %float_1_03225803
+%float_4_60443853e_09 = OpConstant %float 4.60443853e+09
+%float_2_00528435e_09 = OpConstant %float 2.00528435e+09
+%float_0_333333343 = OpConstant %float 0.333333343
+ %float_5 = OpConstant %float 5
+ %float_2_5 = OpConstant %float 2.5
+%float_0_0250000004 = OpConstant %float 0.0250000004
+%float_0_239999995 = OpConstant %float 0.239999995
+%float_0_0148148146 = OpConstant %float 0.0148148146
+%float_0_819999993 = OpConstant %float 0.819999993
+ %496 = OpConstantComposite %v3float %float_9_99999975en05 %float_9_99999975en05 %float_9_99999975en05
+%float_0_0296296291 = OpConstant %float 0.0296296291
+%float_0_952381015 = OpConstant %float 0.952381015
+ %499 = OpConstantComposite %v3float %float_0_952381015 %float_0_952381015 %float_0_952381015
+ %MainPS = OpFunction %void None %377
+ %500 = OpLabel
+ %501 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %502 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %503 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %504 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %505 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %506 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %507 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %508 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %509 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %510 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %511 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %512 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %513 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %514 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %515 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %516 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %517 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %518 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %519 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %520 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %521 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %522 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %523 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %524 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %525 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %526 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %527 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %528 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %529 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %530 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %531 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %532 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %533 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %534 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %535 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %536 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %537 = OpLoad %v2float %in_var_TEXCOORD0
+ %538 = OpLoad %uint %gl_Layer
+ %539 = OpFSub %v2float %537 %128
+ %540 = OpFMul %v2float %539 %486
+ %541 = OpCompositeExtract %float %540 0
+ %542 = OpCompositeExtract %float %540 1
+ %543 = OpConvertUToF %float %538
+ %544 = OpFMul %float %543 %float_0_0322580636
+ %545 = OpCompositeConstruct %v4float %541 %542 %544 %float_0
+ %546 = OpMatrixTimesMatrix %mat3v3float %422 %434
+ %547 = OpMatrixTimesMatrix %mat3v3float %546 %406
+ %548 = OpMatrixTimesMatrix %mat3v3float %402 %438
+ %549 = OpMatrixTimesMatrix %mat3v3float %548 %418
+ %550 = OpMatrixTimesMatrix %mat3v3float %395 %406
+ %551 = OpMatrixTimesMatrix %mat3v3float %402 %399
+ %552 = OpAccessChain %_ptr_Uniform_uint %_Globals %int_42
+ %553 = OpLoad %uint %552
+ OpBranch %554
+ %554 = OpLabel
+ OpLoopMerge %555 %556 None
+ OpBranch %557
+ %557 = OpLabel
+ %558 = OpMatrixTimesMatrix %mat3v3float %548 %430
+ %559 = OpMatrixTimesMatrix %mat3v3float %548 %426
+ %560 = OpIEqual %bool %553 %uint_1
+ OpSelectionMerge %561 None
+ OpBranchConditional %560 %562 %563
+ %563 = OpLabel
+ %564 = OpIEqual %bool %553 %uint_2
+ OpSelectionMerge %565 None
+ OpBranchConditional %564 %566 %567
+ %567 = OpLabel
+ %568 = OpIEqual %bool %553 %uint_3
+ OpSelectionMerge %569 None
+ OpBranchConditional %568 %570 %571
+ %571 = OpLabel
+ %572 = OpIEqual %bool %553 %uint_4
+ OpSelectionMerge %573 None
+ OpBranchConditional %572 %574 %575
+ %575 = OpLabel
+ OpBranch %555
+ %574 = OpLabel
+ OpBranch %555
+ %573 = OpLabel
+ OpUnreachable
+ %570 = OpLabel
+ OpBranch %555
+ %569 = OpLabel
+ OpUnreachable
+ %566 = OpLabel
+ OpBranch %555
+ %565 = OpLabel
+ OpUnreachable
+ %562 = OpLabel
+ OpBranch %555
+ %561 = OpLabel
+ OpUnreachable
+ %556 = OpLabel
+ OpBranch %554
+ %555 = OpLabel
+ %576 = OpPhi %mat3v3float %549 %575 %446 %574 %414 %570 %559 %566 %558 %562
+ %577 = OpVectorShuffle %v3float %545 %545 0 1 2
+ %578 = OpAccessChain %_ptr_Uniform_uint %_Globals %int_41
+ %579 = OpLoad %uint %578
+ %580 = OpUGreaterThanEqual %bool %579 %uint_3
+ OpSelectionMerge %581 None
+ OpBranchConditional %580 %582 %583
+ %583 = OpLabel
+ %584 = OpFSub %v3float %577 %192
+ %585 = OpFMul %v3float %584 %193
+ %586 = OpExtInst %v3float %1 Exp2 %585
+ %587 = OpFMul %v3float %586 %194
+ %588 = OpExtInst %v3float %1 Exp2 %448
+ %589 = OpFMul %v3float %588 %194
+ %590 = OpFSub %v3float %587 %589
+ OpBranch %581
+ %582 = OpLabel
+ %591 = OpExtInst %v3float %1 Pow %577 %182
+ %592 = OpFSub %v3float %591 %183
+ %593 = OpExtInst %v3float %1 FMax %132 %592
+ %594 = OpFMul %v3float %185 %591
+ %595 = OpFSub %v3float %184 %594
+ %596 = OpFDiv %v3float %593 %595
+ %597 = OpExtInst %v3float %1 Pow %596 %187
+ %598 = OpFMul %v3float %597 %188
+ OpBranch %581
+ %581 = OpLabel
+ %599 = OpPhi %v3float %590 %583 %598 %582
+ %600 = OpAccessChain %_ptr_Uniform_float %_Globals %int_17
+ %601 = OpLoad %float %600
+ %602 = OpFMul %float %601 %float_1_00055635
+ %603 = OpFOrdLessThanEqual %bool %602 %float_7000
+ %604 = OpFDiv %float %float_4_60443853e_09 %601
+ %605 = OpFSub %float %float_2967800 %604
+ %606 = OpFDiv %float %605 %602
+ %607 = OpFAdd %float %float_99_1100006 %606
+ %608 = OpFDiv %float %607 %602
+ %609 = OpFAdd %float %float_0_244063005 %608
+ %610 = OpFDiv %float %float_2_00528435e_09 %601
+ %611 = OpFSub %float %float_1901800 %610
+ %612 = OpFDiv %float %611 %602
+ %613 = OpFAdd %float %float_247_479996 %612
+ %614 = OpFDiv %float %613 %602
+ %615 = OpFAdd %float %float_0_237039998 %614
+ %616 = OpSelect %float %603 %609 %615
+ %617 = OpFMul %float %float_n3 %616
+ %618 = OpFMul %float %617 %616
+ %619 = OpFMul %float %float_2_86999989 %616
+ %620 = OpFAdd %float %618 %619
+ %621 = OpFSub %float %620 %float_0_275000006
+ %622 = OpCompositeConstruct %v2float %616 %621
+ %623 = OpFMul %float %float_0_000154118257 %601
+ %624 = OpFAdd %float %float_0_860117733 %623
+ %625 = OpFMul %float %float_1_28641219en07 %601
+ %626 = OpFMul %float %625 %601
+ %627 = OpFAdd %float %624 %626
+ %628 = OpFMul %float %float_0_00084242021 %601
+ %629 = OpFAdd %float %float_1 %628
+ %630 = OpFMul %float %float_7_08145137en07 %601
+ %631 = OpFMul %float %630 %601
+ %632 = OpFAdd %float %629 %631
+ %633 = OpFDiv %float %627 %632
+ %634 = OpFMul %float %float_4_22806261en05 %601
+ %635 = OpFAdd %float %float_0_317398727 %634
+ %636 = OpFMul %float %float_4_20481676en08 %601
+ %637 = OpFMul %float %636 %601
+ %638 = OpFAdd %float %635 %637
+ %639 = OpFMul %float %float_2_8974182en05 %601
+ %640 = OpFSub %float %float_1 %639
+ %641 = OpFMul %float %float_1_61456057en07 %601
+ %642 = OpFMul %float %641 %601
+ %643 = OpFAdd %float %640 %642
+ %644 = OpFDiv %float %638 %643
+ %645 = OpFMul %float %float_3 %633
+ %646 = OpFMul %float %float_2 %633
+ %647 = OpFMul %float %float_8 %644
+ %648 = OpFSub %float %646 %647
+ %649 = OpFAdd %float %648 %float_4
+ %650 = OpFDiv %float %645 %649
+ %651 = OpFMul %float %float_2 %644
+ %652 = OpFDiv %float %651 %649
+ %653 = OpCompositeConstruct %v2float %650 %652
+ %654 = OpFOrdLessThan %bool %601 %float_4000
+ %655 = OpCompositeConstruct %v2bool %654 %654
+ %656 = OpSelect %v2float %655 %653 %622
+ %657 = OpAccessChain %_ptr_Uniform_float %_Globals %int_18
+ %658 = OpLoad %float %657
+ %659 = OpCompositeConstruct %v2float %633 %644
+ %660 = OpExtInst %v2float %1 Normalize %659
+ %661 = OpCompositeExtract %float %660 1
+ %662 = OpFNegate %float %661
+ %663 = OpFMul %float %662 %658
+ %664 = OpFMul %float %663 %float_0_0500000007
+ %665 = OpFAdd %float %633 %664
+ %666 = OpCompositeExtract %float %660 0
+ %667 = OpFMul %float %666 %658
+ %668 = OpFMul %float %667 %float_0_0500000007
+ %669 = OpFAdd %float %644 %668
+ %670 = OpFMul %float %float_3 %665
+ %671 = OpFMul %float %float_2 %665
+ %672 = OpFMul %float %float_8 %669
+ %673 = OpFSub %float %671 %672
+ %674 = OpFAdd %float %673 %float_4
+ %675 = OpFDiv %float %670 %674
+ %676 = OpFMul %float %float_2 %669
+ %677 = OpFDiv %float %676 %674
+ %678 = OpCompositeConstruct %v2float %675 %677
+ %679 = OpFSub %v2float %678 %653
+ %680 = OpFAdd %v2float %656 %679
+ %681 = OpCompositeExtract %float %680 0
+ %682 = OpCompositeExtract %float %680 1
+ %683 = OpExtInst %float %1 FMax %682 %float_1_00000001en10
+ %684 = OpFDiv %float %681 %683
+ %685 = OpCompositeInsert %v3float %684 %391 0
+ %686 = OpCompositeInsert %v3float %float_1 %685 1
+ %687 = OpFSub %float %float_1 %681
+ %688 = OpFSub %float %687 %682
+ %689 = OpFDiv %float %688 %683
+ %690 = OpCompositeInsert %v3float %689 %686 2
+ %691 = OpExtInst %float %1 FMax %float_0_328999996 %float_1_00000001en10
+ %692 = OpFDiv %float %float_0_312700003 %691
+ %693 = OpCompositeInsert %v3float %692 %391 0
+ %694 = OpCompositeInsert %v3float %float_1 %693 1
+ %695 = OpFDiv %float %float_0_358299971 %691
+ %696 = OpCompositeInsert %v3float %695 %694 2
+ %697 = OpVectorTimesMatrix %v3float %690 %452
+ %698 = OpVectorTimesMatrix %v3float %696 %452
+ %699 = OpCompositeExtract %float %698 0
+ %700 = OpCompositeExtract %float %697 0
+ %701 = OpFDiv %float %699 %700
+ %702 = OpCompositeConstruct %v3float %701 %float_0 %float_0
+ %703 = OpCompositeExtract %float %698 1
+ %704 = OpCompositeExtract %float %697 1
+ %705 = OpFDiv %float %703 %704
+ %706 = OpCompositeConstruct %v3float %float_0 %705 %float_0
+ %707 = OpCompositeExtract %float %698 2
+ %708 = OpCompositeExtract %float %697 2
+ %709 = OpFDiv %float %707 %708
+ %710 = OpCompositeConstruct %v3float %float_0 %float_0 %709
+ %711 = OpCompositeConstruct %mat3v3float %702 %706 %710
+ %712 = OpMatrixTimesMatrix %mat3v3float %452 %711
+ %713 = OpMatrixTimesMatrix %mat3v3float %712 %456
+ %714 = OpMatrixTimesMatrix %mat3v3float %422 %713
+ %715 = OpMatrixTimesMatrix %mat3v3float %714 %418
+ %716 = OpVectorTimesMatrix %v3float %599 %715
+ %717 = OpVectorTimesMatrix %v3float %716 %547
+ %718 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_9
+ %719 = OpAccessChain %_ptr_Uniform_float %_Globals %int_9 %int_3
+ %720 = OpLoad %float %719
+ %721 = OpFOrdNotEqual %bool %720 %float_0
+ OpSelectionMerge %722 None
+ OpBranchConditional %721 %723 %722
+ %723 = OpLabel
+ %724 = OpDot %float %717 %67
+ %725 = OpCompositeConstruct %v3float %724 %724 %724
+ %726 = OpFDiv %v3float %717 %725
+ %727 = OpFSub %v3float %726 %135
+ %728 = OpDot %float %727 %727
+ %729 = OpFMul %float %float_n4 %728
+ %730 = OpExtInst %float %1 Exp2 %729
+ %731 = OpFSub %float %float_1 %730
+ %732 = OpAccessChain %_ptr_Uniform_float %_Globals %int_44
+ %733 = OpLoad %float %732
+ %734 = OpFMul %float %float_n4 %733
+ %735 = OpFMul %float %734 %724
+ %736 = OpFMul %float %735 %724
+ %737 = OpExtInst %float %1 Exp2 %736
+ %738 = OpFSub %float %float_1 %737
+ %739 = OpFMul %float %731 %738
+ %740 = OpMatrixTimesMatrix %mat3v3float %461 %406
+ %741 = OpMatrixTimesMatrix %mat3v3float %549 %740
+ %742 = OpVectorTimesMatrix %v3float %717 %741
+ %743 = OpCompositeConstruct %v3float %739 %739 %739
+ %744 = OpExtInst %v3float %1 FMix %717 %742 %743
+ OpBranch %722
+ %722 = OpLabel
+ %745 = OpPhi %v3float %717 %581 %744 %723
+ %746 = OpDot %float %745 %67
+ %747 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_24
+ %748 = OpLoad %v4float %747
+ %749 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_19
+ %750 = OpLoad %v4float %749
+ %751 = OpFMul %v4float %748 %750
+ %752 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_25
+ %753 = OpLoad %v4float %752
+ %754 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_20
+ %755 = OpLoad %v4float %754
+ %756 = OpFMul %v4float %753 %755
+ %757 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_26
+ %758 = OpLoad %v4float %757
+ %759 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_21
+ %760 = OpLoad %v4float %759
+ %761 = OpFMul %v4float %758 %760
+ %762 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_27
+ %763 = OpLoad %v4float %762
+ %764 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_22
+ %765 = OpLoad %v4float %764
+ %766 = OpFMul %v4float %763 %765
+ %767 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_28
+ %768 = OpLoad %v4float %767
+ %769 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_23
+ %770 = OpLoad %v4float %769
+ %771 = OpFAdd %v4float %768 %770
+ %772 = OpCompositeConstruct %v3float %746 %746 %746
+ %773 = OpVectorShuffle %v3float %751 %751 0 1 2
+ %774 = OpCompositeExtract %float %751 3
+ %775 = OpCompositeConstruct %v3float %774 %774 %774
+ %776 = OpFMul %v3float %773 %775
+ %777 = OpExtInst %v3float %1 FMix %772 %745 %776
+ %778 = OpExtInst %v3float %1 FMax %132 %777
+ %779 = OpFMul %v3float %778 %307
+ %780 = OpVectorShuffle %v3float %756 %756 0 1 2
+ %781 = OpCompositeExtract %float %756 3
+ %782 = OpCompositeConstruct %v3float %781 %781 %781
+ %783 = OpFMul %v3float %780 %782
+ %784 = OpExtInst %v3float %1 Pow %779 %783
+ %785 = OpFMul %v3float %784 %194
+ %786 = OpVectorShuffle %v3float %761 %761 0 1 2
+ %787 = OpCompositeExtract %float %761 3
+ %788 = OpCompositeConstruct %v3float %787 %787 %787
+ %789 = OpFMul %v3float %786 %788
+ %790 = OpFDiv %v3float %135 %789
+ %791 = OpExtInst %v3float %1 Pow %785 %790
+ %792 = OpVectorShuffle %v3float %766 %766 0 1 2
+ %793 = OpCompositeExtract %float %766 3
+ %794 = OpCompositeConstruct %v3float %793 %793 %793
+ %795 = OpFMul %v3float %792 %794
+ %796 = OpFMul %v3float %791 %795
+ %797 = OpVectorShuffle %v3float %771 %771 0 1 2
+ %798 = OpCompositeExtract %float %771 3
+ %799 = OpCompositeConstruct %v3float %798 %798 %798
+ %800 = OpFAdd %v3float %797 %799
+ %801 = OpFAdd %v3float %796 %800
+ %802 = OpAccessChain %_ptr_Uniform_float %_Globals %int_39
+ %803 = OpLoad %float %802
+ %804 = OpExtInst %float %1 SmoothStep %float_0 %803 %746
+ %805 = OpFSub %float %float_1 %804
+ %806 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_34
+ %807 = OpLoad %v4float %806
+ %808 = OpFMul %v4float %807 %750
+ %809 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_35
+ %810 = OpLoad %v4float %809
+ %811 = OpFMul %v4float %810 %755
+ %812 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_36
+ %813 = OpLoad %v4float %812
+ %814 = OpFMul %v4float %813 %760
+ %815 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_37
+ %816 = OpLoad %v4float %815
+ %817 = OpFMul %v4float %816 %765
+ %818 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_38
+ %819 = OpLoad %v4float %818
+ %820 = OpFAdd %v4float %819 %770
+ %821 = OpVectorShuffle %v3float %808 %808 0 1 2
+ %822 = OpCompositeExtract %float %808 3
+ %823 = OpCompositeConstruct %v3float %822 %822 %822
+ %824 = OpFMul %v3float %821 %823
+ %825 = OpExtInst %v3float %1 FMix %772 %745 %824
+ %826 = OpExtInst %v3float %1 FMax %132 %825
+ %827 = OpFMul %v3float %826 %307
+ %828 = OpVectorShuffle %v3float %811 %811 0 1 2
+ %829 = OpCompositeExtract %float %811 3
+ %830 = OpCompositeConstruct %v3float %829 %829 %829
+ %831 = OpFMul %v3float %828 %830
+ %832 = OpExtInst %v3float %1 Pow %827 %831
+ %833 = OpFMul %v3float %832 %194
+ %834 = OpVectorShuffle %v3float %814 %814 0 1 2
+ %835 = OpCompositeExtract %float %814 3
+ %836 = OpCompositeConstruct %v3float %835 %835 %835
+ %837 = OpFMul %v3float %834 %836
+ %838 = OpFDiv %v3float %135 %837
+ %839 = OpExtInst %v3float %1 Pow %833 %838
+ %840 = OpVectorShuffle %v3float %817 %817 0 1 2
+ %841 = OpCompositeExtract %float %817 3
+ %842 = OpCompositeConstruct %v3float %841 %841 %841
+ %843 = OpFMul %v3float %840 %842
+ %844 = OpFMul %v3float %839 %843
+ %845 = OpVectorShuffle %v3float %820 %820 0 1 2
+ %846 = OpCompositeExtract %float %820 3
+ %847 = OpCompositeConstruct %v3float %846 %846 %846
+ %848 = OpFAdd %v3float %845 %847
+ %849 = OpFAdd %v3float %844 %848
+ %850 = OpAccessChain %_ptr_Uniform_float %_Globals %int_40
+ %851 = OpLoad %float %850
+ %852 = OpExtInst %float %1 SmoothStep %851 %float_1 %746
+ %853 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_29
+ %854 = OpLoad %v4float %853
+ %855 = OpFMul %v4float %854 %750
+ %856 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_30
+ %857 = OpLoad %v4float %856
+ %858 = OpFMul %v4float %857 %755
+ %859 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_31
+ %860 = OpLoad %v4float %859
+ %861 = OpFMul %v4float %860 %760
+ %862 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_32
+ %863 = OpLoad %v4float %862
+ %864 = OpFMul %v4float %863 %765
+ %865 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_33
+ %866 = OpLoad %v4float %865
+ %867 = OpFAdd %v4float %866 %770
+ %868 = OpVectorShuffle %v3float %855 %855 0 1 2
+ %869 = OpCompositeExtract %float %855 3
+ %870 = OpCompositeConstruct %v3float %869 %869 %869
+ %871 = OpFMul %v3float %868 %870
+ %872 = OpExtInst %v3float %1 FMix %772 %745 %871
+ %873 = OpExtInst %v3float %1 FMax %132 %872
+ %874 = OpFMul %v3float %873 %307
+ %875 = OpVectorShuffle %v3float %858 %858 0 1 2
+ %876 = OpCompositeExtract %float %858 3
+ %877 = OpCompositeConstruct %v3float %876 %876 %876
+ %878 = OpFMul %v3float %875 %877
+ %879 = OpExtInst %v3float %1 Pow %874 %878
+ %880 = OpFMul %v3float %879 %194
+ %881 = OpVectorShuffle %v3float %861 %861 0 1 2
+ %882 = OpCompositeExtract %float %861 3
+ %883 = OpCompositeConstruct %v3float %882 %882 %882
+ %884 = OpFMul %v3float %881 %883
+ %885 = OpFDiv %v3float %135 %884
+ %886 = OpExtInst %v3float %1 Pow %880 %885
+ %887 = OpVectorShuffle %v3float %864 %864 0 1 2
+ %888 = OpCompositeExtract %float %864 3
+ %889 = OpCompositeConstruct %v3float %888 %888 %888
+ %890 = OpFMul %v3float %887 %889
+ %891 = OpFMul %v3float %886 %890
+ %892 = OpVectorShuffle %v3float %867 %867 0 1 2
+ %893 = OpCompositeExtract %float %867 3
+ %894 = OpCompositeConstruct %v3float %893 %893 %893
+ %895 = OpFAdd %v3float %892 %894
+ %896 = OpFAdd %v3float %891 %895
+ %897 = OpFSub %float %804 %852
+ %898 = OpCompositeConstruct %v3float %805 %805 %805
+ %899 = OpFMul %v3float %801 %898
+ %900 = OpCompositeConstruct %v3float %897 %897 %897
+ %901 = OpFMul %v3float %896 %900
+ %902 = OpFAdd %v3float %899 %901
+ %903 = OpCompositeConstruct %v3float %852 %852 %852
+ %904 = OpFMul %v3float %849 %903
+ %905 = OpFAdd %v3float %902 %904
+ %906 = OpVectorTimesMatrix %v3float %905 %549
+ %907 = OpMatrixTimesMatrix %mat3v3float %551 %465
+ %908 = OpMatrixTimesMatrix %mat3v3float %907 %550
+ %909 = OpMatrixTimesMatrix %mat3v3float %551 %469
+ %910 = OpMatrixTimesMatrix %mat3v3float %909 %550
+ %911 = OpVectorTimesMatrix %v3float %905 %908
+ %912 = OpAccessChain %_ptr_Uniform_float %_Globals %int_43
+ %913 = OpLoad %float %912
+ %914 = OpCompositeConstruct %v3float %913 %913 %913
+ %915 = OpExtInst %v3float %1 FMix %905 %911 %914
+ %916 = OpVectorTimesMatrix %v3float %915 %551
+ %917 = OpCompositeExtract %float %916 0
+ %918 = OpCompositeExtract %float %916 1
+ %919 = OpExtInst %float %1 FMin %917 %918
+ %920 = OpCompositeExtract %float %916 2
+ %921 = OpExtInst %float %1 FMin %919 %920
+ %922 = OpExtInst %float %1 FMax %917 %918
+ %923 = OpExtInst %float %1 FMax %922 %920
+ %924 = OpExtInst %float %1 FMax %923 %float_1_00000001en10
+ %925 = OpExtInst %float %1 FMax %921 %float_1_00000001en10
+ %926 = OpFSub %float %924 %925
+ %927 = OpExtInst %float %1 FMax %923 %float_0_00999999978
+ %928 = OpFDiv %float %926 %927
+ %929 = OpFSub %float %920 %918
+ %930 = OpFMul %float %920 %929
+ %931 = OpFSub %float %918 %917
+ %932 = OpFMul %float %918 %931
+ %933 = OpFAdd %float %930 %932
+ %934 = OpFSub %float %917 %920
+ %935 = OpFMul %float %917 %934
+ %936 = OpFAdd %float %933 %935
+ %937 = OpExtInst %float %1 Sqrt %936
+ %938 = OpFAdd %float %920 %918
+ %939 = OpFAdd %float %938 %917
+ %940 = OpFMul %float %float_1_75 %937
+ %941 = OpFAdd %float %939 %940
+ %942 = OpFMul %float %941 %float_0_333333343
+ %943 = OpFSub %float %928 %float_0_400000006
+ %944 = OpFMul %float %943 %float_5
+ %945 = OpFMul %float %943 %float_2_5
+ %946 = OpExtInst %float %1 FAbs %945
+ %947 = OpFSub %float %float_1 %946
+ %948 = OpExtInst %float %1 FMax %947 %float_0
+ %949 = OpExtInst %float %1 FSign %944
+ %950 = OpConvertFToS %int %949
+ %951 = OpConvertSToF %float %950
+ %952 = OpFMul %float %948 %948
+ %953 = OpFSub %float %float_1 %952
+ %954 = OpFMul %float %951 %953
+ %955 = OpFAdd %float %float_1 %954
+ %956 = OpFMul %float %955 %float_0_0250000004
+ %957 = OpFOrdLessThanEqual %bool %942 %float_0_0533333346
+ OpSelectionMerge %958 None
+ OpBranchConditional %957 %959 %960
+ %960 = OpLabel
+ %961 = OpFOrdGreaterThanEqual %bool %942 %float_0_159999996
+ OpSelectionMerge %962 None
+ OpBranchConditional %961 %963 %964
+ %964 = OpLabel
+ %965 = OpFDiv %float %float_0_239999995 %941
+ %966 = OpFSub %float %965 %float_0_5
+ %967 = OpFMul %float %956 %966
+ OpBranch %962
+ %963 = OpLabel
+ OpBranch %962
+ %962 = OpLabel
+ %968 = OpPhi %float %967 %964 %float_0 %963
+ OpBranch %958
+ %959 = OpLabel
+ OpBranch %958
+ %958 = OpLabel
+ %969 = OpPhi %float %968 %962 %956 %959
+ %970 = OpFAdd %float %float_1 %969
+ %971 = OpCompositeConstruct %v3float %970 %970 %970
+ %972 = OpFMul %v3float %916 %971
+ %973 = OpCompositeExtract %float %972 0
+ %974 = OpCompositeExtract %float %972 1
+ %975 = OpFOrdEqual %bool %973 %974
+ %976 = OpCompositeExtract %float %972 2
+ %977 = OpFOrdEqual %bool %974 %976
+ %978 = OpLogicalAnd %bool %975 %977
+ OpSelectionMerge %979 None
+ OpBranchConditional %978 %980 %981
+ %981 = OpLabel
+ %982 = OpExtInst %float %1 Sqrt %float_3
+ %983 = OpFSub %float %974 %976
+ %984 = OpFMul %float %982 %983
+ %985 = OpFMul %float %float_2 %973
+ %986 = OpFSub %float %985 %974
+ %987 = OpFSub %float %986 %976
+ %988 = OpExtInst %float %1 Atan2 %984 %987
+ %989 = OpFMul %float %float_57_2957764 %988
+ OpBranch %979
+ %980 = OpLabel
+ OpBranch %979
+ %979 = OpLabel
+ %990 = OpPhi %float %989 %981 %float_0 %980
+ %991 = OpFOrdLessThan %bool %990 %float_0
+ OpSelectionMerge %992 None
+ OpBranchConditional %991 %993 %992
+ %993 = OpLabel
+ %994 = OpFAdd %float %990 %float_360
+ OpBranch %992
+ %992 = OpLabel
+ %995 = OpPhi %float %990 %979 %994 %993
+ %996 = OpExtInst %float %1 FClamp %995 %float_0 %float_360
+ %997 = OpFOrdGreaterThan %bool %996 %float_180
+ OpSelectionMerge %998 None
+ OpBranchConditional %997 %999 %998
+ %999 = OpLabel
+ %1000 = OpFSub %float %996 %float_360
+ OpBranch %998
+ %998 = OpLabel
+ %1001 = OpPhi %float %996 %992 %1000 %999
+ %1002 = OpFMul %float %1001 %float_0_0148148146
+ %1003 = OpExtInst %float %1 FAbs %1002
+ %1004 = OpFSub %float %float_1 %1003
+ %1005 = OpExtInst %float %1 SmoothStep %float_0 %float_1 %1004
+ %1006 = OpFMul %float %1005 %1005
+ %1007 = OpFMul %float %1006 %928
+ %1008 = OpFSub %float %float_0_0299999993 %973
+ %1009 = OpFMul %float %1007 %1008
+ %1010 = OpFMul %float %1009 %float_0_180000007
+ %1011 = OpFAdd %float %973 %1010
+ %1012 = OpCompositeInsert %v3float %1011 %972 0
+ %1013 = OpVectorTimesMatrix %v3float %1012 %410
+ %1014 = OpExtInst %v3float %1 FMax %132 %1013
+ %1015 = OpDot %float %1014 %67
+ %1016 = OpCompositeConstruct %v3float %1015 %1015 %1015
+ %1017 = OpExtInst %v3float %1 FMix %1016 %1014 %228
+ %1018 = OpAccessChain %_ptr_Uniform_float %_Globals %int_13
+ %1019 = OpLoad %float %1018
+ %1020 = OpFAdd %float %float_1 %1019
+ %1021 = OpAccessChain %_ptr_Uniform_float %_Globals %int_11
+ %1022 = OpLoad %float %1021
+ %1023 = OpFSub %float %1020 %1022
+ %1024 = OpAccessChain %_ptr_Uniform_float %_Globals %int_14
+ %1025 = OpLoad %float %1024
+ %1026 = OpFAdd %float %float_1 %1025
+ %1027 = OpAccessChain %_ptr_Uniform_float %_Globals %int_12
+ %1028 = OpLoad %float %1027
+ %1029 = OpFSub %float %1026 %1028
+ %1030 = OpFOrdGreaterThan %bool %1022 %float_0_800000012
+ OpSelectionMerge %1031 None
+ OpBranchConditional %1030 %1032 %1033
+ %1033 = OpLabel
+ %1034 = OpFAdd %float %float_0_180000007 %1019
+ %1035 = OpFDiv %float %1034 %1023
+ %1036 = OpExtInst %float %1 Log %float_0_180000007
+ %1037 = OpExtInst %float %1 Log %float_10
+ %1038 = OpFDiv %float %1036 %1037
+ %1039 = OpFSub %float %float_2 %1035
+ %1040 = OpFDiv %float %1035 %1039
+ %1041 = OpExtInst %float %1 Log %1040
+ %1042 = OpFMul %float %float_0_5 %1041
+ %1043 = OpAccessChain %_ptr_Uniform_float %_Globals %int_10
+ %1044 = OpLoad %float %1043
+ %1045 = OpFDiv %float %1023 %1044
+ %1046 = OpFMul %float %1042 %1045
+ %1047 = OpFSub %float %1038 %1046
+ OpBranch %1031
+ %1032 = OpLabel
+ %1048 = OpFSub %float %float_0_819999993 %1022
+ %1049 = OpAccessChain %_ptr_Uniform_float %_Globals %int_10
+ %1050 = OpLoad %float %1049
+ %1051 = OpFDiv %float %1048 %1050
+ %1052 = OpExtInst %float %1 Log %float_0_180000007
+ %1053 = OpExtInst %float %1 Log %float_10
+ %1054 = OpFDiv %float %1052 %1053
+ %1055 = OpFAdd %float %1051 %1054
+ OpBranch %1031
+ %1031 = OpLabel
+ %1056 = OpPhi %float %1047 %1033 %1055 %1032
+ %1057 = OpFSub %float %float_1 %1022
+ %1058 = OpAccessChain %_ptr_Uniform_float %_Globals %int_10
+ %1059 = OpLoad %float %1058
+ %1060 = OpFDiv %float %1057 %1059
+ %1061 = OpFSub %float %1060 %1056
+ %1062 = OpFDiv %float %1028 %1059
+ %1063 = OpFSub %float %1062 %1061
+ %1064 = OpExtInst %v3float %1 Log %1017
+ %1065 = OpExtInst %float %1 Log %float_10
+ %1066 = OpCompositeConstruct %v3float %1065 %1065 %1065
+ %1067 = OpFDiv %v3float %1064 %1066
+ %1068 = OpCompositeConstruct %v3float %1059 %1059 %1059
+ %1069 = OpCompositeConstruct %v3float %1061 %1061 %1061
+ %1070 = OpFAdd %v3float %1067 %1069
+ %1071 = OpFMul %v3float %1068 %1070
+ %1072 = OpFNegate %float %1019
+ %1073 = OpCompositeConstruct %v3float %1072 %1072 %1072
+ %1074 = OpFMul %float %float_2 %1023
+ %1075 = OpCompositeConstruct %v3float %1074 %1074 %1074
+ %1076 = OpFMul %float %float_n2 %1059
+ %1077 = OpFDiv %float %1076 %1023
+ %1078 = OpCompositeConstruct %v3float %1077 %1077 %1077
+ %1079 = OpCompositeConstruct %v3float %1056 %1056 %1056
+ %1080 = OpFSub %v3float %1067 %1079
+ %1081 = OpFMul %v3float %1078 %1080
+ %1082 = OpExtInst %v3float %1 Exp %1081
+ %1083 = OpFAdd %v3float %135 %1082
+ %1084 = OpFDiv %v3float %1075 %1083
+ %1085 = OpFAdd %v3float %1073 %1084
+ %1086 = OpCompositeConstruct %v3float %1026 %1026 %1026
+ %1087 = OpFMul %float %float_2 %1029
+ %1088 = OpCompositeConstruct %v3float %1087 %1087 %1087
+ %1089 = OpFMul %float %float_2 %1059
+ %1090 = OpFDiv %float %1089 %1029
+ %1091 = OpCompositeConstruct %v3float %1090 %1090 %1090
+ %1092 = OpCompositeConstruct %v3float %1063 %1063 %1063
+ %1093 = OpFSub %v3float %1067 %1092
+ %1094 = OpFMul %v3float %1091 %1093
+ %1095 = OpExtInst %v3float %1 Exp %1094
+ %1096 = OpFAdd %v3float %135 %1095
+ %1097 = OpFDiv %v3float %1088 %1096
+ %1098 = OpFSub %v3float %1086 %1097
+ %1099 = OpFOrdLessThan %v3bool %1067 %1079
+ %1100 = OpSelect %v3float %1099 %1085 %1071
+ %1101 = OpFOrdGreaterThan %v3bool %1067 %1092
+ %1102 = OpSelect %v3float %1101 %1098 %1071
+ %1103 = OpFSub %float %1063 %1056
+ %1104 = OpCompositeConstruct %v3float %1103 %1103 %1103
+ %1105 = OpFDiv %v3float %1080 %1104
+ %1106 = OpExtInst %v3float %1 FClamp %1105 %132 %135
+ %1107 = OpFOrdLessThan %bool %1063 %1056
+ %1108 = OpFSub %v3float %135 %1106
+ %1109 = OpCompositeConstruct %v3bool %1107 %1107 %1107
+ %1110 = OpSelect %v3float %1109 %1108 %1106
+ %1111 = OpFMul %v3float %239 %1110
+ %1112 = OpFSub %v3float %238 %1111
+ %1113 = OpFMul %v3float %1112 %1110
+ %1114 = OpFMul %v3float %1113 %1110
+ %1115 = OpExtInst %v3float %1 FMix %1100 %1102 %1114
+ %1116 = OpDot %float %1115 %67
+ %1117 = OpCompositeConstruct %v3float %1116 %1116 %1116
+ %1118 = OpExtInst %v3float %1 FMix %1117 %1115 %241
+ %1119 = OpExtInst %v3float %1 FMax %132 %1118
+ %1120 = OpVectorTimesMatrix %v3float %1119 %910
+ %1121 = OpExtInst %v3float %1 FMix %1119 %1120 %914
+ %1122 = OpVectorTimesMatrix %v3float %1121 %549
+ %1123 = OpExtInst %v3float %1 FMax %132 %1122
+ %1124 = OpFOrdEqual %bool %720 %float_0
+ OpSelectionMerge %1125 DontFlatten
+ OpBranchConditional %1124 %1126 %1125
+ %1126 = OpLabel
+ %1127 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_2
+ %1128 = OpLoad %v4float %1127
+ %1129 = OpVectorShuffle %v3float %1128 %1128 0 1 2
+ %1130 = OpDot %float %906 %1129
+ %1131 = OpCompositeInsert %v3float %1130 %391 0
+ %1132 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_3
+ %1133 = OpLoad %v4float %1132
+ %1134 = OpVectorShuffle %v3float %1133 %1133 0 1 2
+ %1135 = OpDot %float %906 %1134
+ %1136 = OpCompositeInsert %v3float %1135 %1131 1
+ %1137 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_4
+ %1138 = OpLoad %v4float %1137
+ %1139 = OpVectorShuffle %v3float %1138 %1138 0 1 2
+ %1140 = OpDot %float %906 %1139
+ %1141 = OpCompositeInsert %v3float %1140 %1136 2
+ %1142 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_8
+ %1143 = OpLoad %v4float %1142
+ %1144 = OpVectorShuffle %v3float %1143 %1143 0 1 2
+ %1145 = OpLoad %v4float %718
+ %1146 = OpVectorShuffle %v3float %1145 %1145 0 1 2
+ %1147 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_7
+ %1148 = OpLoad %v4float %1147
+ %1149 = OpVectorShuffle %v3float %1148 %1148 0 1 2
+ %1150 = OpDot %float %906 %1149
+ %1151 = OpFAdd %float %1150 %float_1
+ %1152 = OpFDiv %float %float_1 %1151
+ %1153 = OpCompositeConstruct %v3float %1152 %1152 %1152
+ %1154 = OpFMul %v3float %1146 %1153
+ %1155 = OpFAdd %v3float %1144 %1154
+ %1156 = OpFMul %v3float %1141 %1155
+ %1157 = OpExtInst %v3float %1 FMax %132 %1156
+ %1158 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_5
+ %1159 = OpLoad %v4float %1158
+ %1160 = OpVectorShuffle %v3float %1159 %1159 0 0 0
+ %1161 = OpFSub %v3float %1160 %1157
+ %1162 = OpExtInst %v3float %1 FMax %132 %1161
+ %1163 = OpVectorShuffle %v3float %1159 %1159 2 2 2
+ %1164 = OpExtInst %v3float %1 FMax %1157 %1163
+ %1165 = OpExtInst %v3float %1 FClamp %1157 %1160 %1163
+ %1166 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_6
+ %1167 = OpLoad %v4float %1166
+ %1168 = OpVectorShuffle %v3float %1167 %1167 0 0 0
+ %1169 = OpFMul %v3float %1164 %1168
+ %1170 = OpVectorShuffle %v3float %1167 %1167 1 1 1
+ %1171 = OpFAdd %v3float %1169 %1170
+ %1172 = OpVectorShuffle %v3float %1159 %1159 3 3 3
+ %1173 = OpFAdd %v3float %1164 %1172
+ %1174 = OpFDiv %v3float %135 %1173
+ %1175 = OpFMul %v3float %1171 %1174
+ %1176 = OpVectorShuffle %v3float %1138 %1138 3 3 3
+ %1177 = OpFMul %v3float %1165 %1176
+ %1178 = OpVectorShuffle %v3float %1128 %1128 3 3 3
+ %1179 = OpFMul %v3float %1162 %1178
+ %1180 = OpVectorShuffle %v3float %1159 %1159 1 1 1
+ %1181 = OpFAdd %v3float %1162 %1180
+ %1182 = OpFDiv %v3float %135 %1181
+ %1183 = OpFMul %v3float %1179 %1182
+ %1184 = OpVectorShuffle %v3float %1133 %1133 3 3 3
+ %1185 = OpFAdd %v3float %1183 %1184
+ %1186 = OpFAdd %v3float %1177 %1185
+ %1187 = OpFAdd %v3float %1175 %1186
+ %1188 = OpFSub %v3float %1187 %248
+ OpBranch %1125
+ %1125 = OpLabel
+ %1189 = OpPhi %v3float %1123 %1031 %1188 %1126
+ %1190 = OpAccessChain %_ptr_Uniform_float %_Globals %int_0 %int_0
+ %1191 = OpLoad %float %1190
+ %1192 = OpCompositeConstruct %v3float %1191 %1191 %1191
+ %1193 = OpFMul %v3float %1189 %1189
+ %1194 = OpFMul %v3float %1192 %1193
+ %1195 = OpAccessChain %_ptr_Uniform_float %_Globals %int_0 %int_1
+ %1196 = OpLoad %float %1195
+ %1197 = OpCompositeConstruct %v3float %1196 %1196 %1196
+ %1198 = OpFMul %v3float %1197 %1189
+ %1199 = OpFAdd %v3float %1194 %1198
+ %1200 = OpAccessChain %_ptr_Uniform_float %_Globals %int_0 %int_2
+ %1201 = OpLoad %float %1200
+ %1202 = OpCompositeConstruct %v3float %1201 %1201 %1201
+ %1203 = OpFAdd %v3float %1199 %1202
+ %1204 = OpAccessChain %_ptr_Uniform_v3float %_Globals %int_15
+ %1205 = OpLoad %v3float %1204
+ %1206 = OpFMul %v3float %1203 %1205
+ %1207 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_16
+ %1208 = OpLoad %v4float %1207
+ %1209 = OpVectorShuffle %v3float %1208 %1208 0 1 2
+ %1210 = OpAccessChain %_ptr_Uniform_float %_Globals %int_16 %int_3
+ %1211 = OpLoad %float %1210
+ %1212 = OpCompositeConstruct %v3float %1211 %1211 %1211
+ %1213 = OpExtInst %v3float %1 FMix %1206 %1209 %1212
+ %1214 = OpExtInst %v3float %1 FMax %132 %1213
+ %1215 = OpAccessChain %_ptr_Uniform_float %_Globals %int_1 %int_1
+ %1216 = OpLoad %float %1215
+ %1217 = OpCompositeConstruct %v3float %1216 %1216 %1216
+ %1218 = OpExtInst %v3float %1 Pow %1214 %1217
+ %1219 = OpIEqual %bool %579 %uint_0
+ OpSelectionMerge %1220 DontFlatten
+ OpBranchConditional %1219 %1221 %1222
+ %1222 = OpLabel
+ %1223 = OpIEqual %bool %579 %uint_1
+ OpSelectionMerge %1224 None
+ OpBranchConditional %1223 %1225 %1226
+ %1226 = OpLabel
+ %1227 = OpIEqual %bool %579 %uint_3
+ %1228 = OpIEqual %bool %579 %uint_5
+ %1229 = OpLogicalOr %bool %1227 %1228
+ OpSelectionMerge %1230 None
+ OpBranchConditional %1229 %1231 %1232
+ %1232 = OpLabel
+ %1233 = OpIEqual %bool %579 %uint_4
+ %1234 = OpIEqual %bool %579 %uint_6
+ %1235 = OpLogicalOr %bool %1233 %1234
+ OpSelectionMerge %1236 None
+ OpBranchConditional %1235 %1237 %1238
+ %1238 = OpLabel
+ %1239 = OpIEqual %bool %579 %uint_7
+ OpSelectionMerge %1240 None
+ OpBranchConditional %1239 %1241 %1242
+ %1242 = OpLabel
+ %1243 = OpVectorTimesMatrix %v3float %1218 %547
+ %1244 = OpVectorTimesMatrix %v3float %1243 %576
+ %1245 = OpAccessChain %_ptr_Uniform_float %_Globals %int_1 %int_2
+ %1246 = OpLoad %float %1245
+ %1247 = OpCompositeConstruct %v3float %1246 %1246 %1246
+ %1248 = OpExtInst %v3float %1 Pow %1244 %1247
+ OpBranch %1240
+ %1241 = OpLabel
+ %1249 = OpVectorTimesMatrix %v3float %906 %547
+ %1250 = OpVectorTimesMatrix %v3float %1249 %576
+ %1251 = OpFMul %v3float %1250 %496
+ %1252 = OpExtInst %v3float %1 Pow %1251 %263
+ %1253 = OpFMul %v3float %184 %1252
+ %1254 = OpFAdd %v3float %183 %1253
+ %1255 = OpFMul %v3float %185 %1252
+ %1256 = OpFAdd %v3float %135 %1255
+ %1257 = OpFDiv %v3float %135 %1256
+ %1258 = OpFMul %v3float %1254 %1257
+ %1259 = OpExtInst %v3float %1 Pow %1258 %264
+ OpBranch %1240
+ %1240 = OpLabel
+ %1260 = OpPhi %v3float %1248 %1242 %1259 %1241
+ OpBranch %1236
+ %1237 = OpLabel
+ %1261 = OpMatrixTimesMatrix %mat3v3float %546 %399
+ %1262 = OpFMul %v3float %906 %262
+ %1263 = OpVectorTimesMatrix %v3float %1262 %1261
+ %1264 = OpCompositeExtract %float %1263 0
+ %1265 = OpCompositeExtract %float %1263 1
+ %1266 = OpExtInst %float %1 FMin %1264 %1265
+ %1267 = OpCompositeExtract %float %1263 2
+ %1268 = OpExtInst %float %1 FMin %1266 %1267
+ %1269 = OpExtInst %float %1 FMax %1264 %1265
+ %1270 = OpExtInst %float %1 FMax %1269 %1267
+ %1271 = OpExtInst %float %1 FMax %1270 %float_1_00000001en10
+ %1272 = OpExtInst %float %1 FMax %1268 %float_1_00000001en10
+ %1273 = OpFSub %float %1271 %1272
+ %1274 = OpExtInst %float %1 FMax %1270 %float_0_00999999978
+ %1275 = OpFDiv %float %1273 %1274
+ %1276 = OpFSub %float %1267 %1265
+ %1277 = OpFMul %float %1267 %1276
+ %1278 = OpFSub %float %1265 %1264
+ %1279 = OpFMul %float %1265 %1278
+ %1280 = OpFAdd %float %1277 %1279
+ %1281 = OpFSub %float %1264 %1267
+ %1282 = OpFMul %float %1264 %1281
+ %1283 = OpFAdd %float %1280 %1282
+ %1284 = OpExtInst %float %1 Sqrt %1283
+ %1285 = OpFAdd %float %1267 %1265
+ %1286 = OpFAdd %float %1285 %1264
+ %1287 = OpFMul %float %float_1_75 %1284
+ %1288 = OpFAdd %float %1286 %1287
+ %1289 = OpFMul %float %1288 %float_0_333333343
+ %1290 = OpFSub %float %1275 %float_0_400000006
+ %1291 = OpFMul %float %1290 %float_5
+ %1292 = OpFMul %float %1290 %float_2_5
+ %1293 = OpExtInst %float %1 FAbs %1292
+ %1294 = OpFSub %float %float_1 %1293
+ %1295 = OpExtInst %float %1 FMax %1294 %float_0
+ %1296 = OpExtInst %float %1 FSign %1291
+ %1297 = OpConvertFToS %int %1296
+ %1298 = OpConvertSToF %float %1297
+ %1299 = OpFMul %float %1295 %1295
+ %1300 = OpFSub %float %float_1 %1299
+ %1301 = OpFMul %float %1298 %1300
+ %1302 = OpFAdd %float %float_1 %1301
+ %1303 = OpFMul %float %1302 %float_0_0250000004
+ %1304 = OpFOrdLessThanEqual %bool %1289 %float_0_0533333346
+ OpSelectionMerge %1305 None
+ OpBranchConditional %1304 %1306 %1307
+ %1307 = OpLabel
+ %1308 = OpFOrdGreaterThanEqual %bool %1289 %float_0_159999996
+ OpSelectionMerge %1309 None
+ OpBranchConditional %1308 %1310 %1311
+ %1311 = OpLabel
+ %1312 = OpFDiv %float %float_0_239999995 %1288
+ %1313 = OpFSub %float %1312 %float_0_5
+ %1314 = OpFMul %float %1303 %1313
+ OpBranch %1309
+ %1310 = OpLabel
+ OpBranch %1309
+ %1309 = OpLabel
+ %1315 = OpPhi %float %1314 %1311 %float_0 %1310
+ OpBranch %1305
+ %1306 = OpLabel
+ OpBranch %1305
+ %1305 = OpLabel
+ %1316 = OpPhi %float %1315 %1309 %1303 %1306
+ %1317 = OpFAdd %float %float_1 %1316
+ %1318 = OpCompositeConstruct %v3float %1317 %1317 %1317
+ %1319 = OpFMul %v3float %1263 %1318
+ %1320 = OpCompositeExtract %float %1319 0
+ %1321 = OpCompositeExtract %float %1319 1
+ %1322 = OpFOrdEqual %bool %1320 %1321
+ %1323 = OpCompositeExtract %float %1319 2
+ %1324 = OpFOrdEqual %bool %1321 %1323
+ %1325 = OpLogicalAnd %bool %1322 %1324
+ OpSelectionMerge %1326 None
+ OpBranchConditional %1325 %1327 %1328
+ %1328 = OpLabel
+ %1329 = OpExtInst %float %1 Sqrt %float_3
+ %1330 = OpFSub %float %1321 %1323
+ %1331 = OpFMul %float %1329 %1330
+ %1332 = OpFMul %float %float_2 %1320
+ %1333 = OpFSub %float %1332 %1321
+ %1334 = OpFSub %float %1333 %1323
+ %1335 = OpExtInst %float %1 Atan2 %1331 %1334
+ %1336 = OpFMul %float %float_57_2957764 %1335
+ OpBranch %1326
+ %1327 = OpLabel
+ OpBranch %1326
+ %1326 = OpLabel
+ %1337 = OpPhi %float %1336 %1328 %float_0 %1327
+ %1338 = OpFOrdLessThan %bool %1337 %float_0
+ OpSelectionMerge %1339 None
+ OpBranchConditional %1338 %1340 %1339
+ %1340 = OpLabel
+ %1341 = OpFAdd %float %1337 %float_360
+ OpBranch %1339
+ %1339 = OpLabel
+ %1342 = OpPhi %float %1337 %1326 %1341 %1340
+ %1343 = OpExtInst %float %1 FClamp %1342 %float_0 %float_360
+ %1344 = OpFOrdGreaterThan %bool %1343 %float_180
+ OpSelectionMerge %1345 None
+ OpBranchConditional %1344 %1346 %1345
+ %1346 = OpLabel
+ %1347 = OpFSub %float %1343 %float_360
+ OpBranch %1345
+ %1345 = OpLabel
+ %1348 = OpPhi %float %1343 %1339 %1347 %1346
+ %1349 = OpFOrdGreaterThan %bool %1348 %float_n67_5
+ %1350 = OpFOrdLessThan %bool %1348 %float_67_5
+ %1351 = OpLogicalAnd %bool %1349 %1350
+ OpSelectionMerge %1352 None
+ OpBranchConditional %1351 %1353 %1352
+ %1353 = OpLabel
+ %1354 = OpFSub %float %1348 %float_n67_5
+ %1355 = OpFMul %float %1354 %float_0_0296296291
+ %1356 = OpConvertFToS %int %1355
+ %1357 = OpConvertSToF %float %1356
+ %1358 = OpFSub %float %1355 %1357
+ %1359 = OpFMul %float %1358 %1358
+ %1360 = OpFMul %float %1359 %1358
+ %1361 = OpIEqual %bool %1356 %int_3
+ OpSelectionMerge %1362 None
+ OpBranchConditional %1361 %1363 %1364
+ %1364 = OpLabel
+ %1365 = OpIEqual %bool %1356 %int_2
+ OpSelectionMerge %1366 None
+ OpBranchConditional %1365 %1367 %1368
+ %1368 = OpLabel
+ %1369 = OpIEqual %bool %1356 %int_1
+ OpSelectionMerge %1370 None
+ OpBranchConditional %1369 %1371 %1372
+ %1372 = OpLabel
+ %1373 = OpIEqual %bool %1356 %int_0
+ OpSelectionMerge %1374 None
+ OpBranchConditional %1373 %1375 %1376
+ %1376 = OpLabel
+ OpBranch %1374
+ %1375 = OpLabel
+ %1377 = OpFMul %float %1360 %float_0_166666672
+ OpBranch %1374
+ %1374 = OpLabel
+ %1378 = OpPhi %float %float_0 %1376 %1377 %1375
+ OpBranch %1370
+ %1371 = OpLabel
+ %1379 = OpFMul %float %1360 %float_n0_5
+ %1380 = OpFMul %float %1359 %float_0_5
+ %1381 = OpFAdd %float %1379 %1380
+ %1382 = OpFMul %float %1358 %float_0_5
+ %1383 = OpFAdd %float %1381 %1382
+ %1384 = OpFAdd %float %1383 %float_0_166666672
+ OpBranch %1370
+ %1370 = OpLabel
+ %1385 = OpPhi %float %1378 %1374 %1384 %1371
+ OpBranch %1366
+ %1367 = OpLabel
+ %1386 = OpFMul %float %1360 %float_0_5
+ %1387 = OpFMul %float %1359 %float_n1
+ %1388 = OpFAdd %float %1386 %1387
+ %1389 = OpFAdd %float %1388 %float_0_666666687
+ OpBranch %1366
+ %1366 = OpLabel
+ %1390 = OpPhi %float %1385 %1370 %1389 %1367
+ OpBranch %1362
+ %1363 = OpLabel
+ %1391 = OpFMul %float %1360 %float_n0_166666672
+ %1392 = OpFMul %float %1359 %float_0_5
+ %1393 = OpFAdd %float %1391 %1392
+ %1394 = OpFMul %float %1358 %float_n0_5
+ %1395 = OpFAdd %float %1393 %1394
+ %1396 = OpFAdd %float %1395 %float_0_166666672
+ OpBranch %1362
+ %1362 = OpLabel
+ %1397 = OpPhi %float %1390 %1366 %1396 %1363
+ OpBranch %1352
+ %1352 = OpLabel
+ %1398 = OpPhi %float %float_0 %1345 %1397 %1362
+ %1399 = OpFMul %float %1398 %float_1_5
+ %1400 = OpFMul %float %1399 %1275
+ %1401 = OpFSub %float %float_0_0299999993 %1320
+ %1402 = OpFMul %float %1400 %1401
+ %1403 = OpFMul %float %1402 %float_0_180000007
+ %1404 = OpFAdd %float %1320 %1403
+ %1405 = OpCompositeInsert %v3float %1404 %1319 0
+ %1406 = OpExtInst %v3float %1 FClamp %1405 %132 %314
+ %1407 = OpVectorTimesMatrix %v3float %1406 %410
+ %1408 = OpExtInst %v3float %1 FClamp %1407 %132 %314
+ %1409 = OpDot %float %1408 %67
+ %1410 = OpCompositeConstruct %v3float %1409 %1409 %1409
+ %1411 = OpExtInst %v3float %1 FMix %1410 %1408 %228
+ %1412 = OpCompositeExtract %float %1411 0
+ %1413 = OpExtInst %float %1 Exp2 %float_n15
+ %1414 = OpFMul %float %float_0_179999992 %1413
+ %1415 = OpExtInst %float %1 Exp2 %float_18
+ %1416 = OpFMul %float %float_0_179999992 %1415
+ OpStore %502 %475
+ OpStore %501 %476
+ %1417 = OpFOrdLessThanEqual %bool %1412 %float_0
+ %1418 = OpExtInst %float %1 Exp2 %float_n14
+ %1419 = OpSelect %float %1417 %1418 %1412
+ %1420 = OpExtInst %float %1 Log %1419
+ %1421 = OpFDiv %float %1420 %1065
+ %1422 = OpExtInst %float %1 Log %1414
+ %1423 = OpFDiv %float %1422 %1065
+ %1424 = OpFOrdLessThanEqual %bool %1421 %1423
+ OpSelectionMerge %1425 None
+ OpBranchConditional %1424 %1426 %1427
+ %1427 = OpLabel
+ %1428 = OpFOrdGreaterThan %bool %1421 %1423
+ %1429 = OpExtInst %float %1 Log %float_0_180000007
+ %1430 = OpFDiv %float %1429 %1065
+ %1431 = OpFOrdLessThan %bool %1421 %1430
+ %1432 = OpLogicalAnd %bool %1428 %1431
+ OpSelectionMerge %1433 None
+ OpBranchConditional %1432 %1434 %1435
+ %1435 = OpLabel
+ %1436 = OpFOrdGreaterThanEqual %bool %1421 %1430
+ %1437 = OpExtInst %float %1 Log %1416
+ %1438 = OpFDiv %float %1437 %1065
+ %1439 = OpFOrdLessThan %bool %1421 %1438
+ %1440 = OpLogicalAnd %bool %1436 %1439
+ OpSelectionMerge %1441 None
+ OpBranchConditional %1440 %1442 %1443
+ %1443 = OpLabel
+ %1444 = OpExtInst %float %1 Log %float_10000
+ %1445 = OpFDiv %float %1444 %1065
+ OpBranch %1441
+ %1442 = OpLabel
+ %1446 = OpFSub %float %1421 %1430
+ %1447 = OpFMul %float %float_3 %1446
+ %1448 = OpFSub %float %1438 %1430
+ %1449 = OpFDiv %float %1447 %1448
+ %1450 = OpConvertFToS %int %1449
+ %1451 = OpConvertSToF %float %1450
+ %1452 = OpFSub %float %1449 %1451
+ %1453 = OpAccessChain %_ptr_Function_float %501 %1450
+ %1454 = OpLoad %float %1453
+ %1455 = OpIAdd %int %1450 %int_1
+ %1456 = OpAccessChain %_ptr_Function_float %501 %1455
+ %1457 = OpLoad %float %1456
+ %1458 = OpIAdd %int %1450 %int_2
+ %1459 = OpAccessChain %_ptr_Function_float %501 %1458
+ %1460 = OpLoad %float %1459
+ %1461 = OpCompositeConstruct %v3float %1454 %1457 %1460
+ %1462 = OpFMul %float %1452 %1452
+ %1463 = OpCompositeConstruct %v3float %1462 %1452 %float_1
+ %1464 = OpMatrixTimesVector %v3float %442 %1461
+ %1465 = OpDot %float %1463 %1464
+ OpBranch %1441
+ %1441 = OpLabel
+ %1466 = OpPhi %float %1445 %1443 %1465 %1442
+ OpBranch %1433
+ %1434 = OpLabel
+ %1467 = OpFSub %float %1421 %1423
+ %1468 = OpFMul %float %float_3 %1467
+ %1469 = OpFSub %float %1430 %1423
+ %1470 = OpFDiv %float %1468 %1469
+ %1471 = OpConvertFToS %int %1470
+ %1472 = OpConvertSToF %float %1471
+ %1473 = OpFSub %float %1470 %1472
+ %1474 = OpAccessChain %_ptr_Function_float %502 %1471
+ %1475 = OpLoad %float %1474
+ %1476 = OpIAdd %int %1471 %int_1
+ %1477 = OpAccessChain %_ptr_Function_float %502 %1476
+ %1478 = OpLoad %float %1477
+ %1479 = OpIAdd %int %1471 %int_2
+ %1480 = OpAccessChain %_ptr_Function_float %502 %1479
+ %1481 = OpLoad %float %1480
+ %1482 = OpCompositeConstruct %v3float %1475 %1478 %1481
+ %1483 = OpFMul %float %1473 %1473
+ %1484 = OpCompositeConstruct %v3float %1483 %1473 %float_1
+ %1485 = OpMatrixTimesVector %v3float %442 %1482
+ %1486 = OpDot %float %1484 %1485
+ OpBranch %1433
+ %1433 = OpLabel
+ %1487 = OpPhi %float %1466 %1441 %1486 %1434
+ OpBranch %1425
+ %1426 = OpLabel
+ %1488 = OpExtInst %float %1 Log %float_9_99999975en05
+ %1489 = OpFDiv %float %1488 %1065
+ OpBranch %1425
+ %1425 = OpLabel
+ %1490 = OpPhi %float %1487 %1433 %1489 %1426
+ %1491 = OpExtInst %float %1 Pow %float_10 %1490
+ %1492 = OpCompositeInsert %v3float %1491 %391 0
+ %1493 = OpCompositeExtract %float %1411 1
+ OpStore %504 %475
+ OpStore %503 %476
+ %1494 = OpFOrdLessThanEqual %bool %1493 %float_0
+ %1495 = OpSelect %float %1494 %1418 %1493
+ %1496 = OpExtInst %float %1 Log %1495
+ %1497 = OpFDiv %float %1496 %1065
+ %1498 = OpFOrdLessThanEqual %bool %1497 %1423
+ OpSelectionMerge %1499 None
+ OpBranchConditional %1498 %1500 %1501
+ %1501 = OpLabel
+ %1502 = OpFOrdGreaterThan %bool %1497 %1423
+ %1503 = OpExtInst %float %1 Log %float_0_180000007
+ %1504 = OpFDiv %float %1503 %1065
+ %1505 = OpFOrdLessThan %bool %1497 %1504
+ %1506 = OpLogicalAnd %bool %1502 %1505
+ OpSelectionMerge %1507 None
+ OpBranchConditional %1506 %1508 %1509
+ %1509 = OpLabel
+ %1510 = OpFOrdGreaterThanEqual %bool %1497 %1504
+ %1511 = OpExtInst %float %1 Log %1416
+ %1512 = OpFDiv %float %1511 %1065
+ %1513 = OpFOrdLessThan %bool %1497 %1512
+ %1514 = OpLogicalAnd %bool %1510 %1513
+ OpSelectionMerge %1515 None
+ OpBranchConditional %1514 %1516 %1517
+ %1517 = OpLabel
+ %1518 = OpExtInst %float %1 Log %float_10000
+ %1519 = OpFDiv %float %1518 %1065
+ OpBranch %1515
+ %1516 = OpLabel
+ %1520 = OpFSub %float %1497 %1504
+ %1521 = OpFMul %float %float_3 %1520
+ %1522 = OpFSub %float %1512 %1504
+ %1523 = OpFDiv %float %1521 %1522
+ %1524 = OpConvertFToS %int %1523
+ %1525 = OpConvertSToF %float %1524
+ %1526 = OpFSub %float %1523 %1525
+ %1527 = OpAccessChain %_ptr_Function_float %503 %1524
+ %1528 = OpLoad %float %1527
+ %1529 = OpIAdd %int %1524 %int_1
+ %1530 = OpAccessChain %_ptr_Function_float %503 %1529
+ %1531 = OpLoad %float %1530
+ %1532 = OpIAdd %int %1524 %int_2
+ %1533 = OpAccessChain %_ptr_Function_float %503 %1532
+ %1534 = OpLoad %float %1533
+ %1535 = OpCompositeConstruct %v3float %1528 %1531 %1534
+ %1536 = OpFMul %float %1526 %1526
+ %1537 = OpCompositeConstruct %v3float %1536 %1526 %float_1
+ %1538 = OpMatrixTimesVector %v3float %442 %1535
+ %1539 = OpDot %float %1537 %1538
+ OpBranch %1515
+ %1515 = OpLabel
+ %1540 = OpPhi %float %1519 %1517 %1539 %1516
+ OpBranch %1507
+ %1508 = OpLabel
+ %1541 = OpFSub %float %1497 %1423
+ %1542 = OpFMul %float %float_3 %1541
+ %1543 = OpFSub %float %1504 %1423
+ %1544 = OpFDiv %float %1542 %1543
+ %1545 = OpConvertFToS %int %1544
+ %1546 = OpConvertSToF %float %1545
+ %1547 = OpFSub %float %1544 %1546
+ %1548 = OpAccessChain %_ptr_Function_float %504 %1545
+ %1549 = OpLoad %float %1548
+ %1550 = OpIAdd %int %1545 %int_1
+ %1551 = OpAccessChain %_ptr_Function_float %504 %1550
+ %1552 = OpLoad %float %1551
+ %1553 = OpIAdd %int %1545 %int_2
+ %1554 = OpAccessChain %_ptr_Function_float %504 %1553
+ %1555 = OpLoad %float %1554
+ %1556 = OpCompositeConstruct %v3float %1549 %1552 %1555
+ %1557 = OpFMul %float %1547 %1547
+ %1558 = OpCompositeConstruct %v3float %1557 %1547 %float_1
+ %1559 = OpMatrixTimesVector %v3float %442 %1556
+ %1560 = OpDot %float %1558 %1559
+ OpBranch %1507
+ %1507 = OpLabel
+ %1561 = OpPhi %float %1540 %1515 %1560 %1508
+ OpBranch %1499
+ %1500 = OpLabel
+ %1562 = OpExtInst %float %1 Log %float_9_99999975en05
+ %1563 = OpFDiv %float %1562 %1065
+ OpBranch %1499
+ %1499 = OpLabel
+ %1564 = OpPhi %float %1561 %1507 %1563 %1500
+ %1565 = OpExtInst %float %1 Pow %float_10 %1564
+ %1566 = OpCompositeInsert %v3float %1565 %1492 1
+ %1567 = OpCompositeExtract %float %1411 2
+ OpStore %506 %475
+ OpStore %505 %476
+ %1568 = OpFOrdLessThanEqual %bool %1567 %float_0
+ %1569 = OpSelect %float %1568 %1418 %1567
+ %1570 = OpExtInst %float %1 Log %1569
+ %1571 = OpFDiv %float %1570 %1065
+ %1572 = OpFOrdLessThanEqual %bool %1571 %1423
+ OpSelectionMerge %1573 None
+ OpBranchConditional %1572 %1574 %1575
+ %1575 = OpLabel
+ %1576 = OpFOrdGreaterThan %bool %1571 %1423
+ %1577 = OpExtInst %float %1 Log %float_0_180000007
+ %1578 = OpFDiv %float %1577 %1065
+ %1579 = OpFOrdLessThan %bool %1571 %1578
+ %1580 = OpLogicalAnd %bool %1576 %1579
+ OpSelectionMerge %1581 None
+ OpBranchConditional %1580 %1582 %1583
+ %1583 = OpLabel
+ %1584 = OpFOrdGreaterThanEqual %bool %1571 %1578
+ %1585 = OpExtInst %float %1 Log %1416
+ %1586 = OpFDiv %float %1585 %1065
+ %1587 = OpFOrdLessThan %bool %1571 %1586
+ %1588 = OpLogicalAnd %bool %1584 %1587
+ OpSelectionMerge %1589 None
+ OpBranchConditional %1588 %1590 %1591
+ %1591 = OpLabel
+ %1592 = OpExtInst %float %1 Log %float_10000
+ %1593 = OpFDiv %float %1592 %1065
+ OpBranch %1589
+ %1590 = OpLabel
+ %1594 = OpFSub %float %1571 %1578
+ %1595 = OpFMul %float %float_3 %1594
+ %1596 = OpFSub %float %1586 %1578
+ %1597 = OpFDiv %float %1595 %1596
+ %1598 = OpConvertFToS %int %1597
+ %1599 = OpConvertSToF %float %1598
+ %1600 = OpFSub %float %1597 %1599
+ %1601 = OpAccessChain %_ptr_Function_float %505 %1598
+ %1602 = OpLoad %float %1601
+ %1603 = OpIAdd %int %1598 %int_1
+ %1604 = OpAccessChain %_ptr_Function_float %505 %1603
+ %1605 = OpLoad %float %1604
+ %1606 = OpIAdd %int %1598 %int_2
+ %1607 = OpAccessChain %_ptr_Function_float %505 %1606
+ %1608 = OpLoad %float %1607
+ %1609 = OpCompositeConstruct %v3float %1602 %1605 %1608
+ %1610 = OpFMul %float %1600 %1600
+ %1611 = OpCompositeConstruct %v3float %1610 %1600 %float_1
+ %1612 = OpMatrixTimesVector %v3float %442 %1609
+ %1613 = OpDot %float %1611 %1612
+ OpBranch %1589
+ %1589 = OpLabel
+ %1614 = OpPhi %float %1593 %1591 %1613 %1590
+ OpBranch %1581
+ %1582 = OpLabel
+ %1615 = OpFSub %float %1571 %1423
+ %1616 = OpFMul %float %float_3 %1615
+ %1617 = OpFSub %float %1578 %1423
+ %1618 = OpFDiv %float %1616 %1617
+ %1619 = OpConvertFToS %int %1618
+ %1620 = OpConvertSToF %float %1619
+ %1621 = OpFSub %float %1618 %1620
+ %1622 = OpAccessChain %_ptr_Function_float %506 %1619
+ %1623 = OpLoad %float %1622
+ %1624 = OpIAdd %int %1619 %int_1
+ %1625 = OpAccessChain %_ptr_Function_float %506 %1624
+ %1626 = OpLoad %float %1625
+ %1627 = OpIAdd %int %1619 %int_2
+ %1628 = OpAccessChain %_ptr_Function_float %506 %1627
+ %1629 = OpLoad %float %1628
+ %1630 = OpCompositeConstruct %v3float %1623 %1626 %1629
+ %1631 = OpFMul %float %1621 %1621
+ %1632 = OpCompositeConstruct %v3float %1631 %1621 %float_1
+ %1633 = OpMatrixTimesVector %v3float %442 %1630
+ %1634 = OpDot %float %1632 %1633
+ OpBranch %1581
+ %1581 = OpLabel
+ %1635 = OpPhi %float %1614 %1589 %1634 %1582
+ OpBranch %1573
+ %1574 = OpLabel
+ %1636 = OpExtInst %float %1 Log %float_9_99999975en05
+ %1637 = OpFDiv %float %1636 %1065
+ OpBranch %1573
+ %1573 = OpLabel
+ %1638 = OpPhi %float %1635 %1581 %1637 %1574
+ %1639 = OpExtInst %float %1 Pow %float_10 %1638
+ %1640 = OpCompositeInsert %v3float %1639 %1566 2
+ %1641 = OpVectorTimesMatrix %v3float %1640 %414
+ %1642 = OpVectorTimesMatrix %v3float %1641 %410
+ %1643 = OpExtInst %float %1 Pow %float_2 %float_n12
+ %1644 = OpFMul %float %float_0_179999992 %1643
+ OpStore %514 %475
+ OpStore %513 %476
+ %1645 = OpFOrdLessThanEqual %bool %1644 %float_0
+ %1646 = OpSelect %float %1645 %1418 %1644
+ %1647 = OpExtInst %float %1 Log %1646
+ %1648 = OpFDiv %float %1647 %1065
+ %1649 = OpFOrdLessThanEqual %bool %1648 %1423
+ OpSelectionMerge %1650 None
+ OpBranchConditional %1649 %1651 %1652
+ %1652 = OpLabel
+ %1653 = OpFOrdGreaterThan %bool %1648 %1423
+ %1654 = OpExtInst %float %1 Log %float_0_180000007
+ %1655 = OpFDiv %float %1654 %1065
+ %1656 = OpFOrdLessThan %bool %1648 %1655
+ %1657 = OpLogicalAnd %bool %1653 %1656
+ OpSelectionMerge %1658 None
+ OpBranchConditional %1657 %1659 %1660
+ %1660 = OpLabel
+ %1661 = OpFOrdGreaterThanEqual %bool %1648 %1655
+ %1662 = OpExtInst %float %1 Log %1416
+ %1663 = OpFDiv %float %1662 %1065
+ %1664 = OpFOrdLessThan %bool %1648 %1663
+ %1665 = OpLogicalAnd %bool %1661 %1664
+ OpSelectionMerge %1666 None
+ OpBranchConditional %1665 %1667 %1668
+ %1668 = OpLabel
+ %1669 = OpExtInst %float %1 Log %float_10000
+ %1670 = OpFDiv %float %1669 %1065
+ OpBranch %1666
+ %1667 = OpLabel
+ %1671 = OpFSub %float %1648 %1655
+ %1672 = OpFMul %float %float_3 %1671
+ %1673 = OpFSub %float %1663 %1655
+ %1674 = OpFDiv %float %1672 %1673
+ %1675 = OpConvertFToS %int %1674
+ %1676 = OpConvertSToF %float %1675
+ %1677 = OpFSub %float %1674 %1676
+ %1678 = OpAccessChain %_ptr_Function_float %513 %1675
+ %1679 = OpLoad %float %1678
+ %1680 = OpIAdd %int %1675 %int_1
+ %1681 = OpAccessChain %_ptr_Function_float %513 %1680
+ %1682 = OpLoad %float %1681
+ %1683 = OpIAdd %int %1675 %int_2
+ %1684 = OpAccessChain %_ptr_Function_float %513 %1683
+ %1685 = OpLoad %float %1684
+ %1686 = OpCompositeConstruct %v3float %1679 %1682 %1685
+ %1687 = OpFMul %float %1677 %1677
+ %1688 = OpCompositeConstruct %v3float %1687 %1677 %float_1
+ %1689 = OpMatrixTimesVector %v3float %442 %1686
+ %1690 = OpDot %float %1688 %1689
+ OpBranch %1666
+ %1666 = OpLabel
+ %1691 = OpPhi %float %1670 %1668 %1690 %1667
+ OpBranch %1658
+ %1659 = OpLabel
+ %1692 = OpFSub %float %1648 %1423
+ %1693 = OpFMul %float %float_3 %1692
+ %1694 = OpFSub %float %1655 %1423
+ %1695 = OpFDiv %float %1693 %1694
+ %1696 = OpConvertFToS %int %1695
+ %1697 = OpConvertSToF %float %1696
+ %1698 = OpFSub %float %1695 %1697
+ %1699 = OpAccessChain %_ptr_Function_float %514 %1696
+ %1700 = OpLoad %float %1699
+ %1701 = OpIAdd %int %1696 %int_1
+ %1702 = OpAccessChain %_ptr_Function_float %514 %1701
+ %1703 = OpLoad %float %1702
+ %1704 = OpIAdd %int %1696 %int_2
+ %1705 = OpAccessChain %_ptr_Function_float %514 %1704
+ %1706 = OpLoad %float %1705
+ %1707 = OpCompositeConstruct %v3float %1700 %1703 %1706
+ %1708 = OpFMul %float %1698 %1698
+ %1709 = OpCompositeConstruct %v3float %1708 %1698 %float_1
+ %1710 = OpMatrixTimesVector %v3float %442 %1707
+ %1711 = OpDot %float %1709 %1710
+ OpBranch %1658
+ %1658 = OpLabel
+ %1712 = OpPhi %float %1691 %1666 %1711 %1659
+ OpBranch %1650
+ %1651 = OpLabel
+ %1713 = OpExtInst %float %1 Log %float_9_99999975en05
+ %1714 = OpFDiv %float %1713 %1065
+ OpBranch %1650
+ %1650 = OpLabel
+ %1715 = OpPhi %float %1712 %1658 %1714 %1651
+ %1716 = OpExtInst %float %1 Pow %float_10 %1715
+ OpStore %516 %475
+ OpStore %515 %476
+ %1717 = OpExtInst %float %1 Log %float_0_180000007
+ %1718 = OpFDiv %float %1717 %1065
+ %1719 = OpFOrdLessThanEqual %bool %1718 %1423
+ OpSelectionMerge %1720 None
+ OpBranchConditional %1719 %1721 %1722
+ %1722 = OpLabel
+ %1723 = OpFOrdGreaterThan %bool %1718 %1423
+ %1724 = OpFOrdLessThan %bool %1718 %1718
+ %1725 = OpLogicalAnd %bool %1723 %1724
+ OpSelectionMerge %1726 None
+ OpBranchConditional %1725 %1727 %1728
+ %1728 = OpLabel
+ %1729 = OpFOrdGreaterThanEqual %bool %1718 %1718
+ %1730 = OpExtInst %float %1 Log %1416
+ %1731 = OpFDiv %float %1730 %1065
+ %1732 = OpFOrdLessThan %bool %1718 %1731
+ %1733 = OpLogicalAnd %bool %1729 %1732
+ OpSelectionMerge %1734 None
+ OpBranchConditional %1733 %1735 %1736
+ %1736 = OpLabel
+ %1737 = OpExtInst %float %1 Log %float_10000
+ %1738 = OpFDiv %float %1737 %1065
+ OpBranch %1734
+ %1735 = OpLabel
+ %1739 = OpFSub %float %1718 %1718
+ %1740 = OpFMul %float %float_3 %1739
+ %1741 = OpFSub %float %1731 %1718
+ %1742 = OpFDiv %float %1740 %1741
+ %1743 = OpConvertFToS %int %1742
+ %1744 = OpConvertSToF %float %1743
+ %1745 = OpFSub %float %1742 %1744
+ %1746 = OpAccessChain %_ptr_Function_float %515 %1743
+ %1747 = OpLoad %float %1746
+ %1748 = OpIAdd %int %1743 %int_1
+ %1749 = OpAccessChain %_ptr_Function_float %515 %1748
+ %1750 = OpLoad %float %1749
+ %1751 = OpIAdd %int %1743 %int_2
+ %1752 = OpAccessChain %_ptr_Function_float %515 %1751
+ %1753 = OpLoad %float %1752
+ %1754 = OpCompositeConstruct %v3float %1747 %1750 %1753
+ %1755 = OpFMul %float %1745 %1745
+ %1756 = OpCompositeConstruct %v3float %1755 %1745 %float_1
+ %1757 = OpMatrixTimesVector %v3float %442 %1754
+ %1758 = OpDot %float %1756 %1757
+ OpBranch %1734
+ %1734 = OpLabel
+ %1759 = OpPhi %float %1738 %1736 %1758 %1735
+ OpBranch %1726
+ %1727 = OpLabel
+ %1760 = OpFSub %float %1718 %1423
+ %1761 = OpFMul %float %float_3 %1760
+ %1762 = OpAccessChain %_ptr_Function_float %516 %int_3
+ %1763 = OpLoad %float %1762
+ %1764 = OpAccessChain %_ptr_Function_float %516 %int_4
+ %1765 = OpLoad %float %1764
+ %1766 = OpAccessChain %_ptr_Function_float %516 %int_5
+ %1767 = OpLoad %float %1766
+ %1768 = OpCompositeConstruct %v3float %1763 %1765 %1767
+ %1769 = OpMatrixTimesVector %v3float %442 %1768
+ %1770 = OpCompositeExtract %float %1769 2
+ OpBranch %1726
+ %1726 = OpLabel
+ %1771 = OpPhi %float %1759 %1734 %1770 %1727
+ OpBranch %1720
+ %1721 = OpLabel
+ %1772 = OpExtInst %float %1 Log %float_9_99999975en05
+ %1773 = OpFDiv %float %1772 %1065
+ OpBranch %1720
+ %1720 = OpLabel
+ %1774 = OpPhi %float %1771 %1726 %1773 %1721
+ %1775 = OpExtInst %float %1 Pow %float_10 %1774
+ %1776 = OpExtInst %float %1 Pow %float_2 %float_11
+ %1777 = OpFMul %float %float_0_179999992 %1776
+ OpStore %518 %475
+ OpStore %517 %476
+ %1778 = OpFOrdLessThanEqual %bool %1777 %float_0
+ %1779 = OpSelect %float %1778 %1418 %1777
+ %1780 = OpExtInst %float %1 Log %1779
+ %1781 = OpFDiv %float %1780 %1065
+ %1782 = OpFOrdLessThanEqual %bool %1781 %1423
+ OpSelectionMerge %1783 None
+ OpBranchConditional %1782 %1784 %1785
+ %1785 = OpLabel
+ %1786 = OpFOrdGreaterThan %bool %1781 %1423
+ %1787 = OpFOrdLessThan %bool %1781 %1718
+ %1788 = OpLogicalAnd %bool %1786 %1787
+ OpSelectionMerge %1789 None
+ OpBranchConditional %1788 %1790 %1791
+ %1791 = OpLabel
+ %1792 = OpFOrdGreaterThanEqual %bool %1781 %1718
+ %1793 = OpExtInst %float %1 Log %1416
+ %1794 = OpFDiv %float %1793 %1065
+ %1795 = OpFOrdLessThan %bool %1781 %1794
+ %1796 = OpLogicalAnd %bool %1792 %1795
+ OpSelectionMerge %1797 None
+ OpBranchConditional %1796 %1798 %1799
+ %1799 = OpLabel
+ %1800 = OpExtInst %float %1 Log %float_10000
+ %1801 = OpFDiv %float %1800 %1065
+ OpBranch %1797
+ %1798 = OpLabel
+ %1802 = OpFSub %float %1781 %1718
+ %1803 = OpFMul %float %float_3 %1802
+ %1804 = OpFSub %float %1794 %1718
+ %1805 = OpFDiv %float %1803 %1804
+ %1806 = OpConvertFToS %int %1805
+ %1807 = OpConvertSToF %float %1806
+ %1808 = OpFSub %float %1805 %1807
+ %1809 = OpAccessChain %_ptr_Function_float %517 %1806
+ %1810 = OpLoad %float %1809
+ %1811 = OpIAdd %int %1806 %int_1
+ %1812 = OpAccessChain %_ptr_Function_float %517 %1811
+ %1813 = OpLoad %float %1812
+ %1814 = OpIAdd %int %1806 %int_2
+ %1815 = OpAccessChain %_ptr_Function_float %517 %1814
+ %1816 = OpLoad %float %1815
+ %1817 = OpCompositeConstruct %v3float %1810 %1813 %1816
+ %1818 = OpFMul %float %1808 %1808
+ %1819 = OpCompositeConstruct %v3float %1818 %1808 %float_1
+ %1820 = OpMatrixTimesVector %v3float %442 %1817
+ %1821 = OpDot %float %1819 %1820
+ OpBranch %1797
+ %1797 = OpLabel
+ %1822 = OpPhi %float %1801 %1799 %1821 %1798
+ OpBranch %1789
+ %1790 = OpLabel
+ %1823 = OpFSub %float %1781 %1423
+ %1824 = OpFMul %float %float_3 %1823
+ %1825 = OpFSub %float %1718 %1423
+ %1826 = OpFDiv %float %1824 %1825
+ %1827 = OpConvertFToS %int %1826
+ %1828 = OpConvertSToF %float %1827
+ %1829 = OpFSub %float %1826 %1828
+ %1830 = OpAccessChain %_ptr_Function_float %518 %1827
+ %1831 = OpLoad %float %1830
+ %1832 = OpIAdd %int %1827 %int_1
+ %1833 = OpAccessChain %_ptr_Function_float %518 %1832
+ %1834 = OpLoad %float %1833
+ %1835 = OpIAdd %int %1827 %int_2
+ %1836 = OpAccessChain %_ptr_Function_float %518 %1835
+ %1837 = OpLoad %float %1836
+ %1838 = OpCompositeConstruct %v3float %1831 %1834 %1837
+ %1839 = OpFMul %float %1829 %1829
+ %1840 = OpCompositeConstruct %v3float %1839 %1829 %float_1
+ %1841 = OpMatrixTimesVector %v3float %442 %1838
+ %1842 = OpDot %float %1840 %1841
+ OpBranch %1789
+ %1789 = OpLabel
+ %1843 = OpPhi %float %1822 %1797 %1842 %1790
+ OpBranch %1783
+ %1784 = OpLabel
+ %1844 = OpExtInst %float %1 Log %float_9_99999975en05
+ %1845 = OpFDiv %float %1844 %1065
+ OpBranch %1783
+ %1783 = OpLabel
+ %1846 = OpPhi %float %1843 %1789 %1845 %1784
+ %1847 = OpExtInst %float %1 Pow %float_10 %1846
+ %1848 = OpCompositeExtract %float %1642 0
+ OpStore %512 %482
+ OpStore %511 %483
+ %1849 = OpFOrdLessThanEqual %bool %1848 %float_0
+ %1850 = OpSelect %float %1849 %float_9_99999975en05 %1848
+ %1851 = OpExtInst %float %1 Log %1850
+ %1852 = OpFDiv %float %1851 %1065
+ %1853 = OpExtInst %float %1 Log %1716
+ %1854 = OpFDiv %float %1853 %1065
+ %1855 = OpFOrdLessThanEqual %bool %1852 %1854
+ OpSelectionMerge %1856 None
+ OpBranchConditional %1855 %1857 %1858
+ %1858 = OpLabel
+ %1859 = OpFOrdGreaterThan %bool %1852 %1854
+ %1860 = OpExtInst %float %1 Log %1775
+ %1861 = OpFDiv %float %1860 %1065
+ %1862 = OpFOrdLessThan %bool %1852 %1861
+ %1863 = OpLogicalAnd %bool %1859 %1862
+ OpSelectionMerge %1864 None
+ OpBranchConditional %1863 %1865 %1866
+ %1866 = OpLabel
+ %1867 = OpFOrdGreaterThanEqual %bool %1852 %1861
+ %1868 = OpExtInst %float %1 Log %1847
+ %1869 = OpFDiv %float %1868 %1065
+ %1870 = OpFOrdLessThan %bool %1852 %1869
+ %1871 = OpLogicalAnd %bool %1867 %1870
+ OpSelectionMerge %1872 None
+ OpBranchConditional %1871 %1873 %1874
+ %1874 = OpLabel
+ %1875 = OpFMul %float %1852 %float_0_119999997
+ %1876 = OpExtInst %float %1 Log %float_2000
+ %1877 = OpFDiv %float %1876 %1065
+ %1878 = OpFMul %float %float_0_119999997 %1868
+ %1879 = OpFDiv %float %1878 %1065
+ %1880 = OpFSub %float %1877 %1879
+ %1881 = OpFAdd %float %1875 %1880
+ OpBranch %1872
+ %1873 = OpLabel
+ %1882 = OpFSub %float %1852 %1861
+ %1883 = OpFMul %float %float_7 %1882
+ %1884 = OpFSub %float %1869 %1861
+ %1885 = OpFDiv %float %1883 %1884
+ %1886 = OpConvertFToS %int %1885
+ %1887 = OpConvertSToF %float %1886
+ %1888 = OpFSub %float %1885 %1887
+ %1889 = OpAccessChain %_ptr_Function_float %511 %1886
+ %1890 = OpLoad %float %1889
+ %1891 = OpIAdd %int %1886 %int_1
+ %1892 = OpAccessChain %_ptr_Function_float %511 %1891
+ %1893 = OpLoad %float %1892
+ %1894 = OpIAdd %int %1886 %int_2
+ %1895 = OpAccessChain %_ptr_Function_float %511 %1894
+ %1896 = OpLoad %float %1895
+ %1897 = OpCompositeConstruct %v3float %1890 %1893 %1896
+ %1898 = OpFMul %float %1888 %1888
+ %1899 = OpCompositeConstruct %v3float %1898 %1888 %float_1
+ %1900 = OpMatrixTimesVector %v3float %442 %1897
+ %1901 = OpDot %float %1899 %1900
+ OpBranch %1872
+ %1872 = OpLabel
+ %1902 = OpPhi %float %1881 %1874 %1901 %1873
+ OpBranch %1864
+ %1865 = OpLabel
+ %1903 = OpFSub %float %1852 %1854
+ %1904 = OpFMul %float %float_7 %1903
+ %1905 = OpFSub %float %1861 %1854
+ %1906 = OpFDiv %float %1904 %1905
+ %1907 = OpConvertFToS %int %1906
+ %1908 = OpConvertSToF %float %1907
+ %1909 = OpFSub %float %1906 %1908
+ %1910 = OpAccessChain %_ptr_Function_float %512 %1907
+ %1911 = OpLoad %float %1910
+ %1912 = OpIAdd %int %1907 %int_1
+ %1913 = OpAccessChain %_ptr_Function_float %512 %1912
+ %1914 = OpLoad %float %1913
+ %1915 = OpIAdd %int %1907 %int_2
+ %1916 = OpAccessChain %_ptr_Function_float %512 %1915
+ %1917 = OpLoad %float %1916
+ %1918 = OpCompositeConstruct %v3float %1911 %1914 %1917
+ %1919 = OpFMul %float %1909 %1909
+ %1920 = OpCompositeConstruct %v3float %1919 %1909 %float_1
+ %1921 = OpMatrixTimesVector %v3float %442 %1918
+ %1922 = OpDot %float %1920 %1921
+ OpBranch %1864
+ %1864 = OpLabel
+ %1923 = OpPhi %float %1902 %1872 %1922 %1865
+ OpBranch %1856
+ %1857 = OpLabel
+ %1924 = OpExtInst %float %1 Log %float_0_00499999989
+ %1925 = OpFDiv %float %1924 %1065
+ OpBranch %1856
+ %1856 = OpLabel
+ %1926 = OpPhi %float %1923 %1864 %1925 %1857
+ %1927 = OpExtInst %float %1 Pow %float_10 %1926
+ %1928 = OpCompositeInsert %v3float %1927 %391 0
+ %1929 = OpCompositeExtract %float %1642 1
+ OpStore %510 %482
+ OpStore %509 %483
+ %1930 = OpFOrdLessThanEqual %bool %1929 %float_0
+ %1931 = OpSelect %float %1930 %float_9_99999975en05 %1929
+ %1932 = OpExtInst %float %1 Log %1931
+ %1933 = OpFDiv %float %1932 %1065
+ %1934 = OpFOrdLessThanEqual %bool %1933 %1854
+ OpSelectionMerge %1935 None
+ OpBranchConditional %1934 %1936 %1937
+ %1937 = OpLabel
+ %1938 = OpFOrdGreaterThan %bool %1933 %1854
+ %1939 = OpExtInst %float %1 Log %1775
+ %1940 = OpFDiv %float %1939 %1065
+ %1941 = OpFOrdLessThan %bool %1933 %1940
+ %1942 = OpLogicalAnd %bool %1938 %1941
+ OpSelectionMerge %1943 None
+ OpBranchConditional %1942 %1944 %1945
+ %1945 = OpLabel
+ %1946 = OpFOrdGreaterThanEqual %bool %1933 %1940
+ %1947 = OpExtInst %float %1 Log %1847
+ %1948 = OpFDiv %float %1947 %1065
+ %1949 = OpFOrdLessThan %bool %1933 %1948
+ %1950 = OpLogicalAnd %bool %1946 %1949
+ OpSelectionMerge %1951 None
+ OpBranchConditional %1950 %1952 %1953
+ %1953 = OpLabel
+ %1954 = OpFMul %float %1933 %float_0_119999997
+ %1955 = OpExtInst %float %1 Log %float_2000
+ %1956 = OpFDiv %float %1955 %1065
+ %1957 = OpFMul %float %float_0_119999997 %1947
+ %1958 = OpFDiv %float %1957 %1065
+ %1959 = OpFSub %float %1956 %1958
+ %1960 = OpFAdd %float %1954 %1959
+ OpBranch %1951
+ %1952 = OpLabel
+ %1961 = OpFSub %float %1933 %1940
+ %1962 = OpFMul %float %float_7 %1961
+ %1963 = OpFSub %float %1948 %1940
+ %1964 = OpFDiv %float %1962 %1963
+ %1965 = OpConvertFToS %int %1964
+ %1966 = OpConvertSToF %float %1965
+ %1967 = OpFSub %float %1964 %1966
+ %1968 = OpAccessChain %_ptr_Function_float %509 %1965
+ %1969 = OpLoad %float %1968
+ %1970 = OpIAdd %int %1965 %int_1
+ %1971 = OpAccessChain %_ptr_Function_float %509 %1970
+ %1972 = OpLoad %float %1971
+ %1973 = OpIAdd %int %1965 %int_2
+ %1974 = OpAccessChain %_ptr_Function_float %509 %1973
+ %1975 = OpLoad %float %1974
+ %1976 = OpCompositeConstruct %v3float %1969 %1972 %1975
+ %1977 = OpFMul %float %1967 %1967
+ %1978 = OpCompositeConstruct %v3float %1977 %1967 %float_1
+ %1979 = OpMatrixTimesVector %v3float %442 %1976
+ %1980 = OpDot %float %1978 %1979
+ OpBranch %1951
+ %1951 = OpLabel
+ %1981 = OpPhi %float %1960 %1953 %1980 %1952
+ OpBranch %1943
+ %1944 = OpLabel
+ %1982 = OpFSub %float %1933 %1854
+ %1983 = OpFMul %float %float_7 %1982
+ %1984 = OpFSub %float %1940 %1854
+ %1985 = OpFDiv %float %1983 %1984
+ %1986 = OpConvertFToS %int %1985
+ %1987 = OpConvertSToF %float %1986
+ %1988 = OpFSub %float %1985 %1987
+ %1989 = OpAccessChain %_ptr_Function_float %510 %1986
+ %1990 = OpLoad %float %1989
+ %1991 = OpIAdd %int %1986 %int_1
+ %1992 = OpAccessChain %_ptr_Function_float %510 %1991
+ %1993 = OpLoad %float %1992
+ %1994 = OpIAdd %int %1986 %int_2
+ %1995 = OpAccessChain %_ptr_Function_float %510 %1994
+ %1996 = OpLoad %float %1995
+ %1997 = OpCompositeConstruct %v3float %1990 %1993 %1996
+ %1998 = OpFMul %float %1988 %1988
+ %1999 = OpCompositeConstruct %v3float %1998 %1988 %float_1
+ %2000 = OpMatrixTimesVector %v3float %442 %1997
+ %2001 = OpDot %float %1999 %2000
+ OpBranch %1943
+ %1943 = OpLabel
+ %2002 = OpPhi %float %1981 %1951 %2001 %1944
+ OpBranch %1935
+ %1936 = OpLabel
+ %2003 = OpExtInst %float %1 Log %float_0_00499999989
+ %2004 = OpFDiv %float %2003 %1065
+ OpBranch %1935
+ %1935 = OpLabel
+ %2005 = OpPhi %float %2002 %1943 %2004 %1936
+ %2006 = OpExtInst %float %1 Pow %float_10 %2005
+ %2007 = OpCompositeInsert %v3float %2006 %1928 1
+ %2008 = OpCompositeExtract %float %1642 2
+ OpStore %508 %482
+ OpStore %507 %483
+ %2009 = OpFOrdLessThanEqual %bool %2008 %float_0
+ %2010 = OpSelect %float %2009 %float_9_99999975en05 %2008
+ %2011 = OpExtInst %float %1 Log %2010
+ %2012 = OpFDiv %float %2011 %1065
+ %2013 = OpFOrdLessThanEqual %bool %2012 %1854
+ OpSelectionMerge %2014 None
+ OpBranchConditional %2013 %2015 %2016
+ %2016 = OpLabel
+ %2017 = OpFOrdGreaterThan %bool %2012 %1854
+ %2018 = OpExtInst %float %1 Log %1775
+ %2019 = OpFDiv %float %2018 %1065
+ %2020 = OpFOrdLessThan %bool %2012 %2019
+ %2021 = OpLogicalAnd %bool %2017 %2020
+ OpSelectionMerge %2022 None
+ OpBranchConditional %2021 %2023 %2024
+ %2024 = OpLabel
+ %2025 = OpFOrdGreaterThanEqual %bool %2012 %2019
+ %2026 = OpExtInst %float %1 Log %1847
+ %2027 = OpFDiv %float %2026 %1065
+ %2028 = OpFOrdLessThan %bool %2012 %2027
+ %2029 = OpLogicalAnd %bool %2025 %2028
+ OpSelectionMerge %2030 None
+ OpBranchConditional %2029 %2031 %2032
+ %2032 = OpLabel
+ %2033 = OpFMul %float %2012 %float_0_119999997
+ %2034 = OpExtInst %float %1 Log %float_2000
+ %2035 = OpFDiv %float %2034 %1065
+ %2036 = OpFMul %float %float_0_119999997 %2026
+ %2037 = OpFDiv %float %2036 %1065
+ %2038 = OpFSub %float %2035 %2037
+ %2039 = OpFAdd %float %2033 %2038
+ OpBranch %2030
+ %2031 = OpLabel
+ %2040 = OpFSub %float %2012 %2019
+ %2041 = OpFMul %float %float_7 %2040
+ %2042 = OpFSub %float %2027 %2019
+ %2043 = OpFDiv %float %2041 %2042
+ %2044 = OpConvertFToS %int %2043
+ %2045 = OpConvertSToF %float %2044
+ %2046 = OpFSub %float %2043 %2045
+ %2047 = OpAccessChain %_ptr_Function_float %507 %2044
+ %2048 = OpLoad %float %2047
+ %2049 = OpIAdd %int %2044 %int_1
+ %2050 = OpAccessChain %_ptr_Function_float %507 %2049
+ %2051 = OpLoad %float %2050
+ %2052 = OpIAdd %int %2044 %int_2
+ %2053 = OpAccessChain %_ptr_Function_float %507 %2052
+ %2054 = OpLoad %float %2053
+ %2055 = OpCompositeConstruct %v3float %2048 %2051 %2054
+ %2056 = OpFMul %float %2046 %2046
+ %2057 = OpCompositeConstruct %v3float %2056 %2046 %float_1
+ %2058 = OpMatrixTimesVector %v3float %442 %2055
+ %2059 = OpDot %float %2057 %2058
+ OpBranch %2030
+ %2030 = OpLabel
+ %2060 = OpPhi %float %2039 %2032 %2059 %2031
+ OpBranch %2022
+ %2023 = OpLabel
+ %2061 = OpFSub %float %2012 %1854
+ %2062 = OpFMul %float %float_7 %2061
+ %2063 = OpFSub %float %2019 %1854
+ %2064 = OpFDiv %float %2062 %2063
+ %2065 = OpConvertFToS %int %2064
+ %2066 = OpConvertSToF %float %2065
+ %2067 = OpFSub %float %2064 %2066
+ %2068 = OpAccessChain %_ptr_Function_float %508 %2065
+ %2069 = OpLoad %float %2068
+ %2070 = OpIAdd %int %2065 %int_1
+ %2071 = OpAccessChain %_ptr_Function_float %508 %2070
+ %2072 = OpLoad %float %2071
+ %2073 = OpIAdd %int %2065 %int_2
+ %2074 = OpAccessChain %_ptr_Function_float %508 %2073
+ %2075 = OpLoad %float %2074
+ %2076 = OpCompositeConstruct %v3float %2069 %2072 %2075
+ %2077 = OpFMul %float %2067 %2067
+ %2078 = OpCompositeConstruct %v3float %2077 %2067 %float_1
+ %2079 = OpMatrixTimesVector %v3float %442 %2076
+ %2080 = OpDot %float %2078 %2079
+ OpBranch %2022
+ %2022 = OpLabel
+ %2081 = OpPhi %float %2060 %2030 %2080 %2023
+ OpBranch %2014
+ %2015 = OpLabel
+ %2082 = OpExtInst %float %1 Log %float_0_00499999989
+ %2083 = OpFDiv %float %2082 %1065
+ OpBranch %2014
+ %2014 = OpLabel
+ %2084 = OpPhi %float %2081 %2022 %2083 %2015
+ %2085 = OpExtInst %float %1 Pow %float_10 %2084
+ %2086 = OpCompositeInsert %v3float %2085 %2007 2
+ %2087 = OpVectorTimesMatrix %v3float %2086 %576
+ %2088 = OpFMul %v3float %2087 %496
+ %2089 = OpExtInst %v3float %1 Pow %2088 %263
+ %2090 = OpFMul %v3float %184 %2089
+ %2091 = OpFAdd %v3float %183 %2090
+ %2092 = OpFMul %v3float %185 %2089
+ %2093 = OpFAdd %v3float %135 %2092
+ %2094 = OpFDiv %v3float %135 %2093
+ %2095 = OpFMul %v3float %2091 %2094
+ %2096 = OpExtInst %v3float %1 Pow %2095 %264
+ OpBranch %1236
+ %1236 = OpLabel
+ %2097 = OpPhi %v3float %1260 %1240 %2096 %2014
+ OpBranch %1230
+ %1231 = OpLabel
+ %2098 = OpMatrixTimesMatrix %mat3v3float %546 %399
+ %2099 = OpFMul %v3float %906 %262
+ %2100 = OpVectorTimesMatrix %v3float %2099 %2098
+ %2101 = OpCompositeExtract %float %2100 0
+ %2102 = OpCompositeExtract %float %2100 1
+ %2103 = OpExtInst %float %1 FMin %2101 %2102
+ %2104 = OpCompositeExtract %float %2100 2
+ %2105 = OpExtInst %float %1 FMin %2103 %2104
+ %2106 = OpExtInst %float %1 FMax %2101 %2102
+ %2107 = OpExtInst %float %1 FMax %2106 %2104
+ %2108 = OpExtInst %float %1 FMax %2107 %float_1_00000001en10
+ %2109 = OpExtInst %float %1 FMax %2105 %float_1_00000001en10
+ %2110 = OpFSub %float %2108 %2109
+ %2111 = OpExtInst %float %1 FMax %2107 %float_0_00999999978
+ %2112 = OpFDiv %float %2110 %2111
+ %2113 = OpFSub %float %2104 %2102
+ %2114 = OpFMul %float %2104 %2113
+ %2115 = OpFSub %float %2102 %2101
+ %2116 = OpFMul %float %2102 %2115
+ %2117 = OpFAdd %float %2114 %2116
+ %2118 = OpFSub %float %2101 %2104
+ %2119 = OpFMul %float %2101 %2118
+ %2120 = OpFAdd %float %2117 %2119
+ %2121 = OpExtInst %float %1 Sqrt %2120
+ %2122 = OpFAdd %float %2104 %2102
+ %2123 = OpFAdd %float %2122 %2101
+ %2124 = OpFMul %float %float_1_75 %2121
+ %2125 = OpFAdd %float %2123 %2124
+ %2126 = OpFMul %float %2125 %float_0_333333343
+ %2127 = OpFSub %float %2112 %float_0_400000006
+ %2128 = OpFMul %float %2127 %float_5
+ %2129 = OpFMul %float %2127 %float_2_5
+ %2130 = OpExtInst %float %1 FAbs %2129
+ %2131 = OpFSub %float %float_1 %2130
+ %2132 = OpExtInst %float %1 FMax %2131 %float_0
+ %2133 = OpExtInst %float %1 FSign %2128
+ %2134 = OpConvertFToS %int %2133
+ %2135 = OpConvertSToF %float %2134
+ %2136 = OpFMul %float %2132 %2132
+ %2137 = OpFSub %float %float_1 %2136
+ %2138 = OpFMul %float %2135 %2137
+ %2139 = OpFAdd %float %float_1 %2138
+ %2140 = OpFMul %float %2139 %float_0_0250000004
+ %2141 = OpFOrdLessThanEqual %bool %2126 %float_0_0533333346
+ OpSelectionMerge %2142 None
+ OpBranchConditional %2141 %2143 %2144
+ %2144 = OpLabel
+ %2145 = OpFOrdGreaterThanEqual %bool %2126 %float_0_159999996
+ OpSelectionMerge %2146 None
+ OpBranchConditional %2145 %2147 %2148
+ %2148 = OpLabel
+ %2149 = OpFDiv %float %float_0_239999995 %2125
+ %2150 = OpFSub %float %2149 %float_0_5
+ %2151 = OpFMul %float %2140 %2150
+ OpBranch %2146
+ %2147 = OpLabel
+ OpBranch %2146
+ %2146 = OpLabel
+ %2152 = OpPhi %float %2151 %2148 %float_0 %2147
+ OpBranch %2142
+ %2143 = OpLabel
+ OpBranch %2142
+ %2142 = OpLabel
+ %2153 = OpPhi %float %2152 %2146 %2140 %2143
+ %2154 = OpFAdd %float %float_1 %2153
+ %2155 = OpCompositeConstruct %v3float %2154 %2154 %2154
+ %2156 = OpFMul %v3float %2100 %2155
+ %2157 = OpCompositeExtract %float %2156 0
+ %2158 = OpCompositeExtract %float %2156 1
+ %2159 = OpFOrdEqual %bool %2157 %2158
+ %2160 = OpCompositeExtract %float %2156 2
+ %2161 = OpFOrdEqual %bool %2158 %2160
+ %2162 = OpLogicalAnd %bool %2159 %2161
+ OpSelectionMerge %2163 None
+ OpBranchConditional %2162 %2164 %2165
+ %2165 = OpLabel
+ %2166 = OpExtInst %float %1 Sqrt %float_3
+ %2167 = OpFSub %float %2158 %2160
+ %2168 = OpFMul %float %2166 %2167
+ %2169 = OpFMul %float %float_2 %2157
+ %2170 = OpFSub %float %2169 %2158
+ %2171 = OpFSub %float %2170 %2160
+ %2172 = OpExtInst %float %1 Atan2 %2168 %2171
+ %2173 = OpFMul %float %float_57_2957764 %2172
+ OpBranch %2163
+ %2164 = OpLabel
+ OpBranch %2163
+ %2163 = OpLabel
+ %2174 = OpPhi %float %2173 %2165 %float_0 %2164
+ %2175 = OpFOrdLessThan %bool %2174 %float_0
+ OpSelectionMerge %2176 None
+ OpBranchConditional %2175 %2177 %2176
+ %2177 = OpLabel
+ %2178 = OpFAdd %float %2174 %float_360
+ OpBranch %2176
+ %2176 = OpLabel
+ %2179 = OpPhi %float %2174 %2163 %2178 %2177
+ %2180 = OpExtInst %float %1 FClamp %2179 %float_0 %float_360
+ %2181 = OpFOrdGreaterThan %bool %2180 %float_180
+ OpSelectionMerge %2182 None
+ OpBranchConditional %2181 %2183 %2182
+ %2183 = OpLabel
+ %2184 = OpFSub %float %2180 %float_360
+ OpBranch %2182
+ %2182 = OpLabel
+ %2185 = OpPhi %float %2180 %2176 %2184 %2183
+ %2186 = OpFOrdGreaterThan %bool %2185 %float_n67_5
+ %2187 = OpFOrdLessThan %bool %2185 %float_67_5
+ %2188 = OpLogicalAnd %bool %2186 %2187
+ OpSelectionMerge %2189 None
+ OpBranchConditional %2188 %2190 %2189
+ %2190 = OpLabel
+ %2191 = OpFSub %float %2185 %float_n67_5
+ %2192 = OpFMul %float %2191 %float_0_0296296291
+ %2193 = OpConvertFToS %int %2192
+ %2194 = OpConvertSToF %float %2193
+ %2195 = OpFSub %float %2192 %2194
+ %2196 = OpFMul %float %2195 %2195
+ %2197 = OpFMul %float %2196 %2195
+ %2198 = OpIEqual %bool %2193 %int_3
+ OpSelectionMerge %2199 None
+ OpBranchConditional %2198 %2200 %2201
+ %2201 = OpLabel
+ %2202 = OpIEqual %bool %2193 %int_2
+ OpSelectionMerge %2203 None
+ OpBranchConditional %2202 %2204 %2205
+ %2205 = OpLabel
+ %2206 = OpIEqual %bool %2193 %int_1
+ OpSelectionMerge %2207 None
+ OpBranchConditional %2206 %2208 %2209
+ %2209 = OpLabel
+ %2210 = OpIEqual %bool %2193 %int_0
+ OpSelectionMerge %2211 None
+ OpBranchConditional %2210 %2212 %2213
+ %2213 = OpLabel
+ OpBranch %2211
+ %2212 = OpLabel
+ %2214 = OpFMul %float %2197 %float_0_166666672
+ OpBranch %2211
+ %2211 = OpLabel
+ %2215 = OpPhi %float %float_0 %2213 %2214 %2212
+ OpBranch %2207
+ %2208 = OpLabel
+ %2216 = OpFMul %float %2197 %float_n0_5
+ %2217 = OpFMul %float %2196 %float_0_5
+ %2218 = OpFAdd %float %2216 %2217
+ %2219 = OpFMul %float %2195 %float_0_5
+ %2220 = OpFAdd %float %2218 %2219
+ %2221 = OpFAdd %float %2220 %float_0_166666672
+ OpBranch %2207
+ %2207 = OpLabel
+ %2222 = OpPhi %float %2215 %2211 %2221 %2208
+ OpBranch %2203
+ %2204 = OpLabel
+ %2223 = OpFMul %float %2197 %float_0_5
+ %2224 = OpFMul %float %2196 %float_n1
+ %2225 = OpFAdd %float %2223 %2224
+ %2226 = OpFAdd %float %2225 %float_0_666666687
+ OpBranch %2203
+ %2203 = OpLabel
+ %2227 = OpPhi %float %2222 %2207 %2226 %2204
+ OpBranch %2199
+ %2200 = OpLabel
+ %2228 = OpFMul %float %2197 %float_n0_166666672
+ %2229 = OpFMul %float %2196 %float_0_5
+ %2230 = OpFAdd %float %2228 %2229
+ %2231 = OpFMul %float %2195 %float_n0_5
+ %2232 = OpFAdd %float %2230 %2231
+ %2233 = OpFAdd %float %2232 %float_0_166666672
+ OpBranch %2199
+ %2199 = OpLabel
+ %2234 = OpPhi %float %2227 %2203 %2233 %2200
+ OpBranch %2189
+ %2189 = OpLabel
+ %2235 = OpPhi %float %float_0 %2182 %2234 %2199
+ %2236 = OpFMul %float %2235 %float_1_5
+ %2237 = OpFMul %float %2236 %2112
+ %2238 = OpFSub %float %float_0_0299999993 %2157
+ %2239 = OpFMul %float %2237 %2238
+ %2240 = OpFMul %float %2239 %float_0_180000007
+ %2241 = OpFAdd %float %2157 %2240
+ %2242 = OpCompositeInsert %v3float %2241 %2156 0
+ %2243 = OpExtInst %v3float %1 FClamp %2242 %132 %314
+ %2244 = OpVectorTimesMatrix %v3float %2243 %410
+ %2245 = OpExtInst %v3float %1 FClamp %2244 %132 %314
+ %2246 = OpDot %float %2245 %67
+ %2247 = OpCompositeConstruct %v3float %2246 %2246 %2246
+ %2248 = OpExtInst %v3float %1 FMix %2247 %2245 %228
+ %2249 = OpCompositeExtract %float %2248 0
+ %2250 = OpExtInst %float %1 Exp2 %float_n15
+ %2251 = OpFMul %float %float_0_179999992 %2250
+ %2252 = OpExtInst %float %1 Exp2 %float_18
+ %2253 = OpFMul %float %float_0_179999992 %2252
+ OpStore %520 %475
+ OpStore %519 %476
+ %2254 = OpFOrdLessThanEqual %bool %2249 %float_0
+ %2255 = OpExtInst %float %1 Exp2 %float_n14
+ %2256 = OpSelect %float %2254 %2255 %2249
+ %2257 = OpExtInst %float %1 Log %2256
+ %2258 = OpFDiv %float %2257 %1065
+ %2259 = OpExtInst %float %1 Log %2251
+ %2260 = OpFDiv %float %2259 %1065
+ %2261 = OpFOrdLessThanEqual %bool %2258 %2260
+ OpSelectionMerge %2262 None
+ OpBranchConditional %2261 %2263 %2264
+ %2264 = OpLabel
+ %2265 = OpFOrdGreaterThan %bool %2258 %2260
+ %2266 = OpExtInst %float %1 Log %float_0_180000007
+ %2267 = OpFDiv %float %2266 %1065
+ %2268 = OpFOrdLessThan %bool %2258 %2267
+ %2269 = OpLogicalAnd %bool %2265 %2268
+ OpSelectionMerge %2270 None
+ OpBranchConditional %2269 %2271 %2272
+ %2272 = OpLabel
+ %2273 = OpFOrdGreaterThanEqual %bool %2258 %2267
+ %2274 = OpExtInst %float %1 Log %2253
+ %2275 = OpFDiv %float %2274 %1065
+ %2276 = OpFOrdLessThan %bool %2258 %2275
+ %2277 = OpLogicalAnd %bool %2273 %2276
+ OpSelectionMerge %2278 None
+ OpBranchConditional %2277 %2279 %2280
+ %2280 = OpLabel
+ %2281 = OpExtInst %float %1 Log %float_10000
+ %2282 = OpFDiv %float %2281 %1065
+ OpBranch %2278
+ %2279 = OpLabel
+ %2283 = OpFSub %float %2258 %2267
+ %2284 = OpFMul %float %float_3 %2283
+ %2285 = OpFSub %float %2275 %2267
+ %2286 = OpFDiv %float %2284 %2285
+ %2287 = OpConvertFToS %int %2286
+ %2288 = OpConvertSToF %float %2287
+ %2289 = OpFSub %float %2286 %2288
+ %2290 = OpAccessChain %_ptr_Function_float %519 %2287
+ %2291 = OpLoad %float %2290
+ %2292 = OpIAdd %int %2287 %int_1
+ %2293 = OpAccessChain %_ptr_Function_float %519 %2292
+ %2294 = OpLoad %float %2293
+ %2295 = OpIAdd %int %2287 %int_2
+ %2296 = OpAccessChain %_ptr_Function_float %519 %2295
+ %2297 = OpLoad %float %2296
+ %2298 = OpCompositeConstruct %v3float %2291 %2294 %2297
+ %2299 = OpFMul %float %2289 %2289
+ %2300 = OpCompositeConstruct %v3float %2299 %2289 %float_1
+ %2301 = OpMatrixTimesVector %v3float %442 %2298
+ %2302 = OpDot %float %2300 %2301
+ OpBranch %2278
+ %2278 = OpLabel
+ %2303 = OpPhi %float %2282 %2280 %2302 %2279
+ OpBranch %2270
+ %2271 = OpLabel
+ %2304 = OpFSub %float %2258 %2260
+ %2305 = OpFMul %float %float_3 %2304
+ %2306 = OpFSub %float %2267 %2260
+ %2307 = OpFDiv %float %2305 %2306
+ %2308 = OpConvertFToS %int %2307
+ %2309 = OpConvertSToF %float %2308
+ %2310 = OpFSub %float %2307 %2309
+ %2311 = OpAccessChain %_ptr_Function_float %520 %2308
+ %2312 = OpLoad %float %2311
+ %2313 = OpIAdd %int %2308 %int_1
+ %2314 = OpAccessChain %_ptr_Function_float %520 %2313
+ %2315 = OpLoad %float %2314
+ %2316 = OpIAdd %int %2308 %int_2
+ %2317 = OpAccessChain %_ptr_Function_float %520 %2316
+ %2318 = OpLoad %float %2317
+ %2319 = OpCompositeConstruct %v3float %2312 %2315 %2318
+ %2320 = OpFMul %float %2310 %2310
+ %2321 = OpCompositeConstruct %v3float %2320 %2310 %float_1
+ %2322 = OpMatrixTimesVector %v3float %442 %2319
+ %2323 = OpDot %float %2321 %2322
+ OpBranch %2270
+ %2270 = OpLabel
+ %2324 = OpPhi %float %2303 %2278 %2323 %2271
+ OpBranch %2262
+ %2263 = OpLabel
+ %2325 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2326 = OpFDiv %float %2325 %1065
+ OpBranch %2262
+ %2262 = OpLabel
+ %2327 = OpPhi %float %2324 %2270 %2326 %2263
+ %2328 = OpExtInst %float %1 Pow %float_10 %2327
+ %2329 = OpCompositeInsert %v3float %2328 %391 0
+ %2330 = OpCompositeExtract %float %2248 1
+ OpStore %522 %475
+ OpStore %521 %476
+ %2331 = OpFOrdLessThanEqual %bool %2330 %float_0
+ %2332 = OpSelect %float %2331 %2255 %2330
+ %2333 = OpExtInst %float %1 Log %2332
+ %2334 = OpFDiv %float %2333 %1065
+ %2335 = OpFOrdLessThanEqual %bool %2334 %2260
+ OpSelectionMerge %2336 None
+ OpBranchConditional %2335 %2337 %2338
+ %2338 = OpLabel
+ %2339 = OpFOrdGreaterThan %bool %2334 %2260
+ %2340 = OpExtInst %float %1 Log %float_0_180000007
+ %2341 = OpFDiv %float %2340 %1065
+ %2342 = OpFOrdLessThan %bool %2334 %2341
+ %2343 = OpLogicalAnd %bool %2339 %2342
+ OpSelectionMerge %2344 None
+ OpBranchConditional %2343 %2345 %2346
+ %2346 = OpLabel
+ %2347 = OpFOrdGreaterThanEqual %bool %2334 %2341
+ %2348 = OpExtInst %float %1 Log %2253
+ %2349 = OpFDiv %float %2348 %1065
+ %2350 = OpFOrdLessThan %bool %2334 %2349
+ %2351 = OpLogicalAnd %bool %2347 %2350
+ OpSelectionMerge %2352 None
+ OpBranchConditional %2351 %2353 %2354
+ %2354 = OpLabel
+ %2355 = OpExtInst %float %1 Log %float_10000
+ %2356 = OpFDiv %float %2355 %1065
+ OpBranch %2352
+ %2353 = OpLabel
+ %2357 = OpFSub %float %2334 %2341
+ %2358 = OpFMul %float %float_3 %2357
+ %2359 = OpFSub %float %2349 %2341
+ %2360 = OpFDiv %float %2358 %2359
+ %2361 = OpConvertFToS %int %2360
+ %2362 = OpConvertSToF %float %2361
+ %2363 = OpFSub %float %2360 %2362
+ %2364 = OpAccessChain %_ptr_Function_float %521 %2361
+ %2365 = OpLoad %float %2364
+ %2366 = OpIAdd %int %2361 %int_1
+ %2367 = OpAccessChain %_ptr_Function_float %521 %2366
+ %2368 = OpLoad %float %2367
+ %2369 = OpIAdd %int %2361 %int_2
+ %2370 = OpAccessChain %_ptr_Function_float %521 %2369
+ %2371 = OpLoad %float %2370
+ %2372 = OpCompositeConstruct %v3float %2365 %2368 %2371
+ %2373 = OpFMul %float %2363 %2363
+ %2374 = OpCompositeConstruct %v3float %2373 %2363 %float_1
+ %2375 = OpMatrixTimesVector %v3float %442 %2372
+ %2376 = OpDot %float %2374 %2375
+ OpBranch %2352
+ %2352 = OpLabel
+ %2377 = OpPhi %float %2356 %2354 %2376 %2353
+ OpBranch %2344
+ %2345 = OpLabel
+ %2378 = OpFSub %float %2334 %2260
+ %2379 = OpFMul %float %float_3 %2378
+ %2380 = OpFSub %float %2341 %2260
+ %2381 = OpFDiv %float %2379 %2380
+ %2382 = OpConvertFToS %int %2381
+ %2383 = OpConvertSToF %float %2382
+ %2384 = OpFSub %float %2381 %2383
+ %2385 = OpAccessChain %_ptr_Function_float %522 %2382
+ %2386 = OpLoad %float %2385
+ %2387 = OpIAdd %int %2382 %int_1
+ %2388 = OpAccessChain %_ptr_Function_float %522 %2387
+ %2389 = OpLoad %float %2388
+ %2390 = OpIAdd %int %2382 %int_2
+ %2391 = OpAccessChain %_ptr_Function_float %522 %2390
+ %2392 = OpLoad %float %2391
+ %2393 = OpCompositeConstruct %v3float %2386 %2389 %2392
+ %2394 = OpFMul %float %2384 %2384
+ %2395 = OpCompositeConstruct %v3float %2394 %2384 %float_1
+ %2396 = OpMatrixTimesVector %v3float %442 %2393
+ %2397 = OpDot %float %2395 %2396
+ OpBranch %2344
+ %2344 = OpLabel
+ %2398 = OpPhi %float %2377 %2352 %2397 %2345
+ OpBranch %2336
+ %2337 = OpLabel
+ %2399 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2400 = OpFDiv %float %2399 %1065
+ OpBranch %2336
+ %2336 = OpLabel
+ %2401 = OpPhi %float %2398 %2344 %2400 %2337
+ %2402 = OpExtInst %float %1 Pow %float_10 %2401
+ %2403 = OpCompositeInsert %v3float %2402 %2329 1
+ %2404 = OpCompositeExtract %float %2248 2
+ OpStore %524 %475
+ OpStore %523 %476
+ %2405 = OpFOrdLessThanEqual %bool %2404 %float_0
+ %2406 = OpSelect %float %2405 %2255 %2404
+ %2407 = OpExtInst %float %1 Log %2406
+ %2408 = OpFDiv %float %2407 %1065
+ %2409 = OpFOrdLessThanEqual %bool %2408 %2260
+ OpSelectionMerge %2410 None
+ OpBranchConditional %2409 %2411 %2412
+ %2412 = OpLabel
+ %2413 = OpFOrdGreaterThan %bool %2408 %2260
+ %2414 = OpExtInst %float %1 Log %float_0_180000007
+ %2415 = OpFDiv %float %2414 %1065
+ %2416 = OpFOrdLessThan %bool %2408 %2415
+ %2417 = OpLogicalAnd %bool %2413 %2416
+ OpSelectionMerge %2418 None
+ OpBranchConditional %2417 %2419 %2420
+ %2420 = OpLabel
+ %2421 = OpFOrdGreaterThanEqual %bool %2408 %2415
+ %2422 = OpExtInst %float %1 Log %2253
+ %2423 = OpFDiv %float %2422 %1065
+ %2424 = OpFOrdLessThan %bool %2408 %2423
+ %2425 = OpLogicalAnd %bool %2421 %2424
+ OpSelectionMerge %2426 None
+ OpBranchConditional %2425 %2427 %2428
+ %2428 = OpLabel
+ %2429 = OpExtInst %float %1 Log %float_10000
+ %2430 = OpFDiv %float %2429 %1065
+ OpBranch %2426
+ %2427 = OpLabel
+ %2431 = OpFSub %float %2408 %2415
+ %2432 = OpFMul %float %float_3 %2431
+ %2433 = OpFSub %float %2423 %2415
+ %2434 = OpFDiv %float %2432 %2433
+ %2435 = OpConvertFToS %int %2434
+ %2436 = OpConvertSToF %float %2435
+ %2437 = OpFSub %float %2434 %2436
+ %2438 = OpAccessChain %_ptr_Function_float %523 %2435
+ %2439 = OpLoad %float %2438
+ %2440 = OpIAdd %int %2435 %int_1
+ %2441 = OpAccessChain %_ptr_Function_float %523 %2440
+ %2442 = OpLoad %float %2441
+ %2443 = OpIAdd %int %2435 %int_2
+ %2444 = OpAccessChain %_ptr_Function_float %523 %2443
+ %2445 = OpLoad %float %2444
+ %2446 = OpCompositeConstruct %v3float %2439 %2442 %2445
+ %2447 = OpFMul %float %2437 %2437
+ %2448 = OpCompositeConstruct %v3float %2447 %2437 %float_1
+ %2449 = OpMatrixTimesVector %v3float %442 %2446
+ %2450 = OpDot %float %2448 %2449
+ OpBranch %2426
+ %2426 = OpLabel
+ %2451 = OpPhi %float %2430 %2428 %2450 %2427
+ OpBranch %2418
+ %2419 = OpLabel
+ %2452 = OpFSub %float %2408 %2260
+ %2453 = OpFMul %float %float_3 %2452
+ %2454 = OpFSub %float %2415 %2260
+ %2455 = OpFDiv %float %2453 %2454
+ %2456 = OpConvertFToS %int %2455
+ %2457 = OpConvertSToF %float %2456
+ %2458 = OpFSub %float %2455 %2457
+ %2459 = OpAccessChain %_ptr_Function_float %524 %2456
+ %2460 = OpLoad %float %2459
+ %2461 = OpIAdd %int %2456 %int_1
+ %2462 = OpAccessChain %_ptr_Function_float %524 %2461
+ %2463 = OpLoad %float %2462
+ %2464 = OpIAdd %int %2456 %int_2
+ %2465 = OpAccessChain %_ptr_Function_float %524 %2464
+ %2466 = OpLoad %float %2465
+ %2467 = OpCompositeConstruct %v3float %2460 %2463 %2466
+ %2468 = OpFMul %float %2458 %2458
+ %2469 = OpCompositeConstruct %v3float %2468 %2458 %float_1
+ %2470 = OpMatrixTimesVector %v3float %442 %2467
+ %2471 = OpDot %float %2469 %2470
+ OpBranch %2418
+ %2418 = OpLabel
+ %2472 = OpPhi %float %2451 %2426 %2471 %2419
+ OpBranch %2410
+ %2411 = OpLabel
+ %2473 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2474 = OpFDiv %float %2473 %1065
+ OpBranch %2410
+ %2410 = OpLabel
+ %2475 = OpPhi %float %2472 %2418 %2474 %2411
+ %2476 = OpExtInst %float %1 Pow %float_10 %2475
+ %2477 = OpCompositeInsert %v3float %2476 %2403 2
+ %2478 = OpVectorTimesMatrix %v3float %2477 %414
+ %2479 = OpVectorTimesMatrix %v3float %2478 %410
+ %2480 = OpExtInst %float %1 Pow %float_2 %float_n12
+ %2481 = OpFMul %float %float_0_179999992 %2480
+ OpStore %532 %475
+ OpStore %531 %476
+ %2482 = OpFOrdLessThanEqual %bool %2481 %float_0
+ %2483 = OpSelect %float %2482 %2255 %2481
+ %2484 = OpExtInst %float %1 Log %2483
+ %2485 = OpFDiv %float %2484 %1065
+ %2486 = OpFOrdLessThanEqual %bool %2485 %2260
+ OpSelectionMerge %2487 None
+ OpBranchConditional %2486 %2488 %2489
+ %2489 = OpLabel
+ %2490 = OpFOrdGreaterThan %bool %2485 %2260
+ %2491 = OpExtInst %float %1 Log %float_0_180000007
+ %2492 = OpFDiv %float %2491 %1065
+ %2493 = OpFOrdLessThan %bool %2485 %2492
+ %2494 = OpLogicalAnd %bool %2490 %2493
+ OpSelectionMerge %2495 None
+ OpBranchConditional %2494 %2496 %2497
+ %2497 = OpLabel
+ %2498 = OpFOrdGreaterThanEqual %bool %2485 %2492
+ %2499 = OpExtInst %float %1 Log %2253
+ %2500 = OpFDiv %float %2499 %1065
+ %2501 = OpFOrdLessThan %bool %2485 %2500
+ %2502 = OpLogicalAnd %bool %2498 %2501
+ OpSelectionMerge %2503 None
+ OpBranchConditional %2502 %2504 %2505
+ %2505 = OpLabel
+ %2506 = OpExtInst %float %1 Log %float_10000
+ %2507 = OpFDiv %float %2506 %1065
+ OpBranch %2503
+ %2504 = OpLabel
+ %2508 = OpFSub %float %2485 %2492
+ %2509 = OpFMul %float %float_3 %2508
+ %2510 = OpFSub %float %2500 %2492
+ %2511 = OpFDiv %float %2509 %2510
+ %2512 = OpConvertFToS %int %2511
+ %2513 = OpConvertSToF %float %2512
+ %2514 = OpFSub %float %2511 %2513
+ %2515 = OpAccessChain %_ptr_Function_float %531 %2512
+ %2516 = OpLoad %float %2515
+ %2517 = OpIAdd %int %2512 %int_1
+ %2518 = OpAccessChain %_ptr_Function_float %531 %2517
+ %2519 = OpLoad %float %2518
+ %2520 = OpIAdd %int %2512 %int_2
+ %2521 = OpAccessChain %_ptr_Function_float %531 %2520
+ %2522 = OpLoad %float %2521
+ %2523 = OpCompositeConstruct %v3float %2516 %2519 %2522
+ %2524 = OpFMul %float %2514 %2514
+ %2525 = OpCompositeConstruct %v3float %2524 %2514 %float_1
+ %2526 = OpMatrixTimesVector %v3float %442 %2523
+ %2527 = OpDot %float %2525 %2526
+ OpBranch %2503
+ %2503 = OpLabel
+ %2528 = OpPhi %float %2507 %2505 %2527 %2504
+ OpBranch %2495
+ %2496 = OpLabel
+ %2529 = OpFSub %float %2485 %2260
+ %2530 = OpFMul %float %float_3 %2529
+ %2531 = OpFSub %float %2492 %2260
+ %2532 = OpFDiv %float %2530 %2531
+ %2533 = OpConvertFToS %int %2532
+ %2534 = OpConvertSToF %float %2533
+ %2535 = OpFSub %float %2532 %2534
+ %2536 = OpAccessChain %_ptr_Function_float %532 %2533
+ %2537 = OpLoad %float %2536
+ %2538 = OpIAdd %int %2533 %int_1
+ %2539 = OpAccessChain %_ptr_Function_float %532 %2538
+ %2540 = OpLoad %float %2539
+ %2541 = OpIAdd %int %2533 %int_2
+ %2542 = OpAccessChain %_ptr_Function_float %532 %2541
+ %2543 = OpLoad %float %2542
+ %2544 = OpCompositeConstruct %v3float %2537 %2540 %2543
+ %2545 = OpFMul %float %2535 %2535
+ %2546 = OpCompositeConstruct %v3float %2545 %2535 %float_1
+ %2547 = OpMatrixTimesVector %v3float %442 %2544
+ %2548 = OpDot %float %2546 %2547
+ OpBranch %2495
+ %2495 = OpLabel
+ %2549 = OpPhi %float %2528 %2503 %2548 %2496
+ OpBranch %2487
+ %2488 = OpLabel
+ %2550 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2551 = OpFDiv %float %2550 %1065
+ OpBranch %2487
+ %2487 = OpLabel
+ %2552 = OpPhi %float %2549 %2495 %2551 %2488
+ %2553 = OpExtInst %float %1 Pow %float_10 %2552
+ OpStore %534 %475
+ OpStore %533 %476
+ %2554 = OpExtInst %float %1 Log %float_0_180000007
+ %2555 = OpFDiv %float %2554 %1065
+ %2556 = OpFOrdLessThanEqual %bool %2555 %2260
+ OpSelectionMerge %2557 None
+ OpBranchConditional %2556 %2558 %2559
+ %2559 = OpLabel
+ %2560 = OpFOrdGreaterThan %bool %2555 %2260
+ %2561 = OpFOrdLessThan %bool %2555 %2555
+ %2562 = OpLogicalAnd %bool %2560 %2561
+ OpSelectionMerge %2563 None
+ OpBranchConditional %2562 %2564 %2565
+ %2565 = OpLabel
+ %2566 = OpFOrdGreaterThanEqual %bool %2555 %2555
+ %2567 = OpExtInst %float %1 Log %2253
+ %2568 = OpFDiv %float %2567 %1065
+ %2569 = OpFOrdLessThan %bool %2555 %2568
+ %2570 = OpLogicalAnd %bool %2566 %2569
+ OpSelectionMerge %2571 None
+ OpBranchConditional %2570 %2572 %2573
+ %2573 = OpLabel
+ %2574 = OpExtInst %float %1 Log %float_10000
+ %2575 = OpFDiv %float %2574 %1065
+ OpBranch %2571
+ %2572 = OpLabel
+ %2576 = OpFSub %float %2555 %2555
+ %2577 = OpFMul %float %float_3 %2576
+ %2578 = OpFSub %float %2568 %2555
+ %2579 = OpFDiv %float %2577 %2578
+ %2580 = OpConvertFToS %int %2579
+ %2581 = OpConvertSToF %float %2580
+ %2582 = OpFSub %float %2579 %2581
+ %2583 = OpAccessChain %_ptr_Function_float %533 %2580
+ %2584 = OpLoad %float %2583
+ %2585 = OpIAdd %int %2580 %int_1
+ %2586 = OpAccessChain %_ptr_Function_float %533 %2585
+ %2587 = OpLoad %float %2586
+ %2588 = OpIAdd %int %2580 %int_2
+ %2589 = OpAccessChain %_ptr_Function_float %533 %2588
+ %2590 = OpLoad %float %2589
+ %2591 = OpCompositeConstruct %v3float %2584 %2587 %2590
+ %2592 = OpFMul %float %2582 %2582
+ %2593 = OpCompositeConstruct %v3float %2592 %2582 %float_1
+ %2594 = OpMatrixTimesVector %v3float %442 %2591
+ %2595 = OpDot %float %2593 %2594
+ OpBranch %2571
+ %2571 = OpLabel
+ %2596 = OpPhi %float %2575 %2573 %2595 %2572
+ OpBranch %2563
+ %2564 = OpLabel
+ %2597 = OpFSub %float %2555 %2260
+ %2598 = OpFMul %float %float_3 %2597
+ %2599 = OpAccessChain %_ptr_Function_float %534 %int_3
+ %2600 = OpLoad %float %2599
+ %2601 = OpAccessChain %_ptr_Function_float %534 %int_4
+ %2602 = OpLoad %float %2601
+ %2603 = OpAccessChain %_ptr_Function_float %534 %int_5
+ %2604 = OpLoad %float %2603
+ %2605 = OpCompositeConstruct %v3float %2600 %2602 %2604
+ %2606 = OpMatrixTimesVector %v3float %442 %2605
+ %2607 = OpCompositeExtract %float %2606 2
+ OpBranch %2563
+ %2563 = OpLabel
+ %2608 = OpPhi %float %2596 %2571 %2607 %2564
+ OpBranch %2557
+ %2558 = OpLabel
+ %2609 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2610 = OpFDiv %float %2609 %1065
+ OpBranch %2557
+ %2557 = OpLabel
+ %2611 = OpPhi %float %2608 %2563 %2610 %2558
+ %2612 = OpExtInst %float %1 Pow %float_10 %2611
+ %2613 = OpExtInst %float %1 Pow %float_2 %float_10
+ %2614 = OpFMul %float %float_0_179999992 %2613
+ OpStore %536 %475
+ OpStore %535 %476
+ %2615 = OpFOrdLessThanEqual %bool %2614 %float_0
+ %2616 = OpSelect %float %2615 %2255 %2614
+ %2617 = OpExtInst %float %1 Log %2616
+ %2618 = OpFDiv %float %2617 %1065
+ %2619 = OpFOrdLessThanEqual %bool %2618 %2260
+ OpSelectionMerge %2620 None
+ OpBranchConditional %2619 %2621 %2622
+ %2622 = OpLabel
+ %2623 = OpFOrdGreaterThan %bool %2618 %2260
+ %2624 = OpFOrdLessThan %bool %2618 %2555
+ %2625 = OpLogicalAnd %bool %2623 %2624
+ OpSelectionMerge %2626 None
+ OpBranchConditional %2625 %2627 %2628
+ %2628 = OpLabel
+ %2629 = OpFOrdGreaterThanEqual %bool %2618 %2555
+ %2630 = OpExtInst %float %1 Log %2253
+ %2631 = OpFDiv %float %2630 %1065
+ %2632 = OpFOrdLessThan %bool %2618 %2631
+ %2633 = OpLogicalAnd %bool %2629 %2632
+ OpSelectionMerge %2634 None
+ OpBranchConditional %2633 %2635 %2636
+ %2636 = OpLabel
+ %2637 = OpExtInst %float %1 Log %float_10000
+ %2638 = OpFDiv %float %2637 %1065
+ OpBranch %2634
+ %2635 = OpLabel
+ %2639 = OpFSub %float %2618 %2555
+ %2640 = OpFMul %float %float_3 %2639
+ %2641 = OpFSub %float %2631 %2555
+ %2642 = OpFDiv %float %2640 %2641
+ %2643 = OpConvertFToS %int %2642
+ %2644 = OpConvertSToF %float %2643
+ %2645 = OpFSub %float %2642 %2644
+ %2646 = OpAccessChain %_ptr_Function_float %535 %2643
+ %2647 = OpLoad %float %2646
+ %2648 = OpIAdd %int %2643 %int_1
+ %2649 = OpAccessChain %_ptr_Function_float %535 %2648
+ %2650 = OpLoad %float %2649
+ %2651 = OpIAdd %int %2643 %int_2
+ %2652 = OpAccessChain %_ptr_Function_float %535 %2651
+ %2653 = OpLoad %float %2652
+ %2654 = OpCompositeConstruct %v3float %2647 %2650 %2653
+ %2655 = OpFMul %float %2645 %2645
+ %2656 = OpCompositeConstruct %v3float %2655 %2645 %float_1
+ %2657 = OpMatrixTimesVector %v3float %442 %2654
+ %2658 = OpDot %float %2656 %2657
+ OpBranch %2634
+ %2634 = OpLabel
+ %2659 = OpPhi %float %2638 %2636 %2658 %2635
+ OpBranch %2626
+ %2627 = OpLabel
+ %2660 = OpFSub %float %2618 %2260
+ %2661 = OpFMul %float %float_3 %2660
+ %2662 = OpFSub %float %2555 %2260
+ %2663 = OpFDiv %float %2661 %2662
+ %2664 = OpConvertFToS %int %2663
+ %2665 = OpConvertSToF %float %2664
+ %2666 = OpFSub %float %2663 %2665
+ %2667 = OpAccessChain %_ptr_Function_float %536 %2664
+ %2668 = OpLoad %float %2667
+ %2669 = OpIAdd %int %2664 %int_1
+ %2670 = OpAccessChain %_ptr_Function_float %536 %2669
+ %2671 = OpLoad %float %2670
+ %2672 = OpIAdd %int %2664 %int_2
+ %2673 = OpAccessChain %_ptr_Function_float %536 %2672
+ %2674 = OpLoad %float %2673
+ %2675 = OpCompositeConstruct %v3float %2668 %2671 %2674
+ %2676 = OpFMul %float %2666 %2666
+ %2677 = OpCompositeConstruct %v3float %2676 %2666 %float_1
+ %2678 = OpMatrixTimesVector %v3float %442 %2675
+ %2679 = OpDot %float %2677 %2678
+ OpBranch %2626
+ %2626 = OpLabel
+ %2680 = OpPhi %float %2659 %2634 %2679 %2627
+ OpBranch %2620
+ %2621 = OpLabel
+ %2681 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2682 = OpFDiv %float %2681 %1065
+ OpBranch %2620
+ %2620 = OpLabel
+ %2683 = OpPhi %float %2680 %2626 %2682 %2621
+ %2684 = OpExtInst %float %1 Pow %float_10 %2683
+ %2685 = OpCompositeExtract %float %2479 0
+ OpStore %530 %479
+ OpStore %529 %480
+ %2686 = OpFOrdLessThanEqual %bool %2685 %float_0
+ %2687 = OpSelect %float %2686 %float_9_99999975en05 %2685
+ %2688 = OpExtInst %float %1 Log %2687
+ %2689 = OpFDiv %float %2688 %1065
+ %2690 = OpExtInst %float %1 Log %2553
+ %2691 = OpFDiv %float %2690 %1065
+ %2692 = OpFOrdLessThanEqual %bool %2689 %2691
+ OpSelectionMerge %2693 None
+ OpBranchConditional %2692 %2694 %2695
+ %2695 = OpLabel
+ %2696 = OpFOrdGreaterThan %bool %2689 %2691
+ %2697 = OpExtInst %float %1 Log %2612
+ %2698 = OpFDiv %float %2697 %1065
+ %2699 = OpFOrdLessThan %bool %2689 %2698
+ %2700 = OpLogicalAnd %bool %2696 %2699
+ OpSelectionMerge %2701 None
+ OpBranchConditional %2700 %2702 %2703
+ %2703 = OpLabel
+ %2704 = OpFOrdGreaterThanEqual %bool %2689 %2698
+ %2705 = OpExtInst %float %1 Log %2684
+ %2706 = OpFDiv %float %2705 %1065
+ %2707 = OpFOrdLessThan %bool %2689 %2706
+ %2708 = OpLogicalAnd %bool %2704 %2707
+ OpSelectionMerge %2709 None
+ OpBranchConditional %2708 %2710 %2711
+ %2711 = OpLabel
+ %2712 = OpFMul %float %2689 %float_0_0599999987
+ %2713 = OpExtInst %float %1 Log %float_1000
+ %2714 = OpFDiv %float %2713 %1065
+ %2715 = OpFMul %float %float_0_0599999987 %2705
+ %2716 = OpFDiv %float %2715 %1065
+ %2717 = OpFSub %float %2714 %2716
+ %2718 = OpFAdd %float %2712 %2717
+ OpBranch %2709
+ %2710 = OpLabel
+ %2719 = OpFSub %float %2689 %2698
+ %2720 = OpFMul %float %float_7 %2719
+ %2721 = OpFSub %float %2706 %2698
+ %2722 = OpFDiv %float %2720 %2721
+ %2723 = OpConvertFToS %int %2722
+ %2724 = OpConvertSToF %float %2723
+ %2725 = OpFSub %float %2722 %2724
+ %2726 = OpAccessChain %_ptr_Function_float %529 %2723
+ %2727 = OpLoad %float %2726
+ %2728 = OpIAdd %int %2723 %int_1
+ %2729 = OpAccessChain %_ptr_Function_float %529 %2728
+ %2730 = OpLoad %float %2729
+ %2731 = OpIAdd %int %2723 %int_2
+ %2732 = OpAccessChain %_ptr_Function_float %529 %2731
+ %2733 = OpLoad %float %2732
+ %2734 = OpCompositeConstruct %v3float %2727 %2730 %2733
+ %2735 = OpFMul %float %2725 %2725
+ %2736 = OpCompositeConstruct %v3float %2735 %2725 %float_1
+ %2737 = OpMatrixTimesVector %v3float %442 %2734
+ %2738 = OpDot %float %2736 %2737
+ OpBranch %2709
+ %2709 = OpLabel
+ %2739 = OpPhi %float %2718 %2711 %2738 %2710
+ OpBranch %2701
+ %2702 = OpLabel
+ %2740 = OpFSub %float %2689 %2691
+ %2741 = OpFMul %float %float_7 %2740
+ %2742 = OpFSub %float %2698 %2691
+ %2743 = OpFDiv %float %2741 %2742
+ %2744 = OpConvertFToS %int %2743
+ %2745 = OpConvertSToF %float %2744
+ %2746 = OpFSub %float %2743 %2745
+ %2747 = OpAccessChain %_ptr_Function_float %530 %2744
+ %2748 = OpLoad %float %2747
+ %2749 = OpIAdd %int %2744 %int_1
+ %2750 = OpAccessChain %_ptr_Function_float %530 %2749
+ %2751 = OpLoad %float %2750
+ %2752 = OpIAdd %int %2744 %int_2
+ %2753 = OpAccessChain %_ptr_Function_float %530 %2752
+ %2754 = OpLoad %float %2753
+ %2755 = OpCompositeConstruct %v3float %2748 %2751 %2754
+ %2756 = OpFMul %float %2746 %2746
+ %2757 = OpCompositeConstruct %v3float %2756 %2746 %float_1
+ %2758 = OpMatrixTimesVector %v3float %442 %2755
+ %2759 = OpDot %float %2757 %2758
+ OpBranch %2701
+ %2701 = OpLabel
+ %2760 = OpPhi %float %2739 %2709 %2759 %2702
+ OpBranch %2693
+ %2694 = OpLabel
+ %2761 = OpFMul %float %2689 %float_3
+ %2762 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2763 = OpFDiv %float %2762 %1065
+ %2764 = OpFMul %float %float_3 %2690
+ %2765 = OpFDiv %float %2764 %1065
+ %2766 = OpFSub %float %2763 %2765
+ %2767 = OpFAdd %float %2761 %2766
+ OpBranch %2693
+ %2693 = OpLabel
+ %2768 = OpPhi %float %2760 %2701 %2767 %2694
+ %2769 = OpExtInst %float %1 Pow %float_10 %2768
+ %2770 = OpCompositeInsert %v3float %2769 %391 0
+ %2771 = OpCompositeExtract %float %2479 1
+ OpStore %528 %479
+ OpStore %527 %480
+ %2772 = OpFOrdLessThanEqual %bool %2771 %float_0
+ %2773 = OpSelect %float %2772 %float_9_99999975en05 %2771
+ %2774 = OpExtInst %float %1 Log %2773
+ %2775 = OpFDiv %float %2774 %1065
+ %2776 = OpFOrdLessThanEqual %bool %2775 %2691
+ OpSelectionMerge %2777 None
+ OpBranchConditional %2776 %2778 %2779
+ %2779 = OpLabel
+ %2780 = OpFOrdGreaterThan %bool %2775 %2691
+ %2781 = OpExtInst %float %1 Log %2612
+ %2782 = OpFDiv %float %2781 %1065
+ %2783 = OpFOrdLessThan %bool %2775 %2782
+ %2784 = OpLogicalAnd %bool %2780 %2783
+ OpSelectionMerge %2785 None
+ OpBranchConditional %2784 %2786 %2787
+ %2787 = OpLabel
+ %2788 = OpFOrdGreaterThanEqual %bool %2775 %2782
+ %2789 = OpExtInst %float %1 Log %2684
+ %2790 = OpFDiv %float %2789 %1065
+ %2791 = OpFOrdLessThan %bool %2775 %2790
+ %2792 = OpLogicalAnd %bool %2788 %2791
+ OpSelectionMerge %2793 None
+ OpBranchConditional %2792 %2794 %2795
+ %2795 = OpLabel
+ %2796 = OpFMul %float %2775 %float_0_0599999987
+ %2797 = OpExtInst %float %1 Log %float_1000
+ %2798 = OpFDiv %float %2797 %1065
+ %2799 = OpFMul %float %float_0_0599999987 %2789
+ %2800 = OpFDiv %float %2799 %1065
+ %2801 = OpFSub %float %2798 %2800
+ %2802 = OpFAdd %float %2796 %2801
+ OpBranch %2793
+ %2794 = OpLabel
+ %2803 = OpFSub %float %2775 %2782
+ %2804 = OpFMul %float %float_7 %2803
+ %2805 = OpFSub %float %2790 %2782
+ %2806 = OpFDiv %float %2804 %2805
+ %2807 = OpConvertFToS %int %2806
+ %2808 = OpConvertSToF %float %2807
+ %2809 = OpFSub %float %2806 %2808
+ %2810 = OpAccessChain %_ptr_Function_float %527 %2807
+ %2811 = OpLoad %float %2810
+ %2812 = OpIAdd %int %2807 %int_1
+ %2813 = OpAccessChain %_ptr_Function_float %527 %2812
+ %2814 = OpLoad %float %2813
+ %2815 = OpIAdd %int %2807 %int_2
+ %2816 = OpAccessChain %_ptr_Function_float %527 %2815
+ %2817 = OpLoad %float %2816
+ %2818 = OpCompositeConstruct %v3float %2811 %2814 %2817
+ %2819 = OpFMul %float %2809 %2809
+ %2820 = OpCompositeConstruct %v3float %2819 %2809 %float_1
+ %2821 = OpMatrixTimesVector %v3float %442 %2818
+ %2822 = OpDot %float %2820 %2821
+ OpBranch %2793
+ %2793 = OpLabel
+ %2823 = OpPhi %float %2802 %2795 %2822 %2794
+ OpBranch %2785
+ %2786 = OpLabel
+ %2824 = OpFSub %float %2775 %2691
+ %2825 = OpFMul %float %float_7 %2824
+ %2826 = OpFSub %float %2782 %2691
+ %2827 = OpFDiv %float %2825 %2826
+ %2828 = OpConvertFToS %int %2827
+ %2829 = OpConvertSToF %float %2828
+ %2830 = OpFSub %float %2827 %2829
+ %2831 = OpAccessChain %_ptr_Function_float %528 %2828
+ %2832 = OpLoad %float %2831
+ %2833 = OpIAdd %int %2828 %int_1
+ %2834 = OpAccessChain %_ptr_Function_float %528 %2833
+ %2835 = OpLoad %float %2834
+ %2836 = OpIAdd %int %2828 %int_2
+ %2837 = OpAccessChain %_ptr_Function_float %528 %2836
+ %2838 = OpLoad %float %2837
+ %2839 = OpCompositeConstruct %v3float %2832 %2835 %2838
+ %2840 = OpFMul %float %2830 %2830
+ %2841 = OpCompositeConstruct %v3float %2840 %2830 %float_1
+ %2842 = OpMatrixTimesVector %v3float %442 %2839
+ %2843 = OpDot %float %2841 %2842
+ OpBranch %2785
+ %2785 = OpLabel
+ %2844 = OpPhi %float %2823 %2793 %2843 %2786
+ OpBranch %2777
+ %2778 = OpLabel
+ %2845 = OpFMul %float %2775 %float_3
+ %2846 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2847 = OpFDiv %float %2846 %1065
+ %2848 = OpFMul %float %float_3 %2690
+ %2849 = OpFDiv %float %2848 %1065
+ %2850 = OpFSub %float %2847 %2849
+ %2851 = OpFAdd %float %2845 %2850
+ OpBranch %2777
+ %2777 = OpLabel
+ %2852 = OpPhi %float %2844 %2785 %2851 %2778
+ %2853 = OpExtInst %float %1 Pow %float_10 %2852
+ %2854 = OpCompositeInsert %v3float %2853 %2770 1
+ %2855 = OpCompositeExtract %float %2479 2
+ OpStore %526 %479
+ OpStore %525 %480
+ %2856 = OpFOrdLessThanEqual %bool %2855 %float_0
+ %2857 = OpSelect %float %2856 %float_9_99999975en05 %2855
+ %2858 = OpExtInst %float %1 Log %2857
+ %2859 = OpFDiv %float %2858 %1065
+ %2860 = OpFOrdLessThanEqual %bool %2859 %2691
+ OpSelectionMerge %2861 None
+ OpBranchConditional %2860 %2862 %2863
+ %2863 = OpLabel
+ %2864 = OpFOrdGreaterThan %bool %2859 %2691
+ %2865 = OpExtInst %float %1 Log %2612
+ %2866 = OpFDiv %float %2865 %1065
+ %2867 = OpFOrdLessThan %bool %2859 %2866
+ %2868 = OpLogicalAnd %bool %2864 %2867
+ OpSelectionMerge %2869 None
+ OpBranchConditional %2868 %2870 %2871
+ %2871 = OpLabel
+ %2872 = OpFOrdGreaterThanEqual %bool %2859 %2866
+ %2873 = OpExtInst %float %1 Log %2684
+ %2874 = OpFDiv %float %2873 %1065
+ %2875 = OpFOrdLessThan %bool %2859 %2874
+ %2876 = OpLogicalAnd %bool %2872 %2875
+ OpSelectionMerge %2877 None
+ OpBranchConditional %2876 %2878 %2879
+ %2879 = OpLabel
+ %2880 = OpFMul %float %2859 %float_0_0599999987
+ %2881 = OpExtInst %float %1 Log %float_1000
+ %2882 = OpFDiv %float %2881 %1065
+ %2883 = OpFMul %float %float_0_0599999987 %2873
+ %2884 = OpFDiv %float %2883 %1065
+ %2885 = OpFSub %float %2882 %2884
+ %2886 = OpFAdd %float %2880 %2885
+ OpBranch %2877
+ %2878 = OpLabel
+ %2887 = OpFSub %float %2859 %2866
+ %2888 = OpFMul %float %float_7 %2887
+ %2889 = OpFSub %float %2874 %2866
+ %2890 = OpFDiv %float %2888 %2889
+ %2891 = OpConvertFToS %int %2890
+ %2892 = OpConvertSToF %float %2891
+ %2893 = OpFSub %float %2890 %2892
+ %2894 = OpAccessChain %_ptr_Function_float %525 %2891
+ %2895 = OpLoad %float %2894
+ %2896 = OpIAdd %int %2891 %int_1
+ %2897 = OpAccessChain %_ptr_Function_float %525 %2896
+ %2898 = OpLoad %float %2897
+ %2899 = OpIAdd %int %2891 %int_2
+ %2900 = OpAccessChain %_ptr_Function_float %525 %2899
+ %2901 = OpLoad %float %2900
+ %2902 = OpCompositeConstruct %v3float %2895 %2898 %2901
+ %2903 = OpFMul %float %2893 %2893
+ %2904 = OpCompositeConstruct %v3float %2903 %2893 %float_1
+ %2905 = OpMatrixTimesVector %v3float %442 %2902
+ %2906 = OpDot %float %2904 %2905
+ OpBranch %2877
+ %2877 = OpLabel
+ %2907 = OpPhi %float %2886 %2879 %2906 %2878
+ OpBranch %2869
+ %2870 = OpLabel
+ %2908 = OpFSub %float %2859 %2691
+ %2909 = OpFMul %float %float_7 %2908
+ %2910 = OpFSub %float %2866 %2691
+ %2911 = OpFDiv %float %2909 %2910
+ %2912 = OpConvertFToS %int %2911
+ %2913 = OpConvertSToF %float %2912
+ %2914 = OpFSub %float %2911 %2913
+ %2915 = OpAccessChain %_ptr_Function_float %526 %2912
+ %2916 = OpLoad %float %2915
+ %2917 = OpIAdd %int %2912 %int_1
+ %2918 = OpAccessChain %_ptr_Function_float %526 %2917
+ %2919 = OpLoad %float %2918
+ %2920 = OpIAdd %int %2912 %int_2
+ %2921 = OpAccessChain %_ptr_Function_float %526 %2920
+ %2922 = OpLoad %float %2921
+ %2923 = OpCompositeConstruct %v3float %2916 %2919 %2922
+ %2924 = OpFMul %float %2914 %2914
+ %2925 = OpCompositeConstruct %v3float %2924 %2914 %float_1
+ %2926 = OpMatrixTimesVector %v3float %442 %2923
+ %2927 = OpDot %float %2925 %2926
+ OpBranch %2869
+ %2869 = OpLabel
+ %2928 = OpPhi %float %2907 %2877 %2927 %2870
+ OpBranch %2861
+ %2862 = OpLabel
+ %2929 = OpFMul %float %2859 %float_3
+ %2930 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2931 = OpFDiv %float %2930 %1065
+ %2932 = OpFMul %float %float_3 %2690
+ %2933 = OpFDiv %float %2932 %1065
+ %2934 = OpFSub %float %2931 %2933
+ %2935 = OpFAdd %float %2929 %2934
+ OpBranch %2861
+ %2861 = OpLabel
+ %2936 = OpPhi %float %2928 %2869 %2935 %2862
+ %2937 = OpExtInst %float %1 Pow %float_10 %2936
+ %2938 = OpCompositeInsert %v3float %2937 %2854 2
+ %2939 = OpFSub %v3float %2938 %338
+ %2940 = OpVectorTimesMatrix %v3float %2939 %576
+ %2941 = OpFMul %v3float %2940 %496
+ %2942 = OpExtInst %v3float %1 Pow %2941 %263
+ %2943 = OpFMul %v3float %184 %2942
+ %2944 = OpFAdd %v3float %183 %2943
+ %2945 = OpFMul %v3float %185 %2942
+ %2946 = OpFAdd %v3float %135 %2945
+ %2947 = OpFDiv %v3float %135 %2946
+ %2948 = OpFMul %v3float %2944 %2947
+ %2949 = OpExtInst %v3float %1 Pow %2948 %264
+ OpBranch %1230
+ %1230 = OpLabel
+ %2950 = OpPhi %v3float %2097 %1236 %2949 %2861
+ OpBranch %1224
+ %1225 = OpLabel
+ %2951 = OpVectorTimesMatrix %v3float %1218 %547
+ %2952 = OpVectorTimesMatrix %v3float %2951 %576
+ %2953 = OpExtInst %v3float %1 FMax %250 %2952
+ %2954 = OpFMul %v3float %2953 %252
+ %2955 = OpExtInst %v3float %1 FMax %2953 %254
+ %2956 = OpExtInst %v3float %1 Pow %2955 %256
+ %2957 = OpFMul %v3float %2956 %258
+ %2958 = OpFSub %v3float %2957 %260
+ %2959 = OpExtInst %v3float %1 FMin %2954 %2958
+ OpBranch %1224
+ %1224 = OpLabel
+ %2960 = OpPhi %v3float %2950 %1230 %2959 %1225
+ OpBranch %1220
+ %1221 = OpLabel
+ %2961 = OpCompositeExtract %float %1218 0
+ OpBranch %2962
+ %2962 = OpLabel
+ OpLoopMerge %2963 %2964 None
+ OpBranch %2965
+ %2965 = OpLabel
+ %2966 = OpFOrdLessThan %bool %2961 %float_0_00313066994
+ OpSelectionMerge %2967 None
+ OpBranchConditional %2966 %2968 %2967
+ %2968 = OpLabel
+ %2969 = OpFMul %float %2961 %float_12_9200001
+ OpBranch %2963
+ %2967 = OpLabel
+ %2970 = OpExtInst %float %1 Pow %2961 %float_0_416666657
+ %2971 = OpFMul %float %2970 %float_1_05499995
+ %2972 = OpFSub %float %2971 %float_0_0549999997
+ OpBranch %2963
+ %2964 = OpLabel
+ OpBranch %2962
+ %2963 = OpLabel
+ %2973 = OpPhi %float %2969 %2968 %2972 %2967
+ %2974 = OpCompositeExtract %float %1218 1
+ OpBranch %2975
+ %2975 = OpLabel
+ OpLoopMerge %2976 %2977 None
+ OpBranch %2978
+ %2978 = OpLabel
+ %2979 = OpFOrdLessThan %bool %2974 %float_0_00313066994
+ OpSelectionMerge %2980 None
+ OpBranchConditional %2979 %2981 %2980
+ %2981 = OpLabel
+ %2982 = OpFMul %float %2974 %float_12_9200001
+ OpBranch %2976
+ %2980 = OpLabel
+ %2983 = OpExtInst %float %1 Pow %2974 %float_0_416666657
+ %2984 = OpFMul %float %2983 %float_1_05499995
+ %2985 = OpFSub %float %2984 %float_0_0549999997
+ OpBranch %2976
+ %2977 = OpLabel
+ OpBranch %2975
+ %2976 = OpLabel
+ %2986 = OpPhi %float %2982 %2981 %2985 %2980
+ %2987 = OpCompositeExtract %float %1218 2
+ OpBranch %2988
+ %2988 = OpLabel
+ OpLoopMerge %2989 %2990 None
+ OpBranch %2991
+ %2991 = OpLabel
+ %2992 = OpFOrdLessThan %bool %2987 %float_0_00313066994
+ OpSelectionMerge %2993 None
+ OpBranchConditional %2992 %2994 %2993
+ %2994 = OpLabel
+ %2995 = OpFMul %float %2987 %float_12_9200001
+ OpBranch %2989
+ %2993 = OpLabel
+ %2996 = OpExtInst %float %1 Pow %2987 %float_0_416666657
+ %2997 = OpFMul %float %2996 %float_1_05499995
+ %2998 = OpFSub %float %2997 %float_0_0549999997
+ OpBranch %2989
+ %2990 = OpLabel
+ OpBranch %2988
+ %2989 = OpLabel
+ %2999 = OpPhi %float %2995 %2994 %2998 %2993
+ %3000 = OpCompositeConstruct %v3float %2973 %2986 %2999
+ OpBranch %1220
+ %1220 = OpLabel
+ %3001 = OpPhi %v3float %2960 %1224 %3000 %2989
+ %3002 = OpFMul %v3float %3001 %499
+ %3003 = OpVectorShuffle %v4float %129 %3002 4 5 6 3
+ %3004 = OpCompositeInsert %v4float %float_0 %3003 3
+ OpStore %out_var_SV_Target0 %3004
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag
new file mode 100644
index 00000000000..e0359bfdd3e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag
@@ -0,0 +1,3694 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 3107
+; Schema: 0
+ OpCapability Shader
+ OpCapability Geometry
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %MainPS "main" %in_var_TEXCOORD0 %gl_FragCoord %gl_Layer %out_var_SV_Target0
+ OpExecutionMode %MainPS OriginUpperLeft
+ OpSource HLSL 600
+ OpName %type__Globals "type.$Globals"
+ OpMemberName %type__Globals 0 "MappingPolynomial"
+ OpMemberName %type__Globals 1 "InverseGamma"
+ OpMemberName %type__Globals 2 "ColorMatrixR_ColorCurveCd1"
+ OpMemberName %type__Globals 3 "ColorMatrixG_ColorCurveCd3Cm3"
+ OpMemberName %type__Globals 4 "ColorMatrixB_ColorCurveCm2"
+ OpMemberName %type__Globals 5 "ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3"
+ OpMemberName %type__Globals 6 "ColorCurve_Ch1_Ch2"
+ OpMemberName %type__Globals 7 "ColorShadow_Luma"
+ OpMemberName %type__Globals 8 "ColorShadow_Tint1"
+ OpMemberName %type__Globals 9 "ColorShadow_Tint2"
+ OpMemberName %type__Globals 10 "FilmSlope"
+ OpMemberName %type__Globals 11 "FilmToe"
+ OpMemberName %type__Globals 12 "FilmShoulder"
+ OpMemberName %type__Globals 13 "FilmBlackClip"
+ OpMemberName %type__Globals 14 "FilmWhiteClip"
+ OpMemberName %type__Globals 15 "LUTWeights"
+ OpMemberName %type__Globals 16 "ColorScale"
+ OpMemberName %type__Globals 17 "OverlayColor"
+ OpMemberName %type__Globals 18 "WhiteTemp"
+ OpMemberName %type__Globals 19 "WhiteTint"
+ OpMemberName %type__Globals 20 "ColorSaturation"
+ OpMemberName %type__Globals 21 "ColorContrast"
+ OpMemberName %type__Globals 22 "ColorGamma"
+ OpMemberName %type__Globals 23 "ColorGain"
+ OpMemberName %type__Globals 24 "ColorOffset"
+ OpMemberName %type__Globals 25 "ColorSaturationShadows"
+ OpMemberName %type__Globals 26 "ColorContrastShadows"
+ OpMemberName %type__Globals 27 "ColorGammaShadows"
+ OpMemberName %type__Globals 28 "ColorGainShadows"
+ OpMemberName %type__Globals 29 "ColorOffsetShadows"
+ OpMemberName %type__Globals 30 "ColorSaturationMidtones"
+ OpMemberName %type__Globals 31 "ColorContrastMidtones"
+ OpMemberName %type__Globals 32 "ColorGammaMidtones"
+ OpMemberName %type__Globals 33 "ColorGainMidtones"
+ OpMemberName %type__Globals 34 "ColorOffsetMidtones"
+ OpMemberName %type__Globals 35 "ColorSaturationHighlights"
+ OpMemberName %type__Globals 36 "ColorContrastHighlights"
+ OpMemberName %type__Globals 37 "ColorGammaHighlights"
+ OpMemberName %type__Globals 38 "ColorGainHighlights"
+ OpMemberName %type__Globals 39 "ColorOffsetHighlights"
+ OpMemberName %type__Globals 40 "ColorCorrectionShadowsMax"
+ OpMemberName %type__Globals 41 "ColorCorrectionHighlightsMin"
+ OpMemberName %type__Globals 42 "OutputDevice"
+ OpMemberName %type__Globals 43 "OutputGamut"
+ OpMemberName %type__Globals 44 "BlueCorrection"
+ OpMemberName %type__Globals 45 "ExpandGamut"
+ OpName %_Globals "$Globals"
+ OpName %type_2d_image "type.2d.image"
+ OpName %Texture1 "Texture1"
+ OpName %type_sampler "type.sampler"
+ OpName %Texture1Sampler "Texture1Sampler"
+ OpName %in_var_TEXCOORD0 "in.var.TEXCOORD0"
+ OpName %out_var_SV_Target0 "out.var.SV_Target0"
+ OpName %MainPS "MainPS"
+ OpName %type_sampled_image "type.sampled.image"
+ OpDecorateString %in_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorate %in_var_TEXCOORD0 NoPerspective
+ OpDecorate %gl_FragCoord BuiltIn FragCoord
+ OpDecorateString %gl_FragCoord UserSemantic "SV_POSITION"
+ OpDecorate %gl_Layer BuiltIn Layer
+ OpDecorateString %gl_Layer UserSemantic "SV_RenderTargetArrayIndex"
+ OpDecorate %gl_Layer Flat
+ OpDecorateString %out_var_SV_Target0 UserSemantic "SV_Target0"
+ OpDecorate %in_var_TEXCOORD0 Location 0
+ OpDecorate %out_var_SV_Target0 Location 0
+ OpDecorate %_Globals DescriptorSet 0
+ OpDecorate %_Globals Binding 0
+ OpDecorate %Texture1 DescriptorSet 0
+ OpDecorate %Texture1 Binding 0
+ OpDecorate %Texture1Sampler DescriptorSet 0
+ OpDecorate %Texture1Sampler Binding 0
+ OpDecorate %_arr_float_uint_5 ArrayStride 16
+ OpMemberDecorate %type__Globals 0 Offset 0
+ OpMemberDecorate %type__Globals 1 Offset 16
+ OpMemberDecorate %type__Globals 2 Offset 32
+ OpMemberDecorate %type__Globals 3 Offset 48
+ OpMemberDecorate %type__Globals 4 Offset 64
+ OpMemberDecorate %type__Globals 5 Offset 80
+ OpMemberDecorate %type__Globals 6 Offset 96
+ OpMemberDecorate %type__Globals 7 Offset 112
+ OpMemberDecorate %type__Globals 8 Offset 128
+ OpMemberDecorate %type__Globals 9 Offset 144
+ OpMemberDecorate %type__Globals 10 Offset 160
+ OpMemberDecorate %type__Globals 11 Offset 164
+ OpMemberDecorate %type__Globals 12 Offset 168
+ OpMemberDecorate %type__Globals 13 Offset 172
+ OpMemberDecorate %type__Globals 14 Offset 176
+ OpMemberDecorate %type__Globals 15 Offset 192
+ OpMemberDecorate %type__Globals 16 Offset 272
+ OpMemberDecorate %type__Globals 17 Offset 288
+ OpMemberDecorate %type__Globals 18 Offset 304
+ OpMemberDecorate %type__Globals 19 Offset 308
+ OpMemberDecorate %type__Globals 20 Offset 320
+ OpMemberDecorate %type__Globals 21 Offset 336
+ OpMemberDecorate %type__Globals 22 Offset 352
+ OpMemberDecorate %type__Globals 23 Offset 368
+ OpMemberDecorate %type__Globals 24 Offset 384
+ OpMemberDecorate %type__Globals 25 Offset 400
+ OpMemberDecorate %type__Globals 26 Offset 416
+ OpMemberDecorate %type__Globals 27 Offset 432
+ OpMemberDecorate %type__Globals 28 Offset 448
+ OpMemberDecorate %type__Globals 29 Offset 464
+ OpMemberDecorate %type__Globals 30 Offset 480
+ OpMemberDecorate %type__Globals 31 Offset 496
+ OpMemberDecorate %type__Globals 32 Offset 512
+ OpMemberDecorate %type__Globals 33 Offset 528
+ OpMemberDecorate %type__Globals 34 Offset 544
+ OpMemberDecorate %type__Globals 35 Offset 560
+ OpMemberDecorate %type__Globals 36 Offset 576
+ OpMemberDecorate %type__Globals 37 Offset 592
+ OpMemberDecorate %type__Globals 38 Offset 608
+ OpMemberDecorate %type__Globals 39 Offset 624
+ OpMemberDecorate %type__Globals 40 Offset 640
+ OpMemberDecorate %type__Globals 41 Offset 644
+ OpMemberDecorate %type__Globals 42 Offset 648
+ OpMemberDecorate %type__Globals 43 Offset 652
+ OpMemberDecorate %type__Globals 44 Offset 656
+ OpMemberDecorate %type__Globals 45 Offset 660
+ OpDecorate %type__Globals Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+%float_0_952552378 = OpConstant %float 0.952552378
+ %float_0 = OpConstant %float 0
+
+; HACK: Needed to hack this constant since MSVC and GNU libc are off by 1 ULP when converting to string (it probably still works fine though in a roundtrip ...)
+%float_9_36786018en05 = OpConstant %float 9.25
+
+%float_0_343966454 = OpConstant %float 0.343966454
+%float_0_728166103 = OpConstant %float 0.728166103
+%float_n0_0721325427 = OpConstant %float -0.0721325427
+%float_1_00882518 = OpConstant %float 1.00882518
+%float_1_04981101 = OpConstant %float 1.04981101
+%float_n9_74845025en05 = OpConstant %float -9.74845025e-05
+%float_n0_495903015 = OpConstant %float -0.495903015
+%float_1_37331307 = OpConstant %float 1.37331307
+%float_0_0982400328 = OpConstant %float 0.0982400328
+%float_0_991252005 = OpConstant %float 0.991252005
+%float_0_662454188 = OpConstant %float 0.662454188
+%float_0_134004205 = OpConstant %float 0.134004205
+%float_0_156187683 = OpConstant %float 0.156187683
+%float_0_272228718 = OpConstant %float 0.272228718
+%float_0_674081743 = OpConstant %float 0.674081743
+%float_0_0536895171 = OpConstant %float 0.0536895171
+%float_n0_00557464967 = OpConstant %float -0.00557464967
+%float_0_0040607336 = OpConstant %float 0.0040607336
+%float_1_01033914 = OpConstant %float 1.01033914
+%float_1_6410234 = OpConstant %float 1.6410234
+%float_n0_324803293 = OpConstant %float -0.324803293
+%float_n0_236424699 = OpConstant %float -0.236424699
+%float_n0_663662851 = OpConstant %float -0.663662851
+%float_1_61533165 = OpConstant %float 1.61533165
+%float_0_0167563483 = OpConstant %float 0.0167563483
+%float_0_0117218941 = OpConstant %float 0.0117218941
+%float_n0_00828444213 = OpConstant %float -0.00828444213
+%float_0_988394856 = OpConstant %float 0.988394856
+%float_1_45143926 = OpConstant %float 1.45143926
+%float_n0_236510754 = OpConstant %float -0.236510754
+%float_n0_214928567 = OpConstant %float -0.214928567
+%float_n0_0765537769 = OpConstant %float -0.0765537769
+%float_1_17622972 = OpConstant %float 1.17622972
+%float_n0_0996759236 = OpConstant %float -0.0996759236
+%float_0_00831614807 = OpConstant %float 0.00831614807
+%float_n0_00603244966 = OpConstant %float -0.00603244966
+%float_0_997716308 = OpConstant %float 0.997716308
+%float_0_695452213 = OpConstant %float 0.695452213
+%float_0_140678704 = OpConstant %float 0.140678704
+%float_0_163869068 = OpConstant %float 0.163869068
+%float_0_0447945632 = OpConstant %float 0.0447945632
+%float_0_859671116 = OpConstant %float 0.859671116
+%float_0_0955343172 = OpConstant %float 0.0955343172
+%float_n0_00552588282 = OpConstant %float -0.00552588282
+%float_0_00402521016 = OpConstant %float 0.00402521016
+%float_1_00150073 = OpConstant %float 1.00150073
+ %73 = OpConstantComposite %v3float %float_0_272228718 %float_0_674081743 %float_0_0536895171
+%float_3_2409699 = OpConstant %float 3.2409699
+%float_n1_5373832 = OpConstant %float -1.5373832
+%float_n0_498610765 = OpConstant %float -0.498610765
+%float_n0_969243646 = OpConstant %float -0.969243646
+%float_1_8759675 = OpConstant %float 1.8759675
+%float_0_0415550582 = OpConstant %float 0.0415550582
+%float_0_0556300804 = OpConstant %float 0.0556300804
+%float_n0_203976959 = OpConstant %float -0.203976959
+%float_1_05697155 = OpConstant %float 1.05697155
+%float_0_412456393 = OpConstant %float 0.412456393
+%float_0_357576102 = OpConstant %float 0.357576102
+%float_0_180437505 = OpConstant %float 0.180437505
+%float_0_212672904 = OpConstant %float 0.212672904
+%float_0_715152204 = OpConstant %float 0.715152204
+%float_0_0721750036 = OpConstant %float 0.0721750036
+%float_0_0193339009 = OpConstant %float 0.0193339009
+%float_0_119191997 = OpConstant %float 0.119191997
+%float_0_950304091 = OpConstant %float 0.950304091
+%float_1_71660841 = OpConstant %float 1.71660841
+%float_n0_355662107 = OpConstant %float -0.355662107
+%float_n0_253360093 = OpConstant %float -0.253360093
+%float_n0_666682899 = OpConstant %float -0.666682899
+%float_1_61647761 = OpConstant %float 1.61647761
+%float_0_0157685 = OpConstant %float 0.0157685
+%float_0_0176422 = OpConstant %float 0.0176422
+%float_n0_0427763015 = OpConstant %float -0.0427763015
+%float_0_942228675 = OpConstant %float 0.942228675
+%float_2_49339628 = OpConstant %float 2.49339628
+%float_n0_93134588 = OpConstant %float -0.93134588
+%float_n0_402694494 = OpConstant %float -0.402694494
+%float_n0_829486787 = OpConstant %float -0.829486787
+%float_1_76265967 = OpConstant %float 1.76265967
+%float_0_0236246008 = OpConstant %float 0.0236246008
+%float_0_0358507 = OpConstant %float 0.0358507
+%float_n0_0761827007 = OpConstant %float -0.0761827007
+%float_0_957014024 = OpConstant %float 0.957014024
+%float_1_01303005 = OpConstant %float 1.01303005
+%float_0_00610530982 = OpConstant %float 0.00610530982
+%float_n0_0149710001 = OpConstant %float -0.0149710001
+%float_0_00769822998 = OpConstant %float 0.00769822998
+%float_0_998165011 = OpConstant %float 0.998165011
+%float_n0_00503202993 = OpConstant %float -0.00503202993
+%float_n0_00284131011 = OpConstant %float -0.00284131011
+%float_0_00468515977 = OpConstant %float 0.00468515977
+%float_0_924507022 = OpConstant %float 0.924507022
+%float_0_987223983 = OpConstant %float 0.987223983
+%float_n0_00611326983 = OpConstant %float -0.00611326983
+%float_0_0159533005 = OpConstant %float 0.0159533005
+%float_n0_00759836007 = OpConstant %float -0.00759836007
+%float_1_00186002 = OpConstant %float 1.00186002
+%float_0_0053300201 = OpConstant %float 0.0053300201
+%float_0_00307257008 = OpConstant %float 0.00307257008
+%float_n0_00509594986 = OpConstant %float -0.00509594986
+%float_1_08168006 = OpConstant %float 1.08168006
+ %float_0_5 = OpConstant %float 0.5
+ %float_n1 = OpConstant %float -1
+ %float_1 = OpConstant %float 1
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+%float_0_015625 = OpConstant %float 0.015625
+ %134 = OpConstantComposite %v2float %float_0_015625 %float_0_015625
+ %135 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+ %int_43 = OpConstant %int 43
+ %uint_3 = OpConstant %uint 3
+ %138 = OpConstantComposite %v3float %float_0 %float_0 %float_0
+ %int_9 = OpConstant %int 9
+ %int_3 = OpConstant %int 3
+ %141 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+ %float_n4 = OpConstant %float -4
+ %int_45 = OpConstant %int 45
+%float_0_544169128 = OpConstant %float 0.544169128
+%float_0_239592597 = OpConstant %float 0.239592597
+%float_0_166694298 = OpConstant %float 0.166694298
+%float_0_239465594 = OpConstant %float 0.239465594
+%float_0_702153027 = OpConstant %float 0.702153027
+%float_0_058381401 = OpConstant %float 0.058381401
+%float_n0_00234390004 = OpConstant %float -0.00234390004
+%float_0_0361833982 = OpConstant %float 0.0361833982
+%float_1_05521834 = OpConstant %float 1.05521834
+%float_0_940437257 = OpConstant %float 0.940437257
+%float_n0_0183068793 = OpConstant %float -0.0183068793
+%float_0_077869609 = OpConstant %float 0.077869609
+%float_0_00837869663 = OpConstant %float 0.00837869663
+%float_0_828660011 = OpConstant %float 0.828660011
+%float_0_162961304 = OpConstant %float 0.162961304
+%float_0_00054712611 = OpConstant %float 0.00054712611
+%float_n0_000883374596 = OpConstant %float -0.000883374596
+%float_1_00033629 = OpConstant %float 1.00033629
+%float_1_06317997 = OpConstant %float 1.06317997
+%float_0_0233955998 = OpConstant %float 0.0233955998
+%float_n0_0865726024 = OpConstant %float -0.0865726024
+%float_n0_0106336996 = OpConstant %float -0.0106336996
+%float_1_20632005 = OpConstant %float 1.20632005
+%float_n0_195690006 = OpConstant %float -0.195690006
+%float_n0_000590886979 = OpConstant %float -0.000590886979
+%float_0_00105247996 = OpConstant %float 0.00105247996
+%float_0_999538004 = OpConstant %float 0.999538004
+ %int_44 = OpConstant %int 44
+%float_0_9375 = OpConstant %float 0.9375
+ %173 = OpConstantComposite %v3float %float_0_9375 %float_0_9375 %float_0_9375
+%float_0_03125 = OpConstant %float 0.03125
+ %175 = OpConstantComposite %v3float %float_0_03125 %float_0_03125 %float_0_03125
+ %int_15 = OpConstant %int 15
+ %float_16 = OpConstant %float 16
+ %int_16 = OpConstant %int 16
+ %int_17 = OpConstant %int 17
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %uint_5 = OpConstant %uint 5
+ %uint_6 = OpConstant %uint 6
+ %int_2 = OpConstant %int 2
+%mat3v3float = OpTypeMatrix %v3float 3
+ %int_42 = OpConstant %int 42
+%float_0_159301758 = OpConstant %float 0.159301758
+%float_78_84375 = OpConstant %float 78.84375
+%float_0_8359375 = OpConstant %float 0.8359375
+%float_18_8515625 = OpConstant %float 18.8515625
+%float_18_6875 = OpConstant %float 18.6875
+%float_10000 = OpConstant %float 10000
+%float_0_0126833133 = OpConstant %float 0.0126833133
+ %194 = OpConstantComposite %v3float %float_0_0126833133 %float_0_0126833133 %float_0_0126833133
+ %195 = OpConstantComposite %v3float %float_0_8359375 %float_0_8359375 %float_0_8359375
+ %196 = OpConstantComposite %v3float %float_18_8515625 %float_18_8515625 %float_18_8515625
+ %197 = OpConstantComposite %v3float %float_18_6875 %float_18_6875 %float_18_6875
+%float_6_27739477 = OpConstant %float 6.27739477
+ %199 = OpConstantComposite %v3float %float_6_27739477 %float_6_27739477 %float_6_27739477
+ %200 = OpConstantComposite %v3float %float_10000 %float_10000 %float_10000
+ %float_14 = OpConstant %float 14
+%float_0_180000007 = OpConstant %float 0.180000007
+%float_0_434017599 = OpConstant %float 0.434017599
+ %204 = OpConstantComposite %v3float %float_0_434017599 %float_0_434017599 %float_0_434017599
+ %205 = OpConstantComposite %v3float %float_14 %float_14 %float_14
+ %206 = OpConstantComposite %v3float %float_0_180000007 %float_0_180000007 %float_0_180000007
+ %int_18 = OpConstant %int 18
+ %float_4000 = OpConstant %float 4000
+%float_0_312700003 = OpConstant %float 0.312700003
+%float_0_328999996 = OpConstant %float 0.328999996
+ %int_19 = OpConstant %int 19
+ %int_25 = OpConstant %int 25
+ %int_20 = OpConstant %int 20
+ %int_26 = OpConstant %int 26
+ %int_21 = OpConstant %int 21
+ %int_27 = OpConstant %int 27
+ %int_22 = OpConstant %int 22
+ %int_28 = OpConstant %int 28
+ %int_23 = OpConstant %int 23
+ %int_29 = OpConstant %int 29
+ %int_24 = OpConstant %int 24
+ %int_40 = OpConstant %int 40
+ %int_35 = OpConstant %int 35
+ %int_36 = OpConstant %int 36
+ %int_37 = OpConstant %int 37
+ %int_38 = OpConstant %int 38
+ %int_39 = OpConstant %int 39
+ %int_41 = OpConstant %int 41
+ %int_30 = OpConstant %int 30
+ %int_31 = OpConstant %int 31
+ %int_32 = OpConstant %int 32
+ %int_33 = OpConstant %int 33
+ %int_34 = OpConstant %int 34
+%float_0_0500000007 = OpConstant %float 0.0500000007
+ %float_1_75 = OpConstant %float 1.75
+%float_0_400000006 = OpConstant %float 0.400000006
+%float_0_819999993 = OpConstant %float 0.819999993
+%float_0_0299999993 = OpConstant %float 0.0299999993
+ %float_2 = OpConstant %float 2
+%float_0_959999979 = OpConstant %float 0.959999979
+ %241 = OpConstantComposite %v3float %float_0_959999979 %float_0_959999979 %float_0_959999979
+ %int_13 = OpConstant %int 13
+ %int_11 = OpConstant %int 11
+ %int_14 = OpConstant %int 14
+ %int_12 = OpConstant %int 12
+%float_0_800000012 = OpConstant %float 0.800000012
+ %int_10 = OpConstant %int 10
+ %float_10 = OpConstant %float 10
+ %float_n2 = OpConstant %float -2
+ %float_3 = OpConstant %float 3
+ %251 = OpConstantComposite %v3float %float_3 %float_3 %float_3
+ %252 = OpConstantComposite %v3float %float_2 %float_2 %float_2
+%float_0_930000007 = OpConstant %float 0.930000007
+ %254 = OpConstantComposite %v3float %float_0_930000007 %float_0_930000007 %float_0_930000007
+ %int_4 = OpConstant %int 4
+ %int_8 = OpConstant %int 8
+ %int_7 = OpConstant %int 7
+ %int_5 = OpConstant %int 5
+ %int_6 = OpConstant %int 6
+%float_0_00200000009 = OpConstant %float 0.00200000009
+ %261 = OpConstantComposite %v3float %float_0_00200000009 %float_0_00200000009 %float_0_00200000009
+%float_6_10351999en05 = OpConstant %float 6.10351999e-05
+ %263 = OpConstantComposite %v3float %float_6_10351999en05 %float_6_10351999en05 %float_6_10351999en05
+%float_0_0404499993 = OpConstant %float 0.0404499993
+ %265 = OpConstantComposite %v3float %float_0_0404499993 %float_0_0404499993 %float_0_0404499993
+%float_0_947867274 = OpConstant %float 0.947867274
+ %267 = OpConstantComposite %v3float %float_0_947867274 %float_0_947867274 %float_0_947867274
+%float_0_0521326996 = OpConstant %float 0.0521326996
+ %269 = OpConstantComposite %v3float %float_0_0521326996 %float_0_0521326996 %float_0_0521326996
+%float_2_4000001 = OpConstant %float 2.4000001
+ %271 = OpConstantComposite %v3float %float_2_4000001 %float_2_4000001 %float_2_4000001
+%float_0_0773993805 = OpConstant %float 0.0773993805
+ %273 = OpConstantComposite %v3float %float_0_0773993805 %float_0_0773993805 %float_0_0773993805
+ %float_4_5 = OpConstant %float 4.5
+ %275 = OpConstantComposite %v3float %float_4_5 %float_4_5 %float_4_5
+%float_0_0179999992 = OpConstant %float 0.0179999992
+ %277 = OpConstantComposite %v3float %float_0_0179999992 %float_0_0179999992 %float_0_0179999992
+%float_0_449999988 = OpConstant %float 0.449999988
+ %279 = OpConstantComposite %v3float %float_0_449999988 %float_0_449999988 %float_0_449999988
+%float_1_09899998 = OpConstant %float 1.09899998
+ %281 = OpConstantComposite %v3float %float_1_09899998 %float_1_09899998 %float_1_09899998
+%float_0_0989999995 = OpConstant %float 0.0989999995
+ %283 = OpConstantComposite %v3float %float_0_0989999995 %float_0_0989999995 %float_0_0989999995
+ %float_1_5 = OpConstant %float 1.5
+ %285 = OpConstantComposite %v3float %float_1_5 %float_1_5 %float_1_5
+ %286 = OpConstantComposite %v3float %float_0_159301758 %float_0_159301758 %float_0_159301758
+ %287 = OpConstantComposite %v3float %float_78_84375 %float_78_84375 %float_78_84375
+%float_1_00055635 = OpConstant %float 1.00055635
+ %float_7000 = OpConstant %float 7000
+%float_0_244063005 = OpConstant %float 0.244063005
+%float_99_1100006 = OpConstant %float 99.1100006
+%float_2967800 = OpConstant %float 2967800
+%float_0_237039998 = OpConstant %float 0.237039998
+%float_247_479996 = OpConstant %float 247.479996
+%float_1901800 = OpConstant %float 1901800
+ %float_n3 = OpConstant %float -3
+%float_2_86999989 = OpConstant %float 2.86999989
+%float_0_275000006 = OpConstant %float 0.275000006
+%float_0_860117733 = OpConstant %float 0.860117733
+%float_0_000154118257 = OpConstant %float 0.000154118257
+%float_1_28641219en07 = OpConstant %float 1.28641219e-07
+%float_0_00084242021 = OpConstant %float 0.00084242021
+%float_7_08145137en07 = OpConstant %float 7.08145137e-07
+%float_0_317398727 = OpConstant %float 0.317398727
+
+; HACK: Needed to hack this constant since MSVC and GNU libc are off by 1 ULP when converting to string (it probably still works fine though in a roundtrip ...)
+%float_4_22806261en05 = OpConstant %float 4.25
+
+%float_4_20481676en08 = OpConstant %float 4.20481676e-08
+%float_2_8974182en05 = OpConstant %float 2.8974182e-05
+%float_1_61456057en07 = OpConstant %float 1.61456057e-07
+ %float_8 = OpConstant %float 8
+ %float_4 = OpConstant %float 4
+%float_0_895099998 = OpConstant %float 0.895099998
+%float_0_266400009 = OpConstant %float 0.266400009
+%float_n0_161400005 = OpConstant %float -0.161400005
+%float_n0_750199974 = OpConstant %float -0.750199974
+%float_1_71350002 = OpConstant %float 1.71350002
+%float_0_0366999991 = OpConstant %float 0.0366999991
+%float_0_0388999991 = OpConstant %float 0.0388999991
+%float_n0_0684999973 = OpConstant %float -0.0684999973
+%float_1_02960002 = OpConstant %float 1.02960002
+%float_0_986992896 = OpConstant %float 0.986992896
+%float_n0_1470543 = OpConstant %float -0.1470543
+%float_0_159962699 = OpConstant %float 0.159962699
+%float_0_432305306 = OpConstant %float 0.432305306
+%float_0_518360317 = OpConstant %float 0.518360317
+%float_0_0492912009 = OpConstant %float 0.0492912009
+%float_n0_0085287001 = OpConstant %float -0.0085287001
+%float_0_040042799 = OpConstant %float 0.040042799
+%float_0_968486726 = OpConstant %float 0.968486726
+%float_5_55555534 = OpConstant %float 5.55555534
+ %330 = OpConstantComposite %v3float %float_5_55555534 %float_5_55555534 %float_5_55555534
+%float_1_00000001en10 = OpConstant %float 1.00000001e-10
+%float_0_00999999978 = OpConstant %float 0.00999999978
+%float_0_666666687 = OpConstant %float 0.666666687
+ %float_180 = OpConstant %float 180
+ %float_360 = OpConstant %float 360
+%float_65535 = OpConstant %float 65535
+ %337 = OpConstantComposite %v3float %float_65535 %float_65535 %float_65535
+%float_n4_97062206 = OpConstant %float -4.97062206
+%float_n3_02937818 = OpConstant %float -3.02937818
+%float_n2_12619996 = OpConstant %float -2.12619996
+%float_n1_51049995 = OpConstant %float -1.51049995
+%float_n1_05780005 = OpConstant %float -1.05780005
+%float_n0_466800004 = OpConstant %float -0.466800004
+%float_0_119379997 = OpConstant %float 0.119379997
+%float_0_708813429 = OpConstant %float 0.708813429
+%float_1_29118657 = OpConstant %float 1.29118657
+%float_0_808913231 = OpConstant %float 0.808913231
+%float_1_19108677 = OpConstant %float 1.19108677
+%float_1_56830001 = OpConstant %float 1.56830001
+%float_1_9483 = OpConstant %float 1.9483
+%float_2_30830002 = OpConstant %float 2.30830002
+%float_2_63840008 = OpConstant %float 2.63840008
+%float_2_85949993 = OpConstant %float 2.85949993
+%float_2_98726082 = OpConstant %float 2.98726082
+%float_3_01273918 = OpConstant %float 3.01273918
+%float_0_179999992 = OpConstant %float 0.179999992
+%float_9_99999975en05 = OpConstant %float 9.99999975e-05
+ %float_1000 = OpConstant %float 1000
+%float_0_0599999987 = OpConstant %float 0.0599999987
+%float_3_50738446en05 = OpConstant %float 3.50738446e-05
+ %361 = OpConstantComposite %v3float %float_3_50738446en05 %float_3_50738446en05 %float_3_50738446en05
+%float_n2_30102992 = OpConstant %float -2.30102992
+%float_n1_93120003 = OpConstant %float -1.93120003
+%float_n1_52049994 = OpConstant %float -1.52049994
+%float_0_801995218 = OpConstant %float 0.801995218
+%float_1_19800484 = OpConstant %float 1.19800484
+%float_1_59430003 = OpConstant %float 1.59430003
+%float_1_99730003 = OpConstant %float 1.99730003
+%float_2_37829995 = OpConstant %float 2.37829995
+%float_2_76839995 = OpConstant %float 2.76839995
+%float_3_05150008 = OpConstant %float 3.05150008
+%float_3_27462935 = OpConstant %float 3.27462935
+%float_3_32743073 = OpConstant %float 3.32743073
+%float_0_00499999989 = OpConstant %float 0.00499999989
+ %float_11 = OpConstant %float 11
+ %float_2000 = OpConstant %float 2000
+%float_0_119999997 = OpConstant %float 0.119999997
+%float_0_00313066994 = OpConstant %float 0.00313066994
+%float_12_9200001 = OpConstant %float 12.9200001
+%float_0_416666657 = OpConstant %float 0.416666657
+%float_1_05499995 = OpConstant %float 1.05499995
+%float_0_0549999997 = OpConstant %float 0.0549999997
+%float_n0_166666672 = OpConstant %float -0.166666672
+ %float_n0_5 = OpConstant %float -0.5
+%float_0_166666672 = OpConstant %float 0.166666672
+%float_n3_15737653 = OpConstant %float -3.15737653
+%float_n0_485249996 = OpConstant %float -0.485249996
+%float_1_84773242 = OpConstant %float 1.84773242
+%float_n0_718548238 = OpConstant %float -0.718548238
+%float_2_08103061 = OpConstant %float 2.08103061
+%float_3_6681242 = OpConstant %float 3.6681242
+ %float_18 = OpConstant %float 18
+ %float_7 = OpConstant %float 7
+%_arr_float_uint_5 = OpTypeArray %float %uint_5
+%type__Globals = OpTypeStruct %v4float %v3float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %float %float %float %float %float %_arr_float_uint_5 %v3float %v4float %float %float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %float %float %uint %uint %float %float
+%_ptr_Uniform_type__Globals = OpTypePointer Uniform %type__Globals
+%type_2d_image = OpTypeImage %float 2D 2 0 0 1 Unknown
+%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image
+%type_sampler = OpTypeSampler
+%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler
+%_ptr_Input_v2float = OpTypePointer Input %v2float
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Input_uint = OpTypePointer Input %uint
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %402 = OpTypeFunction %void
+%_ptr_Function_float = OpTypePointer Function %float
+%_ptr_Uniform_uint = OpTypePointer Uniform %uint
+ %bool = OpTypeBool
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+ %v2bool = OpTypeVector %bool 2
+ %v3bool = OpTypeVector %bool 3
+%type_sampled_image = OpTypeSampledImage %type_2d_image
+ %uint_10 = OpConstant %uint 10
+%_arr_float_uint_10 = OpTypeArray %float %uint_10
+%_arr_float_uint_6 = OpTypeArray %float %uint_6
+ %_Globals = OpVariable %_ptr_Uniform_type__Globals Uniform
+ %Texture1 = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%Texture1Sampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%in_var_TEXCOORD0 = OpVariable %_ptr_Input_v2float Input
+%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
+ %gl_Layer = OpVariable %_ptr_Input_uint Input
+%out_var_SV_Target0 = OpVariable %_ptr_Output_v4float Output
+%_ptr_Function__arr_float_uint_6 = OpTypePointer Function %_arr_float_uint_6
+%_ptr_Function__arr_float_uint_10 = OpTypePointer Function %_arr_float_uint_10
+ %416 = OpConstantComposite %v3float %float_0_952552378 %float_0 %float_9_36786018en05
+ %417 = OpConstantComposite %v3float %float_0_343966454 %float_0_728166103 %float_n0_0721325427
+ %418 = OpConstantComposite %v3float %float_0 %float_0 %float_1_00882518
+ %419 = OpConstantComposite %mat3v3float %416 %417 %418
+ %420 = OpConstantComposite %v3float %float_1_04981101 %float_0 %float_n9_74845025en05
+ %421 = OpConstantComposite %v3float %float_n0_495903015 %float_1_37331307 %float_0_0982400328
+ %422 = OpConstantComposite %v3float %float_0 %float_0 %float_0_991252005
+ %423 = OpConstantComposite %mat3v3float %420 %421 %422
+ %424 = OpConstantComposite %v3float %float_0_662454188 %float_0_134004205 %float_0_156187683
+ %425 = OpConstantComposite %v3float %float_n0_00557464967 %float_0_0040607336 %float_1_01033914
+ %426 = OpConstantComposite %mat3v3float %424 %73 %425
+ %427 = OpConstantComposite %v3float %float_1_6410234 %float_n0_324803293 %float_n0_236424699
+ %428 = OpConstantComposite %v3float %float_n0_663662851 %float_1_61533165 %float_0_0167563483
+ %429 = OpConstantComposite %v3float %float_0_0117218941 %float_n0_00828444213 %float_0_988394856
+ %430 = OpConstantComposite %mat3v3float %427 %428 %429
+ %431 = OpConstantComposite %v3float %float_1_45143926 %float_n0_236510754 %float_n0_214928567
+ %432 = OpConstantComposite %v3float %float_n0_0765537769 %float_1_17622972 %float_n0_0996759236
+ %433 = OpConstantComposite %v3float %float_0_00831614807 %float_n0_00603244966 %float_0_997716308
+ %434 = OpConstantComposite %mat3v3float %431 %432 %433
+ %435 = OpConstantComposite %v3float %float_0_695452213 %float_0_140678704 %float_0_163869068
+ %436 = OpConstantComposite %v3float %float_0_0447945632 %float_0_859671116 %float_0_0955343172
+ %437 = OpConstantComposite %v3float %float_n0_00552588282 %float_0_00402521016 %float_1_00150073
+ %438 = OpConstantComposite %mat3v3float %435 %436 %437
+ %439 = OpConstantComposite %v3float %float_3_2409699 %float_n1_5373832 %float_n0_498610765
+ %440 = OpConstantComposite %v3float %float_n0_969243646 %float_1_8759675 %float_0_0415550582
+ %441 = OpConstantComposite %v3float %float_0_0556300804 %float_n0_203976959 %float_1_05697155
+ %442 = OpConstantComposite %mat3v3float %439 %440 %441
+ %443 = OpConstantComposite %v3float %float_0_412456393 %float_0_357576102 %float_0_180437505
+ %444 = OpConstantComposite %v3float %float_0_212672904 %float_0_715152204 %float_0_0721750036
+ %445 = OpConstantComposite %v3float %float_0_0193339009 %float_0_119191997 %float_0_950304091
+ %446 = OpConstantComposite %mat3v3float %443 %444 %445
+ %447 = OpConstantComposite %v3float %float_1_71660841 %float_n0_355662107 %float_n0_253360093
+ %448 = OpConstantComposite %v3float %float_n0_666682899 %float_1_61647761 %float_0_0157685
+ %449 = OpConstantComposite %v3float %float_0_0176422 %float_n0_0427763015 %float_0_942228675
+ %450 = OpConstantComposite %mat3v3float %447 %448 %449
+ %451 = OpConstantComposite %v3float %float_2_49339628 %float_n0_93134588 %float_n0_402694494
+ %452 = OpConstantComposite %v3float %float_n0_829486787 %float_1_76265967 %float_0_0236246008
+ %453 = OpConstantComposite %v3float %float_0_0358507 %float_n0_0761827007 %float_0_957014024
+ %454 = OpConstantComposite %mat3v3float %451 %452 %453
+ %455 = OpConstantComposite %v3float %float_1_01303005 %float_0_00610530982 %float_n0_0149710001
+ %456 = OpConstantComposite %v3float %float_0_00769822998 %float_0_998165011 %float_n0_00503202993
+ %457 = OpConstantComposite %v3float %float_n0_00284131011 %float_0_00468515977 %float_0_924507022
+ %458 = OpConstantComposite %mat3v3float %455 %456 %457
+ %459 = OpConstantComposite %v3float %float_0_987223983 %float_n0_00611326983 %float_0_0159533005
+ %460 = OpConstantComposite %v3float %float_n0_00759836007 %float_1_00186002 %float_0_0053300201
+ %461 = OpConstantComposite %v3float %float_0_00307257008 %float_n0_00509594986 %float_1_08168006
+ %462 = OpConstantComposite %mat3v3float %459 %460 %461
+ %463 = OpConstantComposite %v3float %float_0_5 %float_n1 %float_0_5
+ %464 = OpConstantComposite %v3float %float_n1 %float_1 %float_0_5
+ %465 = OpConstantComposite %v3float %float_0_5 %float_0 %float_0
+ %466 = OpConstantComposite %mat3v3float %463 %464 %465
+ %467 = OpConstantComposite %v3float %float_1 %float_0 %float_0
+ %468 = OpConstantComposite %v3float %float_0 %float_1 %float_0
+ %469 = OpConstantComposite %v3float %float_0 %float_0 %float_1
+ %470 = OpConstantComposite %mat3v3float %467 %468 %469
+%float_n6_07624626 = OpConstant %float -6.07624626
+ %472 = OpConstantComposite %v3float %float_n6_07624626 %float_n6_07624626 %float_n6_07624626
+ %473 = OpConstantComposite %v3float %float_0_895099998 %float_0_266400009 %float_n0_161400005
+ %474 = OpConstantComposite %v3float %float_n0_750199974 %float_1_71350002 %float_0_0366999991
+ %475 = OpConstantComposite %v3float %float_0_0388999991 %float_n0_0684999973 %float_1_02960002
+ %476 = OpConstantComposite %mat3v3float %473 %474 %475
+ %477 = OpConstantComposite %v3float %float_0_986992896 %float_n0_1470543 %float_0_159962699
+ %478 = OpConstantComposite %v3float %float_0_432305306 %float_0_518360317 %float_0_0492912009
+ %479 = OpConstantComposite %v3float %float_n0_0085287001 %float_0_040042799 %float_0_968486726
+ %480 = OpConstantComposite %mat3v3float %477 %478 %479
+ %481 = OpConstantComposite %v3float %float_0_544169128 %float_0_239592597 %float_0_166694298
+ %482 = OpConstantComposite %v3float %float_0_239465594 %float_0_702153027 %float_0_058381401
+ %483 = OpConstantComposite %v3float %float_n0_00234390004 %float_0_0361833982 %float_1_05521834
+ %484 = OpConstantComposite %mat3v3float %481 %482 %483
+ %485 = OpConstantComposite %v3float %float_0_940437257 %float_n0_0183068793 %float_0_077869609
+ %486 = OpConstantComposite %v3float %float_0_00837869663 %float_0_828660011 %float_0_162961304
+ %487 = OpConstantComposite %v3float %float_0_00054712611 %float_n0_000883374596 %float_1_00033629
+ %488 = OpConstantComposite %mat3v3float %485 %486 %487
+ %489 = OpConstantComposite %v3float %float_1_06317997 %float_0_0233955998 %float_n0_0865726024
+ %490 = OpConstantComposite %v3float %float_n0_0106336996 %float_1_20632005 %float_n0_195690006
+ %491 = OpConstantComposite %v3float %float_n0_000590886979 %float_0_00105247996 %float_0_999538004
+ %492 = OpConstantComposite %mat3v3float %489 %490 %491
+%float_0_0533333346 = OpConstant %float 0.0533333346
+%float_0_159999996 = OpConstant %float 0.159999996
+%float_57_2957764 = OpConstant %float 57.2957764
+%float_0_0625 = OpConstant %float 0.0625
+%float_n67_5 = OpConstant %float -67.5
+ %float_67_5 = OpConstant %float 67.5
+ %499 = OpConstantComposite %_arr_float_uint_6 %float_n4 %float_n4 %float_n3_15737653 %float_n0_485249996 %float_1_84773242 %float_1_84773242
+ %500 = OpConstantComposite %_arr_float_uint_6 %float_n0_718548238 %float_2_08103061 %float_3_6681242 %float_4 %float_4 %float_4
+ %float_n15 = OpConstant %float -15
+ %float_n14 = OpConstant %float -14
+ %503 = OpConstantComposite %_arr_float_uint_10 %float_n4_97062206 %float_n3_02937818 %float_n2_12619996 %float_n1_51049995 %float_n1_05780005 %float_n0_466800004 %float_0_119379997 %float_0_708813429 %float_1_29118657 %float_1_29118657
+ %504 = OpConstantComposite %_arr_float_uint_10 %float_0_808913231 %float_1_19108677 %float_1_56830001 %float_1_9483 %float_2_30830002 %float_2_63840008 %float_2_85949993 %float_2_98726082 %float_3_01273918 %float_3_01273918
+ %float_n12 = OpConstant %float -12
+ %506 = OpConstantComposite %_arr_float_uint_10 %float_n2_30102992 %float_n2_30102992 %float_n1_93120003 %float_n1_52049994 %float_n1_05780005 %float_n0_466800004 %float_0_119379997 %float_0_708813429 %float_1_29118657 %float_1_29118657
+ %507 = OpConstantComposite %_arr_float_uint_10 %float_0_801995218 %float_1_19800484 %float_1_59430003 %float_1_99730003 %float_2_37829995 %float_2_76839995 %float_3_05150008 %float_3_27462935 %float_3_32743073 %float_3_32743073
+%float_0_0322580636 = OpConstant %float 0.0322580636
+%float_1_03225803 = OpConstant %float 1.03225803
+ %510 = OpConstantComposite %v2float %float_1_03225803 %float_1_03225803
+%float_4_60443853e_09 = OpConstant %float 4.60443853e+09
+%float_2_00528435e_09 = OpConstant %float 2.00528435e+09
+%float_0_333333343 = OpConstant %float 0.333333343
+ %float_5 = OpConstant %float 5
+ %float_2_5 = OpConstant %float 2.5
+%float_0_0250000004 = OpConstant %float 0.0250000004
+%float_0_239999995 = OpConstant %float 0.239999995
+%float_0_0148148146 = OpConstant %float 0.0148148146
+ %519 = OpConstantComposite %v3float %float_9_99999975en05 %float_9_99999975en05 %float_9_99999975en05
+%float_0_0296296291 = OpConstant %float 0.0296296291
+%float_0_952381015 = OpConstant %float 0.952381015
+ %522 = OpConstantComposite %v3float %float_0_952381015 %float_0_952381015 %float_0_952381015
+ %523 = OpUndef %v3float
+%float_0_358299971 = OpConstant %float 0.358299971
+ %525 = OpUndef %v3float
+ %MainPS = OpFunction %void None %402
+ %526 = OpLabel
+ %527 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %528 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %529 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %530 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %531 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %532 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %533 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %534 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %535 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %536 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %537 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %538 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %539 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %540 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %541 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %542 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %543 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %544 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %545 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %546 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %547 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %548 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %549 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %550 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %551 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %552 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %553 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %554 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %555 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %556 = OpVariable %_ptr_Function__arr_float_uint_10 Function
+ %557 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %558 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %559 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %560 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %561 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %562 = OpVariable %_ptr_Function__arr_float_uint_6 Function
+ %563 = OpLoad %v2float %in_var_TEXCOORD0
+ %564 = OpLoad %uint %gl_Layer
+ %565 = OpFSub %v2float %563 %134
+ %566 = OpFMul %v2float %565 %510
+ %567 = OpCompositeExtract %float %566 0
+ %568 = OpCompositeExtract %float %566 1
+ %569 = OpConvertUToF %float %564
+ %570 = OpFMul %float %569 %float_0_0322580636
+ %571 = OpCompositeConstruct %v4float %567 %568 %570 %float_0
+ %572 = OpMatrixTimesMatrix %mat3v3float %446 %458
+ %573 = OpMatrixTimesMatrix %mat3v3float %572 %430
+ %574 = OpMatrixTimesMatrix %mat3v3float %426 %462
+ %575 = OpMatrixTimesMatrix %mat3v3float %574 %442
+ %576 = OpMatrixTimesMatrix %mat3v3float %419 %430
+ %577 = OpMatrixTimesMatrix %mat3v3float %426 %423
+ %578 = OpAccessChain %_ptr_Uniform_uint %_Globals %int_43
+ %579 = OpLoad %uint %578
+ OpBranch %580
+ %580 = OpLabel
+ OpLoopMerge %581 %582 None
+ OpBranch %583
+ %583 = OpLabel
+ %584 = OpMatrixTimesMatrix %mat3v3float %574 %454
+ %585 = OpMatrixTimesMatrix %mat3v3float %574 %450
+ %586 = OpIEqual %bool %579 %uint_1
+ OpSelectionMerge %587 None
+ OpBranchConditional %586 %588 %589
+ %589 = OpLabel
+ %590 = OpIEqual %bool %579 %uint_2
+ OpSelectionMerge %591 None
+ OpBranchConditional %590 %592 %593
+ %593 = OpLabel
+ %594 = OpIEqual %bool %579 %uint_3
+ OpSelectionMerge %595 None
+ OpBranchConditional %594 %596 %597
+ %597 = OpLabel
+ %598 = OpIEqual %bool %579 %uint_4
+ OpSelectionMerge %599 None
+ OpBranchConditional %598 %600 %601
+ %601 = OpLabel
+ OpBranch %581
+ %600 = OpLabel
+ OpBranch %581
+ %599 = OpLabel
+ OpUnreachable
+ %596 = OpLabel
+ OpBranch %581
+ %595 = OpLabel
+ OpUnreachable
+ %592 = OpLabel
+ OpBranch %581
+ %591 = OpLabel
+ OpUnreachable
+ %588 = OpLabel
+ OpBranch %581
+ %587 = OpLabel
+ OpUnreachable
+ %582 = OpLabel
+ OpBranch %580
+ %581 = OpLabel
+ %602 = OpPhi %mat3v3float %575 %601 %470 %600 %438 %596 %585 %592 %584 %588
+ %603 = OpVectorShuffle %v3float %571 %571 0 1 2
+ %604 = OpAccessChain %_ptr_Uniform_uint %_Globals %int_42
+ %605 = OpLoad %uint %604
+ %606 = OpUGreaterThanEqual %bool %605 %uint_3
+ OpSelectionMerge %607 None
+ OpBranchConditional %606 %608 %609
+ %609 = OpLabel
+ %610 = OpFSub %v3float %603 %204
+ %611 = OpFMul %v3float %610 %205
+ %612 = OpExtInst %v3float %1 Exp2 %611
+ %613 = OpFMul %v3float %612 %206
+ %614 = OpExtInst %v3float %1 Exp2 %472
+ %615 = OpFMul %v3float %614 %206
+ %616 = OpFSub %v3float %613 %615
+ OpBranch %607
+ %608 = OpLabel
+ %617 = OpExtInst %v3float %1 Pow %603 %194
+ %618 = OpFSub %v3float %617 %195
+ %619 = OpExtInst %v3float %1 FMax %138 %618
+ %620 = OpFMul %v3float %197 %617
+ %621 = OpFSub %v3float %196 %620
+ %622 = OpFDiv %v3float %619 %621
+ %623 = OpExtInst %v3float %1 Pow %622 %199
+ %624 = OpFMul %v3float %623 %200
+ OpBranch %607
+ %607 = OpLabel
+ %625 = OpPhi %v3float %616 %609 %624 %608
+ %626 = OpAccessChain %_ptr_Uniform_float %_Globals %int_18
+ %627 = OpLoad %float %626
+ %628 = OpFMul %float %627 %float_1_00055635
+ %629 = OpFOrdLessThanEqual %bool %628 %float_7000
+ %630 = OpFDiv %float %float_4_60443853e_09 %627
+ %631 = OpFSub %float %float_2967800 %630
+ %632 = OpFDiv %float %631 %628
+ %633 = OpFAdd %float %float_99_1100006 %632
+ %634 = OpFDiv %float %633 %628
+ %635 = OpFAdd %float %float_0_244063005 %634
+ %636 = OpFDiv %float %float_2_00528435e_09 %627
+ %637 = OpFSub %float %float_1901800 %636
+ %638 = OpFDiv %float %637 %628
+ %639 = OpFAdd %float %float_247_479996 %638
+ %640 = OpFDiv %float %639 %628
+ %641 = OpFAdd %float %float_0_237039998 %640
+ %642 = OpSelect %float %629 %635 %641
+ %643 = OpFMul %float %float_n3 %642
+ %644 = OpFMul %float %643 %642
+ %645 = OpFMul %float %float_2_86999989 %642
+ %646 = OpFAdd %float %644 %645
+ %647 = OpFSub %float %646 %float_0_275000006
+ %648 = OpCompositeConstruct %v2float %642 %647
+ %649 = OpFMul %float %float_0_000154118257 %627
+ %650 = OpFAdd %float %float_0_860117733 %649
+ %651 = OpFMul %float %float_1_28641219en07 %627
+ %652 = OpFMul %float %651 %627
+ %653 = OpFAdd %float %650 %652
+ %654 = OpFMul %float %float_0_00084242021 %627
+ %655 = OpFAdd %float %float_1 %654
+ %656 = OpFMul %float %float_7_08145137en07 %627
+ %657 = OpFMul %float %656 %627
+ %658 = OpFAdd %float %655 %657
+ %659 = OpFDiv %float %653 %658
+ %660 = OpFMul %float %float_4_22806261en05 %627
+ %661 = OpFAdd %float %float_0_317398727 %660
+ %662 = OpFMul %float %float_4_20481676en08 %627
+ %663 = OpFMul %float %662 %627
+ %664 = OpFAdd %float %661 %663
+ %665 = OpFMul %float %float_2_8974182en05 %627
+ %666 = OpFSub %float %float_1 %665
+ %667 = OpFMul %float %float_1_61456057en07 %627
+ %668 = OpFMul %float %667 %627
+ %669 = OpFAdd %float %666 %668
+ %670 = OpFDiv %float %664 %669
+ %671 = OpFMul %float %float_3 %659
+ %672 = OpFMul %float %float_2 %659
+ %673 = OpFMul %float %float_8 %670
+ %674 = OpFSub %float %672 %673
+ %675 = OpFAdd %float %674 %float_4
+ %676 = OpFDiv %float %671 %675
+ %677 = OpFMul %float %float_2 %670
+ %678 = OpFDiv %float %677 %675
+ %679 = OpCompositeConstruct %v2float %676 %678
+ %680 = OpFOrdLessThan %bool %627 %float_4000
+ %681 = OpCompositeConstruct %v2bool %680 %680
+ %682 = OpSelect %v2float %681 %679 %648
+ %683 = OpAccessChain %_ptr_Uniform_float %_Globals %int_19
+ %684 = OpLoad %float %683
+ %685 = OpCompositeConstruct %v2float %659 %670
+ %686 = OpExtInst %v2float %1 Normalize %685
+ %687 = OpCompositeExtract %float %686 1
+ %688 = OpFNegate %float %687
+ %689 = OpFMul %float %688 %684
+ %690 = OpFMul %float %689 %float_0_0500000007
+ %691 = OpFAdd %float %659 %690
+ %692 = OpCompositeExtract %float %686 0
+ %693 = OpFMul %float %692 %684
+ %694 = OpFMul %float %693 %float_0_0500000007
+ %695 = OpFAdd %float %670 %694
+ %696 = OpFMul %float %float_3 %691
+ %697 = OpFMul %float %float_2 %691
+ %698 = OpFMul %float %float_8 %695
+ %699 = OpFSub %float %697 %698
+ %700 = OpFAdd %float %699 %float_4
+ %701 = OpFDiv %float %696 %700
+ %702 = OpFMul %float %float_2 %695
+ %703 = OpFDiv %float %702 %700
+ %704 = OpCompositeConstruct %v2float %701 %703
+ %705 = OpFSub %v2float %704 %679
+ %706 = OpFAdd %v2float %682 %705
+ %707 = OpCompositeExtract %float %706 0
+ %708 = OpCompositeExtract %float %706 1
+ %709 = OpExtInst %float %1 FMax %708 %float_1_00000001en10
+ %710 = OpFDiv %float %707 %709
+ %711 = OpCompositeInsert %v3float %710 %523 0
+ %712 = OpCompositeInsert %v3float %float_1 %711 1
+ %713 = OpFSub %float %float_1 %707
+ %714 = OpFSub %float %713 %708
+ %715 = OpFDiv %float %714 %709
+ %716 = OpCompositeInsert %v3float %715 %712 2
+ %717 = OpExtInst %float %1 FMax %float_0_328999996 %float_1_00000001en10
+ %718 = OpFDiv %float %float_0_312700003 %717
+ %719 = OpCompositeInsert %v3float %718 %523 0
+ %720 = OpCompositeInsert %v3float %float_1 %719 1
+ %721 = OpFDiv %float %float_0_358299971 %717
+ %722 = OpCompositeInsert %v3float %721 %720 2
+ %723 = OpVectorTimesMatrix %v3float %716 %476
+ %724 = OpVectorTimesMatrix %v3float %722 %476
+ %725 = OpCompositeExtract %float %724 0
+ %726 = OpCompositeExtract %float %723 0
+ %727 = OpFDiv %float %725 %726
+ %728 = OpCompositeConstruct %v3float %727 %float_0 %float_0
+ %729 = OpCompositeExtract %float %724 1
+ %730 = OpCompositeExtract %float %723 1
+ %731 = OpFDiv %float %729 %730
+ %732 = OpCompositeConstruct %v3float %float_0 %731 %float_0
+ %733 = OpCompositeExtract %float %724 2
+ %734 = OpCompositeExtract %float %723 2
+ %735 = OpFDiv %float %733 %734
+ %736 = OpCompositeConstruct %v3float %float_0 %float_0 %735
+ %737 = OpCompositeConstruct %mat3v3float %728 %732 %736
+ %738 = OpMatrixTimesMatrix %mat3v3float %476 %737
+ %739 = OpMatrixTimesMatrix %mat3v3float %738 %480
+ %740 = OpMatrixTimesMatrix %mat3v3float %446 %739
+ %741 = OpMatrixTimesMatrix %mat3v3float %740 %442
+ %742 = OpVectorTimesMatrix %v3float %625 %741
+ %743 = OpVectorTimesMatrix %v3float %742 %573
+ %744 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_9
+ %745 = OpAccessChain %_ptr_Uniform_float %_Globals %int_9 %int_3
+ %746 = OpLoad %float %745
+ %747 = OpFOrdNotEqual %bool %746 %float_0
+ OpSelectionMerge %748 None
+ OpBranchConditional %747 %749 %748
+ %749 = OpLabel
+ %750 = OpDot %float %743 %73
+ %751 = OpCompositeConstruct %v3float %750 %750 %750
+ %752 = OpFDiv %v3float %743 %751
+ %753 = OpFSub %v3float %752 %141
+ %754 = OpDot %float %753 %753
+ %755 = OpFMul %float %float_n4 %754
+ %756 = OpExtInst %float %1 Exp2 %755
+ %757 = OpFSub %float %float_1 %756
+ %758 = OpAccessChain %_ptr_Uniform_float %_Globals %int_45
+ %759 = OpLoad %float %758
+ %760 = OpFMul %float %float_n4 %759
+ %761 = OpFMul %float %760 %750
+ %762 = OpFMul %float %761 %750
+ %763 = OpExtInst %float %1 Exp2 %762
+ %764 = OpFSub %float %float_1 %763
+ %765 = OpFMul %float %757 %764
+ %766 = OpMatrixTimesMatrix %mat3v3float %484 %430
+ %767 = OpMatrixTimesMatrix %mat3v3float %575 %766
+ %768 = OpVectorTimesMatrix %v3float %743 %767
+ %769 = OpCompositeConstruct %v3float %765 %765 %765
+ %770 = OpExtInst %v3float %1 FMix %743 %768 %769
+ OpBranch %748
+ %748 = OpLabel
+ %771 = OpPhi %v3float %743 %607 %770 %749
+ %772 = OpDot %float %771 %73
+ %773 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_25
+ %774 = OpLoad %v4float %773
+ %775 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_20
+ %776 = OpLoad %v4float %775
+ %777 = OpFMul %v4float %774 %776
+ %778 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_26
+ %779 = OpLoad %v4float %778
+ %780 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_21
+ %781 = OpLoad %v4float %780
+ %782 = OpFMul %v4float %779 %781
+ %783 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_27
+ %784 = OpLoad %v4float %783
+ %785 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_22
+ %786 = OpLoad %v4float %785
+ %787 = OpFMul %v4float %784 %786
+ %788 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_28
+ %789 = OpLoad %v4float %788
+ %790 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_23
+ %791 = OpLoad %v4float %790
+ %792 = OpFMul %v4float %789 %791
+ %793 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_29
+ %794 = OpLoad %v4float %793
+ %795 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_24
+ %796 = OpLoad %v4float %795
+ %797 = OpFAdd %v4float %794 %796
+ %798 = OpCompositeConstruct %v3float %772 %772 %772
+ %799 = OpVectorShuffle %v3float %777 %777 0 1 2
+ %800 = OpCompositeExtract %float %777 3
+ %801 = OpCompositeConstruct %v3float %800 %800 %800
+ %802 = OpFMul %v3float %799 %801
+ %803 = OpExtInst %v3float %1 FMix %798 %771 %802
+ %804 = OpExtInst %v3float %1 FMax %138 %803
+ %805 = OpFMul %v3float %804 %330
+ %806 = OpVectorShuffle %v3float %782 %782 0 1 2
+ %807 = OpCompositeExtract %float %782 3
+ %808 = OpCompositeConstruct %v3float %807 %807 %807
+ %809 = OpFMul %v3float %806 %808
+ %810 = OpExtInst %v3float %1 Pow %805 %809
+ %811 = OpFMul %v3float %810 %206
+ %812 = OpVectorShuffle %v3float %787 %787 0 1 2
+ %813 = OpCompositeExtract %float %787 3
+ %814 = OpCompositeConstruct %v3float %813 %813 %813
+ %815 = OpFMul %v3float %812 %814
+ %816 = OpFDiv %v3float %141 %815
+ %817 = OpExtInst %v3float %1 Pow %811 %816
+ %818 = OpVectorShuffle %v3float %792 %792 0 1 2
+ %819 = OpCompositeExtract %float %792 3
+ %820 = OpCompositeConstruct %v3float %819 %819 %819
+ %821 = OpFMul %v3float %818 %820
+ %822 = OpFMul %v3float %817 %821
+ %823 = OpVectorShuffle %v3float %797 %797 0 1 2
+ %824 = OpCompositeExtract %float %797 3
+ %825 = OpCompositeConstruct %v3float %824 %824 %824
+ %826 = OpFAdd %v3float %823 %825
+ %827 = OpFAdd %v3float %822 %826
+ %828 = OpAccessChain %_ptr_Uniform_float %_Globals %int_40
+ %829 = OpLoad %float %828
+ %830 = OpExtInst %float %1 SmoothStep %float_0 %829 %772
+ %831 = OpFSub %float %float_1 %830
+ %832 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_35
+ %833 = OpLoad %v4float %832
+ %834 = OpFMul %v4float %833 %776
+ %835 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_36
+ %836 = OpLoad %v4float %835
+ %837 = OpFMul %v4float %836 %781
+ %838 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_37
+ %839 = OpLoad %v4float %838
+ %840 = OpFMul %v4float %839 %786
+ %841 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_38
+ %842 = OpLoad %v4float %841
+ %843 = OpFMul %v4float %842 %791
+ %844 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_39
+ %845 = OpLoad %v4float %844
+ %846 = OpFAdd %v4float %845 %796
+ %847 = OpVectorShuffle %v3float %834 %834 0 1 2
+ %848 = OpCompositeExtract %float %834 3
+ %849 = OpCompositeConstruct %v3float %848 %848 %848
+ %850 = OpFMul %v3float %847 %849
+ %851 = OpExtInst %v3float %1 FMix %798 %771 %850
+ %852 = OpExtInst %v3float %1 FMax %138 %851
+ %853 = OpFMul %v3float %852 %330
+ %854 = OpVectorShuffle %v3float %837 %837 0 1 2
+ %855 = OpCompositeExtract %float %837 3
+ %856 = OpCompositeConstruct %v3float %855 %855 %855
+ %857 = OpFMul %v3float %854 %856
+ %858 = OpExtInst %v3float %1 Pow %853 %857
+ %859 = OpFMul %v3float %858 %206
+ %860 = OpVectorShuffle %v3float %840 %840 0 1 2
+ %861 = OpCompositeExtract %float %840 3
+ %862 = OpCompositeConstruct %v3float %861 %861 %861
+ %863 = OpFMul %v3float %860 %862
+ %864 = OpFDiv %v3float %141 %863
+ %865 = OpExtInst %v3float %1 Pow %859 %864
+ %866 = OpVectorShuffle %v3float %843 %843 0 1 2
+ %867 = OpCompositeExtract %float %843 3
+ %868 = OpCompositeConstruct %v3float %867 %867 %867
+ %869 = OpFMul %v3float %866 %868
+ %870 = OpFMul %v3float %865 %869
+ %871 = OpVectorShuffle %v3float %846 %846 0 1 2
+ %872 = OpCompositeExtract %float %846 3
+ %873 = OpCompositeConstruct %v3float %872 %872 %872
+ %874 = OpFAdd %v3float %871 %873
+ %875 = OpFAdd %v3float %870 %874
+ %876 = OpAccessChain %_ptr_Uniform_float %_Globals %int_41
+ %877 = OpLoad %float %876
+ %878 = OpExtInst %float %1 SmoothStep %877 %float_1 %772
+ %879 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_30
+ %880 = OpLoad %v4float %879
+ %881 = OpFMul %v4float %880 %776
+ %882 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_31
+ %883 = OpLoad %v4float %882
+ %884 = OpFMul %v4float %883 %781
+ %885 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_32
+ %886 = OpLoad %v4float %885
+ %887 = OpFMul %v4float %886 %786
+ %888 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_33
+ %889 = OpLoad %v4float %888
+ %890 = OpFMul %v4float %889 %791
+ %891 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_34
+ %892 = OpLoad %v4float %891
+ %893 = OpFAdd %v4float %892 %796
+ %894 = OpVectorShuffle %v3float %881 %881 0 1 2
+ %895 = OpCompositeExtract %float %881 3
+ %896 = OpCompositeConstruct %v3float %895 %895 %895
+ %897 = OpFMul %v3float %894 %896
+ %898 = OpExtInst %v3float %1 FMix %798 %771 %897
+ %899 = OpExtInst %v3float %1 FMax %138 %898
+ %900 = OpFMul %v3float %899 %330
+ %901 = OpVectorShuffle %v3float %884 %884 0 1 2
+ %902 = OpCompositeExtract %float %884 3
+ %903 = OpCompositeConstruct %v3float %902 %902 %902
+ %904 = OpFMul %v3float %901 %903
+ %905 = OpExtInst %v3float %1 Pow %900 %904
+ %906 = OpFMul %v3float %905 %206
+ %907 = OpVectorShuffle %v3float %887 %887 0 1 2
+ %908 = OpCompositeExtract %float %887 3
+ %909 = OpCompositeConstruct %v3float %908 %908 %908
+ %910 = OpFMul %v3float %907 %909
+ %911 = OpFDiv %v3float %141 %910
+ %912 = OpExtInst %v3float %1 Pow %906 %911
+ %913 = OpVectorShuffle %v3float %890 %890 0 1 2
+ %914 = OpCompositeExtract %float %890 3
+ %915 = OpCompositeConstruct %v3float %914 %914 %914
+ %916 = OpFMul %v3float %913 %915
+ %917 = OpFMul %v3float %912 %916
+ %918 = OpVectorShuffle %v3float %893 %893 0 1 2
+ %919 = OpCompositeExtract %float %893 3
+ %920 = OpCompositeConstruct %v3float %919 %919 %919
+ %921 = OpFAdd %v3float %918 %920
+ %922 = OpFAdd %v3float %917 %921
+ %923 = OpFSub %float %830 %878
+ %924 = OpCompositeConstruct %v3float %831 %831 %831
+ %925 = OpFMul %v3float %827 %924
+ %926 = OpCompositeConstruct %v3float %923 %923 %923
+ %927 = OpFMul %v3float %922 %926
+ %928 = OpFAdd %v3float %925 %927
+ %929 = OpCompositeConstruct %v3float %878 %878 %878
+ %930 = OpFMul %v3float %875 %929
+ %931 = OpFAdd %v3float %928 %930
+ %932 = OpVectorTimesMatrix %v3float %931 %575
+ %933 = OpMatrixTimesMatrix %mat3v3float %577 %488
+ %934 = OpMatrixTimesMatrix %mat3v3float %933 %576
+ %935 = OpMatrixTimesMatrix %mat3v3float %577 %492
+ %936 = OpMatrixTimesMatrix %mat3v3float %935 %576
+ %937 = OpVectorTimesMatrix %v3float %931 %934
+ %938 = OpAccessChain %_ptr_Uniform_float %_Globals %int_44
+ %939 = OpLoad %float %938
+ %940 = OpCompositeConstruct %v3float %939 %939 %939
+ %941 = OpExtInst %v3float %1 FMix %931 %937 %940
+ %942 = OpVectorTimesMatrix %v3float %941 %577
+ %943 = OpCompositeExtract %float %942 0
+ %944 = OpCompositeExtract %float %942 1
+ %945 = OpExtInst %float %1 FMin %943 %944
+ %946 = OpCompositeExtract %float %942 2
+ %947 = OpExtInst %float %1 FMin %945 %946
+ %948 = OpExtInst %float %1 FMax %943 %944
+ %949 = OpExtInst %float %1 FMax %948 %946
+ %950 = OpExtInst %float %1 FMax %949 %float_1_00000001en10
+ %951 = OpExtInst %float %1 FMax %947 %float_1_00000001en10
+ %952 = OpFSub %float %950 %951
+ %953 = OpExtInst %float %1 FMax %949 %float_0_00999999978
+ %954 = OpFDiv %float %952 %953
+ %955 = OpFSub %float %946 %944
+ %956 = OpFMul %float %946 %955
+ %957 = OpFSub %float %944 %943
+ %958 = OpFMul %float %944 %957
+ %959 = OpFAdd %float %956 %958
+ %960 = OpFSub %float %943 %946
+ %961 = OpFMul %float %943 %960
+ %962 = OpFAdd %float %959 %961
+ %963 = OpExtInst %float %1 Sqrt %962
+ %964 = OpFAdd %float %946 %944
+ %965 = OpFAdd %float %964 %943
+ %966 = OpFMul %float %float_1_75 %963
+ %967 = OpFAdd %float %965 %966
+ %968 = OpFMul %float %967 %float_0_333333343
+ %969 = OpFSub %float %954 %float_0_400000006
+ %970 = OpFMul %float %969 %float_5
+ %971 = OpFMul %float %969 %float_2_5
+ %972 = OpExtInst %float %1 FAbs %971
+ %973 = OpFSub %float %float_1 %972
+ %974 = OpExtInst %float %1 FMax %973 %float_0
+ %975 = OpExtInst %float %1 FSign %970
+ %976 = OpConvertFToS %int %975
+ %977 = OpConvertSToF %float %976
+ %978 = OpFMul %float %974 %974
+ %979 = OpFSub %float %float_1 %978
+ %980 = OpFMul %float %977 %979
+ %981 = OpFAdd %float %float_1 %980
+ %982 = OpFMul %float %981 %float_0_0250000004
+ %983 = OpFOrdLessThanEqual %bool %968 %float_0_0533333346
+ OpSelectionMerge %984 None
+ OpBranchConditional %983 %985 %986
+ %986 = OpLabel
+ %987 = OpFOrdGreaterThanEqual %bool %968 %float_0_159999996
+ OpSelectionMerge %988 None
+ OpBranchConditional %987 %989 %990
+ %990 = OpLabel
+ %991 = OpFDiv %float %float_0_239999995 %967
+ %992 = OpFSub %float %991 %float_0_5
+ %993 = OpFMul %float %982 %992
+ OpBranch %988
+ %989 = OpLabel
+ OpBranch %988
+ %988 = OpLabel
+ %994 = OpPhi %float %993 %990 %float_0 %989
+ OpBranch %984
+ %985 = OpLabel
+ OpBranch %984
+ %984 = OpLabel
+ %995 = OpPhi %float %994 %988 %982 %985
+ %996 = OpFAdd %float %float_1 %995
+ %997 = OpCompositeConstruct %v3float %996 %996 %996
+ %998 = OpFMul %v3float %942 %997
+ %999 = OpCompositeExtract %float %998 0
+ %1000 = OpCompositeExtract %float %998 1
+ %1001 = OpFOrdEqual %bool %999 %1000
+ %1002 = OpCompositeExtract %float %998 2
+ %1003 = OpFOrdEqual %bool %1000 %1002
+ %1004 = OpLogicalAnd %bool %1001 %1003
+ OpSelectionMerge %1005 None
+ OpBranchConditional %1004 %1006 %1007
+ %1007 = OpLabel
+ %1008 = OpExtInst %float %1 Sqrt %float_3
+ %1009 = OpFSub %float %1000 %1002
+ %1010 = OpFMul %float %1008 %1009
+ %1011 = OpFMul %float %float_2 %999
+ %1012 = OpFSub %float %1011 %1000
+ %1013 = OpFSub %float %1012 %1002
+ %1014 = OpExtInst %float %1 Atan2 %1010 %1013
+ %1015 = OpFMul %float %float_57_2957764 %1014
+ OpBranch %1005
+ %1006 = OpLabel
+ OpBranch %1005
+ %1005 = OpLabel
+ %1016 = OpPhi %float %1015 %1007 %float_0 %1006
+ %1017 = OpFOrdLessThan %bool %1016 %float_0
+ OpSelectionMerge %1018 None
+ OpBranchConditional %1017 %1019 %1018
+ %1019 = OpLabel
+ %1020 = OpFAdd %float %1016 %float_360
+ OpBranch %1018
+ %1018 = OpLabel
+ %1021 = OpPhi %float %1016 %1005 %1020 %1019
+ %1022 = OpExtInst %float %1 FClamp %1021 %float_0 %float_360
+ %1023 = OpFOrdGreaterThan %bool %1022 %float_180
+ OpSelectionMerge %1024 None
+ OpBranchConditional %1023 %1025 %1024
+ %1025 = OpLabel
+ %1026 = OpFSub %float %1022 %float_360
+ OpBranch %1024
+ %1024 = OpLabel
+ %1027 = OpPhi %float %1022 %1018 %1026 %1025
+ %1028 = OpFMul %float %1027 %float_0_0148148146
+ %1029 = OpExtInst %float %1 FAbs %1028
+ %1030 = OpFSub %float %float_1 %1029
+ %1031 = OpExtInst %float %1 SmoothStep %float_0 %float_1 %1030
+ %1032 = OpFMul %float %1031 %1031
+ %1033 = OpFMul %float %1032 %954
+ %1034 = OpFSub %float %float_0_0299999993 %999
+ %1035 = OpFMul %float %1033 %1034
+ %1036 = OpFMul %float %1035 %float_0_180000007
+ %1037 = OpFAdd %float %999 %1036
+ %1038 = OpCompositeInsert %v3float %1037 %998 0
+ %1039 = OpVectorTimesMatrix %v3float %1038 %434
+ %1040 = OpExtInst %v3float %1 FMax %138 %1039
+ %1041 = OpDot %float %1040 %73
+ %1042 = OpCompositeConstruct %v3float %1041 %1041 %1041
+ %1043 = OpExtInst %v3float %1 FMix %1042 %1040 %241
+ %1044 = OpAccessChain %_ptr_Uniform_float %_Globals %int_13
+ %1045 = OpLoad %float %1044
+ %1046 = OpFAdd %float %float_1 %1045
+ %1047 = OpAccessChain %_ptr_Uniform_float %_Globals %int_11
+ %1048 = OpLoad %float %1047
+ %1049 = OpFSub %float %1046 %1048
+ %1050 = OpAccessChain %_ptr_Uniform_float %_Globals %int_14
+ %1051 = OpLoad %float %1050
+ %1052 = OpFAdd %float %float_1 %1051
+ %1053 = OpAccessChain %_ptr_Uniform_float %_Globals %int_12
+ %1054 = OpLoad %float %1053
+ %1055 = OpFSub %float %1052 %1054
+ %1056 = OpFOrdGreaterThan %bool %1048 %float_0_800000012
+ OpSelectionMerge %1057 None
+ OpBranchConditional %1056 %1058 %1059
+ %1059 = OpLabel
+ %1060 = OpFAdd %float %float_0_180000007 %1045
+ %1061 = OpFDiv %float %1060 %1049
+ %1062 = OpExtInst %float %1 Log %float_0_180000007
+ %1063 = OpExtInst %float %1 Log %float_10
+ %1064 = OpFDiv %float %1062 %1063
+ %1065 = OpFSub %float %float_2 %1061
+ %1066 = OpFDiv %float %1061 %1065
+ %1067 = OpExtInst %float %1 Log %1066
+ %1068 = OpFMul %float %float_0_5 %1067
+ %1069 = OpAccessChain %_ptr_Uniform_float %_Globals %int_10
+ %1070 = OpLoad %float %1069
+ %1071 = OpFDiv %float %1049 %1070
+ %1072 = OpFMul %float %1068 %1071
+ %1073 = OpFSub %float %1064 %1072
+ OpBranch %1057
+ %1058 = OpLabel
+ %1074 = OpFSub %float %float_0_819999993 %1048
+ %1075 = OpAccessChain %_ptr_Uniform_float %_Globals %int_10
+ %1076 = OpLoad %float %1075
+ %1077 = OpFDiv %float %1074 %1076
+ %1078 = OpExtInst %float %1 Log %float_0_180000007
+ %1079 = OpExtInst %float %1 Log %float_10
+ %1080 = OpFDiv %float %1078 %1079
+ %1081 = OpFAdd %float %1077 %1080
+ OpBranch %1057
+ %1057 = OpLabel
+ %1082 = OpPhi %float %1073 %1059 %1081 %1058
+ %1083 = OpFSub %float %float_1 %1048
+ %1084 = OpAccessChain %_ptr_Uniform_float %_Globals %int_10
+ %1085 = OpLoad %float %1084
+ %1086 = OpFDiv %float %1083 %1085
+ %1087 = OpFSub %float %1086 %1082
+ %1088 = OpFDiv %float %1054 %1085
+ %1089 = OpFSub %float %1088 %1087
+ %1090 = OpExtInst %v3float %1 Log %1043
+ %1091 = OpExtInst %float %1 Log %float_10
+ %1092 = OpCompositeConstruct %v3float %1091 %1091 %1091
+ %1093 = OpFDiv %v3float %1090 %1092
+ %1094 = OpCompositeConstruct %v3float %1085 %1085 %1085
+ %1095 = OpCompositeConstruct %v3float %1087 %1087 %1087
+ %1096 = OpFAdd %v3float %1093 %1095
+ %1097 = OpFMul %v3float %1094 %1096
+ %1098 = OpFNegate %float %1045
+ %1099 = OpCompositeConstruct %v3float %1098 %1098 %1098
+ %1100 = OpFMul %float %float_2 %1049
+ %1101 = OpCompositeConstruct %v3float %1100 %1100 %1100
+ %1102 = OpFMul %float %float_n2 %1085
+ %1103 = OpFDiv %float %1102 %1049
+ %1104 = OpCompositeConstruct %v3float %1103 %1103 %1103
+ %1105 = OpCompositeConstruct %v3float %1082 %1082 %1082
+ %1106 = OpFSub %v3float %1093 %1105
+ %1107 = OpFMul %v3float %1104 %1106
+ %1108 = OpExtInst %v3float %1 Exp %1107
+ %1109 = OpFAdd %v3float %141 %1108
+ %1110 = OpFDiv %v3float %1101 %1109
+ %1111 = OpFAdd %v3float %1099 %1110
+ %1112 = OpCompositeConstruct %v3float %1052 %1052 %1052
+ %1113 = OpFMul %float %float_2 %1055
+ %1114 = OpCompositeConstruct %v3float %1113 %1113 %1113
+ %1115 = OpFMul %float %float_2 %1085
+ %1116 = OpFDiv %float %1115 %1055
+ %1117 = OpCompositeConstruct %v3float %1116 %1116 %1116
+ %1118 = OpCompositeConstruct %v3float %1089 %1089 %1089
+ %1119 = OpFSub %v3float %1093 %1118
+ %1120 = OpFMul %v3float %1117 %1119
+ %1121 = OpExtInst %v3float %1 Exp %1120
+ %1122 = OpFAdd %v3float %141 %1121
+ %1123 = OpFDiv %v3float %1114 %1122
+ %1124 = OpFSub %v3float %1112 %1123
+ %1125 = OpFOrdLessThan %v3bool %1093 %1105
+ %1126 = OpSelect %v3float %1125 %1111 %1097
+ %1127 = OpFOrdGreaterThan %v3bool %1093 %1118
+ %1128 = OpSelect %v3float %1127 %1124 %1097
+ %1129 = OpFSub %float %1089 %1082
+ %1130 = OpCompositeConstruct %v3float %1129 %1129 %1129
+ %1131 = OpFDiv %v3float %1106 %1130
+ %1132 = OpExtInst %v3float %1 FClamp %1131 %138 %141
+ %1133 = OpFOrdLessThan %bool %1089 %1082
+ %1134 = OpFSub %v3float %141 %1132
+ %1135 = OpCompositeConstruct %v3bool %1133 %1133 %1133
+ %1136 = OpSelect %v3float %1135 %1134 %1132
+ %1137 = OpFMul %v3float %252 %1136
+ %1138 = OpFSub %v3float %251 %1137
+ %1139 = OpFMul %v3float %1138 %1136
+ %1140 = OpFMul %v3float %1139 %1136
+ %1141 = OpExtInst %v3float %1 FMix %1126 %1128 %1140
+ %1142 = OpDot %float %1141 %73
+ %1143 = OpCompositeConstruct %v3float %1142 %1142 %1142
+ %1144 = OpExtInst %v3float %1 FMix %1143 %1141 %254
+ %1145 = OpExtInst %v3float %1 FMax %138 %1144
+ %1146 = OpVectorTimesMatrix %v3float %1145 %936
+ %1147 = OpExtInst %v3float %1 FMix %1145 %1146 %940
+ %1148 = OpVectorTimesMatrix %v3float %1147 %575
+ %1149 = OpExtInst %v3float %1 FMax %138 %1148
+ %1150 = OpFOrdEqual %bool %746 %float_0
+ OpSelectionMerge %1151 DontFlatten
+ OpBranchConditional %1150 %1152 %1151
+ %1152 = OpLabel
+ %1153 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_2
+ %1154 = OpLoad %v4float %1153
+ %1155 = OpVectorShuffle %v3float %1154 %1154 0 1 2
+ %1156 = OpDot %float %932 %1155
+ %1157 = OpCompositeInsert %v3float %1156 %525 0
+ %1158 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_3
+ %1159 = OpLoad %v4float %1158
+ %1160 = OpVectorShuffle %v3float %1159 %1159 0 1 2
+ %1161 = OpDot %float %932 %1160
+ %1162 = OpCompositeInsert %v3float %1161 %1157 1
+ %1163 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_4
+ %1164 = OpLoad %v4float %1163
+ %1165 = OpVectorShuffle %v3float %1164 %1164 0 1 2
+ %1166 = OpDot %float %932 %1165
+ %1167 = OpCompositeInsert %v3float %1166 %1162 2
+ %1168 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_8
+ %1169 = OpLoad %v4float %1168
+ %1170 = OpVectorShuffle %v3float %1169 %1169 0 1 2
+ %1171 = OpLoad %v4float %744
+ %1172 = OpVectorShuffle %v3float %1171 %1171 0 1 2
+ %1173 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_7
+ %1174 = OpLoad %v4float %1173
+ %1175 = OpVectorShuffle %v3float %1174 %1174 0 1 2
+ %1176 = OpDot %float %932 %1175
+ %1177 = OpFAdd %float %1176 %float_1
+ %1178 = OpFDiv %float %float_1 %1177
+ %1179 = OpCompositeConstruct %v3float %1178 %1178 %1178
+ %1180 = OpFMul %v3float %1172 %1179
+ %1181 = OpFAdd %v3float %1170 %1180
+ %1182 = OpFMul %v3float %1167 %1181
+ %1183 = OpExtInst %v3float %1 FMax %138 %1182
+ %1184 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_5
+ %1185 = OpLoad %v4float %1184
+ %1186 = OpVectorShuffle %v3float %1185 %1185 0 0 0
+ %1187 = OpFSub %v3float %1186 %1183
+ %1188 = OpExtInst %v3float %1 FMax %138 %1187
+ %1189 = OpVectorShuffle %v3float %1185 %1185 2 2 2
+ %1190 = OpExtInst %v3float %1 FMax %1183 %1189
+ %1191 = OpExtInst %v3float %1 FClamp %1183 %1186 %1189
+ %1192 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_6
+ %1193 = OpLoad %v4float %1192
+ %1194 = OpVectorShuffle %v3float %1193 %1193 0 0 0
+ %1195 = OpFMul %v3float %1190 %1194
+ %1196 = OpVectorShuffle %v3float %1193 %1193 1 1 1
+ %1197 = OpFAdd %v3float %1195 %1196
+ %1198 = OpVectorShuffle %v3float %1185 %1185 3 3 3
+ %1199 = OpFAdd %v3float %1190 %1198
+ %1200 = OpFDiv %v3float %141 %1199
+ %1201 = OpFMul %v3float %1197 %1200
+ %1202 = OpVectorShuffle %v3float %1164 %1164 3 3 3
+ %1203 = OpFMul %v3float %1191 %1202
+ %1204 = OpVectorShuffle %v3float %1154 %1154 3 3 3
+ %1205 = OpFMul %v3float %1188 %1204
+ %1206 = OpVectorShuffle %v3float %1185 %1185 1 1 1
+ %1207 = OpFAdd %v3float %1188 %1206
+ %1208 = OpFDiv %v3float %141 %1207
+ %1209 = OpFMul %v3float %1205 %1208
+ %1210 = OpVectorShuffle %v3float %1159 %1159 3 3 3
+ %1211 = OpFAdd %v3float %1209 %1210
+ %1212 = OpFAdd %v3float %1203 %1211
+ %1213 = OpFAdd %v3float %1201 %1212
+ %1214 = OpFSub %v3float %1213 %261
+ OpBranch %1151
+ %1151 = OpLabel
+ %1215 = OpPhi %v3float %1149 %1057 %1214 %1152
+ %1216 = OpExtInst %v3float %1 FClamp %1215 %138 %141
+ %1217 = OpCompositeExtract %float %1216 0
+ OpBranch %1218
+ %1218 = OpLabel
+ OpLoopMerge %1219 %1220 None
+ OpBranch %1221
+ %1221 = OpLabel
+ %1222 = OpFOrdLessThan %bool %1217 %float_0_00313066994
+ OpSelectionMerge %1223 None
+ OpBranchConditional %1222 %1224 %1223
+ %1224 = OpLabel
+ %1225 = OpFMul %float %1217 %float_12_9200001
+ OpBranch %1219
+ %1223 = OpLabel
+ %1226 = OpExtInst %float %1 Pow %1217 %float_0_416666657
+ %1227 = OpFMul %float %1226 %float_1_05499995
+ %1228 = OpFSub %float %1227 %float_0_0549999997
+ OpBranch %1219
+ %1220 = OpLabel
+ OpBranch %1218
+ %1219 = OpLabel
+ %1229 = OpPhi %float %1225 %1224 %1228 %1223
+ %1230 = OpCompositeExtract %float %1216 1
+ OpBranch %1231
+ %1231 = OpLabel
+ OpLoopMerge %1232 %1233 None
+ OpBranch %1234
+ %1234 = OpLabel
+ %1235 = OpFOrdLessThan %bool %1230 %float_0_00313066994
+ OpSelectionMerge %1236 None
+ OpBranchConditional %1235 %1237 %1236
+ %1237 = OpLabel
+ %1238 = OpFMul %float %1230 %float_12_9200001
+ OpBranch %1232
+ %1236 = OpLabel
+ %1239 = OpExtInst %float %1 Pow %1230 %float_0_416666657
+ %1240 = OpFMul %float %1239 %float_1_05499995
+ %1241 = OpFSub %float %1240 %float_0_0549999997
+ OpBranch %1232
+ %1233 = OpLabel
+ OpBranch %1231
+ %1232 = OpLabel
+ %1242 = OpPhi %float %1238 %1237 %1241 %1236
+ %1243 = OpCompositeExtract %float %1216 2
+ OpBranch %1244
+ %1244 = OpLabel
+ OpLoopMerge %1245 %1246 None
+ OpBranch %1247
+ %1247 = OpLabel
+ %1248 = OpFOrdLessThan %bool %1243 %float_0_00313066994
+ OpSelectionMerge %1249 None
+ OpBranchConditional %1248 %1250 %1249
+ %1250 = OpLabel
+ %1251 = OpFMul %float %1243 %float_12_9200001
+ OpBranch %1245
+ %1249 = OpLabel
+ %1252 = OpExtInst %float %1 Pow %1243 %float_0_416666657
+ %1253 = OpFMul %float %1252 %float_1_05499995
+ %1254 = OpFSub %float %1253 %float_0_0549999997
+ OpBranch %1245
+ %1246 = OpLabel
+ OpBranch %1244
+ %1245 = OpLabel
+ %1255 = OpPhi %float %1251 %1250 %1254 %1249
+ %1256 = OpCompositeConstruct %v3float %1229 %1242 %1255
+ %1257 = OpFMul %v3float %1256 %173
+ %1258 = OpFAdd %v3float %1257 %175
+ %1259 = OpAccessChain %_ptr_Uniform_float %_Globals %int_15 %int_0
+ %1260 = OpLoad %float %1259
+ %1261 = OpCompositeConstruct %v3float %1260 %1260 %1260
+ %1262 = OpFMul %v3float %1261 %1256
+ %1263 = OpAccessChain %_ptr_Uniform_float %_Globals %int_15 %int_1
+ %1264 = OpLoad %float %1263
+ %1265 = OpCompositeConstruct %v3float %1264 %1264 %1264
+ %1266 = OpLoad %type_2d_image %Texture1
+ %1267 = OpLoad %type_sampler %Texture1Sampler
+ %1268 = OpCompositeExtract %float %1258 2
+ %1269 = OpFMul %float %1268 %float_16
+ %1270 = OpFSub %float %1269 %float_0_5
+ %1271 = OpExtInst %float %1 Floor %1270
+ %1272 = OpFSub %float %1270 %1271
+ %1273 = OpCompositeExtract %float %1258 0
+ %1274 = OpFAdd %float %1273 %1271
+ %1275 = OpFMul %float %1274 %float_0_0625
+ %1276 = OpCompositeExtract %float %1258 1
+ %1277 = OpCompositeConstruct %v2float %1275 %1276
+ %1278 = OpSampledImage %type_sampled_image %1266 %1267
+ %1279 = OpImageSampleImplicitLod %v4float %1278 %1277 None
+ %1280 = OpFAdd %float %1275 %float_0_0625
+ %1281 = OpCompositeConstruct %v2float %1280 %1276
+ %1282 = OpSampledImage %type_sampled_image %1266 %1267
+ %1283 = OpImageSampleImplicitLod %v4float %1282 %1281 None
+ %1284 = OpCompositeConstruct %v4float %1272 %1272 %1272 %1272
+ %1285 = OpExtInst %v4float %1 FMix %1279 %1283 %1284
+ %1286 = OpVectorShuffle %v3float %1285 %1285 0 1 2
+ %1287 = OpFMul %v3float %1265 %1286
+ %1288 = OpFAdd %v3float %1262 %1287
+ %1289 = OpExtInst %v3float %1 FMax %263 %1288
+ %1290 = OpFOrdGreaterThan %v3bool %1289 %265
+ %1291 = OpFMul %v3float %1289 %267
+ %1292 = OpFAdd %v3float %1291 %269
+ %1293 = OpExtInst %v3float %1 Pow %1292 %271
+ %1294 = OpFMul %v3float %1289 %273
+ %1295 = OpSelect %v3float %1290 %1293 %1294
+ %1296 = OpAccessChain %_ptr_Uniform_float %_Globals %int_0 %int_0
+ %1297 = OpLoad %float %1296
+ %1298 = OpCompositeConstruct %v3float %1297 %1297 %1297
+ %1299 = OpFMul %v3float %1295 %1295
+ %1300 = OpFMul %v3float %1298 %1299
+ %1301 = OpAccessChain %_ptr_Uniform_float %_Globals %int_0 %int_1
+ %1302 = OpLoad %float %1301
+ %1303 = OpCompositeConstruct %v3float %1302 %1302 %1302
+ %1304 = OpFMul %v3float %1303 %1295
+ %1305 = OpFAdd %v3float %1300 %1304
+ %1306 = OpAccessChain %_ptr_Uniform_float %_Globals %int_0 %int_2
+ %1307 = OpLoad %float %1306
+ %1308 = OpCompositeConstruct %v3float %1307 %1307 %1307
+ %1309 = OpFAdd %v3float %1305 %1308
+ %1310 = OpAccessChain %_ptr_Uniform_v3float %_Globals %int_16
+ %1311 = OpLoad %v3float %1310
+ %1312 = OpFMul %v3float %1309 %1311
+ %1313 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_17
+ %1314 = OpLoad %v4float %1313
+ %1315 = OpVectorShuffle %v3float %1314 %1314 0 1 2
+ %1316 = OpAccessChain %_ptr_Uniform_float %_Globals %int_17 %int_3
+ %1317 = OpLoad %float %1316
+ %1318 = OpCompositeConstruct %v3float %1317 %1317 %1317
+ %1319 = OpExtInst %v3float %1 FMix %1312 %1315 %1318
+ %1320 = OpExtInst %v3float %1 FMax %138 %1319
+ %1321 = OpAccessChain %_ptr_Uniform_float %_Globals %int_1 %int_1
+ %1322 = OpLoad %float %1321
+ %1323 = OpCompositeConstruct %v3float %1322 %1322 %1322
+ %1324 = OpExtInst %v3float %1 Pow %1320 %1323
+ %1325 = OpIEqual %bool %605 %uint_0
+ OpSelectionMerge %1326 DontFlatten
+ OpBranchConditional %1325 %1327 %1328
+ %1328 = OpLabel
+ %1329 = OpIEqual %bool %605 %uint_1
+ OpSelectionMerge %1330 None
+ OpBranchConditional %1329 %1331 %1332
+ %1332 = OpLabel
+ %1333 = OpIEqual %bool %605 %uint_3
+ %1334 = OpIEqual %bool %605 %uint_5
+ %1335 = OpLogicalOr %bool %1333 %1334
+ OpSelectionMerge %1336 None
+ OpBranchConditional %1335 %1337 %1338
+ %1338 = OpLabel
+ %1339 = OpIEqual %bool %605 %uint_4
+ %1340 = OpIEqual %bool %605 %uint_6
+ %1341 = OpLogicalOr %bool %1339 %1340
+ OpSelectionMerge %1342 None
+ OpBranchConditional %1341 %1343 %1344
+ %1344 = OpLabel
+ %1345 = OpIEqual %bool %605 %uint_7
+ OpSelectionMerge %1346 None
+ OpBranchConditional %1345 %1347 %1348
+ %1348 = OpLabel
+ %1349 = OpVectorTimesMatrix %v3float %1324 %573
+ %1350 = OpVectorTimesMatrix %v3float %1349 %602
+ %1351 = OpAccessChain %_ptr_Uniform_float %_Globals %int_1 %int_2
+ %1352 = OpLoad %float %1351
+ %1353 = OpCompositeConstruct %v3float %1352 %1352 %1352
+ %1354 = OpExtInst %v3float %1 Pow %1350 %1353
+ OpBranch %1346
+ %1347 = OpLabel
+ %1355 = OpVectorTimesMatrix %v3float %932 %573
+ %1356 = OpVectorTimesMatrix %v3float %1355 %602
+ %1357 = OpFMul %v3float %1356 %519
+ %1358 = OpExtInst %v3float %1 Pow %1357 %286
+ %1359 = OpFMul %v3float %196 %1358
+ %1360 = OpFAdd %v3float %195 %1359
+ %1361 = OpFMul %v3float %197 %1358
+ %1362 = OpFAdd %v3float %141 %1361
+ %1363 = OpFDiv %v3float %141 %1362
+ %1364 = OpFMul %v3float %1360 %1363
+ %1365 = OpExtInst %v3float %1 Pow %1364 %287
+ OpBranch %1346
+ %1346 = OpLabel
+ %1366 = OpPhi %v3float %1354 %1348 %1365 %1347
+ OpBranch %1342
+ %1343 = OpLabel
+ %1367 = OpMatrixTimesMatrix %mat3v3float %572 %423
+ %1368 = OpFMul %v3float %932 %285
+ %1369 = OpVectorTimesMatrix %v3float %1368 %1367
+ %1370 = OpCompositeExtract %float %1369 0
+ %1371 = OpCompositeExtract %float %1369 1
+ %1372 = OpExtInst %float %1 FMin %1370 %1371
+ %1373 = OpCompositeExtract %float %1369 2
+ %1374 = OpExtInst %float %1 FMin %1372 %1373
+ %1375 = OpExtInst %float %1 FMax %1370 %1371
+ %1376 = OpExtInst %float %1 FMax %1375 %1373
+ %1377 = OpExtInst %float %1 FMax %1376 %float_1_00000001en10
+ %1378 = OpExtInst %float %1 FMax %1374 %float_1_00000001en10
+ %1379 = OpFSub %float %1377 %1378
+ %1380 = OpExtInst %float %1 FMax %1376 %float_0_00999999978
+ %1381 = OpFDiv %float %1379 %1380
+ %1382 = OpFSub %float %1373 %1371
+ %1383 = OpFMul %float %1373 %1382
+ %1384 = OpFSub %float %1371 %1370
+ %1385 = OpFMul %float %1371 %1384
+ %1386 = OpFAdd %float %1383 %1385
+ %1387 = OpFSub %float %1370 %1373
+ %1388 = OpFMul %float %1370 %1387
+ %1389 = OpFAdd %float %1386 %1388
+ %1390 = OpExtInst %float %1 Sqrt %1389
+ %1391 = OpFAdd %float %1373 %1371
+ %1392 = OpFAdd %float %1391 %1370
+ %1393 = OpFMul %float %float_1_75 %1390
+ %1394 = OpFAdd %float %1392 %1393
+ %1395 = OpFMul %float %1394 %float_0_333333343
+ %1396 = OpFSub %float %1381 %float_0_400000006
+ %1397 = OpFMul %float %1396 %float_5
+ %1398 = OpFMul %float %1396 %float_2_5
+ %1399 = OpExtInst %float %1 FAbs %1398
+ %1400 = OpFSub %float %float_1 %1399
+ %1401 = OpExtInst %float %1 FMax %1400 %float_0
+ %1402 = OpExtInst %float %1 FSign %1397
+ %1403 = OpConvertFToS %int %1402
+ %1404 = OpConvertSToF %float %1403
+ %1405 = OpFMul %float %1401 %1401
+ %1406 = OpFSub %float %float_1 %1405
+ %1407 = OpFMul %float %1404 %1406
+ %1408 = OpFAdd %float %float_1 %1407
+ %1409 = OpFMul %float %1408 %float_0_0250000004
+ %1410 = OpFOrdLessThanEqual %bool %1395 %float_0_0533333346
+ OpSelectionMerge %1411 None
+ OpBranchConditional %1410 %1412 %1413
+ %1413 = OpLabel
+ %1414 = OpFOrdGreaterThanEqual %bool %1395 %float_0_159999996
+ OpSelectionMerge %1415 None
+ OpBranchConditional %1414 %1416 %1417
+ %1417 = OpLabel
+ %1418 = OpFDiv %float %float_0_239999995 %1394
+ %1419 = OpFSub %float %1418 %float_0_5
+ %1420 = OpFMul %float %1409 %1419
+ OpBranch %1415
+ %1416 = OpLabel
+ OpBranch %1415
+ %1415 = OpLabel
+ %1421 = OpPhi %float %1420 %1417 %float_0 %1416
+ OpBranch %1411
+ %1412 = OpLabel
+ OpBranch %1411
+ %1411 = OpLabel
+ %1422 = OpPhi %float %1421 %1415 %1409 %1412
+ %1423 = OpFAdd %float %float_1 %1422
+ %1424 = OpCompositeConstruct %v3float %1423 %1423 %1423
+ %1425 = OpFMul %v3float %1369 %1424
+ %1426 = OpCompositeExtract %float %1425 0
+ %1427 = OpCompositeExtract %float %1425 1
+ %1428 = OpFOrdEqual %bool %1426 %1427
+ %1429 = OpCompositeExtract %float %1425 2
+ %1430 = OpFOrdEqual %bool %1427 %1429
+ %1431 = OpLogicalAnd %bool %1428 %1430
+ OpSelectionMerge %1432 None
+ OpBranchConditional %1431 %1433 %1434
+ %1434 = OpLabel
+ %1435 = OpExtInst %float %1 Sqrt %float_3
+ %1436 = OpFSub %float %1427 %1429
+ %1437 = OpFMul %float %1435 %1436
+ %1438 = OpFMul %float %float_2 %1426
+ %1439 = OpFSub %float %1438 %1427
+ %1440 = OpFSub %float %1439 %1429
+ %1441 = OpExtInst %float %1 Atan2 %1437 %1440
+ %1442 = OpFMul %float %float_57_2957764 %1441
+ OpBranch %1432
+ %1433 = OpLabel
+ OpBranch %1432
+ %1432 = OpLabel
+ %1443 = OpPhi %float %1442 %1434 %float_0 %1433
+ %1444 = OpFOrdLessThan %bool %1443 %float_0
+ OpSelectionMerge %1445 None
+ OpBranchConditional %1444 %1446 %1445
+ %1446 = OpLabel
+ %1447 = OpFAdd %float %1443 %float_360
+ OpBranch %1445
+ %1445 = OpLabel
+ %1448 = OpPhi %float %1443 %1432 %1447 %1446
+ %1449 = OpExtInst %float %1 FClamp %1448 %float_0 %float_360
+ %1450 = OpFOrdGreaterThan %bool %1449 %float_180
+ OpSelectionMerge %1451 None
+ OpBranchConditional %1450 %1452 %1451
+ %1452 = OpLabel
+ %1453 = OpFSub %float %1449 %float_360
+ OpBranch %1451
+ %1451 = OpLabel
+ %1454 = OpPhi %float %1449 %1445 %1453 %1452
+ %1455 = OpFOrdGreaterThan %bool %1454 %float_n67_5
+ %1456 = OpFOrdLessThan %bool %1454 %float_67_5
+ %1457 = OpLogicalAnd %bool %1455 %1456
+ OpSelectionMerge %1458 None
+ OpBranchConditional %1457 %1459 %1458
+ %1459 = OpLabel
+ %1460 = OpFSub %float %1454 %float_n67_5
+ %1461 = OpFMul %float %1460 %float_0_0296296291
+ %1462 = OpConvertFToS %int %1461
+ %1463 = OpConvertSToF %float %1462
+ %1464 = OpFSub %float %1461 %1463
+ %1465 = OpFMul %float %1464 %1464
+ %1466 = OpFMul %float %1465 %1464
+ %1467 = OpIEqual %bool %1462 %int_3
+ OpSelectionMerge %1468 None
+ OpBranchConditional %1467 %1469 %1470
+ %1470 = OpLabel
+ %1471 = OpIEqual %bool %1462 %int_2
+ OpSelectionMerge %1472 None
+ OpBranchConditional %1471 %1473 %1474
+ %1474 = OpLabel
+ %1475 = OpIEqual %bool %1462 %int_1
+ OpSelectionMerge %1476 None
+ OpBranchConditional %1475 %1477 %1478
+ %1478 = OpLabel
+ %1479 = OpIEqual %bool %1462 %int_0
+ OpSelectionMerge %1480 None
+ OpBranchConditional %1479 %1481 %1482
+ %1482 = OpLabel
+ OpBranch %1480
+ %1481 = OpLabel
+ %1483 = OpFMul %float %1466 %float_0_166666672
+ OpBranch %1480
+ %1480 = OpLabel
+ %1484 = OpPhi %float %float_0 %1482 %1483 %1481
+ OpBranch %1476
+ %1477 = OpLabel
+ %1485 = OpFMul %float %1466 %float_n0_5
+ %1486 = OpFMul %float %1465 %float_0_5
+ %1487 = OpFAdd %float %1485 %1486
+ %1488 = OpFMul %float %1464 %float_0_5
+ %1489 = OpFAdd %float %1487 %1488
+ %1490 = OpFAdd %float %1489 %float_0_166666672
+ OpBranch %1476
+ %1476 = OpLabel
+ %1491 = OpPhi %float %1484 %1480 %1490 %1477
+ OpBranch %1472
+ %1473 = OpLabel
+ %1492 = OpFMul %float %1466 %float_0_5
+ %1493 = OpFMul %float %1465 %float_n1
+ %1494 = OpFAdd %float %1492 %1493
+ %1495 = OpFAdd %float %1494 %float_0_666666687
+ OpBranch %1472
+ %1472 = OpLabel
+ %1496 = OpPhi %float %1491 %1476 %1495 %1473
+ OpBranch %1468
+ %1469 = OpLabel
+ %1497 = OpFMul %float %1466 %float_n0_166666672
+ %1498 = OpFMul %float %1465 %float_0_5
+ %1499 = OpFAdd %float %1497 %1498
+ %1500 = OpFMul %float %1464 %float_n0_5
+ %1501 = OpFAdd %float %1499 %1500
+ %1502 = OpFAdd %float %1501 %float_0_166666672
+ OpBranch %1468
+ %1468 = OpLabel
+ %1503 = OpPhi %float %1496 %1472 %1502 %1469
+ OpBranch %1458
+ %1458 = OpLabel
+ %1504 = OpPhi %float %float_0 %1451 %1503 %1468
+ %1505 = OpFMul %float %1504 %float_1_5
+ %1506 = OpFMul %float %1505 %1381
+ %1507 = OpFSub %float %float_0_0299999993 %1426
+ %1508 = OpFMul %float %1506 %1507
+ %1509 = OpFMul %float %1508 %float_0_180000007
+ %1510 = OpFAdd %float %1426 %1509
+ %1511 = OpCompositeInsert %v3float %1510 %1425 0
+ %1512 = OpExtInst %v3float %1 FClamp %1511 %138 %337
+ %1513 = OpVectorTimesMatrix %v3float %1512 %434
+ %1514 = OpExtInst %v3float %1 FClamp %1513 %138 %337
+ %1515 = OpDot %float %1514 %73
+ %1516 = OpCompositeConstruct %v3float %1515 %1515 %1515
+ %1517 = OpExtInst %v3float %1 FMix %1516 %1514 %241
+ %1518 = OpCompositeExtract %float %1517 0
+ %1519 = OpExtInst %float %1 Exp2 %float_n15
+ %1520 = OpFMul %float %float_0_179999992 %1519
+ %1521 = OpExtInst %float %1 Exp2 %float_18
+ %1522 = OpFMul %float %float_0_179999992 %1521
+ OpStore %528 %499
+ OpStore %527 %500
+ %1523 = OpFOrdLessThanEqual %bool %1518 %float_0
+ %1524 = OpExtInst %float %1 Exp2 %float_n14
+ %1525 = OpSelect %float %1523 %1524 %1518
+ %1526 = OpExtInst %float %1 Log %1525
+ %1527 = OpFDiv %float %1526 %1091
+ %1528 = OpExtInst %float %1 Log %1520
+ %1529 = OpFDiv %float %1528 %1091
+ %1530 = OpFOrdLessThanEqual %bool %1527 %1529
+ OpSelectionMerge %1531 None
+ OpBranchConditional %1530 %1532 %1533
+ %1533 = OpLabel
+ %1534 = OpFOrdGreaterThan %bool %1527 %1529
+ %1535 = OpExtInst %float %1 Log %float_0_180000007
+ %1536 = OpFDiv %float %1535 %1091
+ %1537 = OpFOrdLessThan %bool %1527 %1536
+ %1538 = OpLogicalAnd %bool %1534 %1537
+ OpSelectionMerge %1539 None
+ OpBranchConditional %1538 %1540 %1541
+ %1541 = OpLabel
+ %1542 = OpFOrdGreaterThanEqual %bool %1527 %1536
+ %1543 = OpExtInst %float %1 Log %1522
+ %1544 = OpFDiv %float %1543 %1091
+ %1545 = OpFOrdLessThan %bool %1527 %1544
+ %1546 = OpLogicalAnd %bool %1542 %1545
+ OpSelectionMerge %1547 None
+ OpBranchConditional %1546 %1548 %1549
+ %1549 = OpLabel
+ %1550 = OpExtInst %float %1 Log %float_10000
+ %1551 = OpFDiv %float %1550 %1091
+ OpBranch %1547
+ %1548 = OpLabel
+ %1552 = OpFSub %float %1527 %1536
+ %1553 = OpFMul %float %float_3 %1552
+ %1554 = OpFSub %float %1544 %1536
+ %1555 = OpFDiv %float %1553 %1554
+ %1556 = OpConvertFToS %int %1555
+ %1557 = OpConvertSToF %float %1556
+ %1558 = OpFSub %float %1555 %1557
+ %1559 = OpAccessChain %_ptr_Function_float %527 %1556
+ %1560 = OpLoad %float %1559
+ %1561 = OpIAdd %int %1556 %int_1
+ %1562 = OpAccessChain %_ptr_Function_float %527 %1561
+ %1563 = OpLoad %float %1562
+ %1564 = OpIAdd %int %1556 %int_2
+ %1565 = OpAccessChain %_ptr_Function_float %527 %1564
+ %1566 = OpLoad %float %1565
+ %1567 = OpCompositeConstruct %v3float %1560 %1563 %1566
+ %1568 = OpFMul %float %1558 %1558
+ %1569 = OpCompositeConstruct %v3float %1568 %1558 %float_1
+ %1570 = OpMatrixTimesVector %v3float %466 %1567
+ %1571 = OpDot %float %1569 %1570
+ OpBranch %1547
+ %1547 = OpLabel
+ %1572 = OpPhi %float %1551 %1549 %1571 %1548
+ OpBranch %1539
+ %1540 = OpLabel
+ %1573 = OpFSub %float %1527 %1529
+ %1574 = OpFMul %float %float_3 %1573
+ %1575 = OpFSub %float %1536 %1529
+ %1576 = OpFDiv %float %1574 %1575
+ %1577 = OpConvertFToS %int %1576
+ %1578 = OpConvertSToF %float %1577
+ %1579 = OpFSub %float %1576 %1578
+ %1580 = OpAccessChain %_ptr_Function_float %528 %1577
+ %1581 = OpLoad %float %1580
+ %1582 = OpIAdd %int %1577 %int_1
+ %1583 = OpAccessChain %_ptr_Function_float %528 %1582
+ %1584 = OpLoad %float %1583
+ %1585 = OpIAdd %int %1577 %int_2
+ %1586 = OpAccessChain %_ptr_Function_float %528 %1585
+ %1587 = OpLoad %float %1586
+ %1588 = OpCompositeConstruct %v3float %1581 %1584 %1587
+ %1589 = OpFMul %float %1579 %1579
+ %1590 = OpCompositeConstruct %v3float %1589 %1579 %float_1
+ %1591 = OpMatrixTimesVector %v3float %466 %1588
+ %1592 = OpDot %float %1590 %1591
+ OpBranch %1539
+ %1539 = OpLabel
+ %1593 = OpPhi %float %1572 %1547 %1592 %1540
+ OpBranch %1531
+ %1532 = OpLabel
+ %1594 = OpExtInst %float %1 Log %float_9_99999975en05
+ %1595 = OpFDiv %float %1594 %1091
+ OpBranch %1531
+ %1531 = OpLabel
+ %1596 = OpPhi %float %1593 %1539 %1595 %1532
+ %1597 = OpExtInst %float %1 Pow %float_10 %1596
+ %1598 = OpCompositeInsert %v3float %1597 %523 0
+ %1599 = OpCompositeExtract %float %1517 1
+ OpStore %530 %499
+ OpStore %529 %500
+ %1600 = OpFOrdLessThanEqual %bool %1599 %float_0
+ %1601 = OpSelect %float %1600 %1524 %1599
+ %1602 = OpExtInst %float %1 Log %1601
+ %1603 = OpFDiv %float %1602 %1091
+ %1604 = OpFOrdLessThanEqual %bool %1603 %1529
+ OpSelectionMerge %1605 None
+ OpBranchConditional %1604 %1606 %1607
+ %1607 = OpLabel
+ %1608 = OpFOrdGreaterThan %bool %1603 %1529
+ %1609 = OpExtInst %float %1 Log %float_0_180000007
+ %1610 = OpFDiv %float %1609 %1091
+ %1611 = OpFOrdLessThan %bool %1603 %1610
+ %1612 = OpLogicalAnd %bool %1608 %1611
+ OpSelectionMerge %1613 None
+ OpBranchConditional %1612 %1614 %1615
+ %1615 = OpLabel
+ %1616 = OpFOrdGreaterThanEqual %bool %1603 %1610
+ %1617 = OpExtInst %float %1 Log %1522
+ %1618 = OpFDiv %float %1617 %1091
+ %1619 = OpFOrdLessThan %bool %1603 %1618
+ %1620 = OpLogicalAnd %bool %1616 %1619
+ OpSelectionMerge %1621 None
+ OpBranchConditional %1620 %1622 %1623
+ %1623 = OpLabel
+ %1624 = OpExtInst %float %1 Log %float_10000
+ %1625 = OpFDiv %float %1624 %1091
+ OpBranch %1621
+ %1622 = OpLabel
+ %1626 = OpFSub %float %1603 %1610
+ %1627 = OpFMul %float %float_3 %1626
+ %1628 = OpFSub %float %1618 %1610
+ %1629 = OpFDiv %float %1627 %1628
+ %1630 = OpConvertFToS %int %1629
+ %1631 = OpConvertSToF %float %1630
+ %1632 = OpFSub %float %1629 %1631
+ %1633 = OpAccessChain %_ptr_Function_float %529 %1630
+ %1634 = OpLoad %float %1633
+ %1635 = OpIAdd %int %1630 %int_1
+ %1636 = OpAccessChain %_ptr_Function_float %529 %1635
+ %1637 = OpLoad %float %1636
+ %1638 = OpIAdd %int %1630 %int_2
+ %1639 = OpAccessChain %_ptr_Function_float %529 %1638
+ %1640 = OpLoad %float %1639
+ %1641 = OpCompositeConstruct %v3float %1634 %1637 %1640
+ %1642 = OpFMul %float %1632 %1632
+ %1643 = OpCompositeConstruct %v3float %1642 %1632 %float_1
+ %1644 = OpMatrixTimesVector %v3float %466 %1641
+ %1645 = OpDot %float %1643 %1644
+ OpBranch %1621
+ %1621 = OpLabel
+ %1646 = OpPhi %float %1625 %1623 %1645 %1622
+ OpBranch %1613
+ %1614 = OpLabel
+ %1647 = OpFSub %float %1603 %1529
+ %1648 = OpFMul %float %float_3 %1647
+ %1649 = OpFSub %float %1610 %1529
+ %1650 = OpFDiv %float %1648 %1649
+ %1651 = OpConvertFToS %int %1650
+ %1652 = OpConvertSToF %float %1651
+ %1653 = OpFSub %float %1650 %1652
+ %1654 = OpAccessChain %_ptr_Function_float %530 %1651
+ %1655 = OpLoad %float %1654
+ %1656 = OpIAdd %int %1651 %int_1
+ %1657 = OpAccessChain %_ptr_Function_float %530 %1656
+ %1658 = OpLoad %float %1657
+ %1659 = OpIAdd %int %1651 %int_2
+ %1660 = OpAccessChain %_ptr_Function_float %530 %1659
+ %1661 = OpLoad %float %1660
+ %1662 = OpCompositeConstruct %v3float %1655 %1658 %1661
+ %1663 = OpFMul %float %1653 %1653
+ %1664 = OpCompositeConstruct %v3float %1663 %1653 %float_1
+ %1665 = OpMatrixTimesVector %v3float %466 %1662
+ %1666 = OpDot %float %1664 %1665
+ OpBranch %1613
+ %1613 = OpLabel
+ %1667 = OpPhi %float %1646 %1621 %1666 %1614
+ OpBranch %1605
+ %1606 = OpLabel
+ %1668 = OpExtInst %float %1 Log %float_9_99999975en05
+ %1669 = OpFDiv %float %1668 %1091
+ OpBranch %1605
+ %1605 = OpLabel
+ %1670 = OpPhi %float %1667 %1613 %1669 %1606
+ %1671 = OpExtInst %float %1 Pow %float_10 %1670
+ %1672 = OpCompositeInsert %v3float %1671 %1598 1
+ %1673 = OpCompositeExtract %float %1517 2
+ OpStore %532 %499
+ OpStore %531 %500
+ %1674 = OpFOrdLessThanEqual %bool %1673 %float_0
+ %1675 = OpSelect %float %1674 %1524 %1673
+ %1676 = OpExtInst %float %1 Log %1675
+ %1677 = OpFDiv %float %1676 %1091
+ %1678 = OpFOrdLessThanEqual %bool %1677 %1529
+ OpSelectionMerge %1679 None
+ OpBranchConditional %1678 %1680 %1681
+ %1681 = OpLabel
+ %1682 = OpFOrdGreaterThan %bool %1677 %1529
+ %1683 = OpExtInst %float %1 Log %float_0_180000007
+ %1684 = OpFDiv %float %1683 %1091
+ %1685 = OpFOrdLessThan %bool %1677 %1684
+ %1686 = OpLogicalAnd %bool %1682 %1685
+ OpSelectionMerge %1687 None
+ OpBranchConditional %1686 %1688 %1689
+ %1689 = OpLabel
+ %1690 = OpFOrdGreaterThanEqual %bool %1677 %1684
+ %1691 = OpExtInst %float %1 Log %1522
+ %1692 = OpFDiv %float %1691 %1091
+ %1693 = OpFOrdLessThan %bool %1677 %1692
+ %1694 = OpLogicalAnd %bool %1690 %1693
+ OpSelectionMerge %1695 None
+ OpBranchConditional %1694 %1696 %1697
+ %1697 = OpLabel
+ %1698 = OpExtInst %float %1 Log %float_10000
+ %1699 = OpFDiv %float %1698 %1091
+ OpBranch %1695
+ %1696 = OpLabel
+ %1700 = OpFSub %float %1677 %1684
+ %1701 = OpFMul %float %float_3 %1700
+ %1702 = OpFSub %float %1692 %1684
+ %1703 = OpFDiv %float %1701 %1702
+ %1704 = OpConvertFToS %int %1703
+ %1705 = OpConvertSToF %float %1704
+ %1706 = OpFSub %float %1703 %1705
+ %1707 = OpAccessChain %_ptr_Function_float %531 %1704
+ %1708 = OpLoad %float %1707
+ %1709 = OpIAdd %int %1704 %int_1
+ %1710 = OpAccessChain %_ptr_Function_float %531 %1709
+ %1711 = OpLoad %float %1710
+ %1712 = OpIAdd %int %1704 %int_2
+ %1713 = OpAccessChain %_ptr_Function_float %531 %1712
+ %1714 = OpLoad %float %1713
+ %1715 = OpCompositeConstruct %v3float %1708 %1711 %1714
+ %1716 = OpFMul %float %1706 %1706
+ %1717 = OpCompositeConstruct %v3float %1716 %1706 %float_1
+ %1718 = OpMatrixTimesVector %v3float %466 %1715
+ %1719 = OpDot %float %1717 %1718
+ OpBranch %1695
+ %1695 = OpLabel
+ %1720 = OpPhi %float %1699 %1697 %1719 %1696
+ OpBranch %1687
+ %1688 = OpLabel
+ %1721 = OpFSub %float %1677 %1529
+ %1722 = OpFMul %float %float_3 %1721
+ %1723 = OpFSub %float %1684 %1529
+ %1724 = OpFDiv %float %1722 %1723
+ %1725 = OpConvertFToS %int %1724
+ %1726 = OpConvertSToF %float %1725
+ %1727 = OpFSub %float %1724 %1726
+ %1728 = OpAccessChain %_ptr_Function_float %532 %1725
+ %1729 = OpLoad %float %1728
+ %1730 = OpIAdd %int %1725 %int_1
+ %1731 = OpAccessChain %_ptr_Function_float %532 %1730
+ %1732 = OpLoad %float %1731
+ %1733 = OpIAdd %int %1725 %int_2
+ %1734 = OpAccessChain %_ptr_Function_float %532 %1733
+ %1735 = OpLoad %float %1734
+ %1736 = OpCompositeConstruct %v3float %1729 %1732 %1735
+ %1737 = OpFMul %float %1727 %1727
+ %1738 = OpCompositeConstruct %v3float %1737 %1727 %float_1
+ %1739 = OpMatrixTimesVector %v3float %466 %1736
+ %1740 = OpDot %float %1738 %1739
+ OpBranch %1687
+ %1687 = OpLabel
+ %1741 = OpPhi %float %1720 %1695 %1740 %1688
+ OpBranch %1679
+ %1680 = OpLabel
+ %1742 = OpExtInst %float %1 Log %float_9_99999975en05
+ %1743 = OpFDiv %float %1742 %1091
+ OpBranch %1679
+ %1679 = OpLabel
+ %1744 = OpPhi %float %1741 %1687 %1743 %1680
+ %1745 = OpExtInst %float %1 Pow %float_10 %1744
+ %1746 = OpCompositeInsert %v3float %1745 %1672 2
+ %1747 = OpVectorTimesMatrix %v3float %1746 %438
+ %1748 = OpVectorTimesMatrix %v3float %1747 %434
+ %1749 = OpExtInst %float %1 Pow %float_2 %float_n12
+ %1750 = OpFMul %float %float_0_179999992 %1749
+ OpStore %540 %499
+ OpStore %539 %500
+ %1751 = OpFOrdLessThanEqual %bool %1750 %float_0
+ %1752 = OpSelect %float %1751 %1524 %1750
+ %1753 = OpExtInst %float %1 Log %1752
+ %1754 = OpFDiv %float %1753 %1091
+ %1755 = OpFOrdLessThanEqual %bool %1754 %1529
+ OpSelectionMerge %1756 None
+ OpBranchConditional %1755 %1757 %1758
+ %1758 = OpLabel
+ %1759 = OpFOrdGreaterThan %bool %1754 %1529
+ %1760 = OpExtInst %float %1 Log %float_0_180000007
+ %1761 = OpFDiv %float %1760 %1091
+ %1762 = OpFOrdLessThan %bool %1754 %1761
+ %1763 = OpLogicalAnd %bool %1759 %1762
+ OpSelectionMerge %1764 None
+ OpBranchConditional %1763 %1765 %1766
+ %1766 = OpLabel
+ %1767 = OpFOrdGreaterThanEqual %bool %1754 %1761
+ %1768 = OpExtInst %float %1 Log %1522
+ %1769 = OpFDiv %float %1768 %1091
+ %1770 = OpFOrdLessThan %bool %1754 %1769
+ %1771 = OpLogicalAnd %bool %1767 %1770
+ OpSelectionMerge %1772 None
+ OpBranchConditional %1771 %1773 %1774
+ %1774 = OpLabel
+ %1775 = OpExtInst %float %1 Log %float_10000
+ %1776 = OpFDiv %float %1775 %1091
+ OpBranch %1772
+ %1773 = OpLabel
+ %1777 = OpFSub %float %1754 %1761
+ %1778 = OpFMul %float %float_3 %1777
+ %1779 = OpFSub %float %1769 %1761
+ %1780 = OpFDiv %float %1778 %1779
+ %1781 = OpConvertFToS %int %1780
+ %1782 = OpConvertSToF %float %1781
+ %1783 = OpFSub %float %1780 %1782
+ %1784 = OpAccessChain %_ptr_Function_float %539 %1781
+ %1785 = OpLoad %float %1784
+ %1786 = OpIAdd %int %1781 %int_1
+ %1787 = OpAccessChain %_ptr_Function_float %539 %1786
+ %1788 = OpLoad %float %1787
+ %1789 = OpIAdd %int %1781 %int_2
+ %1790 = OpAccessChain %_ptr_Function_float %539 %1789
+ %1791 = OpLoad %float %1790
+ %1792 = OpCompositeConstruct %v3float %1785 %1788 %1791
+ %1793 = OpFMul %float %1783 %1783
+ %1794 = OpCompositeConstruct %v3float %1793 %1783 %float_1
+ %1795 = OpMatrixTimesVector %v3float %466 %1792
+ %1796 = OpDot %float %1794 %1795
+ OpBranch %1772
+ %1772 = OpLabel
+ %1797 = OpPhi %float %1776 %1774 %1796 %1773
+ OpBranch %1764
+ %1765 = OpLabel
+ %1798 = OpFSub %float %1754 %1529
+ %1799 = OpFMul %float %float_3 %1798
+ %1800 = OpFSub %float %1761 %1529
+ %1801 = OpFDiv %float %1799 %1800
+ %1802 = OpConvertFToS %int %1801
+ %1803 = OpConvertSToF %float %1802
+ %1804 = OpFSub %float %1801 %1803
+ %1805 = OpAccessChain %_ptr_Function_float %540 %1802
+ %1806 = OpLoad %float %1805
+ %1807 = OpIAdd %int %1802 %int_1
+ %1808 = OpAccessChain %_ptr_Function_float %540 %1807
+ %1809 = OpLoad %float %1808
+ %1810 = OpIAdd %int %1802 %int_2
+ %1811 = OpAccessChain %_ptr_Function_float %540 %1810
+ %1812 = OpLoad %float %1811
+ %1813 = OpCompositeConstruct %v3float %1806 %1809 %1812
+ %1814 = OpFMul %float %1804 %1804
+ %1815 = OpCompositeConstruct %v3float %1814 %1804 %float_1
+ %1816 = OpMatrixTimesVector %v3float %466 %1813
+ %1817 = OpDot %float %1815 %1816
+ OpBranch %1764
+ %1764 = OpLabel
+ %1818 = OpPhi %float %1797 %1772 %1817 %1765
+ OpBranch %1756
+ %1757 = OpLabel
+ %1819 = OpExtInst %float %1 Log %float_9_99999975en05
+ %1820 = OpFDiv %float %1819 %1091
+ OpBranch %1756
+ %1756 = OpLabel
+ %1821 = OpPhi %float %1818 %1764 %1820 %1757
+ %1822 = OpExtInst %float %1 Pow %float_10 %1821
+ OpStore %542 %499
+ OpStore %541 %500
+ %1823 = OpExtInst %float %1 Log %float_0_180000007
+ %1824 = OpFDiv %float %1823 %1091
+ %1825 = OpFOrdLessThanEqual %bool %1824 %1529
+ OpSelectionMerge %1826 None
+ OpBranchConditional %1825 %1827 %1828
+ %1828 = OpLabel
+ %1829 = OpFOrdGreaterThan %bool %1824 %1529
+ %1830 = OpFOrdLessThan %bool %1824 %1824
+ %1831 = OpLogicalAnd %bool %1829 %1830
+ OpSelectionMerge %1832 None
+ OpBranchConditional %1831 %1833 %1834
+ %1834 = OpLabel
+ %1835 = OpFOrdGreaterThanEqual %bool %1824 %1824
+ %1836 = OpExtInst %float %1 Log %1522
+ %1837 = OpFDiv %float %1836 %1091
+ %1838 = OpFOrdLessThan %bool %1824 %1837
+ %1839 = OpLogicalAnd %bool %1835 %1838
+ OpSelectionMerge %1840 None
+ OpBranchConditional %1839 %1841 %1842
+ %1842 = OpLabel
+ %1843 = OpExtInst %float %1 Log %float_10000
+ %1844 = OpFDiv %float %1843 %1091
+ OpBranch %1840
+ %1841 = OpLabel
+ %1845 = OpFSub %float %1824 %1824
+ %1846 = OpFMul %float %float_3 %1845
+ %1847 = OpFSub %float %1837 %1824
+ %1848 = OpFDiv %float %1846 %1847
+ %1849 = OpConvertFToS %int %1848
+ %1850 = OpConvertSToF %float %1849
+ %1851 = OpFSub %float %1848 %1850
+ %1852 = OpAccessChain %_ptr_Function_float %541 %1849
+ %1853 = OpLoad %float %1852
+ %1854 = OpIAdd %int %1849 %int_1
+ %1855 = OpAccessChain %_ptr_Function_float %541 %1854
+ %1856 = OpLoad %float %1855
+ %1857 = OpIAdd %int %1849 %int_2
+ %1858 = OpAccessChain %_ptr_Function_float %541 %1857
+ %1859 = OpLoad %float %1858
+ %1860 = OpCompositeConstruct %v3float %1853 %1856 %1859
+ %1861 = OpFMul %float %1851 %1851
+ %1862 = OpCompositeConstruct %v3float %1861 %1851 %float_1
+ %1863 = OpMatrixTimesVector %v3float %466 %1860
+ %1864 = OpDot %float %1862 %1863
+ OpBranch %1840
+ %1840 = OpLabel
+ %1865 = OpPhi %float %1844 %1842 %1864 %1841
+ OpBranch %1832
+ %1833 = OpLabel
+ %1866 = OpAccessChain %_ptr_Function_float %542 %int_3
+ %1867 = OpLoad %float %1866
+ %1868 = OpAccessChain %_ptr_Function_float %542 %int_4
+ %1869 = OpLoad %float %1868
+ %1870 = OpAccessChain %_ptr_Function_float %542 %int_5
+ %1871 = OpLoad %float %1870
+ %1872 = OpCompositeConstruct %v3float %1867 %1869 %1871
+ %1873 = OpMatrixTimesVector %v3float %466 %1872
+ %1874 = OpCompositeExtract %float %1873 2
+ OpBranch %1832
+ %1832 = OpLabel
+ %1875 = OpPhi %float %1865 %1840 %1874 %1833
+ OpBranch %1826
+ %1827 = OpLabel
+ %1876 = OpExtInst %float %1 Log %float_9_99999975en05
+ %1877 = OpFDiv %float %1876 %1091
+ OpBranch %1826
+ %1826 = OpLabel
+ %1878 = OpPhi %float %1875 %1832 %1877 %1827
+ %1879 = OpExtInst %float %1 Pow %float_10 %1878
+ %1880 = OpExtInst %float %1 Pow %float_2 %float_11
+ %1881 = OpFMul %float %float_0_179999992 %1880
+ OpStore %544 %499
+ OpStore %543 %500
+ %1882 = OpFOrdLessThanEqual %bool %1881 %float_0
+ %1883 = OpSelect %float %1882 %1524 %1881
+ %1884 = OpExtInst %float %1 Log %1883
+ %1885 = OpFDiv %float %1884 %1091
+ %1886 = OpFOrdLessThanEqual %bool %1885 %1529
+ OpSelectionMerge %1887 None
+ OpBranchConditional %1886 %1888 %1889
+ %1889 = OpLabel
+ %1890 = OpFOrdGreaterThan %bool %1885 %1529
+ %1891 = OpFOrdLessThan %bool %1885 %1824
+ %1892 = OpLogicalAnd %bool %1890 %1891
+ OpSelectionMerge %1893 None
+ OpBranchConditional %1892 %1894 %1895
+ %1895 = OpLabel
+ %1896 = OpFOrdGreaterThanEqual %bool %1885 %1824
+ %1897 = OpExtInst %float %1 Log %1522
+ %1898 = OpFDiv %float %1897 %1091
+ %1899 = OpFOrdLessThan %bool %1885 %1898
+ %1900 = OpLogicalAnd %bool %1896 %1899
+ OpSelectionMerge %1901 None
+ OpBranchConditional %1900 %1902 %1903
+ %1903 = OpLabel
+ %1904 = OpExtInst %float %1 Log %float_10000
+ %1905 = OpFDiv %float %1904 %1091
+ OpBranch %1901
+ %1902 = OpLabel
+ %1906 = OpFSub %float %1885 %1824
+ %1907 = OpFMul %float %float_3 %1906
+ %1908 = OpFSub %float %1898 %1824
+ %1909 = OpFDiv %float %1907 %1908
+ %1910 = OpConvertFToS %int %1909
+ %1911 = OpConvertSToF %float %1910
+ %1912 = OpFSub %float %1909 %1911
+ %1913 = OpAccessChain %_ptr_Function_float %543 %1910
+ %1914 = OpLoad %float %1913
+ %1915 = OpIAdd %int %1910 %int_1
+ %1916 = OpAccessChain %_ptr_Function_float %543 %1915
+ %1917 = OpLoad %float %1916
+ %1918 = OpIAdd %int %1910 %int_2
+ %1919 = OpAccessChain %_ptr_Function_float %543 %1918
+ %1920 = OpLoad %float %1919
+ %1921 = OpCompositeConstruct %v3float %1914 %1917 %1920
+ %1922 = OpFMul %float %1912 %1912
+ %1923 = OpCompositeConstruct %v3float %1922 %1912 %float_1
+ %1924 = OpMatrixTimesVector %v3float %466 %1921
+ %1925 = OpDot %float %1923 %1924
+ OpBranch %1901
+ %1901 = OpLabel
+ %1926 = OpPhi %float %1905 %1903 %1925 %1902
+ OpBranch %1893
+ %1894 = OpLabel
+ %1927 = OpFSub %float %1885 %1529
+ %1928 = OpFMul %float %float_3 %1927
+ %1929 = OpFSub %float %1824 %1529
+ %1930 = OpFDiv %float %1928 %1929
+ %1931 = OpConvertFToS %int %1930
+ %1932 = OpConvertSToF %float %1931
+ %1933 = OpFSub %float %1930 %1932
+ %1934 = OpAccessChain %_ptr_Function_float %544 %1931
+ %1935 = OpLoad %float %1934
+ %1936 = OpIAdd %int %1931 %int_1
+ %1937 = OpAccessChain %_ptr_Function_float %544 %1936
+ %1938 = OpLoad %float %1937
+ %1939 = OpIAdd %int %1931 %int_2
+ %1940 = OpAccessChain %_ptr_Function_float %544 %1939
+ %1941 = OpLoad %float %1940
+ %1942 = OpCompositeConstruct %v3float %1935 %1938 %1941
+ %1943 = OpFMul %float %1933 %1933
+ %1944 = OpCompositeConstruct %v3float %1943 %1933 %float_1
+ %1945 = OpMatrixTimesVector %v3float %466 %1942
+ %1946 = OpDot %float %1944 %1945
+ OpBranch %1893
+ %1893 = OpLabel
+ %1947 = OpPhi %float %1926 %1901 %1946 %1894
+ OpBranch %1887
+ %1888 = OpLabel
+ %1948 = OpExtInst %float %1 Log %float_9_99999975en05
+ %1949 = OpFDiv %float %1948 %1091
+ OpBranch %1887
+ %1887 = OpLabel
+ %1950 = OpPhi %float %1947 %1893 %1949 %1888
+ %1951 = OpExtInst %float %1 Pow %float_10 %1950
+ %1952 = OpCompositeExtract %float %1748 0
+ OpStore %538 %506
+ OpStore %537 %507
+ %1953 = OpFOrdLessThanEqual %bool %1952 %float_0
+ %1954 = OpSelect %float %1953 %float_9_99999975en05 %1952
+ %1955 = OpExtInst %float %1 Log %1954
+ %1956 = OpFDiv %float %1955 %1091
+ %1957 = OpExtInst %float %1 Log %1822
+ %1958 = OpFDiv %float %1957 %1091
+ %1959 = OpFOrdLessThanEqual %bool %1956 %1958
+ OpSelectionMerge %1960 None
+ OpBranchConditional %1959 %1961 %1962
+ %1962 = OpLabel
+ %1963 = OpFOrdGreaterThan %bool %1956 %1958
+ %1964 = OpExtInst %float %1 Log %1879
+ %1965 = OpFDiv %float %1964 %1091
+ %1966 = OpFOrdLessThan %bool %1956 %1965
+ %1967 = OpLogicalAnd %bool %1963 %1966
+ OpSelectionMerge %1968 None
+ OpBranchConditional %1967 %1969 %1970
+ %1970 = OpLabel
+ %1971 = OpFOrdGreaterThanEqual %bool %1956 %1965
+ %1972 = OpExtInst %float %1 Log %1951
+ %1973 = OpFDiv %float %1972 %1091
+ %1974 = OpFOrdLessThan %bool %1956 %1973
+ %1975 = OpLogicalAnd %bool %1971 %1974
+ OpSelectionMerge %1976 None
+ OpBranchConditional %1975 %1977 %1978
+ %1978 = OpLabel
+ %1979 = OpFMul %float %1956 %float_0_119999997
+ %1980 = OpExtInst %float %1 Log %float_2000
+ %1981 = OpFDiv %float %1980 %1091
+ %1982 = OpFMul %float %float_0_119999997 %1972
+ %1983 = OpFDiv %float %1982 %1091
+ %1984 = OpFSub %float %1981 %1983
+ %1985 = OpFAdd %float %1979 %1984
+ OpBranch %1976
+ %1977 = OpLabel
+ %1986 = OpFSub %float %1956 %1965
+ %1987 = OpFMul %float %float_7 %1986
+ %1988 = OpFSub %float %1973 %1965
+ %1989 = OpFDiv %float %1987 %1988
+ %1990 = OpConvertFToS %int %1989
+ %1991 = OpConvertSToF %float %1990
+ %1992 = OpFSub %float %1989 %1991
+ %1993 = OpAccessChain %_ptr_Function_float %537 %1990
+ %1994 = OpLoad %float %1993
+ %1995 = OpIAdd %int %1990 %int_1
+ %1996 = OpAccessChain %_ptr_Function_float %537 %1995
+ %1997 = OpLoad %float %1996
+ %1998 = OpIAdd %int %1990 %int_2
+ %1999 = OpAccessChain %_ptr_Function_float %537 %1998
+ %2000 = OpLoad %float %1999
+ %2001 = OpCompositeConstruct %v3float %1994 %1997 %2000
+ %2002 = OpFMul %float %1992 %1992
+ %2003 = OpCompositeConstruct %v3float %2002 %1992 %float_1
+ %2004 = OpMatrixTimesVector %v3float %466 %2001
+ %2005 = OpDot %float %2003 %2004
+ OpBranch %1976
+ %1976 = OpLabel
+ %2006 = OpPhi %float %1985 %1978 %2005 %1977
+ OpBranch %1968
+ %1969 = OpLabel
+ %2007 = OpFSub %float %1956 %1958
+ %2008 = OpFMul %float %float_7 %2007
+ %2009 = OpFSub %float %1965 %1958
+ %2010 = OpFDiv %float %2008 %2009
+ %2011 = OpConvertFToS %int %2010
+ %2012 = OpConvertSToF %float %2011
+ %2013 = OpFSub %float %2010 %2012
+ %2014 = OpAccessChain %_ptr_Function_float %538 %2011
+ %2015 = OpLoad %float %2014
+ %2016 = OpIAdd %int %2011 %int_1
+ %2017 = OpAccessChain %_ptr_Function_float %538 %2016
+ %2018 = OpLoad %float %2017
+ %2019 = OpIAdd %int %2011 %int_2
+ %2020 = OpAccessChain %_ptr_Function_float %538 %2019
+ %2021 = OpLoad %float %2020
+ %2022 = OpCompositeConstruct %v3float %2015 %2018 %2021
+ %2023 = OpFMul %float %2013 %2013
+ %2024 = OpCompositeConstruct %v3float %2023 %2013 %float_1
+ %2025 = OpMatrixTimesVector %v3float %466 %2022
+ %2026 = OpDot %float %2024 %2025
+ OpBranch %1968
+ %1968 = OpLabel
+ %2027 = OpPhi %float %2006 %1976 %2026 %1969
+ OpBranch %1960
+ %1961 = OpLabel
+ %2028 = OpExtInst %float %1 Log %float_0_00499999989
+ %2029 = OpFDiv %float %2028 %1091
+ OpBranch %1960
+ %1960 = OpLabel
+ %2030 = OpPhi %float %2027 %1968 %2029 %1961
+ %2031 = OpExtInst %float %1 Pow %float_10 %2030
+ %2032 = OpCompositeInsert %v3float %2031 %523 0
+ %2033 = OpCompositeExtract %float %1748 1
+ OpStore %536 %506
+ OpStore %535 %507
+ %2034 = OpFOrdLessThanEqual %bool %2033 %float_0
+ %2035 = OpSelect %float %2034 %float_9_99999975en05 %2033
+ %2036 = OpExtInst %float %1 Log %2035
+ %2037 = OpFDiv %float %2036 %1091
+ %2038 = OpFOrdLessThanEqual %bool %2037 %1958
+ OpSelectionMerge %2039 None
+ OpBranchConditional %2038 %2040 %2041
+ %2041 = OpLabel
+ %2042 = OpFOrdGreaterThan %bool %2037 %1958
+ %2043 = OpExtInst %float %1 Log %1879
+ %2044 = OpFDiv %float %2043 %1091
+ %2045 = OpFOrdLessThan %bool %2037 %2044
+ %2046 = OpLogicalAnd %bool %2042 %2045
+ OpSelectionMerge %2047 None
+ OpBranchConditional %2046 %2048 %2049
+ %2049 = OpLabel
+ %2050 = OpFOrdGreaterThanEqual %bool %2037 %2044
+ %2051 = OpExtInst %float %1 Log %1951
+ %2052 = OpFDiv %float %2051 %1091
+ %2053 = OpFOrdLessThan %bool %2037 %2052
+ %2054 = OpLogicalAnd %bool %2050 %2053
+ OpSelectionMerge %2055 None
+ OpBranchConditional %2054 %2056 %2057
+ %2057 = OpLabel
+ %2058 = OpFMul %float %2037 %float_0_119999997
+ %2059 = OpExtInst %float %1 Log %float_2000
+ %2060 = OpFDiv %float %2059 %1091
+ %2061 = OpFMul %float %float_0_119999997 %2051
+ %2062 = OpFDiv %float %2061 %1091
+ %2063 = OpFSub %float %2060 %2062
+ %2064 = OpFAdd %float %2058 %2063
+ OpBranch %2055
+ %2056 = OpLabel
+ %2065 = OpFSub %float %2037 %2044
+ %2066 = OpFMul %float %float_7 %2065
+ %2067 = OpFSub %float %2052 %2044
+ %2068 = OpFDiv %float %2066 %2067
+ %2069 = OpConvertFToS %int %2068
+ %2070 = OpConvertSToF %float %2069
+ %2071 = OpFSub %float %2068 %2070
+ %2072 = OpAccessChain %_ptr_Function_float %535 %2069
+ %2073 = OpLoad %float %2072
+ %2074 = OpIAdd %int %2069 %int_1
+ %2075 = OpAccessChain %_ptr_Function_float %535 %2074
+ %2076 = OpLoad %float %2075
+ %2077 = OpIAdd %int %2069 %int_2
+ %2078 = OpAccessChain %_ptr_Function_float %535 %2077
+ %2079 = OpLoad %float %2078
+ %2080 = OpCompositeConstruct %v3float %2073 %2076 %2079
+ %2081 = OpFMul %float %2071 %2071
+ %2082 = OpCompositeConstruct %v3float %2081 %2071 %float_1
+ %2083 = OpMatrixTimesVector %v3float %466 %2080
+ %2084 = OpDot %float %2082 %2083
+ OpBranch %2055
+ %2055 = OpLabel
+ %2085 = OpPhi %float %2064 %2057 %2084 %2056
+ OpBranch %2047
+ %2048 = OpLabel
+ %2086 = OpFSub %float %2037 %1958
+ %2087 = OpFMul %float %float_7 %2086
+ %2088 = OpFSub %float %2044 %1958
+ %2089 = OpFDiv %float %2087 %2088
+ %2090 = OpConvertFToS %int %2089
+ %2091 = OpConvertSToF %float %2090
+ %2092 = OpFSub %float %2089 %2091
+ %2093 = OpAccessChain %_ptr_Function_float %536 %2090
+ %2094 = OpLoad %float %2093
+ %2095 = OpIAdd %int %2090 %int_1
+ %2096 = OpAccessChain %_ptr_Function_float %536 %2095
+ %2097 = OpLoad %float %2096
+ %2098 = OpIAdd %int %2090 %int_2
+ %2099 = OpAccessChain %_ptr_Function_float %536 %2098
+ %2100 = OpLoad %float %2099
+ %2101 = OpCompositeConstruct %v3float %2094 %2097 %2100
+ %2102 = OpFMul %float %2092 %2092
+ %2103 = OpCompositeConstruct %v3float %2102 %2092 %float_1
+ %2104 = OpMatrixTimesVector %v3float %466 %2101
+ %2105 = OpDot %float %2103 %2104
+ OpBranch %2047
+ %2047 = OpLabel
+ %2106 = OpPhi %float %2085 %2055 %2105 %2048
+ OpBranch %2039
+ %2040 = OpLabel
+ %2107 = OpExtInst %float %1 Log %float_0_00499999989
+ %2108 = OpFDiv %float %2107 %1091
+ OpBranch %2039
+ %2039 = OpLabel
+ %2109 = OpPhi %float %2106 %2047 %2108 %2040
+ %2110 = OpExtInst %float %1 Pow %float_10 %2109
+ %2111 = OpCompositeInsert %v3float %2110 %2032 1
+ %2112 = OpCompositeExtract %float %1748 2
+ OpStore %534 %506
+ OpStore %533 %507
+ %2113 = OpFOrdLessThanEqual %bool %2112 %float_0
+ %2114 = OpSelect %float %2113 %float_9_99999975en05 %2112
+ %2115 = OpExtInst %float %1 Log %2114
+ %2116 = OpFDiv %float %2115 %1091
+ %2117 = OpFOrdLessThanEqual %bool %2116 %1958
+ OpSelectionMerge %2118 None
+ OpBranchConditional %2117 %2119 %2120
+ %2120 = OpLabel
+ %2121 = OpFOrdGreaterThan %bool %2116 %1958
+ %2122 = OpExtInst %float %1 Log %1879
+ %2123 = OpFDiv %float %2122 %1091
+ %2124 = OpFOrdLessThan %bool %2116 %2123
+ %2125 = OpLogicalAnd %bool %2121 %2124
+ OpSelectionMerge %2126 None
+ OpBranchConditional %2125 %2127 %2128
+ %2128 = OpLabel
+ %2129 = OpFOrdGreaterThanEqual %bool %2116 %2123
+ %2130 = OpExtInst %float %1 Log %1951
+ %2131 = OpFDiv %float %2130 %1091
+ %2132 = OpFOrdLessThan %bool %2116 %2131
+ %2133 = OpLogicalAnd %bool %2129 %2132
+ OpSelectionMerge %2134 None
+ OpBranchConditional %2133 %2135 %2136
+ %2136 = OpLabel
+ %2137 = OpFMul %float %2116 %float_0_119999997
+ %2138 = OpExtInst %float %1 Log %float_2000
+ %2139 = OpFDiv %float %2138 %1091
+ %2140 = OpFMul %float %float_0_119999997 %2130
+ %2141 = OpFDiv %float %2140 %1091
+ %2142 = OpFSub %float %2139 %2141
+ %2143 = OpFAdd %float %2137 %2142
+ OpBranch %2134
+ %2135 = OpLabel
+ %2144 = OpFSub %float %2116 %2123
+ %2145 = OpFMul %float %float_7 %2144
+ %2146 = OpFSub %float %2131 %2123
+ %2147 = OpFDiv %float %2145 %2146
+ %2148 = OpConvertFToS %int %2147
+ %2149 = OpConvertSToF %float %2148
+ %2150 = OpFSub %float %2147 %2149
+ %2151 = OpAccessChain %_ptr_Function_float %533 %2148
+ %2152 = OpLoad %float %2151
+ %2153 = OpIAdd %int %2148 %int_1
+ %2154 = OpAccessChain %_ptr_Function_float %533 %2153
+ %2155 = OpLoad %float %2154
+ %2156 = OpIAdd %int %2148 %int_2
+ %2157 = OpAccessChain %_ptr_Function_float %533 %2156
+ %2158 = OpLoad %float %2157
+ %2159 = OpCompositeConstruct %v3float %2152 %2155 %2158
+ %2160 = OpFMul %float %2150 %2150
+ %2161 = OpCompositeConstruct %v3float %2160 %2150 %float_1
+ %2162 = OpMatrixTimesVector %v3float %466 %2159
+ %2163 = OpDot %float %2161 %2162
+ OpBranch %2134
+ %2134 = OpLabel
+ %2164 = OpPhi %float %2143 %2136 %2163 %2135
+ OpBranch %2126
+ %2127 = OpLabel
+ %2165 = OpFSub %float %2116 %1958
+ %2166 = OpFMul %float %float_7 %2165
+ %2167 = OpFSub %float %2123 %1958
+ %2168 = OpFDiv %float %2166 %2167
+ %2169 = OpConvertFToS %int %2168
+ %2170 = OpConvertSToF %float %2169
+ %2171 = OpFSub %float %2168 %2170
+ %2172 = OpAccessChain %_ptr_Function_float %534 %2169
+ %2173 = OpLoad %float %2172
+ %2174 = OpIAdd %int %2169 %int_1
+ %2175 = OpAccessChain %_ptr_Function_float %534 %2174
+ %2176 = OpLoad %float %2175
+ %2177 = OpIAdd %int %2169 %int_2
+ %2178 = OpAccessChain %_ptr_Function_float %534 %2177
+ %2179 = OpLoad %float %2178
+ %2180 = OpCompositeConstruct %v3float %2173 %2176 %2179
+ %2181 = OpFMul %float %2171 %2171
+ %2182 = OpCompositeConstruct %v3float %2181 %2171 %float_1
+ %2183 = OpMatrixTimesVector %v3float %466 %2180
+ %2184 = OpDot %float %2182 %2183
+ OpBranch %2126
+ %2126 = OpLabel
+ %2185 = OpPhi %float %2164 %2134 %2184 %2127
+ OpBranch %2118
+ %2119 = OpLabel
+ %2186 = OpExtInst %float %1 Log %float_0_00499999989
+ %2187 = OpFDiv %float %2186 %1091
+ OpBranch %2118
+ %2118 = OpLabel
+ %2188 = OpPhi %float %2185 %2126 %2187 %2119
+ %2189 = OpExtInst %float %1 Pow %float_10 %2188
+ %2190 = OpCompositeInsert %v3float %2189 %2111 2
+ %2191 = OpVectorTimesMatrix %v3float %2190 %602
+ %2192 = OpFMul %v3float %2191 %519
+ %2193 = OpExtInst %v3float %1 Pow %2192 %286
+ %2194 = OpFMul %v3float %196 %2193
+ %2195 = OpFAdd %v3float %195 %2194
+ %2196 = OpFMul %v3float %197 %2193
+ %2197 = OpFAdd %v3float %141 %2196
+ %2198 = OpFDiv %v3float %141 %2197
+ %2199 = OpFMul %v3float %2195 %2198
+ %2200 = OpExtInst %v3float %1 Pow %2199 %287
+ OpBranch %1342
+ %1342 = OpLabel
+ %2201 = OpPhi %v3float %1366 %1346 %2200 %2118
+ OpBranch %1336
+ %1337 = OpLabel
+ %2202 = OpMatrixTimesMatrix %mat3v3float %572 %423
+ %2203 = OpFMul %v3float %932 %285
+ %2204 = OpVectorTimesMatrix %v3float %2203 %2202
+ %2205 = OpCompositeExtract %float %2204 0
+ %2206 = OpCompositeExtract %float %2204 1
+ %2207 = OpExtInst %float %1 FMin %2205 %2206
+ %2208 = OpCompositeExtract %float %2204 2
+ %2209 = OpExtInst %float %1 FMin %2207 %2208
+ %2210 = OpExtInst %float %1 FMax %2205 %2206
+ %2211 = OpExtInst %float %1 FMax %2210 %2208
+ %2212 = OpExtInst %float %1 FMax %2211 %float_1_00000001en10
+ %2213 = OpExtInst %float %1 FMax %2209 %float_1_00000001en10
+ %2214 = OpFSub %float %2212 %2213
+ %2215 = OpExtInst %float %1 FMax %2211 %float_0_00999999978
+ %2216 = OpFDiv %float %2214 %2215
+ %2217 = OpFSub %float %2208 %2206
+ %2218 = OpFMul %float %2208 %2217
+ %2219 = OpFSub %float %2206 %2205
+ %2220 = OpFMul %float %2206 %2219
+ %2221 = OpFAdd %float %2218 %2220
+ %2222 = OpFSub %float %2205 %2208
+ %2223 = OpFMul %float %2205 %2222
+ %2224 = OpFAdd %float %2221 %2223
+ %2225 = OpExtInst %float %1 Sqrt %2224
+ %2226 = OpFAdd %float %2208 %2206
+ %2227 = OpFAdd %float %2226 %2205
+ %2228 = OpFMul %float %float_1_75 %2225
+ %2229 = OpFAdd %float %2227 %2228
+ %2230 = OpFMul %float %2229 %float_0_333333343
+ %2231 = OpFSub %float %2216 %float_0_400000006
+ %2232 = OpFMul %float %2231 %float_5
+ %2233 = OpFMul %float %2231 %float_2_5
+ %2234 = OpExtInst %float %1 FAbs %2233
+ %2235 = OpFSub %float %float_1 %2234
+ %2236 = OpExtInst %float %1 FMax %2235 %float_0
+ %2237 = OpExtInst %float %1 FSign %2232
+ %2238 = OpConvertFToS %int %2237
+ %2239 = OpConvertSToF %float %2238
+ %2240 = OpFMul %float %2236 %2236
+ %2241 = OpFSub %float %float_1 %2240
+ %2242 = OpFMul %float %2239 %2241
+ %2243 = OpFAdd %float %float_1 %2242
+ %2244 = OpFMul %float %2243 %float_0_0250000004
+ %2245 = OpFOrdLessThanEqual %bool %2230 %float_0_0533333346
+ OpSelectionMerge %2246 None
+ OpBranchConditional %2245 %2247 %2248
+ %2248 = OpLabel
+ %2249 = OpFOrdGreaterThanEqual %bool %2230 %float_0_159999996
+ OpSelectionMerge %2250 None
+ OpBranchConditional %2249 %2251 %2252
+ %2252 = OpLabel
+ %2253 = OpFDiv %float %float_0_239999995 %2229
+ %2254 = OpFSub %float %2253 %float_0_5
+ %2255 = OpFMul %float %2244 %2254
+ OpBranch %2250
+ %2251 = OpLabel
+ OpBranch %2250
+ %2250 = OpLabel
+ %2256 = OpPhi %float %2255 %2252 %float_0 %2251
+ OpBranch %2246
+ %2247 = OpLabel
+ OpBranch %2246
+ %2246 = OpLabel
+ %2257 = OpPhi %float %2256 %2250 %2244 %2247
+ %2258 = OpFAdd %float %float_1 %2257
+ %2259 = OpCompositeConstruct %v3float %2258 %2258 %2258
+ %2260 = OpFMul %v3float %2204 %2259
+ %2261 = OpCompositeExtract %float %2260 0
+ %2262 = OpCompositeExtract %float %2260 1
+ %2263 = OpFOrdEqual %bool %2261 %2262
+ %2264 = OpCompositeExtract %float %2260 2
+ %2265 = OpFOrdEqual %bool %2262 %2264
+ %2266 = OpLogicalAnd %bool %2263 %2265
+ OpSelectionMerge %2267 None
+ OpBranchConditional %2266 %2268 %2269
+ %2269 = OpLabel
+ %2270 = OpExtInst %float %1 Sqrt %float_3
+ %2271 = OpFSub %float %2262 %2264
+ %2272 = OpFMul %float %2270 %2271
+ %2273 = OpFMul %float %float_2 %2261
+ %2274 = OpFSub %float %2273 %2262
+ %2275 = OpFSub %float %2274 %2264
+ %2276 = OpExtInst %float %1 Atan2 %2272 %2275
+ %2277 = OpFMul %float %float_57_2957764 %2276
+ OpBranch %2267
+ %2268 = OpLabel
+ OpBranch %2267
+ %2267 = OpLabel
+ %2278 = OpPhi %float %2277 %2269 %float_0 %2268
+ %2279 = OpFOrdLessThan %bool %2278 %float_0
+ OpSelectionMerge %2280 None
+ OpBranchConditional %2279 %2281 %2280
+ %2281 = OpLabel
+ %2282 = OpFAdd %float %2278 %float_360
+ OpBranch %2280
+ %2280 = OpLabel
+ %2283 = OpPhi %float %2278 %2267 %2282 %2281
+ %2284 = OpExtInst %float %1 FClamp %2283 %float_0 %float_360
+ %2285 = OpFOrdGreaterThan %bool %2284 %float_180
+ OpSelectionMerge %2286 None
+ OpBranchConditional %2285 %2287 %2286
+ %2287 = OpLabel
+ %2288 = OpFSub %float %2284 %float_360
+ OpBranch %2286
+ %2286 = OpLabel
+ %2289 = OpPhi %float %2284 %2280 %2288 %2287
+ %2290 = OpFOrdGreaterThan %bool %2289 %float_n67_5
+ %2291 = OpFOrdLessThan %bool %2289 %float_67_5
+ %2292 = OpLogicalAnd %bool %2290 %2291
+ OpSelectionMerge %2293 None
+ OpBranchConditional %2292 %2294 %2293
+ %2294 = OpLabel
+ %2295 = OpFSub %float %2289 %float_n67_5
+ %2296 = OpFMul %float %2295 %float_0_0296296291
+ %2297 = OpConvertFToS %int %2296
+ %2298 = OpConvertSToF %float %2297
+ %2299 = OpFSub %float %2296 %2298
+ %2300 = OpFMul %float %2299 %2299
+ %2301 = OpFMul %float %2300 %2299
+ %2302 = OpIEqual %bool %2297 %int_3
+ OpSelectionMerge %2303 None
+ OpBranchConditional %2302 %2304 %2305
+ %2305 = OpLabel
+ %2306 = OpIEqual %bool %2297 %int_2
+ OpSelectionMerge %2307 None
+ OpBranchConditional %2306 %2308 %2309
+ %2309 = OpLabel
+ %2310 = OpIEqual %bool %2297 %int_1
+ OpSelectionMerge %2311 None
+ OpBranchConditional %2310 %2312 %2313
+ %2313 = OpLabel
+ %2314 = OpIEqual %bool %2297 %int_0
+ OpSelectionMerge %2315 None
+ OpBranchConditional %2314 %2316 %2317
+ %2317 = OpLabel
+ OpBranch %2315
+ %2316 = OpLabel
+ %2318 = OpFMul %float %2301 %float_0_166666672
+ OpBranch %2315
+ %2315 = OpLabel
+ %2319 = OpPhi %float %float_0 %2317 %2318 %2316
+ OpBranch %2311
+ %2312 = OpLabel
+ %2320 = OpFMul %float %2301 %float_n0_5
+ %2321 = OpFMul %float %2300 %float_0_5
+ %2322 = OpFAdd %float %2320 %2321
+ %2323 = OpFMul %float %2299 %float_0_5
+ %2324 = OpFAdd %float %2322 %2323
+ %2325 = OpFAdd %float %2324 %float_0_166666672
+ OpBranch %2311
+ %2311 = OpLabel
+ %2326 = OpPhi %float %2319 %2315 %2325 %2312
+ OpBranch %2307
+ %2308 = OpLabel
+ %2327 = OpFMul %float %2301 %float_0_5
+ %2328 = OpFMul %float %2300 %float_n1
+ %2329 = OpFAdd %float %2327 %2328
+ %2330 = OpFAdd %float %2329 %float_0_666666687
+ OpBranch %2307
+ %2307 = OpLabel
+ %2331 = OpPhi %float %2326 %2311 %2330 %2308
+ OpBranch %2303
+ %2304 = OpLabel
+ %2332 = OpFMul %float %2301 %float_n0_166666672
+ %2333 = OpFMul %float %2300 %float_0_5
+ %2334 = OpFAdd %float %2332 %2333
+ %2335 = OpFMul %float %2299 %float_n0_5
+ %2336 = OpFAdd %float %2334 %2335
+ %2337 = OpFAdd %float %2336 %float_0_166666672
+ OpBranch %2303
+ %2303 = OpLabel
+ %2338 = OpPhi %float %2331 %2307 %2337 %2304
+ OpBranch %2293
+ %2293 = OpLabel
+ %2339 = OpPhi %float %float_0 %2286 %2338 %2303
+ %2340 = OpFMul %float %2339 %float_1_5
+ %2341 = OpFMul %float %2340 %2216
+ %2342 = OpFSub %float %float_0_0299999993 %2261
+ %2343 = OpFMul %float %2341 %2342
+ %2344 = OpFMul %float %2343 %float_0_180000007
+ %2345 = OpFAdd %float %2261 %2344
+ %2346 = OpCompositeInsert %v3float %2345 %2260 0
+ %2347 = OpExtInst %v3float %1 FClamp %2346 %138 %337
+ %2348 = OpVectorTimesMatrix %v3float %2347 %434
+ %2349 = OpExtInst %v3float %1 FClamp %2348 %138 %337
+ %2350 = OpDot %float %2349 %73
+ %2351 = OpCompositeConstruct %v3float %2350 %2350 %2350
+ %2352 = OpExtInst %v3float %1 FMix %2351 %2349 %241
+ %2353 = OpCompositeExtract %float %2352 0
+ %2354 = OpExtInst %float %1 Exp2 %float_n15
+ %2355 = OpFMul %float %float_0_179999992 %2354
+ %2356 = OpExtInst %float %1 Exp2 %float_18
+ %2357 = OpFMul %float %float_0_179999992 %2356
+ OpStore %546 %499
+ OpStore %545 %500
+ %2358 = OpFOrdLessThanEqual %bool %2353 %float_0
+ %2359 = OpExtInst %float %1 Exp2 %float_n14
+ %2360 = OpSelect %float %2358 %2359 %2353
+ %2361 = OpExtInst %float %1 Log %2360
+ %2362 = OpFDiv %float %2361 %1091
+ %2363 = OpExtInst %float %1 Log %2355
+ %2364 = OpFDiv %float %2363 %1091
+ %2365 = OpFOrdLessThanEqual %bool %2362 %2364
+ OpSelectionMerge %2366 None
+ OpBranchConditional %2365 %2367 %2368
+ %2368 = OpLabel
+ %2369 = OpFOrdGreaterThan %bool %2362 %2364
+ %2370 = OpExtInst %float %1 Log %float_0_180000007
+ %2371 = OpFDiv %float %2370 %1091
+ %2372 = OpFOrdLessThan %bool %2362 %2371
+ %2373 = OpLogicalAnd %bool %2369 %2372
+ OpSelectionMerge %2374 None
+ OpBranchConditional %2373 %2375 %2376
+ %2376 = OpLabel
+ %2377 = OpFOrdGreaterThanEqual %bool %2362 %2371
+ %2378 = OpExtInst %float %1 Log %2357
+ %2379 = OpFDiv %float %2378 %1091
+ %2380 = OpFOrdLessThan %bool %2362 %2379
+ %2381 = OpLogicalAnd %bool %2377 %2380
+ OpSelectionMerge %2382 None
+ OpBranchConditional %2381 %2383 %2384
+ %2384 = OpLabel
+ %2385 = OpExtInst %float %1 Log %float_10000
+ %2386 = OpFDiv %float %2385 %1091
+ OpBranch %2382
+ %2383 = OpLabel
+ %2387 = OpFSub %float %2362 %2371
+ %2388 = OpFMul %float %float_3 %2387
+ %2389 = OpFSub %float %2379 %2371
+ %2390 = OpFDiv %float %2388 %2389
+ %2391 = OpConvertFToS %int %2390
+ %2392 = OpConvertSToF %float %2391
+ %2393 = OpFSub %float %2390 %2392
+ %2394 = OpAccessChain %_ptr_Function_float %545 %2391
+ %2395 = OpLoad %float %2394
+ %2396 = OpIAdd %int %2391 %int_1
+ %2397 = OpAccessChain %_ptr_Function_float %545 %2396
+ %2398 = OpLoad %float %2397
+ %2399 = OpIAdd %int %2391 %int_2
+ %2400 = OpAccessChain %_ptr_Function_float %545 %2399
+ %2401 = OpLoad %float %2400
+ %2402 = OpCompositeConstruct %v3float %2395 %2398 %2401
+ %2403 = OpFMul %float %2393 %2393
+ %2404 = OpCompositeConstruct %v3float %2403 %2393 %float_1
+ %2405 = OpMatrixTimesVector %v3float %466 %2402
+ %2406 = OpDot %float %2404 %2405
+ OpBranch %2382
+ %2382 = OpLabel
+ %2407 = OpPhi %float %2386 %2384 %2406 %2383
+ OpBranch %2374
+ %2375 = OpLabel
+ %2408 = OpFSub %float %2362 %2364
+ %2409 = OpFMul %float %float_3 %2408
+ %2410 = OpFSub %float %2371 %2364
+ %2411 = OpFDiv %float %2409 %2410
+ %2412 = OpConvertFToS %int %2411
+ %2413 = OpConvertSToF %float %2412
+ %2414 = OpFSub %float %2411 %2413
+ %2415 = OpAccessChain %_ptr_Function_float %546 %2412
+ %2416 = OpLoad %float %2415
+ %2417 = OpIAdd %int %2412 %int_1
+ %2418 = OpAccessChain %_ptr_Function_float %546 %2417
+ %2419 = OpLoad %float %2418
+ %2420 = OpIAdd %int %2412 %int_2
+ %2421 = OpAccessChain %_ptr_Function_float %546 %2420
+ %2422 = OpLoad %float %2421
+ %2423 = OpCompositeConstruct %v3float %2416 %2419 %2422
+ %2424 = OpFMul %float %2414 %2414
+ %2425 = OpCompositeConstruct %v3float %2424 %2414 %float_1
+ %2426 = OpMatrixTimesVector %v3float %466 %2423
+ %2427 = OpDot %float %2425 %2426
+ OpBranch %2374
+ %2374 = OpLabel
+ %2428 = OpPhi %float %2407 %2382 %2427 %2375
+ OpBranch %2366
+ %2367 = OpLabel
+ %2429 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2430 = OpFDiv %float %2429 %1091
+ OpBranch %2366
+ %2366 = OpLabel
+ %2431 = OpPhi %float %2428 %2374 %2430 %2367
+ %2432 = OpExtInst %float %1 Pow %float_10 %2431
+ %2433 = OpCompositeInsert %v3float %2432 %523 0
+ %2434 = OpCompositeExtract %float %2352 1
+ OpStore %548 %499
+ OpStore %547 %500
+ %2435 = OpFOrdLessThanEqual %bool %2434 %float_0
+ %2436 = OpSelect %float %2435 %2359 %2434
+ %2437 = OpExtInst %float %1 Log %2436
+ %2438 = OpFDiv %float %2437 %1091
+ %2439 = OpFOrdLessThanEqual %bool %2438 %2364
+ OpSelectionMerge %2440 None
+ OpBranchConditional %2439 %2441 %2442
+ %2442 = OpLabel
+ %2443 = OpFOrdGreaterThan %bool %2438 %2364
+ %2444 = OpExtInst %float %1 Log %float_0_180000007
+ %2445 = OpFDiv %float %2444 %1091
+ %2446 = OpFOrdLessThan %bool %2438 %2445
+ %2447 = OpLogicalAnd %bool %2443 %2446
+ OpSelectionMerge %2448 None
+ OpBranchConditional %2447 %2449 %2450
+ %2450 = OpLabel
+ %2451 = OpFOrdGreaterThanEqual %bool %2438 %2445
+ %2452 = OpExtInst %float %1 Log %2357
+ %2453 = OpFDiv %float %2452 %1091
+ %2454 = OpFOrdLessThan %bool %2438 %2453
+ %2455 = OpLogicalAnd %bool %2451 %2454
+ OpSelectionMerge %2456 None
+ OpBranchConditional %2455 %2457 %2458
+ %2458 = OpLabel
+ %2459 = OpExtInst %float %1 Log %float_10000
+ %2460 = OpFDiv %float %2459 %1091
+ OpBranch %2456
+ %2457 = OpLabel
+ %2461 = OpFSub %float %2438 %2445
+ %2462 = OpFMul %float %float_3 %2461
+ %2463 = OpFSub %float %2453 %2445
+ %2464 = OpFDiv %float %2462 %2463
+ %2465 = OpConvertFToS %int %2464
+ %2466 = OpConvertSToF %float %2465
+ %2467 = OpFSub %float %2464 %2466
+ %2468 = OpAccessChain %_ptr_Function_float %547 %2465
+ %2469 = OpLoad %float %2468
+ %2470 = OpIAdd %int %2465 %int_1
+ %2471 = OpAccessChain %_ptr_Function_float %547 %2470
+ %2472 = OpLoad %float %2471
+ %2473 = OpIAdd %int %2465 %int_2
+ %2474 = OpAccessChain %_ptr_Function_float %547 %2473
+ %2475 = OpLoad %float %2474
+ %2476 = OpCompositeConstruct %v3float %2469 %2472 %2475
+ %2477 = OpFMul %float %2467 %2467
+ %2478 = OpCompositeConstruct %v3float %2477 %2467 %float_1
+ %2479 = OpMatrixTimesVector %v3float %466 %2476
+ %2480 = OpDot %float %2478 %2479
+ OpBranch %2456
+ %2456 = OpLabel
+ %2481 = OpPhi %float %2460 %2458 %2480 %2457
+ OpBranch %2448
+ %2449 = OpLabel
+ %2482 = OpFSub %float %2438 %2364
+ %2483 = OpFMul %float %float_3 %2482
+ %2484 = OpFSub %float %2445 %2364
+ %2485 = OpFDiv %float %2483 %2484
+ %2486 = OpConvertFToS %int %2485
+ %2487 = OpConvertSToF %float %2486
+ %2488 = OpFSub %float %2485 %2487
+ %2489 = OpAccessChain %_ptr_Function_float %548 %2486
+ %2490 = OpLoad %float %2489
+ %2491 = OpIAdd %int %2486 %int_1
+ %2492 = OpAccessChain %_ptr_Function_float %548 %2491
+ %2493 = OpLoad %float %2492
+ %2494 = OpIAdd %int %2486 %int_2
+ %2495 = OpAccessChain %_ptr_Function_float %548 %2494
+ %2496 = OpLoad %float %2495
+ %2497 = OpCompositeConstruct %v3float %2490 %2493 %2496
+ %2498 = OpFMul %float %2488 %2488
+ %2499 = OpCompositeConstruct %v3float %2498 %2488 %float_1
+ %2500 = OpMatrixTimesVector %v3float %466 %2497
+ %2501 = OpDot %float %2499 %2500
+ OpBranch %2448
+ %2448 = OpLabel
+ %2502 = OpPhi %float %2481 %2456 %2501 %2449
+ OpBranch %2440
+ %2441 = OpLabel
+ %2503 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2504 = OpFDiv %float %2503 %1091
+ OpBranch %2440
+ %2440 = OpLabel
+ %2505 = OpPhi %float %2502 %2448 %2504 %2441
+ %2506 = OpExtInst %float %1 Pow %float_10 %2505
+ %2507 = OpCompositeInsert %v3float %2506 %2433 1
+ %2508 = OpCompositeExtract %float %2352 2
+ OpStore %550 %499
+ OpStore %549 %500
+ %2509 = OpFOrdLessThanEqual %bool %2508 %float_0
+ %2510 = OpSelect %float %2509 %2359 %2508
+ %2511 = OpExtInst %float %1 Log %2510
+ %2512 = OpFDiv %float %2511 %1091
+ %2513 = OpFOrdLessThanEqual %bool %2512 %2364
+ OpSelectionMerge %2514 None
+ OpBranchConditional %2513 %2515 %2516
+ %2516 = OpLabel
+ %2517 = OpFOrdGreaterThan %bool %2512 %2364
+ %2518 = OpExtInst %float %1 Log %float_0_180000007
+ %2519 = OpFDiv %float %2518 %1091
+ %2520 = OpFOrdLessThan %bool %2512 %2519
+ %2521 = OpLogicalAnd %bool %2517 %2520
+ OpSelectionMerge %2522 None
+ OpBranchConditional %2521 %2523 %2524
+ %2524 = OpLabel
+ %2525 = OpFOrdGreaterThanEqual %bool %2512 %2519
+ %2526 = OpExtInst %float %1 Log %2357
+ %2527 = OpFDiv %float %2526 %1091
+ %2528 = OpFOrdLessThan %bool %2512 %2527
+ %2529 = OpLogicalAnd %bool %2525 %2528
+ OpSelectionMerge %2530 None
+ OpBranchConditional %2529 %2531 %2532
+ %2532 = OpLabel
+ %2533 = OpExtInst %float %1 Log %float_10000
+ %2534 = OpFDiv %float %2533 %1091
+ OpBranch %2530
+ %2531 = OpLabel
+ %2535 = OpFSub %float %2512 %2519
+ %2536 = OpFMul %float %float_3 %2535
+ %2537 = OpFSub %float %2527 %2519
+ %2538 = OpFDiv %float %2536 %2537
+ %2539 = OpConvertFToS %int %2538
+ %2540 = OpConvertSToF %float %2539
+ %2541 = OpFSub %float %2538 %2540
+ %2542 = OpAccessChain %_ptr_Function_float %549 %2539
+ %2543 = OpLoad %float %2542
+ %2544 = OpIAdd %int %2539 %int_1
+ %2545 = OpAccessChain %_ptr_Function_float %549 %2544
+ %2546 = OpLoad %float %2545
+ %2547 = OpIAdd %int %2539 %int_2
+ %2548 = OpAccessChain %_ptr_Function_float %549 %2547
+ %2549 = OpLoad %float %2548
+ %2550 = OpCompositeConstruct %v3float %2543 %2546 %2549
+ %2551 = OpFMul %float %2541 %2541
+ %2552 = OpCompositeConstruct %v3float %2551 %2541 %float_1
+ %2553 = OpMatrixTimesVector %v3float %466 %2550
+ %2554 = OpDot %float %2552 %2553
+ OpBranch %2530
+ %2530 = OpLabel
+ %2555 = OpPhi %float %2534 %2532 %2554 %2531
+ OpBranch %2522
+ %2523 = OpLabel
+ %2556 = OpFSub %float %2512 %2364
+ %2557 = OpFMul %float %float_3 %2556
+ %2558 = OpFSub %float %2519 %2364
+ %2559 = OpFDiv %float %2557 %2558
+ %2560 = OpConvertFToS %int %2559
+ %2561 = OpConvertSToF %float %2560
+ %2562 = OpFSub %float %2559 %2561
+ %2563 = OpAccessChain %_ptr_Function_float %550 %2560
+ %2564 = OpLoad %float %2563
+ %2565 = OpIAdd %int %2560 %int_1
+ %2566 = OpAccessChain %_ptr_Function_float %550 %2565
+ %2567 = OpLoad %float %2566
+ %2568 = OpIAdd %int %2560 %int_2
+ %2569 = OpAccessChain %_ptr_Function_float %550 %2568
+ %2570 = OpLoad %float %2569
+ %2571 = OpCompositeConstruct %v3float %2564 %2567 %2570
+ %2572 = OpFMul %float %2562 %2562
+ %2573 = OpCompositeConstruct %v3float %2572 %2562 %float_1
+ %2574 = OpMatrixTimesVector %v3float %466 %2571
+ %2575 = OpDot %float %2573 %2574
+ OpBranch %2522
+ %2522 = OpLabel
+ %2576 = OpPhi %float %2555 %2530 %2575 %2523
+ OpBranch %2514
+ %2515 = OpLabel
+ %2577 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2578 = OpFDiv %float %2577 %1091
+ OpBranch %2514
+ %2514 = OpLabel
+ %2579 = OpPhi %float %2576 %2522 %2578 %2515
+ %2580 = OpExtInst %float %1 Pow %float_10 %2579
+ %2581 = OpCompositeInsert %v3float %2580 %2507 2
+ %2582 = OpVectorTimesMatrix %v3float %2581 %438
+ %2583 = OpVectorTimesMatrix %v3float %2582 %434
+ %2584 = OpExtInst %float %1 Pow %float_2 %float_n12
+ %2585 = OpFMul %float %float_0_179999992 %2584
+ OpStore %558 %499
+ OpStore %557 %500
+ %2586 = OpFOrdLessThanEqual %bool %2585 %float_0
+ %2587 = OpSelect %float %2586 %2359 %2585
+ %2588 = OpExtInst %float %1 Log %2587
+ %2589 = OpFDiv %float %2588 %1091
+ %2590 = OpFOrdLessThanEqual %bool %2589 %2364
+ OpSelectionMerge %2591 None
+ OpBranchConditional %2590 %2592 %2593
+ %2593 = OpLabel
+ %2594 = OpFOrdGreaterThan %bool %2589 %2364
+ %2595 = OpExtInst %float %1 Log %float_0_180000007
+ %2596 = OpFDiv %float %2595 %1091
+ %2597 = OpFOrdLessThan %bool %2589 %2596
+ %2598 = OpLogicalAnd %bool %2594 %2597
+ OpSelectionMerge %2599 None
+ OpBranchConditional %2598 %2600 %2601
+ %2601 = OpLabel
+ %2602 = OpFOrdGreaterThanEqual %bool %2589 %2596
+ %2603 = OpExtInst %float %1 Log %2357
+ %2604 = OpFDiv %float %2603 %1091
+ %2605 = OpFOrdLessThan %bool %2589 %2604
+ %2606 = OpLogicalAnd %bool %2602 %2605
+ OpSelectionMerge %2607 None
+ OpBranchConditional %2606 %2608 %2609
+ %2609 = OpLabel
+ %2610 = OpExtInst %float %1 Log %float_10000
+ %2611 = OpFDiv %float %2610 %1091
+ OpBranch %2607
+ %2608 = OpLabel
+ %2612 = OpFSub %float %2589 %2596
+ %2613 = OpFMul %float %float_3 %2612
+ %2614 = OpFSub %float %2604 %2596
+ %2615 = OpFDiv %float %2613 %2614
+ %2616 = OpConvertFToS %int %2615
+ %2617 = OpConvertSToF %float %2616
+ %2618 = OpFSub %float %2615 %2617
+ %2619 = OpAccessChain %_ptr_Function_float %557 %2616
+ %2620 = OpLoad %float %2619
+ %2621 = OpIAdd %int %2616 %int_1
+ %2622 = OpAccessChain %_ptr_Function_float %557 %2621
+ %2623 = OpLoad %float %2622
+ %2624 = OpIAdd %int %2616 %int_2
+ %2625 = OpAccessChain %_ptr_Function_float %557 %2624
+ %2626 = OpLoad %float %2625
+ %2627 = OpCompositeConstruct %v3float %2620 %2623 %2626
+ %2628 = OpFMul %float %2618 %2618
+ %2629 = OpCompositeConstruct %v3float %2628 %2618 %float_1
+ %2630 = OpMatrixTimesVector %v3float %466 %2627
+ %2631 = OpDot %float %2629 %2630
+ OpBranch %2607
+ %2607 = OpLabel
+ %2632 = OpPhi %float %2611 %2609 %2631 %2608
+ OpBranch %2599
+ %2600 = OpLabel
+ %2633 = OpFSub %float %2589 %2364
+ %2634 = OpFMul %float %float_3 %2633
+ %2635 = OpFSub %float %2596 %2364
+ %2636 = OpFDiv %float %2634 %2635
+ %2637 = OpConvertFToS %int %2636
+ %2638 = OpConvertSToF %float %2637
+ %2639 = OpFSub %float %2636 %2638
+ %2640 = OpAccessChain %_ptr_Function_float %558 %2637
+ %2641 = OpLoad %float %2640
+ %2642 = OpIAdd %int %2637 %int_1
+ %2643 = OpAccessChain %_ptr_Function_float %558 %2642
+ %2644 = OpLoad %float %2643
+ %2645 = OpIAdd %int %2637 %int_2
+ %2646 = OpAccessChain %_ptr_Function_float %558 %2645
+ %2647 = OpLoad %float %2646
+ %2648 = OpCompositeConstruct %v3float %2641 %2644 %2647
+ %2649 = OpFMul %float %2639 %2639
+ %2650 = OpCompositeConstruct %v3float %2649 %2639 %float_1
+ %2651 = OpMatrixTimesVector %v3float %466 %2648
+ %2652 = OpDot %float %2650 %2651
+ OpBranch %2599
+ %2599 = OpLabel
+ %2653 = OpPhi %float %2632 %2607 %2652 %2600
+ OpBranch %2591
+ %2592 = OpLabel
+ %2654 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2655 = OpFDiv %float %2654 %1091
+ OpBranch %2591
+ %2591 = OpLabel
+ %2656 = OpPhi %float %2653 %2599 %2655 %2592
+ %2657 = OpExtInst %float %1 Pow %float_10 %2656
+ OpStore %560 %499
+ OpStore %559 %500
+ %2658 = OpExtInst %float %1 Log %float_0_180000007
+ %2659 = OpFDiv %float %2658 %1091
+ %2660 = OpFOrdLessThanEqual %bool %2659 %2364
+ OpSelectionMerge %2661 None
+ OpBranchConditional %2660 %2662 %2663
+ %2663 = OpLabel
+ %2664 = OpFOrdGreaterThan %bool %2659 %2364
+ %2665 = OpFOrdLessThan %bool %2659 %2659
+ %2666 = OpLogicalAnd %bool %2664 %2665
+ OpSelectionMerge %2667 None
+ OpBranchConditional %2666 %2668 %2669
+ %2669 = OpLabel
+ %2670 = OpFOrdGreaterThanEqual %bool %2659 %2659
+ %2671 = OpExtInst %float %1 Log %2357
+ %2672 = OpFDiv %float %2671 %1091
+ %2673 = OpFOrdLessThan %bool %2659 %2672
+ %2674 = OpLogicalAnd %bool %2670 %2673
+ OpSelectionMerge %2675 None
+ OpBranchConditional %2674 %2676 %2677
+ %2677 = OpLabel
+ %2678 = OpExtInst %float %1 Log %float_10000
+ %2679 = OpFDiv %float %2678 %1091
+ OpBranch %2675
+ %2676 = OpLabel
+ %2680 = OpFSub %float %2659 %2659
+ %2681 = OpFMul %float %float_3 %2680
+ %2682 = OpFSub %float %2672 %2659
+ %2683 = OpFDiv %float %2681 %2682
+ %2684 = OpConvertFToS %int %2683
+ %2685 = OpConvertSToF %float %2684
+ %2686 = OpFSub %float %2683 %2685
+ %2687 = OpAccessChain %_ptr_Function_float %559 %2684
+ %2688 = OpLoad %float %2687
+ %2689 = OpIAdd %int %2684 %int_1
+ %2690 = OpAccessChain %_ptr_Function_float %559 %2689
+ %2691 = OpLoad %float %2690
+ %2692 = OpIAdd %int %2684 %int_2
+ %2693 = OpAccessChain %_ptr_Function_float %559 %2692
+ %2694 = OpLoad %float %2693
+ %2695 = OpCompositeConstruct %v3float %2688 %2691 %2694
+ %2696 = OpFMul %float %2686 %2686
+ %2697 = OpCompositeConstruct %v3float %2696 %2686 %float_1
+ %2698 = OpMatrixTimesVector %v3float %466 %2695
+ %2699 = OpDot %float %2697 %2698
+ OpBranch %2675
+ %2675 = OpLabel
+ %2700 = OpPhi %float %2679 %2677 %2699 %2676
+ OpBranch %2667
+ %2668 = OpLabel
+ %2701 = OpAccessChain %_ptr_Function_float %560 %int_3
+ %2702 = OpLoad %float %2701
+ %2703 = OpAccessChain %_ptr_Function_float %560 %int_4
+ %2704 = OpLoad %float %2703
+ %2705 = OpAccessChain %_ptr_Function_float %560 %int_5
+ %2706 = OpLoad %float %2705
+ %2707 = OpCompositeConstruct %v3float %2702 %2704 %2706
+ %2708 = OpMatrixTimesVector %v3float %466 %2707
+ %2709 = OpCompositeExtract %float %2708 2
+ OpBranch %2667
+ %2667 = OpLabel
+ %2710 = OpPhi %float %2700 %2675 %2709 %2668
+ OpBranch %2661
+ %2662 = OpLabel
+ %2711 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2712 = OpFDiv %float %2711 %1091
+ OpBranch %2661
+ %2661 = OpLabel
+ %2713 = OpPhi %float %2710 %2667 %2712 %2662
+ %2714 = OpExtInst %float %1 Pow %float_10 %2713
+ %2715 = OpExtInst %float %1 Pow %float_2 %float_10
+ %2716 = OpFMul %float %float_0_179999992 %2715
+ OpStore %562 %499
+ OpStore %561 %500
+ %2717 = OpFOrdLessThanEqual %bool %2716 %float_0
+ %2718 = OpSelect %float %2717 %2359 %2716
+ %2719 = OpExtInst %float %1 Log %2718
+ %2720 = OpFDiv %float %2719 %1091
+ %2721 = OpFOrdLessThanEqual %bool %2720 %2364
+ OpSelectionMerge %2722 None
+ OpBranchConditional %2721 %2723 %2724
+ %2724 = OpLabel
+ %2725 = OpFOrdGreaterThan %bool %2720 %2364
+ %2726 = OpFOrdLessThan %bool %2720 %2659
+ %2727 = OpLogicalAnd %bool %2725 %2726
+ OpSelectionMerge %2728 None
+ OpBranchConditional %2727 %2729 %2730
+ %2730 = OpLabel
+ %2731 = OpFOrdGreaterThanEqual %bool %2720 %2659
+ %2732 = OpExtInst %float %1 Log %2357
+ %2733 = OpFDiv %float %2732 %1091
+ %2734 = OpFOrdLessThan %bool %2720 %2733
+ %2735 = OpLogicalAnd %bool %2731 %2734
+ OpSelectionMerge %2736 None
+ OpBranchConditional %2735 %2737 %2738
+ %2738 = OpLabel
+ %2739 = OpExtInst %float %1 Log %float_10000
+ %2740 = OpFDiv %float %2739 %1091
+ OpBranch %2736
+ %2737 = OpLabel
+ %2741 = OpFSub %float %2720 %2659
+ %2742 = OpFMul %float %float_3 %2741
+ %2743 = OpFSub %float %2733 %2659
+ %2744 = OpFDiv %float %2742 %2743
+ %2745 = OpConvertFToS %int %2744
+ %2746 = OpConvertSToF %float %2745
+ %2747 = OpFSub %float %2744 %2746
+ %2748 = OpAccessChain %_ptr_Function_float %561 %2745
+ %2749 = OpLoad %float %2748
+ %2750 = OpIAdd %int %2745 %int_1
+ %2751 = OpAccessChain %_ptr_Function_float %561 %2750
+ %2752 = OpLoad %float %2751
+ %2753 = OpIAdd %int %2745 %int_2
+ %2754 = OpAccessChain %_ptr_Function_float %561 %2753
+ %2755 = OpLoad %float %2754
+ %2756 = OpCompositeConstruct %v3float %2749 %2752 %2755
+ %2757 = OpFMul %float %2747 %2747
+ %2758 = OpCompositeConstruct %v3float %2757 %2747 %float_1
+ %2759 = OpMatrixTimesVector %v3float %466 %2756
+ %2760 = OpDot %float %2758 %2759
+ OpBranch %2736
+ %2736 = OpLabel
+ %2761 = OpPhi %float %2740 %2738 %2760 %2737
+ OpBranch %2728
+ %2729 = OpLabel
+ %2762 = OpFSub %float %2720 %2364
+ %2763 = OpFMul %float %float_3 %2762
+ %2764 = OpFSub %float %2659 %2364
+ %2765 = OpFDiv %float %2763 %2764
+ %2766 = OpConvertFToS %int %2765
+ %2767 = OpConvertSToF %float %2766
+ %2768 = OpFSub %float %2765 %2767
+ %2769 = OpAccessChain %_ptr_Function_float %562 %2766
+ %2770 = OpLoad %float %2769
+ %2771 = OpIAdd %int %2766 %int_1
+ %2772 = OpAccessChain %_ptr_Function_float %562 %2771
+ %2773 = OpLoad %float %2772
+ %2774 = OpIAdd %int %2766 %int_2
+ %2775 = OpAccessChain %_ptr_Function_float %562 %2774
+ %2776 = OpLoad %float %2775
+ %2777 = OpCompositeConstruct %v3float %2770 %2773 %2776
+ %2778 = OpFMul %float %2768 %2768
+ %2779 = OpCompositeConstruct %v3float %2778 %2768 %float_1
+ %2780 = OpMatrixTimesVector %v3float %466 %2777
+ %2781 = OpDot %float %2779 %2780
+ OpBranch %2728
+ %2728 = OpLabel
+ %2782 = OpPhi %float %2761 %2736 %2781 %2729
+ OpBranch %2722
+ %2723 = OpLabel
+ %2783 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2784 = OpFDiv %float %2783 %1091
+ OpBranch %2722
+ %2722 = OpLabel
+ %2785 = OpPhi %float %2782 %2728 %2784 %2723
+ %2786 = OpExtInst %float %1 Pow %float_10 %2785
+ %2787 = OpCompositeExtract %float %2583 0
+ OpStore %556 %503
+ OpStore %555 %504
+ %2788 = OpFOrdLessThanEqual %bool %2787 %float_0
+ %2789 = OpSelect %float %2788 %float_9_99999975en05 %2787
+ %2790 = OpExtInst %float %1 Log %2789
+ %2791 = OpFDiv %float %2790 %1091
+ %2792 = OpExtInst %float %1 Log %2657
+ %2793 = OpFDiv %float %2792 %1091
+ %2794 = OpFOrdLessThanEqual %bool %2791 %2793
+ OpSelectionMerge %2795 None
+ OpBranchConditional %2794 %2796 %2797
+ %2797 = OpLabel
+ %2798 = OpFOrdGreaterThan %bool %2791 %2793
+ %2799 = OpExtInst %float %1 Log %2714
+ %2800 = OpFDiv %float %2799 %1091
+ %2801 = OpFOrdLessThan %bool %2791 %2800
+ %2802 = OpLogicalAnd %bool %2798 %2801
+ OpSelectionMerge %2803 None
+ OpBranchConditional %2802 %2804 %2805
+ %2805 = OpLabel
+ %2806 = OpFOrdGreaterThanEqual %bool %2791 %2800
+ %2807 = OpExtInst %float %1 Log %2786
+ %2808 = OpFDiv %float %2807 %1091
+ %2809 = OpFOrdLessThan %bool %2791 %2808
+ %2810 = OpLogicalAnd %bool %2806 %2809
+ OpSelectionMerge %2811 None
+ OpBranchConditional %2810 %2812 %2813
+ %2813 = OpLabel
+ %2814 = OpFMul %float %2791 %float_0_0599999987
+ %2815 = OpExtInst %float %1 Log %float_1000
+ %2816 = OpFDiv %float %2815 %1091
+ %2817 = OpFMul %float %float_0_0599999987 %2807
+ %2818 = OpFDiv %float %2817 %1091
+ %2819 = OpFSub %float %2816 %2818
+ %2820 = OpFAdd %float %2814 %2819
+ OpBranch %2811
+ %2812 = OpLabel
+ %2821 = OpFSub %float %2791 %2800
+ %2822 = OpFMul %float %float_7 %2821
+ %2823 = OpFSub %float %2808 %2800
+ %2824 = OpFDiv %float %2822 %2823
+ %2825 = OpConvertFToS %int %2824
+ %2826 = OpConvertSToF %float %2825
+ %2827 = OpFSub %float %2824 %2826
+ %2828 = OpAccessChain %_ptr_Function_float %555 %2825
+ %2829 = OpLoad %float %2828
+ %2830 = OpIAdd %int %2825 %int_1
+ %2831 = OpAccessChain %_ptr_Function_float %555 %2830
+ %2832 = OpLoad %float %2831
+ %2833 = OpIAdd %int %2825 %int_2
+ %2834 = OpAccessChain %_ptr_Function_float %555 %2833
+ %2835 = OpLoad %float %2834
+ %2836 = OpCompositeConstruct %v3float %2829 %2832 %2835
+ %2837 = OpFMul %float %2827 %2827
+ %2838 = OpCompositeConstruct %v3float %2837 %2827 %float_1
+ %2839 = OpMatrixTimesVector %v3float %466 %2836
+ %2840 = OpDot %float %2838 %2839
+ OpBranch %2811
+ %2811 = OpLabel
+ %2841 = OpPhi %float %2820 %2813 %2840 %2812
+ OpBranch %2803
+ %2804 = OpLabel
+ %2842 = OpFSub %float %2791 %2793
+ %2843 = OpFMul %float %float_7 %2842
+ %2844 = OpFSub %float %2800 %2793
+ %2845 = OpFDiv %float %2843 %2844
+ %2846 = OpConvertFToS %int %2845
+ %2847 = OpConvertSToF %float %2846
+ %2848 = OpFSub %float %2845 %2847
+ %2849 = OpAccessChain %_ptr_Function_float %556 %2846
+ %2850 = OpLoad %float %2849
+ %2851 = OpIAdd %int %2846 %int_1
+ %2852 = OpAccessChain %_ptr_Function_float %556 %2851
+ %2853 = OpLoad %float %2852
+ %2854 = OpIAdd %int %2846 %int_2
+ %2855 = OpAccessChain %_ptr_Function_float %556 %2854
+ %2856 = OpLoad %float %2855
+ %2857 = OpCompositeConstruct %v3float %2850 %2853 %2856
+ %2858 = OpFMul %float %2848 %2848
+ %2859 = OpCompositeConstruct %v3float %2858 %2848 %float_1
+ %2860 = OpMatrixTimesVector %v3float %466 %2857
+ %2861 = OpDot %float %2859 %2860
+ OpBranch %2803
+ %2803 = OpLabel
+ %2862 = OpPhi %float %2841 %2811 %2861 %2804
+ OpBranch %2795
+ %2796 = OpLabel
+ %2863 = OpFMul %float %2791 %float_3
+ %2864 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2865 = OpFDiv %float %2864 %1091
+ %2866 = OpFMul %float %float_3 %2792
+ %2867 = OpFDiv %float %2866 %1091
+ %2868 = OpFSub %float %2865 %2867
+ %2869 = OpFAdd %float %2863 %2868
+ OpBranch %2795
+ %2795 = OpLabel
+ %2870 = OpPhi %float %2862 %2803 %2869 %2796
+ %2871 = OpExtInst %float %1 Pow %float_10 %2870
+ %2872 = OpCompositeInsert %v3float %2871 %523 0
+ %2873 = OpCompositeExtract %float %2583 1
+ OpStore %554 %503
+ OpStore %553 %504
+ %2874 = OpFOrdLessThanEqual %bool %2873 %float_0
+ %2875 = OpSelect %float %2874 %float_9_99999975en05 %2873
+ %2876 = OpExtInst %float %1 Log %2875
+ %2877 = OpFDiv %float %2876 %1091
+ %2878 = OpFOrdLessThanEqual %bool %2877 %2793
+ OpSelectionMerge %2879 None
+ OpBranchConditional %2878 %2880 %2881
+ %2881 = OpLabel
+ %2882 = OpFOrdGreaterThan %bool %2877 %2793
+ %2883 = OpExtInst %float %1 Log %2714
+ %2884 = OpFDiv %float %2883 %1091
+ %2885 = OpFOrdLessThan %bool %2877 %2884
+ %2886 = OpLogicalAnd %bool %2882 %2885
+ OpSelectionMerge %2887 None
+ OpBranchConditional %2886 %2888 %2889
+ %2889 = OpLabel
+ %2890 = OpFOrdGreaterThanEqual %bool %2877 %2884
+ %2891 = OpExtInst %float %1 Log %2786
+ %2892 = OpFDiv %float %2891 %1091
+ %2893 = OpFOrdLessThan %bool %2877 %2892
+ %2894 = OpLogicalAnd %bool %2890 %2893
+ OpSelectionMerge %2895 None
+ OpBranchConditional %2894 %2896 %2897
+ %2897 = OpLabel
+ %2898 = OpFMul %float %2877 %float_0_0599999987
+ %2899 = OpExtInst %float %1 Log %float_1000
+ %2900 = OpFDiv %float %2899 %1091
+ %2901 = OpFMul %float %float_0_0599999987 %2891
+ %2902 = OpFDiv %float %2901 %1091
+ %2903 = OpFSub %float %2900 %2902
+ %2904 = OpFAdd %float %2898 %2903
+ OpBranch %2895
+ %2896 = OpLabel
+ %2905 = OpFSub %float %2877 %2884
+ %2906 = OpFMul %float %float_7 %2905
+ %2907 = OpFSub %float %2892 %2884
+ %2908 = OpFDiv %float %2906 %2907
+ %2909 = OpConvertFToS %int %2908
+ %2910 = OpConvertSToF %float %2909
+ %2911 = OpFSub %float %2908 %2910
+ %2912 = OpAccessChain %_ptr_Function_float %553 %2909
+ %2913 = OpLoad %float %2912
+ %2914 = OpIAdd %int %2909 %int_1
+ %2915 = OpAccessChain %_ptr_Function_float %553 %2914
+ %2916 = OpLoad %float %2915
+ %2917 = OpIAdd %int %2909 %int_2
+ %2918 = OpAccessChain %_ptr_Function_float %553 %2917
+ %2919 = OpLoad %float %2918
+ %2920 = OpCompositeConstruct %v3float %2913 %2916 %2919
+ %2921 = OpFMul %float %2911 %2911
+ %2922 = OpCompositeConstruct %v3float %2921 %2911 %float_1
+ %2923 = OpMatrixTimesVector %v3float %466 %2920
+ %2924 = OpDot %float %2922 %2923
+ OpBranch %2895
+ %2895 = OpLabel
+ %2925 = OpPhi %float %2904 %2897 %2924 %2896
+ OpBranch %2887
+ %2888 = OpLabel
+ %2926 = OpFSub %float %2877 %2793
+ %2927 = OpFMul %float %float_7 %2926
+ %2928 = OpFSub %float %2884 %2793
+ %2929 = OpFDiv %float %2927 %2928
+ %2930 = OpConvertFToS %int %2929
+ %2931 = OpConvertSToF %float %2930
+ %2932 = OpFSub %float %2929 %2931
+ %2933 = OpAccessChain %_ptr_Function_float %554 %2930
+ %2934 = OpLoad %float %2933
+ %2935 = OpIAdd %int %2930 %int_1
+ %2936 = OpAccessChain %_ptr_Function_float %554 %2935
+ %2937 = OpLoad %float %2936
+ %2938 = OpIAdd %int %2930 %int_2
+ %2939 = OpAccessChain %_ptr_Function_float %554 %2938
+ %2940 = OpLoad %float %2939
+ %2941 = OpCompositeConstruct %v3float %2934 %2937 %2940
+ %2942 = OpFMul %float %2932 %2932
+ %2943 = OpCompositeConstruct %v3float %2942 %2932 %float_1
+ %2944 = OpMatrixTimesVector %v3float %466 %2941
+ %2945 = OpDot %float %2943 %2944
+ OpBranch %2887
+ %2887 = OpLabel
+ %2946 = OpPhi %float %2925 %2895 %2945 %2888
+ OpBranch %2879
+ %2880 = OpLabel
+ %2947 = OpFMul %float %2877 %float_3
+ %2948 = OpExtInst %float %1 Log %float_9_99999975en05
+ %2949 = OpFDiv %float %2948 %1091
+ %2950 = OpFMul %float %float_3 %2792
+ %2951 = OpFDiv %float %2950 %1091
+ %2952 = OpFSub %float %2949 %2951
+ %2953 = OpFAdd %float %2947 %2952
+ OpBranch %2879
+ %2879 = OpLabel
+ %2954 = OpPhi %float %2946 %2887 %2953 %2880
+ %2955 = OpExtInst %float %1 Pow %float_10 %2954
+ %2956 = OpCompositeInsert %v3float %2955 %2872 1
+ %2957 = OpCompositeExtract %float %2583 2
+ OpStore %552 %503
+ OpStore %551 %504
+ %2958 = OpFOrdLessThanEqual %bool %2957 %float_0
+ %2959 = OpSelect %float %2958 %float_9_99999975en05 %2957
+ %2960 = OpExtInst %float %1 Log %2959
+ %2961 = OpFDiv %float %2960 %1091
+ %2962 = OpFOrdLessThanEqual %bool %2961 %2793
+ OpSelectionMerge %2963 None
+ OpBranchConditional %2962 %2964 %2965
+ %2965 = OpLabel
+ %2966 = OpFOrdGreaterThan %bool %2961 %2793
+ %2967 = OpExtInst %float %1 Log %2714
+ %2968 = OpFDiv %float %2967 %1091
+ %2969 = OpFOrdLessThan %bool %2961 %2968
+ %2970 = OpLogicalAnd %bool %2966 %2969
+ OpSelectionMerge %2971 None
+ OpBranchConditional %2970 %2972 %2973
+ %2973 = OpLabel
+ %2974 = OpFOrdGreaterThanEqual %bool %2961 %2968
+ %2975 = OpExtInst %float %1 Log %2786
+ %2976 = OpFDiv %float %2975 %1091
+ %2977 = OpFOrdLessThan %bool %2961 %2976
+ %2978 = OpLogicalAnd %bool %2974 %2977
+ OpSelectionMerge %2979 None
+ OpBranchConditional %2978 %2980 %2981
+ %2981 = OpLabel
+ %2982 = OpFMul %float %2961 %float_0_0599999987
+ %2983 = OpExtInst %float %1 Log %float_1000
+ %2984 = OpFDiv %float %2983 %1091
+ %2985 = OpFMul %float %float_0_0599999987 %2975
+ %2986 = OpFDiv %float %2985 %1091
+ %2987 = OpFSub %float %2984 %2986
+ %2988 = OpFAdd %float %2982 %2987
+ OpBranch %2979
+ %2980 = OpLabel
+ %2989 = OpFSub %float %2961 %2968
+ %2990 = OpFMul %float %float_7 %2989
+ %2991 = OpFSub %float %2976 %2968
+ %2992 = OpFDiv %float %2990 %2991
+ %2993 = OpConvertFToS %int %2992
+ %2994 = OpConvertSToF %float %2993
+ %2995 = OpFSub %float %2992 %2994
+ %2996 = OpAccessChain %_ptr_Function_float %551 %2993
+ %2997 = OpLoad %float %2996
+ %2998 = OpIAdd %int %2993 %int_1
+ %2999 = OpAccessChain %_ptr_Function_float %551 %2998
+ %3000 = OpLoad %float %2999
+ %3001 = OpIAdd %int %2993 %int_2
+ %3002 = OpAccessChain %_ptr_Function_float %551 %3001
+ %3003 = OpLoad %float %3002
+ %3004 = OpCompositeConstruct %v3float %2997 %3000 %3003
+ %3005 = OpFMul %float %2995 %2995
+ %3006 = OpCompositeConstruct %v3float %3005 %2995 %float_1
+ %3007 = OpMatrixTimesVector %v3float %466 %3004
+ %3008 = OpDot %float %3006 %3007
+ OpBranch %2979
+ %2979 = OpLabel
+ %3009 = OpPhi %float %2988 %2981 %3008 %2980
+ OpBranch %2971
+ %2972 = OpLabel
+ %3010 = OpFSub %float %2961 %2793
+ %3011 = OpFMul %float %float_7 %3010
+ %3012 = OpFSub %float %2968 %2793
+ %3013 = OpFDiv %float %3011 %3012
+ %3014 = OpConvertFToS %int %3013
+ %3015 = OpConvertSToF %float %3014
+ %3016 = OpFSub %float %3013 %3015
+ %3017 = OpAccessChain %_ptr_Function_float %552 %3014
+ %3018 = OpLoad %float %3017
+ %3019 = OpIAdd %int %3014 %int_1
+ %3020 = OpAccessChain %_ptr_Function_float %552 %3019
+ %3021 = OpLoad %float %3020
+ %3022 = OpIAdd %int %3014 %int_2
+ %3023 = OpAccessChain %_ptr_Function_float %552 %3022
+ %3024 = OpLoad %float %3023
+ %3025 = OpCompositeConstruct %v3float %3018 %3021 %3024
+ %3026 = OpFMul %float %3016 %3016
+ %3027 = OpCompositeConstruct %v3float %3026 %3016 %float_1
+ %3028 = OpMatrixTimesVector %v3float %466 %3025
+ %3029 = OpDot %float %3027 %3028
+ OpBranch %2971
+ %2971 = OpLabel
+ %3030 = OpPhi %float %3009 %2979 %3029 %2972
+ OpBranch %2963
+ %2964 = OpLabel
+ %3031 = OpFMul %float %2961 %float_3
+ %3032 = OpExtInst %float %1 Log %float_9_99999975en05
+ %3033 = OpFDiv %float %3032 %1091
+ %3034 = OpFMul %float %float_3 %2792
+ %3035 = OpFDiv %float %3034 %1091
+ %3036 = OpFSub %float %3033 %3035
+ %3037 = OpFAdd %float %3031 %3036
+ OpBranch %2963
+ %2963 = OpLabel
+ %3038 = OpPhi %float %3030 %2971 %3037 %2964
+ %3039 = OpExtInst %float %1 Pow %float_10 %3038
+ %3040 = OpCompositeInsert %v3float %3039 %2956 2
+ %3041 = OpFSub %v3float %3040 %361
+ %3042 = OpVectorTimesMatrix %v3float %3041 %602
+ %3043 = OpFMul %v3float %3042 %519
+ %3044 = OpExtInst %v3float %1 Pow %3043 %286
+ %3045 = OpFMul %v3float %196 %3044
+ %3046 = OpFAdd %v3float %195 %3045
+ %3047 = OpFMul %v3float %197 %3044
+ %3048 = OpFAdd %v3float %141 %3047
+ %3049 = OpFDiv %v3float %141 %3048
+ %3050 = OpFMul %v3float %3046 %3049
+ %3051 = OpExtInst %v3float %1 Pow %3050 %287
+ OpBranch %1336
+ %1336 = OpLabel
+ %3052 = OpPhi %v3float %2201 %1342 %3051 %2963
+ OpBranch %1330
+ %1331 = OpLabel
+ %3053 = OpVectorTimesMatrix %v3float %1324 %573
+ %3054 = OpVectorTimesMatrix %v3float %3053 %602
+ %3055 = OpExtInst %v3float %1 FMax %263 %3054
+ %3056 = OpFMul %v3float %3055 %275
+ %3057 = OpExtInst %v3float %1 FMax %3055 %277
+ %3058 = OpExtInst %v3float %1 Pow %3057 %279
+ %3059 = OpFMul %v3float %3058 %281
+ %3060 = OpFSub %v3float %3059 %283
+ %3061 = OpExtInst %v3float %1 FMin %3056 %3060
+ OpBranch %1330
+ %1330 = OpLabel
+ %3062 = OpPhi %v3float %3052 %1336 %3061 %1331
+ OpBranch %1326
+ %1327 = OpLabel
+ %3063 = OpCompositeExtract %float %1324 0
+ OpBranch %3064
+ %3064 = OpLabel
+ OpLoopMerge %3065 %3066 None
+ OpBranch %3067
+ %3067 = OpLabel
+ %3068 = OpFOrdLessThan %bool %3063 %float_0_00313066994
+ OpSelectionMerge %3069 None
+ OpBranchConditional %3068 %3070 %3069
+ %3070 = OpLabel
+ %3071 = OpFMul %float %3063 %float_12_9200001
+ OpBranch %3065
+ %3069 = OpLabel
+ %3072 = OpExtInst %float %1 Pow %3063 %float_0_416666657
+ %3073 = OpFMul %float %3072 %float_1_05499995
+ %3074 = OpFSub %float %3073 %float_0_0549999997
+ OpBranch %3065
+ %3066 = OpLabel
+ OpBranch %3064
+ %3065 = OpLabel
+ %3075 = OpPhi %float %3071 %3070 %3074 %3069
+ %3076 = OpCompositeExtract %float %1324 1
+ OpBranch %3077
+ %3077 = OpLabel
+ OpLoopMerge %3078 %3079 None
+ OpBranch %3080
+ %3080 = OpLabel
+ %3081 = OpFOrdLessThan %bool %3076 %float_0_00313066994
+ OpSelectionMerge %3082 None
+ OpBranchConditional %3081 %3083 %3082
+ %3083 = OpLabel
+ %3084 = OpFMul %float %3076 %float_12_9200001
+ OpBranch %3078
+ %3082 = OpLabel
+ %3085 = OpExtInst %float %1 Pow %3076 %float_0_416666657
+ %3086 = OpFMul %float %3085 %float_1_05499995
+ %3087 = OpFSub %float %3086 %float_0_0549999997
+ OpBranch %3078
+ %3079 = OpLabel
+ OpBranch %3077
+ %3078 = OpLabel
+ %3088 = OpPhi %float %3084 %3083 %3087 %3082
+ %3089 = OpCompositeExtract %float %1324 2
+ OpBranch %3090
+ %3090 = OpLabel
+ OpLoopMerge %3091 %3092 None
+ OpBranch %3093
+ %3093 = OpLabel
+ %3094 = OpFOrdLessThan %bool %3089 %float_0_00313066994
+ OpSelectionMerge %3095 None
+ OpBranchConditional %3094 %3096 %3095
+ %3096 = OpLabel
+ %3097 = OpFMul %float %3089 %float_12_9200001
+ OpBranch %3091
+ %3095 = OpLabel
+ %3098 = OpExtInst %float %1 Pow %3089 %float_0_416666657
+ %3099 = OpFMul %float %3098 %float_1_05499995
+ %3100 = OpFSub %float %3099 %float_0_0549999997
+ OpBranch %3091
+ %3092 = OpLabel
+ OpBranch %3090
+ %3091 = OpLabel
+ %3101 = OpPhi %float %3097 %3096 %3100 %3095
+ %3102 = OpCompositeConstruct %v3float %3075 %3088 %3101
+ OpBranch %1326
+ %1326 = OpLabel
+ %3103 = OpPhi %v3float %3062 %1330 %3102 %3091
+ %3104 = OpFMul %v3float %3103 %522
+ %3105 = OpVectorShuffle %v4float %135 %3104 4 5 6 3
+ %3106 = OpCompositeInsert %v4float %float_0 %3105 3
+ OpStore %out_var_SV_Target0 %3106
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag
new file mode 100644
index 00000000000..eba220ba4e7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag
@@ -0,0 +1,878 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 353
+; Schema: 0
+ OpCapability Shader
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %MainPixelShader "main" %gl_FragCoord %in_var_TEXCOORD6 %in_var_TEXCOORD7 %in_var_TEXCOORD10_centroid %in_var_TEXCOORD11_centroid %in_var_TEXCOORD0 %in_var_PRIMITIVE_ID %gl_FrontFacing %gl_FragDepth %out_var_SV_Target0
+ OpExecutionMode %MainPixelShader OriginUpperLeft
+ OpExecutionMode %MainPixelShader DepthReplacing
+ OpExecutionMode %MainPixelShader DepthLess
+ OpSource HLSL 600
+ OpName %type_View "type.View"
+ OpMemberName %type_View 0 "View_TranslatedWorldToClip"
+ OpMemberName %type_View 1 "View_WorldToClip"
+ OpMemberName %type_View 2 "View_ClipToWorld"
+ OpMemberName %type_View 3 "View_TranslatedWorldToView"
+ OpMemberName %type_View 4 "View_ViewToTranslatedWorld"
+ OpMemberName %type_View 5 "View_TranslatedWorldToCameraView"
+ OpMemberName %type_View 6 "View_CameraViewToTranslatedWorld"
+ OpMemberName %type_View 7 "View_ViewToClip"
+ OpMemberName %type_View 8 "View_ViewToClipNoAA"
+ OpMemberName %type_View 9 "View_ClipToView"
+ OpMemberName %type_View 10 "View_ClipToTranslatedWorld"
+ OpMemberName %type_View 11 "View_SVPositionToTranslatedWorld"
+ OpMemberName %type_View 12 "View_ScreenToWorld"
+ OpMemberName %type_View 13 "View_ScreenToTranslatedWorld"
+ OpMemberName %type_View 14 "View_ViewForward"
+ OpMemberName %type_View 15 "PrePadding_View_908"
+ OpMemberName %type_View 16 "View_ViewUp"
+ OpMemberName %type_View 17 "PrePadding_View_924"
+ OpMemberName %type_View 18 "View_ViewRight"
+ OpMemberName %type_View 19 "PrePadding_View_940"
+ OpMemberName %type_View 20 "View_HMDViewNoRollUp"
+ OpMemberName %type_View 21 "PrePadding_View_956"
+ OpMemberName %type_View 22 "View_HMDViewNoRollRight"
+ OpMemberName %type_View 23 "PrePadding_View_972"
+ OpMemberName %type_View 24 "View_InvDeviceZToWorldZTransform"
+ OpMemberName %type_View 25 "View_ScreenPositionScaleBias"
+ OpMemberName %type_View 26 "View_WorldCameraOrigin"
+ OpMemberName %type_View 27 "PrePadding_View_1020"
+ OpMemberName %type_View 28 "View_TranslatedWorldCameraOrigin"
+ OpMemberName %type_View 29 "PrePadding_View_1036"
+ OpMemberName %type_View 30 "View_WorldViewOrigin"
+ OpMemberName %type_View 31 "PrePadding_View_1052"
+ OpMemberName %type_View 32 "View_PreViewTranslation"
+ OpMemberName %type_View 33 "PrePadding_View_1068"
+ OpMemberName %type_View 34 "View_PrevProjection"
+ OpMemberName %type_View 35 "View_PrevViewProj"
+ OpMemberName %type_View 36 "View_PrevViewRotationProj"
+ OpMemberName %type_View 37 "View_PrevViewToClip"
+ OpMemberName %type_View 38 "View_PrevClipToView"
+ OpMemberName %type_View 39 "View_PrevTranslatedWorldToClip"
+ OpMemberName %type_View 40 "View_PrevTranslatedWorldToView"
+ OpMemberName %type_View 41 "View_PrevViewToTranslatedWorld"
+ OpMemberName %type_View 42 "View_PrevTranslatedWorldToCameraView"
+ OpMemberName %type_View 43 "View_PrevCameraViewToTranslatedWorld"
+ OpMemberName %type_View 44 "View_PrevWorldCameraOrigin"
+ OpMemberName %type_View 45 "PrePadding_View_1724"
+ OpMemberName %type_View 46 "View_PrevWorldViewOrigin"
+ OpMemberName %type_View 47 "PrePadding_View_1740"
+ OpMemberName %type_View 48 "View_PrevPreViewTranslation"
+ OpMemberName %type_View 49 "PrePadding_View_1756"
+ OpMemberName %type_View 50 "View_PrevInvViewProj"
+ OpMemberName %type_View 51 "View_PrevScreenToTranslatedWorld"
+ OpMemberName %type_View 52 "View_ClipToPrevClip"
+ OpMemberName %type_View 53 "View_TemporalAAJitter"
+ OpMemberName %type_View 54 "View_GlobalClippingPlane"
+ OpMemberName %type_View 55 "View_FieldOfViewWideAngles"
+ OpMemberName %type_View 56 "View_PrevFieldOfViewWideAngles"
+ OpMemberName %type_View 57 "View_ViewRectMin"
+ OpMemberName %type_View 58 "View_ViewSizeAndInvSize"
+ OpMemberName %type_View 59 "View_BufferSizeAndInvSize"
+ OpMemberName %type_View 60 "View_BufferBilinearUVMinMax"
+ OpMemberName %type_View 61 "View_NumSceneColorMSAASamples"
+ OpMemberName %type_View 62 "View_PreExposure"
+ OpMemberName %type_View 63 "View_OneOverPreExposure"
+ OpMemberName %type_View 64 "PrePadding_View_2076"
+ OpMemberName %type_View 65 "View_DiffuseOverrideParameter"
+ OpMemberName %type_View 66 "View_SpecularOverrideParameter"
+ OpMemberName %type_View 67 "View_NormalOverrideParameter"
+ OpMemberName %type_View 68 "View_RoughnessOverrideParameter"
+ OpMemberName %type_View 69 "View_PrevFrameGameTime"
+ OpMemberName %type_View 70 "View_PrevFrameRealTime"
+ OpMemberName %type_View 71 "View_OutOfBoundsMask"
+ OpMemberName %type_View 72 "PrePadding_View_2148"
+ OpMemberName %type_View 73 "PrePadding_View_2152"
+ OpMemberName %type_View 74 "PrePadding_View_2156"
+ OpMemberName %type_View 75 "View_WorldCameraMovementSinceLastFrame"
+ OpMemberName %type_View 76 "View_CullingSign"
+ OpMemberName %type_View 77 "View_NearPlane"
+ OpMemberName %type_View 78 "View_AdaptiveTessellationFactor"
+ OpMemberName %type_View 79 "View_GameTime"
+ OpMemberName %type_View 80 "View_RealTime"
+ OpMemberName %type_View 81 "View_DeltaTime"
+ OpMemberName %type_View 82 "View_MaterialTextureMipBias"
+ OpMemberName %type_View 83 "View_MaterialTextureDerivativeMultiply"
+ OpMemberName %type_View 84 "View_Random"
+ OpMemberName %type_View 85 "View_FrameNumber"
+ OpMemberName %type_View 86 "View_StateFrameIndexMod8"
+ OpMemberName %type_View 87 "View_StateFrameIndex"
+ OpMemberName %type_View 88 "View_CameraCut"
+ OpMemberName %type_View 89 "View_UnlitViewmodeMask"
+ OpMemberName %type_View 90 "PrePadding_View_2228"
+ OpMemberName %type_View 91 "PrePadding_View_2232"
+ OpMemberName %type_View 92 "PrePadding_View_2236"
+ OpMemberName %type_View 93 "View_DirectionalLightColor"
+ OpMemberName %type_View 94 "View_DirectionalLightDirection"
+ OpMemberName %type_View 95 "PrePadding_View_2268"
+ OpMemberName %type_View 96 "View_TranslucencyLightingVolumeMin"
+ OpMemberName %type_View 97 "View_TranslucencyLightingVolumeInvSize"
+ OpMemberName %type_View 98 "View_TemporalAAParams"
+ OpMemberName %type_View 99 "View_CircleDOFParams"
+ OpMemberName %type_View 100 "View_DepthOfFieldSensorWidth"
+ OpMemberName %type_View 101 "View_DepthOfFieldFocalDistance"
+ OpMemberName %type_View 102 "View_DepthOfFieldScale"
+ OpMemberName %type_View 103 "View_DepthOfFieldFocalLength"
+ OpMemberName %type_View 104 "View_DepthOfFieldFocalRegion"
+ OpMemberName %type_View 105 "View_DepthOfFieldNearTransitionRegion"
+ OpMemberName %type_View 106 "View_DepthOfFieldFarTransitionRegion"
+ OpMemberName %type_View 107 "View_MotionBlurNormalizedToPixel"
+ OpMemberName %type_View 108 "View_bSubsurfacePostprocessEnabled"
+ OpMemberName %type_View 109 "View_GeneralPurposeTweak"
+ OpMemberName %type_View 110 "View_DemosaicVposOffset"
+ OpMemberName %type_View 111 "PrePadding_View_2412"
+ OpMemberName %type_View 112 "View_IndirectLightingColorScale"
+ OpMemberName %type_View 113 "View_HDR32bppEncodingMode"
+ OpMemberName %type_View 114 "View_AtmosphericFogSunDirection"
+ OpMemberName %type_View 115 "View_AtmosphericFogSunPower"
+ OpMemberName %type_View 116 "View_AtmosphericFogPower"
+ OpMemberName %type_View 117 "View_AtmosphericFogDensityScale"
+ OpMemberName %type_View 118 "View_AtmosphericFogDensityOffset"
+ OpMemberName %type_View 119 "View_AtmosphericFogGroundOffset"
+ OpMemberName %type_View 120 "View_AtmosphericFogDistanceScale"
+ OpMemberName %type_View 121 "View_AtmosphericFogAltitudeScale"
+ OpMemberName %type_View 122 "View_AtmosphericFogHeightScaleRayleigh"
+ OpMemberName %type_View 123 "View_AtmosphericFogStartDistance"
+ OpMemberName %type_View 124 "View_AtmosphericFogDistanceOffset"
+ OpMemberName %type_View 125 "View_AtmosphericFogSunDiscScale"
+ OpMemberName %type_View 126 "View_AtmosphericFogSunDiscHalfApexAngleRadian"
+ OpMemberName %type_View 127 "PrePadding_View_2492"
+ OpMemberName %type_View 128 "View_AtmosphericFogSunDiscLuminance"
+ OpMemberName %type_View 129 "View_AtmosphericFogRenderMask"
+ OpMemberName %type_View 130 "View_AtmosphericFogInscatterAltitudeSampleNum"
+ OpMemberName %type_View 131 "PrePadding_View_2520"
+ OpMemberName %type_View 132 "PrePadding_View_2524"
+ OpMemberName %type_View 133 "View_AtmosphericFogSunColor"
+ OpMemberName %type_View 134 "View_NormalCurvatureToRoughnessScaleBias"
+ OpMemberName %type_View 135 "View_RenderingReflectionCaptureMask"
+ OpMemberName %type_View 136 "View_AmbientCubemapTint"
+ OpMemberName %type_View 137 "View_AmbientCubemapIntensity"
+ OpMemberName %type_View 138 "View_SkyLightParameters"
+ OpMemberName %type_View 139 "PrePadding_View_2584"
+ OpMemberName %type_View 140 "PrePadding_View_2588"
+ OpMemberName %type_View 141 "View_SkyLightColor"
+ OpMemberName %type_View 142 "View_SkyIrradianceEnvironmentMap"
+ OpMemberName %type_View 143 "View_MobilePreviewMode"
+ OpMemberName %type_View 144 "View_HMDEyePaddingOffset"
+ OpMemberName %type_View 145 "View_ReflectionCubemapMaxMip"
+ OpMemberName %type_View 146 "View_ShowDecalsMask"
+ OpMemberName %type_View 147 "View_DistanceFieldAOSpecularOcclusionMode"
+ OpMemberName %type_View 148 "View_IndirectCapsuleSelfShadowingIntensity"
+ OpMemberName %type_View 149 "PrePadding_View_2744"
+ OpMemberName %type_View 150 "PrePadding_View_2748"
+ OpMemberName %type_View 151 "View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight"
+ OpMemberName %type_View 152 "View_StereoPassIndex"
+ OpMemberName %type_View 153 "View_GlobalVolumeCenterAndExtent"
+ OpMemberName %type_View 154 "View_GlobalVolumeWorldToUVAddAndMul"
+ OpMemberName %type_View 155 "View_GlobalVolumeDimension"
+ OpMemberName %type_View 156 "View_GlobalVolumeTexelSize"
+ OpMemberName %type_View 157 "View_MaxGlobalDistance"
+ OpMemberName %type_View 158 "PrePadding_View_2908"
+ OpMemberName %type_View 159 "View_CursorPosition"
+ OpMemberName %type_View 160 "View_bCheckerboardSubsurfaceProfileRendering"
+ OpMemberName %type_View 161 "PrePadding_View_2924"
+ OpMemberName %type_View 162 "View_VolumetricFogInvGridSize"
+ OpMemberName %type_View 163 "PrePadding_View_2940"
+ OpMemberName %type_View 164 "View_VolumetricFogGridZParams"
+ OpMemberName %type_View 165 "PrePadding_View_2956"
+ OpMemberName %type_View 166 "View_VolumetricFogSVPosToVolumeUV"
+ OpMemberName %type_View 167 "View_VolumetricFogMaxDistance"
+ OpMemberName %type_View 168 "PrePadding_View_2972"
+ OpMemberName %type_View 169 "View_VolumetricLightmapWorldToUVScale"
+ OpMemberName %type_View 170 "PrePadding_View_2988"
+ OpMemberName %type_View 171 "View_VolumetricLightmapWorldToUVAdd"
+ OpMemberName %type_View 172 "PrePadding_View_3004"
+ OpMemberName %type_View 173 "View_VolumetricLightmapIndirectionTextureSize"
+ OpMemberName %type_View 174 "View_VolumetricLightmapBrickSize"
+ OpMemberName %type_View 175 "View_VolumetricLightmapBrickTexelSize"
+ OpMemberName %type_View 176 "View_StereoIPD"
+ OpMemberName %type_View 177 "View_IndirectLightingCacheShowFlag"
+ OpMemberName %type_View 178 "View_EyeToPixelSpreadAngle"
+ OpName %View "View"
+ OpName %type_PrimitiveDither "type.PrimitiveDither"
+ OpMemberName %type_PrimitiveDither 0 "PrimitiveDither_LODFactor"
+ OpName %PrimitiveDither "PrimitiveDither"
+ OpName %type_PrimitiveFade "type.PrimitiveFade"
+ OpMemberName %type_PrimitiveFade 0 "PrimitiveFade_FadeTimeScaleBias"
+ OpName %PrimitiveFade "PrimitiveFade"
+ OpName %type_Material "type.Material"
+ OpMemberName %type_Material 0 "Material_VectorExpressions"
+ OpMemberName %type_Material 1 "Material_ScalarExpressions"
+ OpName %Material "Material"
+ OpName %type_2d_image "type.2d.image"
+ OpName %Material_Texture2D_0 "Material_Texture2D_0"
+ OpName %type_sampler "type.sampler"
+ OpName %Material_Texture2D_0Sampler "Material_Texture2D_0Sampler"
+ OpName %Material_Texture2D_3 "Material_Texture2D_3"
+ OpName %Material_Texture2D_3Sampler "Material_Texture2D_3Sampler"
+ OpName %in_var_TEXCOORD6 "in.var.TEXCOORD6"
+ OpName %in_var_TEXCOORD7 "in.var.TEXCOORD7"
+ OpName %in_var_TEXCOORD10_centroid "in.var.TEXCOORD10_centroid"
+ OpName %in_var_TEXCOORD11_centroid "in.var.TEXCOORD11_centroid"
+ OpName %in_var_TEXCOORD0 "in.var.TEXCOORD0"
+ OpName %in_var_PRIMITIVE_ID "in.var.PRIMITIVE_ID"
+ OpName %out_var_SV_Target0 "out.var.SV_Target0"
+ OpName %MainPixelShader "MainPixelShader"
+ OpName %type_sampled_image "type.sampled.image"
+ OpDecorate %gl_FragCoord BuiltIn FragCoord
+ OpDecorateString %gl_FragCoord UserSemantic "SV_Position"
+ OpDecorateString %in_var_TEXCOORD6 UserSemantic "TEXCOORD6"
+ OpDecorateString %in_var_TEXCOORD7 UserSemantic "TEXCOORD7"
+ OpDecorateString %in_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %in_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %in_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorateString %in_var_PRIMITIVE_ID UserSemantic "PRIMITIVE_ID"
+ OpDecorate %in_var_PRIMITIVE_ID Flat
+ OpDecorate %gl_FrontFacing BuiltIn FrontFacing
+ OpDecorateString %gl_FrontFacing UserSemantic "SV_IsFrontFace"
+ OpDecorate %gl_FrontFacing Flat
+ OpDecorate %gl_FragDepth BuiltIn FragDepth
+ OpDecorateString %gl_FragDepth UserSemantic "SV_DepthLessEqual"
+ OpDecorateString %out_var_SV_Target0 UserSemantic "SV_Target0"
+ OpDecorate %in_var_TEXCOORD6 Location 0
+ OpDecorate %in_var_TEXCOORD7 Location 1
+ OpDecorate %in_var_TEXCOORD10_centroid Location 2
+ OpDecorate %in_var_TEXCOORD11_centroid Location 3
+ OpDecorate %in_var_TEXCOORD0 Location 4
+ OpDecorate %in_var_PRIMITIVE_ID Location 5
+ OpDecorate %out_var_SV_Target0 Location 0
+ OpDecorate %View DescriptorSet 0
+ OpDecorate %View Binding 0
+ OpDecorate %PrimitiveDither DescriptorSet 0
+ OpDecorate %PrimitiveDither Binding 1
+ OpDecorate %PrimitiveFade DescriptorSet 0
+ OpDecorate %PrimitiveFade Binding 2
+ OpDecorate %Material DescriptorSet 0
+ OpDecorate %Material Binding 3
+ OpDecorate %Material_Texture2D_0 DescriptorSet 0
+ OpDecorate %Material_Texture2D_0 Binding 0
+ OpDecorate %Material_Texture2D_0Sampler DescriptorSet 0
+ OpDecorate %Material_Texture2D_0Sampler Binding 0
+ OpDecorate %Material_Texture2D_3 DescriptorSet 0
+ OpDecorate %Material_Texture2D_3 Binding 1
+ OpDecorate %Material_Texture2D_3Sampler DescriptorSet 0
+ OpDecorate %Material_Texture2D_3Sampler Binding 1
+ OpDecorate %_arr_v4float_uint_2 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_7 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpMemberDecorate %type_View 0 Offset 0
+ OpMemberDecorate %type_View 0 MatrixStride 16
+ OpMemberDecorate %type_View 0 ColMajor
+ OpMemberDecorate %type_View 1 Offset 64
+ OpMemberDecorate %type_View 1 MatrixStride 16
+ OpMemberDecorate %type_View 1 ColMajor
+ OpMemberDecorate %type_View 2 Offset 128
+ OpMemberDecorate %type_View 2 MatrixStride 16
+ OpMemberDecorate %type_View 2 ColMajor
+ OpMemberDecorate %type_View 3 Offset 192
+ OpMemberDecorate %type_View 3 MatrixStride 16
+ OpMemberDecorate %type_View 3 ColMajor
+ OpMemberDecorate %type_View 4 Offset 256
+ OpMemberDecorate %type_View 4 MatrixStride 16
+ OpMemberDecorate %type_View 4 ColMajor
+ OpMemberDecorate %type_View 5 Offset 320
+ OpMemberDecorate %type_View 5 MatrixStride 16
+ OpMemberDecorate %type_View 5 ColMajor
+ OpMemberDecorate %type_View 6 Offset 384
+ OpMemberDecorate %type_View 6 MatrixStride 16
+ OpMemberDecorate %type_View 6 ColMajor
+ OpMemberDecorate %type_View 7 Offset 448
+ OpMemberDecorate %type_View 7 MatrixStride 16
+ OpMemberDecorate %type_View 7 ColMajor
+ OpMemberDecorate %type_View 8 Offset 512
+ OpMemberDecorate %type_View 8 MatrixStride 16
+ OpMemberDecorate %type_View 8 ColMajor
+ OpMemberDecorate %type_View 9 Offset 576
+ OpMemberDecorate %type_View 9 MatrixStride 16
+ OpMemberDecorate %type_View 9 ColMajor
+ OpMemberDecorate %type_View 10 Offset 640
+ OpMemberDecorate %type_View 10 MatrixStride 16
+ OpMemberDecorate %type_View 10 ColMajor
+ OpMemberDecorate %type_View 11 Offset 704
+ OpMemberDecorate %type_View 11 MatrixStride 16
+ OpMemberDecorate %type_View 11 ColMajor
+ OpMemberDecorate %type_View 12 Offset 768
+ OpMemberDecorate %type_View 12 MatrixStride 16
+ OpMemberDecorate %type_View 12 ColMajor
+ OpMemberDecorate %type_View 13 Offset 832
+ OpMemberDecorate %type_View 13 MatrixStride 16
+ OpMemberDecorate %type_View 13 ColMajor
+ OpMemberDecorate %type_View 14 Offset 896
+ OpMemberDecorate %type_View 15 Offset 908
+ OpMemberDecorate %type_View 16 Offset 912
+ OpMemberDecorate %type_View 17 Offset 924
+ OpMemberDecorate %type_View 18 Offset 928
+ OpMemberDecorate %type_View 19 Offset 940
+ OpMemberDecorate %type_View 20 Offset 944
+ OpMemberDecorate %type_View 21 Offset 956
+ OpMemberDecorate %type_View 22 Offset 960
+ OpMemberDecorate %type_View 23 Offset 972
+ OpMemberDecorate %type_View 24 Offset 976
+ OpMemberDecorate %type_View 25 Offset 992
+ OpMemberDecorate %type_View 26 Offset 1008
+ OpMemberDecorate %type_View 27 Offset 1020
+ OpMemberDecorate %type_View 28 Offset 1024
+ OpMemberDecorate %type_View 29 Offset 1036
+ OpMemberDecorate %type_View 30 Offset 1040
+ OpMemberDecorate %type_View 31 Offset 1052
+ OpMemberDecorate %type_View 32 Offset 1056
+ OpMemberDecorate %type_View 33 Offset 1068
+ OpMemberDecorate %type_View 34 Offset 1072
+ OpMemberDecorate %type_View 34 MatrixStride 16
+ OpMemberDecorate %type_View 34 ColMajor
+ OpMemberDecorate %type_View 35 Offset 1136
+ OpMemberDecorate %type_View 35 MatrixStride 16
+ OpMemberDecorate %type_View 35 ColMajor
+ OpMemberDecorate %type_View 36 Offset 1200
+ OpMemberDecorate %type_View 36 MatrixStride 16
+ OpMemberDecorate %type_View 36 ColMajor
+ OpMemberDecorate %type_View 37 Offset 1264
+ OpMemberDecorate %type_View 37 MatrixStride 16
+ OpMemberDecorate %type_View 37 ColMajor
+ OpMemberDecorate %type_View 38 Offset 1328
+ OpMemberDecorate %type_View 38 MatrixStride 16
+ OpMemberDecorate %type_View 38 ColMajor
+ OpMemberDecorate %type_View 39 Offset 1392
+ OpMemberDecorate %type_View 39 MatrixStride 16
+ OpMemberDecorate %type_View 39 ColMajor
+ OpMemberDecorate %type_View 40 Offset 1456
+ OpMemberDecorate %type_View 40 MatrixStride 16
+ OpMemberDecorate %type_View 40 ColMajor
+ OpMemberDecorate %type_View 41 Offset 1520
+ OpMemberDecorate %type_View 41 MatrixStride 16
+ OpMemberDecorate %type_View 41 ColMajor
+ OpMemberDecorate %type_View 42 Offset 1584
+ OpMemberDecorate %type_View 42 MatrixStride 16
+ OpMemberDecorate %type_View 42 ColMajor
+ OpMemberDecorate %type_View 43 Offset 1648
+ OpMemberDecorate %type_View 43 MatrixStride 16
+ OpMemberDecorate %type_View 43 ColMajor
+ OpMemberDecorate %type_View 44 Offset 1712
+ OpMemberDecorate %type_View 45 Offset 1724
+ OpMemberDecorate %type_View 46 Offset 1728
+ OpMemberDecorate %type_View 47 Offset 1740
+ OpMemberDecorate %type_View 48 Offset 1744
+ OpMemberDecorate %type_View 49 Offset 1756
+ OpMemberDecorate %type_View 50 Offset 1760
+ OpMemberDecorate %type_View 50 MatrixStride 16
+ OpMemberDecorate %type_View 50 ColMajor
+ OpMemberDecorate %type_View 51 Offset 1824
+ OpMemberDecorate %type_View 51 MatrixStride 16
+ OpMemberDecorate %type_View 51 ColMajor
+ OpMemberDecorate %type_View 52 Offset 1888
+ OpMemberDecorate %type_View 52 MatrixStride 16
+ OpMemberDecorate %type_View 52 ColMajor
+ OpMemberDecorate %type_View 53 Offset 1952
+ OpMemberDecorate %type_View 54 Offset 1968
+ OpMemberDecorate %type_View 55 Offset 1984
+ OpMemberDecorate %type_View 56 Offset 1992
+ OpMemberDecorate %type_View 57 Offset 2000
+ OpMemberDecorate %type_View 58 Offset 2016
+ OpMemberDecorate %type_View 59 Offset 2032
+ OpMemberDecorate %type_View 60 Offset 2048
+ OpMemberDecorate %type_View 61 Offset 2064
+ OpMemberDecorate %type_View 62 Offset 2068
+ OpMemberDecorate %type_View 63 Offset 2072
+ OpMemberDecorate %type_View 64 Offset 2076
+ OpMemberDecorate %type_View 65 Offset 2080
+ OpMemberDecorate %type_View 66 Offset 2096
+ OpMemberDecorate %type_View 67 Offset 2112
+ OpMemberDecorate %type_View 68 Offset 2128
+ OpMemberDecorate %type_View 69 Offset 2136
+ OpMemberDecorate %type_View 70 Offset 2140
+ OpMemberDecorate %type_View 71 Offset 2144
+ OpMemberDecorate %type_View 72 Offset 2148
+ OpMemberDecorate %type_View 73 Offset 2152
+ OpMemberDecorate %type_View 74 Offset 2156
+ OpMemberDecorate %type_View 75 Offset 2160
+ OpMemberDecorate %type_View 76 Offset 2172
+ OpMemberDecorate %type_View 77 Offset 2176
+ OpMemberDecorate %type_View 78 Offset 2180
+ OpMemberDecorate %type_View 79 Offset 2184
+ OpMemberDecorate %type_View 80 Offset 2188
+ OpMemberDecorate %type_View 81 Offset 2192
+ OpMemberDecorate %type_View 82 Offset 2196
+ OpMemberDecorate %type_View 83 Offset 2200
+ OpMemberDecorate %type_View 84 Offset 2204
+ OpMemberDecorate %type_View 85 Offset 2208
+ OpMemberDecorate %type_View 86 Offset 2212
+ OpMemberDecorate %type_View 87 Offset 2216
+ OpMemberDecorate %type_View 88 Offset 2220
+ OpMemberDecorate %type_View 89 Offset 2224
+ OpMemberDecorate %type_View 90 Offset 2228
+ OpMemberDecorate %type_View 91 Offset 2232
+ OpMemberDecorate %type_View 92 Offset 2236
+ OpMemberDecorate %type_View 93 Offset 2240
+ OpMemberDecorate %type_View 94 Offset 2256
+ OpMemberDecorate %type_View 95 Offset 2268
+ OpMemberDecorate %type_View 96 Offset 2272
+ OpMemberDecorate %type_View 97 Offset 2304
+ OpMemberDecorate %type_View 98 Offset 2336
+ OpMemberDecorate %type_View 99 Offset 2352
+ OpMemberDecorate %type_View 100 Offset 2368
+ OpMemberDecorate %type_View 101 Offset 2372
+ OpMemberDecorate %type_View 102 Offset 2376
+ OpMemberDecorate %type_View 103 Offset 2380
+ OpMemberDecorate %type_View 104 Offset 2384
+ OpMemberDecorate %type_View 105 Offset 2388
+ OpMemberDecorate %type_View 106 Offset 2392
+ OpMemberDecorate %type_View 107 Offset 2396
+ OpMemberDecorate %type_View 108 Offset 2400
+ OpMemberDecorate %type_View 109 Offset 2404
+ OpMemberDecorate %type_View 110 Offset 2408
+ OpMemberDecorate %type_View 111 Offset 2412
+ OpMemberDecorate %type_View 112 Offset 2416
+ OpMemberDecorate %type_View 113 Offset 2428
+ OpMemberDecorate %type_View 114 Offset 2432
+ OpMemberDecorate %type_View 115 Offset 2444
+ OpMemberDecorate %type_View 116 Offset 2448
+ OpMemberDecorate %type_View 117 Offset 2452
+ OpMemberDecorate %type_View 118 Offset 2456
+ OpMemberDecorate %type_View 119 Offset 2460
+ OpMemberDecorate %type_View 120 Offset 2464
+ OpMemberDecorate %type_View 121 Offset 2468
+ OpMemberDecorate %type_View 122 Offset 2472
+ OpMemberDecorate %type_View 123 Offset 2476
+ OpMemberDecorate %type_View 124 Offset 2480
+ OpMemberDecorate %type_View 125 Offset 2484
+ OpMemberDecorate %type_View 126 Offset 2488
+ OpMemberDecorate %type_View 127 Offset 2492
+ OpMemberDecorate %type_View 128 Offset 2496
+ OpMemberDecorate %type_View 129 Offset 2512
+ OpMemberDecorate %type_View 130 Offset 2516
+ OpMemberDecorate %type_View 131 Offset 2520
+ OpMemberDecorate %type_View 132 Offset 2524
+ OpMemberDecorate %type_View 133 Offset 2528
+ OpMemberDecorate %type_View 134 Offset 2544
+ OpMemberDecorate %type_View 135 Offset 2556
+ OpMemberDecorate %type_View 136 Offset 2560
+ OpMemberDecorate %type_View 137 Offset 2576
+ OpMemberDecorate %type_View 138 Offset 2580
+ OpMemberDecorate %type_View 139 Offset 2584
+ OpMemberDecorate %type_View 140 Offset 2588
+ OpMemberDecorate %type_View 141 Offset 2592
+ OpMemberDecorate %type_View 142 Offset 2608
+ OpMemberDecorate %type_View 143 Offset 2720
+ OpMemberDecorate %type_View 144 Offset 2724
+ OpMemberDecorate %type_View 145 Offset 2728
+ OpMemberDecorate %type_View 146 Offset 2732
+ OpMemberDecorate %type_View 147 Offset 2736
+ OpMemberDecorate %type_View 148 Offset 2740
+ OpMemberDecorate %type_View 149 Offset 2744
+ OpMemberDecorate %type_View 150 Offset 2748
+ OpMemberDecorate %type_View 151 Offset 2752
+ OpMemberDecorate %type_View 152 Offset 2764
+ OpMemberDecorate %type_View 153 Offset 2768
+ OpMemberDecorate %type_View 154 Offset 2832
+ OpMemberDecorate %type_View 155 Offset 2896
+ OpMemberDecorate %type_View 156 Offset 2900
+ OpMemberDecorate %type_View 157 Offset 2904
+ OpMemberDecorate %type_View 158 Offset 2908
+ OpMemberDecorate %type_View 159 Offset 2912
+ OpMemberDecorate %type_View 160 Offset 2920
+ OpMemberDecorate %type_View 161 Offset 2924
+ OpMemberDecorate %type_View 162 Offset 2928
+ OpMemberDecorate %type_View 163 Offset 2940
+ OpMemberDecorate %type_View 164 Offset 2944
+ OpMemberDecorate %type_View 165 Offset 2956
+ OpMemberDecorate %type_View 166 Offset 2960
+ OpMemberDecorate %type_View 167 Offset 2968
+ OpMemberDecorate %type_View 168 Offset 2972
+ OpMemberDecorate %type_View 169 Offset 2976
+ OpMemberDecorate %type_View 170 Offset 2988
+ OpMemberDecorate %type_View 171 Offset 2992
+ OpMemberDecorate %type_View 172 Offset 3004
+ OpMemberDecorate %type_View 173 Offset 3008
+ OpMemberDecorate %type_View 174 Offset 3020
+ OpMemberDecorate %type_View 175 Offset 3024
+ OpMemberDecorate %type_View 176 Offset 3036
+ OpMemberDecorate %type_View 177 Offset 3040
+ OpMemberDecorate %type_View 178 Offset 3044
+ OpDecorate %type_View Block
+ OpMemberDecorate %type_PrimitiveDither 0 Offset 0
+ OpDecorate %type_PrimitiveDither Block
+ OpMemberDecorate %type_PrimitiveFade 0 Offset 0
+ OpDecorate %type_PrimitiveFade Block
+ OpDecorate %_arr_v4float_uint_9 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_3 ArrayStride 16
+ OpMemberDecorate %type_Material 0 Offset 0
+ OpMemberDecorate %type_Material 1 Offset 144
+ OpDecorate %type_Material Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+ %v2int = OpTypeVector %int 2
+%float_0_00100000005 = OpConstant %float 0.00100000005
+ %int_2 = OpConstant %int 2
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %float_0 = OpConstant %float 0
+ %49 = OpConstantComposite %v2float %float_0 %float_0
+ %float_1 = OpConstant %float 1
+ %int_4 = OpConstant %int 4
+ %int_11 = OpConstant %int 11
+%float_0_249500006 = OpConstant %float 0.249500006
+ %54 = OpConstantComposite %v2float %float_0_249500006 %float_0_249500006
+%float_0_499992371 = OpConstant %float 0.499992371
+ %56 = OpConstantComposite %v2float %float_0_499992371 %float_0_499992371
+ %int_32 = OpConstant %int 32
+ %int_53 = OpConstant %int 53
+ %int_57 = OpConstant %int 57
+ %int_80 = OpConstant %int 80
+ %int_82 = OpConstant %int 82
+ %int_98 = OpConstant %int 98
+ %uint_1 = OpConstant %uint 1
+%mat3v3float = OpTypeMatrix %v3float 3
+ %float_2 = OpConstant %float 2
+ %float_n1 = OpConstant %float -1
+ %67 = OpConstantComposite %v2float %float_n1 %float_n1
+ %bool = OpTypeBool
+ %float_n0_5 = OpConstant %float -0.5
+ %70 = OpConstantComposite %v3float %float_0 %float_0 %float_1
+%float_0_333299994 = OpConstant %float 0.333299994
+ %uint_5 = OpConstant %uint 5
+%float_347_834503 = OpConstant %float 347.834503
+%float_3343_28369 = OpConstant %float 3343.28369
+ %75 = OpConstantComposite %v2float %float_347_834503 %float_3343_28369
+ %float_1000 = OpConstant %float 1000
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_arr_v4float_uint_7 = OpTypeArray %v4float %uint_7
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+ %type_View = OpTypeStruct %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %v3float %float %v3float %float %v4float %v4float %v3float %float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %v4float %v4float %v2float %v2float %v4float %v4float %v4float %v4float %int %float %float %float %v4float %v4float %v4float %v2float %float %float %float %float %float %float %v3float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %float %float %float %float %float %v4float %v3float %float %_arr_v4float_uint_2 %_arr_v4float_uint_2 %v4float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %v3float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %float %float %v4float %uint %uint %uint %uint %v4float %v3float %float %v4float %float %float %float %float %v4float %_arr_v4float_uint_7 %float %float %float %float %uint %float %float %float %v3float %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %float %float %float %float %v2int %float %float %v3float %float %v3float %float %v2float %float %float %v3float %float %v3float %float %v3float %float %v3float %float %float %float
+%_ptr_Uniform_type_View = OpTypePointer Uniform %type_View
+%type_PrimitiveDither = OpTypeStruct %float
+%_ptr_Uniform_type_PrimitiveDither = OpTypePointer Uniform %type_PrimitiveDither
+%type_PrimitiveFade = OpTypeStruct %v2float
+%_ptr_Uniform_type_PrimitiveFade = OpTypePointer Uniform %type_PrimitiveFade
+ %uint_9 = OpConstant %uint 9
+%_arr_v4float_uint_9 = OpTypeArray %v4float %uint_9
+ %uint_3 = OpConstant %uint 3
+%_arr_v4float_uint_3 = OpTypeArray %v4float %uint_3
+%type_Material = OpTypeStruct %_arr_v4float_uint_9 %_arr_v4float_uint_3
+%_ptr_Uniform_type_Material = OpTypePointer Uniform %type_Material
+%type_2d_image = OpTypeImage %float 2D 2 0 0 1 Unknown
+%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image
+%type_sampler = OpTypeSampler
+%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_arr_v4float_uint_1 = OpTypeArray %v4float %uint_1
+%_ptr_Input__arr_v4float_uint_1 = OpTypePointer Input %_arr_v4float_uint_1
+%_ptr_Input_uint = OpTypePointer Input %uint
+%_ptr_Input_bool = OpTypePointer Input %bool
+%_ptr_Output_float = OpTypePointer Output %float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %93 = OpTypeFunction %void
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%type_sampled_image = OpTypeSampledImage %type_2d_image
+ %View = OpVariable %_ptr_Uniform_type_View Uniform
+%PrimitiveDither = OpVariable %_ptr_Uniform_type_PrimitiveDither Uniform
+%PrimitiveFade = OpVariable %_ptr_Uniform_type_PrimitiveFade Uniform
+ %Material = OpVariable %_ptr_Uniform_type_Material Uniform
+%Material_Texture2D_0 = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%Material_Texture2D_0Sampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%Material_Texture2D_3 = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%Material_Texture2D_3Sampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
+%in_var_TEXCOORD6 = OpVariable %_ptr_Input_v4float Input
+%in_var_TEXCOORD7 = OpVariable %_ptr_Input_v4float Input
+%in_var_TEXCOORD10_centroid = OpVariable %_ptr_Input_v4float Input
+%in_var_TEXCOORD11_centroid = OpVariable %_ptr_Input_v4float Input
+%in_var_TEXCOORD0 = OpVariable %_ptr_Input__arr_v4float_uint_1 Input
+%in_var_PRIMITIVE_ID = OpVariable %_ptr_Input_uint Input
+%gl_FrontFacing = OpVariable %_ptr_Input_bool Input
+%gl_FragDepth = OpVariable %_ptr_Output_float Output
+%out_var_SV_Target0 = OpVariable %_ptr_Output_v4float Output
+ %98 = OpUndef %float
+ %99 = OpConstantNull %v2float
+%float_0_015625 = OpConstant %float 0.015625
+ %101 = OpConstantComposite %v2float %float_0_015625 %float_0_015625
+%float_0_166666672 = OpConstant %float 0.166666672
+ %103 = OpUndef %float
+ %104 = OpConstantNull %v3float
+%MainPixelShader = OpFunction %void None %93
+ %105 = OpLabel
+ %106 = OpLoad %v4float %gl_FragCoord
+ %107 = OpLoad %v4float %in_var_TEXCOORD6
+ %108 = OpLoad %v4float %in_var_TEXCOORD7
+ %109 = OpLoad %v4float %in_var_TEXCOORD10_centroid
+ %110 = OpLoad %v4float %in_var_TEXCOORD11_centroid
+ %111 = OpLoad %_arr_v4float_uint_1 %in_var_TEXCOORD0
+ %112 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_4
+ %113 = OpLoad %mat4v4float %112
+ %114 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_11
+ %115 = OpLoad %mat4v4float %114
+ %116 = OpAccessChain %_ptr_Uniform_v3float %View %int_32
+ %117 = OpLoad %v3float %116
+ %118 = OpAccessChain %_ptr_Uniform_v4float %View %int_53
+ %119 = OpLoad %v4float %118
+ %120 = OpAccessChain %_ptr_Uniform_v4float %View %int_57
+ %121 = OpLoad %v4float %120
+ %122 = OpAccessChain %_ptr_Uniform_float %View %int_80
+ %123 = OpLoad %float %122
+ %124 = OpCompositeExtract %v4float %111 0
+ %125 = OpVectorShuffle %v2float %99 %124 2 3
+ %126 = OpVectorShuffle %v3float %109 %109 0 1 2
+ %127 = OpVectorShuffle %v3float %110 %110 0 1 2
+ %128 = OpExtInst %v3float %1 Cross %127 %126
+ %129 = OpCompositeExtract %float %110 3
+ %130 = OpCompositeConstruct %v3float %129 %129 %129
+ %131 = OpFMul %v3float %128 %130
+ %132 = OpCompositeConstruct %mat3v3float %126 %131 %127
+ %133 = OpVectorShuffle %v2float %106 %106 0 1
+ %134 = OpVectorShuffle %v2float %121 %121 0 1
+ %135 = OpFSub %v2float %133 %134
+ %136 = OpCompositeExtract %float %106 2
+ %137 = OpCompositeConstruct %v4float %103 %103 %136 %float_1
+ %138 = OpCompositeExtract %float %106 3
+ %139 = OpCompositeConstruct %v4float %138 %138 %138 %138
+ %140 = OpFMul %v4float %137 %139
+ %141 = OpCompositeExtract %float %106 0
+ %142 = OpCompositeExtract %float %106 1
+ %143 = OpCompositeConstruct %v4float %141 %142 %136 %float_1
+ %144 = OpMatrixTimesVector %v4float %115 %143
+ %145 = OpVectorShuffle %v3float %144 %144 0 1 2
+ %146 = OpCompositeExtract %float %144 3
+ %147 = OpCompositeConstruct %v3float %146 %146 %146
+ %148 = OpFDiv %v3float %145 %147
+ %149 = OpFSub %v3float %148 %117
+ %150 = OpFNegate %v3float %148
+ %151 = OpExtInst %v3float %1 Normalize %150
+ %152 = OpVectorTimesMatrix %v3float %151 %132
+ %153 = OpVectorShuffle %v2float %152 %152 0 1
+ %154 = OpFMul %v2float %153 %67
+ %155 = OpCompositeExtract %float %152 2
+ %156 = OpCompositeConstruct %v2float %155 %155
+ %157 = OpFDiv %v2float %154 %156
+ %158 = OpAccessChain %_ptr_Uniform_float %Material %int_1 %int_0 %int_0
+ %159 = OpLoad %float %158
+ %160 = OpCompositeConstruct %v2float %159 %159
+ %161 = OpFMul %v2float %160 %157
+ %162 = OpDot %float %151 %127
+ %163 = OpExtInst %float %1 FAbs %162
+ %164 = OpExtInst %float %1 FMax %163 %float_0
+ %165 = OpExtInst %float %1 FMin %164 %float_1
+ %166 = OpAccessChain %_ptr_Uniform_float %Material %int_1 %int_0 %int_1
+ %167 = OpLoad %float %166
+ %168 = OpAccessChain %_ptr_Uniform_float %Material %int_1 %int_0 %int_2
+ %169 = OpLoad %float %168
+ %170 = OpExtInst %float %1 FMix %167 %169 %165
+ %171 = OpExtInst %float %1 Floor %170
+ %172 = OpFDiv %float %float_1 %170
+ %173 = OpCompositeConstruct %v2float %172 %172
+ %174 = OpFMul %v2float %161 %173
+ %175 = OpDPdx %v2float %125
+ %176 = OpDPdy %v2float %125
+ %177 = OpLoad %type_2d_image %Material_Texture2D_0
+ %178 = OpLoad %type_sampler %Material_Texture2D_0Sampler
+ OpBranch %179
+ %179 = OpLabel
+ %180 = OpPhi %float %float_1 %105 %181 %182
+ %183 = OpPhi %v2float %49 %105 %184 %182
+ %185 = OpPhi %int %int_0 %105 %186 %182
+ %187 = OpPhi %float %float_1 %105 %188 %182
+ %189 = OpPhi %float %float_1 %105 %180 %182
+ %190 = OpConvertSToF %float %185
+ %191 = OpFAdd %float %171 %float_2
+ %192 = OpFOrdLessThan %bool %190 %191
+ OpLoopMerge %193 %182 None
+ OpBranchConditional %192 %194 %193
+ %194 = OpLabel
+ %195 = OpFAdd %v2float %125 %183
+ %196 = OpSampledImage %type_sampled_image %177 %178
+ %197 = OpImageSampleExplicitLod %v4float %196 %195 Grad %175 %176
+ %188 = OpCompositeExtract %float %197 1
+ %198 = OpFOrdLessThan %bool %180 %188
+ OpSelectionMerge %182 None
+ OpBranchConditional %198 %199 %182
+ %199 = OpLabel
+ %200 = OpFSub %float %189 %187
+ %201 = OpFSub %float %188 %180
+ %202 = OpFAdd %float %200 %201
+ %203 = OpFDiv %float %201 %202
+ %204 = OpFMul %float %189 %203
+ %205 = OpFSub %float %float_1 %203
+ %206 = OpFMul %float %180 %205
+ %207 = OpFAdd %float %204 %206
+ %208 = OpCompositeConstruct %v2float %203 %203
+ %209 = OpFMul %v2float %208 %174
+ %210 = OpFSub %v2float %183 %209
+ OpBranch %193
+ %182 = OpLabel
+ %181 = OpFSub %float %180 %172
+ %184 = OpFAdd %v2float %183 %174
+ %186 = OpIAdd %int %185 %int_1
+ OpBranch %179
+ %193 = OpLabel
+ %211 = OpPhi %float %98 %179 %207 %199
+ %212 = OpPhi %v2float %183 %179 %210 %199
+ %213 = OpVectorShuffle %v2float %212 %104 0 1
+ %214 = OpFAdd %v2float %125 %213
+ %215 = OpAccessChain %_ptr_Uniform_float %View %int_82
+ %216 = OpLoad %float %215
+ %217 = OpSampledImage %type_sampled_image %177 %178
+ %218 = OpImageSampleImplicitLod %v4float %217 %214 Bias %216
+ %219 = OpCompositeExtract %float %218 0
+ %220 = OpAccessChain %_ptr_Uniform_float %Material %int_1 %int_2 %int_1
+ %221 = OpLoad %float %220
+ %222 = OpFMul %float %219 %221
+ %223 = OpFSub %float %float_1 %222
+ %224 = OpExtInst %float %1 FMax %223 %float_0
+ %225 = OpExtInst %float %1 FMin %224 %float_1
+ %226 = OpAccessChain %_ptr_Uniform_float %View %int_98 %int_0
+ %227 = OpLoad %float %226
+ %228 = OpCompositeConstruct %v2float %227 %227
+ %229 = OpFAdd %v2float %135 %228
+ %230 = OpCompositeExtract %float %229 0
+ %231 = OpConvertFToU %uint %230
+ %232 = OpCompositeExtract %float %229 1
+ %233 = OpConvertFToU %uint %232
+ %234 = OpIMul %uint %uint_2 %233
+ %235 = OpIAdd %uint %231 %234
+ %236 = OpUMod %uint %235 %uint_5
+ %237 = OpConvertUToF %float %236
+ %238 = OpFMul %v2float %135 %101
+ %239 = OpLoad %type_2d_image %Material_Texture2D_3
+ %240 = OpLoad %type_sampler %Material_Texture2D_3Sampler
+ %241 = OpSampledImage %type_sampled_image %239 %240
+ %242 = OpImageSampleImplicitLod %v4float %241 %238 Bias %216
+ %243 = OpCompositeExtract %float %242 0
+ %244 = OpAccessChain %_ptr_Uniform_float %Material %int_1 %int_2 %int_2
+ %245 = OpLoad %float %244
+ %246 = OpFMul %float %243 %245
+ %247 = OpFAdd %float %237 %246
+ %248 = OpFMul %float %247 %float_0_166666672
+ %249 = OpFAdd %float %225 %248
+ %250 = OpFAdd %float %249 %float_n0_5
+ %251 = OpCompositeExtract %float %218 2
+ %252 = OpFAdd %float %251 %250
+ %253 = OpSampledImage %type_sampled_image %239 %240
+ %254 = OpImageSampleImplicitLod %v4float %253 %238 Bias %216
+ %255 = OpCompositeExtract %float %254 0
+ %256 = OpFAdd %float %237 %255
+ %257 = OpFMul %float %256 %float_0_166666672
+ %258 = OpAccessChain %_ptr_Uniform_float %PrimitiveFade %int_0 %int_0
+ %259 = OpLoad %float %258
+ %260 = OpFMul %float %123 %259
+ %261 = OpAccessChain %_ptr_Uniform_float %PrimitiveFade %int_0 %int_1
+ %262 = OpLoad %float %261
+ %263 = OpFAdd %float %260 %262
+ %264 = OpExtInst %float %1 FClamp %263 %float_0 %float_1
+ %265 = OpFAdd %float %264 %257
+ %266 = OpFAdd %float %265 %float_n0_5
+ %267 = OpFMul %float %252 %266
+ %268 = OpFSub %float %float_1 %211
+ %269 = OpFMul %float %268 %159
+ %270 = OpCompositeExtract %float %212 0
+ %271 = OpCompositeExtract %float %212 1
+ %272 = OpCompositeConstruct %v3float %270 %271 %269
+ %273 = OpDot %float %272 %272
+ %274 = OpExtInst %float %1 Sqrt %273
+ %275 = OpDPdx %v2float %125
+ %276 = OpExtInst %v2float %1 FAbs %275
+ %277 = OpDot %float %276 %276
+ %278 = OpExtInst %float %1 Sqrt %277
+ %279 = OpDPdx %v3float %149
+ %280 = OpDot %float %279 %279
+ %281 = OpExtInst %float %1 Sqrt %280
+ %282 = OpFDiv %float %278 %281
+ %283 = OpDPdy %v2float %125
+ %284 = OpExtInst %v2float %1 FAbs %283
+ %285 = OpDot %float %284 %284
+ %286 = OpExtInst %float %1 Sqrt %285
+ %287 = OpDPdy %v3float %149
+ %288 = OpDot %float %287 %287
+ %289 = OpExtInst %float %1 Sqrt %288
+ %290 = OpFDiv %float %286 %289
+ %291 = OpExtInst %float %1 FMax %282 %290
+ %292 = OpCompositeExtract %v4float %113 0
+ %293 = OpVectorShuffle %v3float %292 %292 0 1 2
+ %294 = OpCompositeExtract %v4float %113 1
+ %295 = OpVectorShuffle %v3float %294 %294 0 1 2
+ %296 = OpCompositeExtract %v4float %113 2
+ %297 = OpVectorShuffle %v3float %296 %296 0 1 2
+ %298 = OpCompositeConstruct %mat3v3float %293 %295 %297
+ %299 = OpMatrixTimesVector %v3float %298 %70
+ %300 = OpDot %float %299 %151
+ %301 = OpExtInst %float %1 FAbs %300
+ %302 = OpFDiv %float %291 %301
+ %303 = OpFDiv %float %274 %302
+ %304 = OpAccessChain %_ptr_Uniform_float %PrimitiveDither %int_0
+ %305 = OpLoad %float %304
+ %306 = OpFOrdNotEqual %bool %305 %float_0
+ OpSelectionMerge %307 None
+ OpBranchConditional %306 %308 %307
+ %308 = OpLabel
+ %309 = OpExtInst %float %1 FAbs %305
+ %310 = OpFOrdGreaterThan %bool %309 %float_0_00100000005
+ OpSelectionMerge %311 None
+ OpBranchConditional %310 %312 %311
+ %312 = OpLabel
+ %313 = OpExtInst %v2float %1 Floor %133
+ %314 = OpDot %float %313 %75
+ %315 = OpExtInst %float %1 Cos %314
+ %316 = OpFMul %float %315 %float_1000
+ %317 = OpExtInst %float %1 Fract %316
+ %318 = OpFOrdLessThan %bool %305 %float_0
+ %319 = OpFAdd %float %305 %float_1
+ %320 = OpFOrdGreaterThan %bool %319 %317
+ %321 = OpFOrdLessThan %bool %305 %317
+ %322 = OpSelect %bool %318 %320 %321
+ %323 = OpSelect %float %322 %float_1 %float_0
+ %324 = OpFSub %float %323 %float_0_00100000005
+ %325 = OpFOrdLessThan %bool %324 %float_0
+ OpSelectionMerge %326 None
+ OpBranchConditional %325 %327 %326
+ %327 = OpLabel
+ OpKill
+ %326 = OpLabel
+ OpBranch %311
+ %311 = OpLabel
+ OpBranch %307
+ %307 = OpLabel
+ %328 = OpFSub %float %267 %float_0_333299994
+ %329 = OpFOrdLessThan %bool %328 %float_0
+ OpSelectionMerge %330 None
+ OpBranchConditional %329 %331 %330
+ %331 = OpLabel
+ OpKill
+ %330 = OpLabel
+ %332 = OpCompositeExtract %float %140 2
+ %333 = OpCompositeExtract %float %140 3
+ %334 = OpFAdd %float %333 %303
+ %335 = OpFDiv %float %332 %334
+ %336 = OpExtInst %float %1 FMin %335 %136
+ %337 = OpVectorShuffle %v2float %107 %107 0 1
+ %338 = OpCompositeExtract %float %107 3
+ %339 = OpCompositeConstruct %v2float %338 %338
+ %340 = OpFDiv %v2float %337 %339
+ %341 = OpVectorShuffle %v2float %119 %119 0 1
+ %342 = OpFSub %v2float %340 %341
+ %343 = OpVectorShuffle %v2float %108 %108 0 1
+ %344 = OpCompositeExtract %float %108 3
+ %345 = OpCompositeConstruct %v2float %344 %344
+ %346 = OpFDiv %v2float %343 %345
+ %347 = OpVectorShuffle %v2float %119 %119 2 3
+ %348 = OpFSub %v2float %346 %347
+ %349 = OpFSub %v2float %342 %348
+ %350 = OpFMul %v2float %349 %54
+ %351 = OpFAdd %v2float %350 %56
+ %352 = OpVectorShuffle %v4float %351 %49 0 1 2 3
+ OpStore %gl_FragDepth %336
+ OpStore %out_var_SV_Target0 %352
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag
new file mode 100644
index 00000000000..097eb6354d5
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag
@@ -0,0 +1,1230 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 271
+; Schema: 0
+ OpCapability Shader
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %MainPS "main" %in_var_TEXCOORD10_centroid %in_var_TEXCOORD11_centroid %in_var_PRIMITIVE_ID %in_var_TEXCOORD7 %gl_FragCoord %gl_FrontFacing %gl_SampleMask %out_var_SV_Target0 %gl_SampleMask_0
+ OpExecutionMode %MainPS OriginUpperLeft
+ OpSource HLSL 600
+ OpName %type_View "type.View"
+ OpMemberName %type_View 0 "View_TranslatedWorldToClip"
+ OpMemberName %type_View 1 "View_WorldToClip"
+ OpMemberName %type_View 2 "View_TranslatedWorldToView"
+ OpMemberName %type_View 3 "View_ViewToTranslatedWorld"
+ OpMemberName %type_View 4 "View_TranslatedWorldToCameraView"
+ OpMemberName %type_View 5 "View_CameraViewToTranslatedWorld"
+ OpMemberName %type_View 6 "View_ViewToClip"
+ OpMemberName %type_View 7 "View_ViewToClipNoAA"
+ OpMemberName %type_View 8 "View_ClipToView"
+ OpMemberName %type_View 9 "View_ClipToTranslatedWorld"
+ OpMemberName %type_View 10 "View_SVPositionToTranslatedWorld"
+ OpMemberName %type_View 11 "View_ScreenToWorld"
+ OpMemberName %type_View 12 "View_ScreenToTranslatedWorld"
+ OpMemberName %type_View 13 "View_ViewForward"
+ OpMemberName %type_View 14 "PrePadding_View_844"
+ OpMemberName %type_View 15 "View_ViewUp"
+ OpMemberName %type_View 16 "PrePadding_View_860"
+ OpMemberName %type_View 17 "View_ViewRight"
+ OpMemberName %type_View 18 "PrePadding_View_876"
+ OpMemberName %type_View 19 "View_HMDViewNoRollUp"
+ OpMemberName %type_View 20 "PrePadding_View_892"
+ OpMemberName %type_View 21 "View_HMDViewNoRollRight"
+ OpMemberName %type_View 22 "PrePadding_View_908"
+ OpMemberName %type_View 23 "View_InvDeviceZToWorldZTransform"
+ OpMemberName %type_View 24 "View_ScreenPositionScaleBias"
+ OpMemberName %type_View 25 "View_WorldCameraOrigin"
+ OpMemberName %type_View 26 "PrePadding_View_956"
+ OpMemberName %type_View 27 "View_TranslatedWorldCameraOrigin"
+ OpMemberName %type_View 28 "PrePadding_View_972"
+ OpMemberName %type_View 29 "View_WorldViewOrigin"
+ OpMemberName %type_View 30 "PrePadding_View_988"
+ OpMemberName %type_View 31 "View_PreViewTranslation"
+ OpMemberName %type_View 32 "PrePadding_View_1004"
+ OpMemberName %type_View 33 "View_PrevProjection"
+ OpMemberName %type_View 34 "View_PrevViewProj"
+ OpMemberName %type_View 35 "View_PrevViewRotationProj"
+ OpMemberName %type_View 36 "View_PrevViewToClip"
+ OpMemberName %type_View 37 "View_PrevClipToView"
+ OpMemberName %type_View 38 "View_PrevTranslatedWorldToClip"
+ OpMemberName %type_View 39 "View_PrevTranslatedWorldToView"
+ OpMemberName %type_View 40 "View_PrevViewToTranslatedWorld"
+ OpMemberName %type_View 41 "View_PrevTranslatedWorldToCameraView"
+ OpMemberName %type_View 42 "View_PrevCameraViewToTranslatedWorld"
+ OpMemberName %type_View 43 "View_PrevWorldCameraOrigin"
+ OpMemberName %type_View 44 "PrePadding_View_1660"
+ OpMemberName %type_View 45 "View_PrevWorldViewOrigin"
+ OpMemberName %type_View 46 "PrePadding_View_1676"
+ OpMemberName %type_View 47 "View_PrevPreViewTranslation"
+ OpMemberName %type_View 48 "PrePadding_View_1692"
+ OpMemberName %type_View 49 "View_PrevInvViewProj"
+ OpMemberName %type_View 50 "View_PrevScreenToTranslatedWorld"
+ OpMemberName %type_View 51 "View_ClipToPrevClip"
+ OpMemberName %type_View 52 "View_TemporalAAJitter"
+ OpMemberName %type_View 53 "View_GlobalClippingPlane"
+ OpMemberName %type_View 54 "View_FieldOfViewWideAngles"
+ OpMemberName %type_View 55 "View_PrevFieldOfViewWideAngles"
+ OpMemberName %type_View 56 "View_ViewRectMin"
+ OpMemberName %type_View 57 "View_ViewSizeAndInvSize"
+ OpMemberName %type_View 58 "View_BufferSizeAndInvSize"
+ OpMemberName %type_View 59 "View_BufferBilinearUVMinMax"
+ OpMemberName %type_View 60 "View_NumSceneColorMSAASamples"
+ OpMemberName %type_View 61 "View_PreExposure"
+ OpMemberName %type_View 62 "View_OneOverPreExposure"
+ OpMemberName %type_View 63 "PrePadding_View_2012"
+ OpMemberName %type_View 64 "View_DiffuseOverrideParameter"
+ OpMemberName %type_View 65 "View_SpecularOverrideParameter"
+ OpMemberName %type_View 66 "View_NormalOverrideParameter"
+ OpMemberName %type_View 67 "View_RoughnessOverrideParameter"
+ OpMemberName %type_View 68 "View_PrevFrameGameTime"
+ OpMemberName %type_View 69 "View_PrevFrameRealTime"
+ OpMemberName %type_View 70 "View_OutOfBoundsMask"
+ OpMemberName %type_View 71 "PrePadding_View_2084"
+ OpMemberName %type_View 72 "PrePadding_View_2088"
+ OpMemberName %type_View 73 "PrePadding_View_2092"
+ OpMemberName %type_View 74 "View_WorldCameraMovementSinceLastFrame"
+ OpMemberName %type_View 75 "View_CullingSign"
+ OpMemberName %type_View 76 "View_NearPlane"
+ OpMemberName %type_View 77 "View_AdaptiveTessellationFactor"
+ OpMemberName %type_View 78 "View_GameTime"
+ OpMemberName %type_View 79 "View_RealTime"
+ OpMemberName %type_View 80 "View_DeltaTime"
+ OpMemberName %type_View 81 "View_MaterialTextureMipBias"
+ OpMemberName %type_View 82 "View_MaterialTextureDerivativeMultiply"
+ OpMemberName %type_View 83 "View_Random"
+ OpMemberName %type_View 84 "View_FrameNumber"
+ OpMemberName %type_View 85 "View_StateFrameIndexMod8"
+ OpMemberName %type_View 86 "View_StateFrameIndex"
+ OpMemberName %type_View 87 "View_CameraCut"
+ OpMemberName %type_View 88 "View_UnlitViewmodeMask"
+ OpMemberName %type_View 89 "PrePadding_View_2164"
+ OpMemberName %type_View 90 "PrePadding_View_2168"
+ OpMemberName %type_View 91 "PrePadding_View_2172"
+ OpMemberName %type_View 92 "View_DirectionalLightColor"
+ OpMemberName %type_View 93 "View_DirectionalLightDirection"
+ OpMemberName %type_View 94 "PrePadding_View_2204"
+ OpMemberName %type_View 95 "View_TranslucencyLightingVolumeMin"
+ OpMemberName %type_View 96 "View_TranslucencyLightingVolumeInvSize"
+ OpMemberName %type_View 97 "View_TemporalAAParams"
+ OpMemberName %type_View 98 "View_CircleDOFParams"
+ OpMemberName %type_View 99 "View_DepthOfFieldSensorWidth"
+ OpMemberName %type_View 100 "View_DepthOfFieldFocalDistance"
+ OpMemberName %type_View 101 "View_DepthOfFieldScale"
+ OpMemberName %type_View 102 "View_DepthOfFieldFocalLength"
+ OpMemberName %type_View 103 "View_DepthOfFieldFocalRegion"
+ OpMemberName %type_View 104 "View_DepthOfFieldNearTransitionRegion"
+ OpMemberName %type_View 105 "View_DepthOfFieldFarTransitionRegion"
+ OpMemberName %type_View 106 "View_MotionBlurNormalizedToPixel"
+ OpMemberName %type_View 107 "View_bSubsurfacePostprocessEnabled"
+ OpMemberName %type_View 108 "View_GeneralPurposeTweak"
+ OpMemberName %type_View 109 "View_DemosaicVposOffset"
+ OpMemberName %type_View 110 "PrePadding_View_2348"
+ OpMemberName %type_View 111 "View_IndirectLightingColorScale"
+ OpMemberName %type_View 112 "View_HDR32bppEncodingMode"
+ OpMemberName %type_View 113 "View_AtmosphericFogSunDirection"
+ OpMemberName %type_View 114 "View_AtmosphericFogSunPower"
+ OpMemberName %type_View 115 "View_AtmosphericFogPower"
+ OpMemberName %type_View 116 "View_AtmosphericFogDensityScale"
+ OpMemberName %type_View 117 "View_AtmosphericFogDensityOffset"
+ OpMemberName %type_View 118 "View_AtmosphericFogGroundOffset"
+ OpMemberName %type_View 119 "View_AtmosphericFogDistanceScale"
+ OpMemberName %type_View 120 "View_AtmosphericFogAltitudeScale"
+ OpMemberName %type_View 121 "View_AtmosphericFogHeightScaleRayleigh"
+ OpMemberName %type_View 122 "View_AtmosphericFogStartDistance"
+ OpMemberName %type_View 123 "View_AtmosphericFogDistanceOffset"
+ OpMemberName %type_View 124 "View_AtmosphericFogSunDiscScale"
+ OpMemberName %type_View 125 "View_AtmosphericFogRenderMask"
+ OpMemberName %type_View 126 "View_AtmosphericFogInscatterAltitudeSampleNum"
+ OpMemberName %type_View 127 "View_AtmosphericFogSunColor"
+ OpMemberName %type_View 128 "View_NormalCurvatureToRoughnessScaleBias"
+ OpMemberName %type_View 129 "View_RenderingReflectionCaptureMask"
+ OpMemberName %type_View 130 "View_AmbientCubemapTint"
+ OpMemberName %type_View 131 "View_AmbientCubemapIntensity"
+ OpMemberName %type_View 132 "View_SkyLightParameters"
+ OpMemberName %type_View 133 "PrePadding_View_2488"
+ OpMemberName %type_View 134 "PrePadding_View_2492"
+ OpMemberName %type_View 135 "View_SkyLightColor"
+ OpMemberName %type_View 136 "View_SkyIrradianceEnvironmentMap"
+ OpMemberName %type_View 137 "View_MobilePreviewMode"
+ OpMemberName %type_View 138 "View_HMDEyePaddingOffset"
+ OpMemberName %type_View 139 "View_ReflectionCubemapMaxMip"
+ OpMemberName %type_View 140 "View_ShowDecalsMask"
+ OpMemberName %type_View 141 "View_DistanceFieldAOSpecularOcclusionMode"
+ OpMemberName %type_View 142 "View_IndirectCapsuleSelfShadowingIntensity"
+ OpMemberName %type_View 143 "PrePadding_View_2648"
+ OpMemberName %type_View 144 "PrePadding_View_2652"
+ OpMemberName %type_View 145 "View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight"
+ OpMemberName %type_View 146 "View_StereoPassIndex"
+ OpMemberName %type_View 147 "View_GlobalVolumeCenterAndExtent"
+ OpMemberName %type_View 148 "View_GlobalVolumeWorldToUVAddAndMul"
+ OpMemberName %type_View 149 "View_GlobalVolumeDimension"
+ OpMemberName %type_View 150 "View_GlobalVolumeTexelSize"
+ OpMemberName %type_View 151 "View_MaxGlobalDistance"
+ OpMemberName %type_View 152 "View_bCheckerboardSubsurfaceProfileRendering"
+ OpMemberName %type_View 153 "View_VolumetricFogInvGridSize"
+ OpMemberName %type_View 154 "PrePadding_View_2828"
+ OpMemberName %type_View 155 "View_VolumetricFogGridZParams"
+ OpMemberName %type_View 156 "PrePadding_View_2844"
+ OpMemberName %type_View 157 "View_VolumetricFogSVPosToVolumeUV"
+ OpMemberName %type_View 158 "View_VolumetricFogMaxDistance"
+ OpMemberName %type_View 159 "PrePadding_View_2860"
+ OpMemberName %type_View 160 "View_VolumetricLightmapWorldToUVScale"
+ OpMemberName %type_View 161 "PrePadding_View_2876"
+ OpMemberName %type_View 162 "View_VolumetricLightmapWorldToUVAdd"
+ OpMemberName %type_View 163 "PrePadding_View_2892"
+ OpMemberName %type_View 164 "View_VolumetricLightmapIndirectionTextureSize"
+ OpMemberName %type_View 165 "View_VolumetricLightmapBrickSize"
+ OpMemberName %type_View 166 "View_VolumetricLightmapBrickTexelSize"
+ OpMemberName %type_View 167 "View_StereoIPD"
+ OpMemberName %type_View 168 "View_IndirectLightingCacheShowFlag"
+ OpMemberName %type_View 169 "View_EyeToPixelSpreadAngle"
+ OpName %View "View"
+ OpName %type_3d_image "type.3d.image"
+ OpName %type_sampler "type.sampler"
+ OpName %View_SharedBilinearClampedSampler "View_SharedBilinearClampedSampler"
+ OpName %type_StructuredBuffer_v4float "type.StructuredBuffer.v4float"
+ OpName %View_PrimitiveSceneData "View_PrimitiveSceneData"
+ OpName %type_TranslucentBasePass "type.TranslucentBasePass"
+ OpMemberName %type_TranslucentBasePass 0 "TranslucentBasePass_Shared_Forward_NumLocalLights"
+ OpMemberName %type_TranslucentBasePass 1 "TranslucentBasePass_Shared_Forward_NumReflectionCaptures"
+ OpMemberName %type_TranslucentBasePass 2 "TranslucentBasePass_Shared_Forward_HasDirectionalLight"
+ OpMemberName %type_TranslucentBasePass 3 "TranslucentBasePass_Shared_Forward_NumGridCells"
+ OpMemberName %type_TranslucentBasePass 4 "TranslucentBasePass_Shared_Forward_CulledGridSize"
+ OpMemberName %type_TranslucentBasePass 5 "TranslucentBasePass_Shared_Forward_MaxCulledLightsPerCell"
+ OpMemberName %type_TranslucentBasePass 6 "TranslucentBasePass_Shared_Forward_LightGridPixelSizeShift"
+ OpMemberName %type_TranslucentBasePass 7 "PrePadding_TranslucentBasePass_Shared_Forward_36"
+ OpMemberName %type_TranslucentBasePass 8 "PrePadding_TranslucentBasePass_Shared_Forward_40"
+ OpMemberName %type_TranslucentBasePass 9 "PrePadding_TranslucentBasePass_Shared_Forward_44"
+ OpMemberName %type_TranslucentBasePass 10 "TranslucentBasePass_Shared_Forward_LightGridZParams"
+ OpMemberName %type_TranslucentBasePass 11 "PrePadding_TranslucentBasePass_Shared_Forward_60"
+ OpMemberName %type_TranslucentBasePass 12 "TranslucentBasePass_Shared_Forward_DirectionalLightDirection"
+ OpMemberName %type_TranslucentBasePass 13 "PrePadding_TranslucentBasePass_Shared_Forward_76"
+ OpMemberName %type_TranslucentBasePass 14 "TranslucentBasePass_Shared_Forward_DirectionalLightColor"
+ OpMemberName %type_TranslucentBasePass 15 "TranslucentBasePass_Shared_Forward_DirectionalLightVolumetricScatteringIntensity"
+ OpMemberName %type_TranslucentBasePass 16 "TranslucentBasePass_Shared_Forward_DirectionalLightShadowMapChannelMask"
+ OpMemberName %type_TranslucentBasePass 17 "PrePadding_TranslucentBasePass_Shared_Forward_100"
+ OpMemberName %type_TranslucentBasePass 18 "TranslucentBasePass_Shared_Forward_DirectionalLightDistanceFadeMAD"
+ OpMemberName %type_TranslucentBasePass 19 "TranslucentBasePass_Shared_Forward_NumDirectionalLightCascades"
+ OpMemberName %type_TranslucentBasePass 20 "PrePadding_TranslucentBasePass_Shared_Forward_116"
+ OpMemberName %type_TranslucentBasePass 21 "PrePadding_TranslucentBasePass_Shared_Forward_120"
+ OpMemberName %type_TranslucentBasePass 22 "PrePadding_TranslucentBasePass_Shared_Forward_124"
+ OpMemberName %type_TranslucentBasePass 23 "TranslucentBasePass_Shared_Forward_CascadeEndDepths"
+ OpMemberName %type_TranslucentBasePass 24 "TranslucentBasePass_Shared_Forward_DirectionalLightWorldToShadowMatrix"
+ OpMemberName %type_TranslucentBasePass 25 "TranslucentBasePass_Shared_Forward_DirectionalLightShadowmapMinMax"
+ OpMemberName %type_TranslucentBasePass 26 "TranslucentBasePass_Shared_Forward_DirectionalLightShadowmapAtlasBufferSize"
+ OpMemberName %type_TranslucentBasePass 27 "TranslucentBasePass_Shared_Forward_DirectionalLightDepthBias"
+ OpMemberName %type_TranslucentBasePass 28 "TranslucentBasePass_Shared_Forward_DirectionalLightUseStaticShadowing"
+ OpMemberName %type_TranslucentBasePass 29 "PrePadding_TranslucentBasePass_Shared_Forward_488"
+ OpMemberName %type_TranslucentBasePass 30 "PrePadding_TranslucentBasePass_Shared_Forward_492"
+ OpMemberName %type_TranslucentBasePass 31 "TranslucentBasePass_Shared_Forward_DirectionalLightStaticShadowBufferSize"
+ OpMemberName %type_TranslucentBasePass 32 "TranslucentBasePass_Shared_Forward_DirectionalLightWorldToStaticShadow"
+ OpMemberName %type_TranslucentBasePass 33 "PrePadding_TranslucentBasePass_Shared_ForwardISR_576"
+ OpMemberName %type_TranslucentBasePass 34 "PrePadding_TranslucentBasePass_Shared_ForwardISR_580"
+ OpMemberName %type_TranslucentBasePass 35 "PrePadding_TranslucentBasePass_Shared_ForwardISR_584"
+ OpMemberName %type_TranslucentBasePass 36 "PrePadding_TranslucentBasePass_Shared_ForwardISR_588"
+ OpMemberName %type_TranslucentBasePass 37 "PrePadding_TranslucentBasePass_Shared_ForwardISR_592"
+ OpMemberName %type_TranslucentBasePass 38 "PrePadding_TranslucentBasePass_Shared_ForwardISR_596"
+ OpMemberName %type_TranslucentBasePass 39 "PrePadding_TranslucentBasePass_Shared_ForwardISR_600"
+ OpMemberName %type_TranslucentBasePass 40 "PrePadding_TranslucentBasePass_Shared_ForwardISR_604"
+ OpMemberName %type_TranslucentBasePass 41 "PrePadding_TranslucentBasePass_Shared_ForwardISR_608"
+ OpMemberName %type_TranslucentBasePass 42 "PrePadding_TranslucentBasePass_Shared_ForwardISR_612"
+ OpMemberName %type_TranslucentBasePass 43 "PrePadding_TranslucentBasePass_Shared_ForwardISR_616"
+ OpMemberName %type_TranslucentBasePass 44 "PrePadding_TranslucentBasePass_Shared_ForwardISR_620"
+ OpMemberName %type_TranslucentBasePass 45 "PrePadding_TranslucentBasePass_Shared_ForwardISR_624"
+ OpMemberName %type_TranslucentBasePass 46 "PrePadding_TranslucentBasePass_Shared_ForwardISR_628"
+ OpMemberName %type_TranslucentBasePass 47 "PrePadding_TranslucentBasePass_Shared_ForwardISR_632"
+ OpMemberName %type_TranslucentBasePass 48 "PrePadding_TranslucentBasePass_Shared_ForwardISR_636"
+ OpMemberName %type_TranslucentBasePass 49 "TranslucentBasePass_Shared_ForwardISR_NumLocalLights"
+ OpMemberName %type_TranslucentBasePass 50 "TranslucentBasePass_Shared_ForwardISR_NumReflectionCaptures"
+ OpMemberName %type_TranslucentBasePass 51 "TranslucentBasePass_Shared_ForwardISR_HasDirectionalLight"
+ OpMemberName %type_TranslucentBasePass 52 "TranslucentBasePass_Shared_ForwardISR_NumGridCells"
+ OpMemberName %type_TranslucentBasePass 53 "TranslucentBasePass_Shared_ForwardISR_CulledGridSize"
+ OpMemberName %type_TranslucentBasePass 54 "TranslucentBasePass_Shared_ForwardISR_MaxCulledLightsPerCell"
+ OpMemberName %type_TranslucentBasePass 55 "TranslucentBasePass_Shared_ForwardISR_LightGridPixelSizeShift"
+ OpMemberName %type_TranslucentBasePass 56 "PrePadding_TranslucentBasePass_Shared_ForwardISR_676"
+ OpMemberName %type_TranslucentBasePass 57 "PrePadding_TranslucentBasePass_Shared_ForwardISR_680"
+ OpMemberName %type_TranslucentBasePass 58 "PrePadding_TranslucentBasePass_Shared_ForwardISR_684"
+ OpMemberName %type_TranslucentBasePass 59 "TranslucentBasePass_Shared_ForwardISR_LightGridZParams"
+ OpMemberName %type_TranslucentBasePass 60 "PrePadding_TranslucentBasePass_Shared_ForwardISR_700"
+ OpMemberName %type_TranslucentBasePass 61 "TranslucentBasePass_Shared_ForwardISR_DirectionalLightDirection"
+ OpMemberName %type_TranslucentBasePass 62 "PrePadding_TranslucentBasePass_Shared_ForwardISR_716"
+ OpMemberName %type_TranslucentBasePass 63 "TranslucentBasePass_Shared_ForwardISR_DirectionalLightColor"
+ OpMemberName %type_TranslucentBasePass 64 "TranslucentBasePass_Shared_ForwardISR_DirectionalLightVolumetricScatteringIntensity"
+ OpMemberName %type_TranslucentBasePass 65 "TranslucentBasePass_Shared_ForwardISR_DirectionalLightShadowMapChannelMask"
+ OpMemberName %type_TranslucentBasePass 66 "PrePadding_TranslucentBasePass_Shared_ForwardISR_740"
+ OpMemberName %type_TranslucentBasePass 67 "TranslucentBasePass_Shared_ForwardISR_DirectionalLightDistanceFadeMAD"
+ OpMemberName %type_TranslucentBasePass 68 "TranslucentBasePass_Shared_ForwardISR_NumDirectionalLightCascades"
+ OpMemberName %type_TranslucentBasePass 69 "PrePadding_TranslucentBasePass_Shared_ForwardISR_756"
+ OpMemberName %type_TranslucentBasePass 70 "PrePadding_TranslucentBasePass_Shared_ForwardISR_760"
+ OpMemberName %type_TranslucentBasePass 71 "PrePadding_TranslucentBasePass_Shared_ForwardISR_764"
+ OpMemberName %type_TranslucentBasePass 72 "TranslucentBasePass_Shared_ForwardISR_CascadeEndDepths"
+ OpMemberName %type_TranslucentBasePass 73 "TranslucentBasePass_Shared_ForwardISR_DirectionalLightWorldToShadowMatrix"
+ OpMemberName %type_TranslucentBasePass 74 "TranslucentBasePass_Shared_ForwardISR_DirectionalLightShadowmapMinMax"
+ OpMemberName %type_TranslucentBasePass 75 "TranslucentBasePass_Shared_ForwardISR_DirectionalLightShadowmapAtlasBufferSize"
+ OpMemberName %type_TranslucentBasePass 76 "TranslucentBasePass_Shared_ForwardISR_DirectionalLightDepthBias"
+ OpMemberName %type_TranslucentBasePass 77 "TranslucentBasePass_Shared_ForwardISR_DirectionalLightUseStaticShadowing"
+ OpMemberName %type_TranslucentBasePass 78 "PrePadding_TranslucentBasePass_Shared_ForwardISR_1128"
+ OpMemberName %type_TranslucentBasePass 79 "PrePadding_TranslucentBasePass_Shared_ForwardISR_1132"
+ OpMemberName %type_TranslucentBasePass 80 "TranslucentBasePass_Shared_ForwardISR_DirectionalLightStaticShadowBufferSize"
+ OpMemberName %type_TranslucentBasePass 81 "TranslucentBasePass_Shared_ForwardISR_DirectionalLightWorldToStaticShadow"
+ OpMemberName %type_TranslucentBasePass 82 "PrePadding_TranslucentBasePass_Shared_Reflection_1216"
+ OpMemberName %type_TranslucentBasePass 83 "PrePadding_TranslucentBasePass_Shared_Reflection_1220"
+ OpMemberName %type_TranslucentBasePass 84 "PrePadding_TranslucentBasePass_Shared_Reflection_1224"
+ OpMemberName %type_TranslucentBasePass 85 "PrePadding_TranslucentBasePass_Shared_Reflection_1228"
+ OpMemberName %type_TranslucentBasePass 86 "PrePadding_TranslucentBasePass_Shared_Reflection_1232"
+ OpMemberName %type_TranslucentBasePass 87 "PrePadding_TranslucentBasePass_Shared_Reflection_1236"
+ OpMemberName %type_TranslucentBasePass 88 "PrePadding_TranslucentBasePass_Shared_Reflection_1240"
+ OpMemberName %type_TranslucentBasePass 89 "PrePadding_TranslucentBasePass_Shared_Reflection_1244"
+ OpMemberName %type_TranslucentBasePass 90 "PrePadding_TranslucentBasePass_Shared_Reflection_1248"
+ OpMemberName %type_TranslucentBasePass 91 "PrePadding_TranslucentBasePass_Shared_Reflection_1252"
+ OpMemberName %type_TranslucentBasePass 92 "PrePadding_TranslucentBasePass_Shared_Reflection_1256"
+ OpMemberName %type_TranslucentBasePass 93 "PrePadding_TranslucentBasePass_Shared_Reflection_1260"
+ OpMemberName %type_TranslucentBasePass 94 "PrePadding_TranslucentBasePass_Shared_Reflection_1264"
+ OpMemberName %type_TranslucentBasePass 95 "PrePadding_TranslucentBasePass_Shared_Reflection_1268"
+ OpMemberName %type_TranslucentBasePass 96 "PrePadding_TranslucentBasePass_Shared_Reflection_1272"
+ OpMemberName %type_TranslucentBasePass 97 "PrePadding_TranslucentBasePass_Shared_Reflection_1276"
+ OpMemberName %type_TranslucentBasePass 98 "TranslucentBasePass_Shared_Reflection_SkyLightParameters"
+ OpMemberName %type_TranslucentBasePass 99 "TranslucentBasePass_Shared_Reflection_SkyLightCubemapBrightness"
+ OpMemberName %type_TranslucentBasePass 100 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1300"
+ OpMemberName %type_TranslucentBasePass 101 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1304"
+ OpMemberName %type_TranslucentBasePass 102 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1308"
+ OpMemberName %type_TranslucentBasePass 103 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1312"
+ OpMemberName %type_TranslucentBasePass 104 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1316"
+ OpMemberName %type_TranslucentBasePass 105 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1320"
+ OpMemberName %type_TranslucentBasePass 106 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1324"
+ OpMemberName %type_TranslucentBasePass 107 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1328"
+ OpMemberName %type_TranslucentBasePass 108 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1332"
+ OpMemberName %type_TranslucentBasePass 109 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1336"
+ OpMemberName %type_TranslucentBasePass 110 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1340"
+ OpMemberName %type_TranslucentBasePass 111 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1344"
+ OpMemberName %type_TranslucentBasePass 112 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1348"
+ OpMemberName %type_TranslucentBasePass 113 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1352"
+ OpMemberName %type_TranslucentBasePass 114 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1356"
+ OpMemberName %type_TranslucentBasePass 115 "TranslucentBasePass_Shared_PlanarReflection_ReflectionPlane"
+ OpMemberName %type_TranslucentBasePass 116 "TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionOrigin"
+ OpMemberName %type_TranslucentBasePass 117 "TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionXAxis"
+ OpMemberName %type_TranslucentBasePass 118 "TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionYAxis"
+ OpMemberName %type_TranslucentBasePass 119 "TranslucentBasePass_Shared_PlanarReflection_InverseTransposeMirrorMatrix"
+ OpMemberName %type_TranslucentBasePass 120 "TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionParameters"
+ OpMemberName %type_TranslucentBasePass 121 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1484"
+ OpMemberName %type_TranslucentBasePass 122 "TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionParameters2"
+ OpMemberName %type_TranslucentBasePass 123 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1496"
+ OpMemberName %type_TranslucentBasePass 124 "PrePadding_TranslucentBasePass_Shared_PlanarReflection_1500"
+ OpMemberName %type_TranslucentBasePass 125 "TranslucentBasePass_Shared_PlanarReflection_ProjectionWithExtraFOV"
+ OpMemberName %type_TranslucentBasePass 126 "TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionScreenScaleBias"
+ OpMemberName %type_TranslucentBasePass 127 "TranslucentBasePass_Shared_PlanarReflection_PlanarReflectionScreenBound"
+ OpMemberName %type_TranslucentBasePass 128 "TranslucentBasePass_Shared_PlanarReflection_bIsStereo"
+ OpMemberName %type_TranslucentBasePass 129 "PrePadding_TranslucentBasePass_Shared_Fog_1676"
+ OpMemberName %type_TranslucentBasePass 130 "PrePadding_TranslucentBasePass_Shared_Fog_1680"
+ OpMemberName %type_TranslucentBasePass 131 "PrePadding_TranslucentBasePass_Shared_Fog_1684"
+ OpMemberName %type_TranslucentBasePass 132 "PrePadding_TranslucentBasePass_Shared_Fog_1688"
+ OpMemberName %type_TranslucentBasePass 133 "PrePadding_TranslucentBasePass_Shared_Fog_1692"
+ OpMemberName %type_TranslucentBasePass 134 "TranslucentBasePass_Shared_Fog_ExponentialFogParameters"
+ OpMemberName %type_TranslucentBasePass 135 "TranslucentBasePass_Shared_Fog_ExponentialFogParameters2"
+ OpMemberName %type_TranslucentBasePass 136 "TranslucentBasePass_Shared_Fog_ExponentialFogColorParameter"
+ OpMemberName %type_TranslucentBasePass 137 "TranslucentBasePass_Shared_Fog_ExponentialFogParameters3"
+ OpMemberName %type_TranslucentBasePass 138 "TranslucentBasePass_Shared_Fog_InscatteringLightDirection"
+ OpMemberName %type_TranslucentBasePass 139 "TranslucentBasePass_Shared_Fog_DirectionalInscatteringColor"
+ OpMemberName %type_TranslucentBasePass 140 "TranslucentBasePass_Shared_Fog_SinCosInscatteringColorCubemapRotation"
+ OpMemberName %type_TranslucentBasePass 141 "PrePadding_TranslucentBasePass_Shared_Fog_1800"
+ OpMemberName %type_TranslucentBasePass 142 "PrePadding_TranslucentBasePass_Shared_Fog_1804"
+ OpMemberName %type_TranslucentBasePass 143 "TranslucentBasePass_Shared_Fog_FogInscatteringTextureParameters"
+ OpMemberName %type_TranslucentBasePass 144 "TranslucentBasePass_Shared_Fog_ApplyVolumetricFog"
+ OpMemberName %type_TranslucentBasePass 145 "PrePadding_TranslucentBasePass_1824"
+ OpMemberName %type_TranslucentBasePass 146 "PrePadding_TranslucentBasePass_1828"
+ OpMemberName %type_TranslucentBasePass 147 "PrePadding_TranslucentBasePass_1832"
+ OpMemberName %type_TranslucentBasePass 148 "PrePadding_TranslucentBasePass_1836"
+ OpMemberName %type_TranslucentBasePass 149 "PrePadding_TranslucentBasePass_1840"
+ OpMemberName %type_TranslucentBasePass 150 "PrePadding_TranslucentBasePass_1844"
+ OpMemberName %type_TranslucentBasePass 151 "PrePadding_TranslucentBasePass_1848"
+ OpMemberName %type_TranslucentBasePass 152 "PrePadding_TranslucentBasePass_1852"
+ OpMemberName %type_TranslucentBasePass 153 "PrePadding_TranslucentBasePass_1856"
+ OpMemberName %type_TranslucentBasePass 154 "PrePadding_TranslucentBasePass_1860"
+ OpMemberName %type_TranslucentBasePass 155 "PrePadding_TranslucentBasePass_1864"
+ OpMemberName %type_TranslucentBasePass 156 "PrePadding_TranslucentBasePass_1868"
+ OpMemberName %type_TranslucentBasePass 157 "PrePadding_TranslucentBasePass_1872"
+ OpMemberName %type_TranslucentBasePass 158 "PrePadding_TranslucentBasePass_1876"
+ OpMemberName %type_TranslucentBasePass 159 "PrePadding_TranslucentBasePass_1880"
+ OpMemberName %type_TranslucentBasePass 160 "PrePadding_TranslucentBasePass_1884"
+ OpMemberName %type_TranslucentBasePass 161 "PrePadding_TranslucentBasePass_1888"
+ OpMemberName %type_TranslucentBasePass 162 "PrePadding_TranslucentBasePass_1892"
+ OpMemberName %type_TranslucentBasePass 163 "PrePadding_TranslucentBasePass_1896"
+ OpMemberName %type_TranslucentBasePass 164 "PrePadding_TranslucentBasePass_1900"
+ OpMemberName %type_TranslucentBasePass 165 "PrePadding_TranslucentBasePass_1904"
+ OpMemberName %type_TranslucentBasePass 166 "PrePadding_TranslucentBasePass_1908"
+ OpMemberName %type_TranslucentBasePass 167 "PrePadding_TranslucentBasePass_1912"
+ OpMemberName %type_TranslucentBasePass 168 "PrePadding_TranslucentBasePass_1916"
+ OpMemberName %type_TranslucentBasePass 169 "PrePadding_TranslucentBasePass_1920"
+ OpMemberName %type_TranslucentBasePass 170 "PrePadding_TranslucentBasePass_1924"
+ OpMemberName %type_TranslucentBasePass 171 "PrePadding_TranslucentBasePass_1928"
+ OpMemberName %type_TranslucentBasePass 172 "PrePadding_TranslucentBasePass_1932"
+ OpMemberName %type_TranslucentBasePass 173 "PrePadding_TranslucentBasePass_1936"
+ OpMemberName %type_TranslucentBasePass 174 "PrePadding_TranslucentBasePass_1940"
+ OpMemberName %type_TranslucentBasePass 175 "PrePadding_TranslucentBasePass_1944"
+ OpMemberName %type_TranslucentBasePass 176 "PrePadding_TranslucentBasePass_1948"
+ OpMemberName %type_TranslucentBasePass 177 "PrePadding_TranslucentBasePass_1952"
+ OpMemberName %type_TranslucentBasePass 178 "PrePadding_TranslucentBasePass_1956"
+ OpMemberName %type_TranslucentBasePass 179 "PrePadding_TranslucentBasePass_1960"
+ OpMemberName %type_TranslucentBasePass 180 "PrePadding_TranslucentBasePass_1964"
+ OpMemberName %type_TranslucentBasePass 181 "PrePadding_TranslucentBasePass_1968"
+ OpMemberName %type_TranslucentBasePass 182 "PrePadding_TranslucentBasePass_1972"
+ OpMemberName %type_TranslucentBasePass 183 "PrePadding_TranslucentBasePass_1976"
+ OpMemberName %type_TranslucentBasePass 184 "PrePadding_TranslucentBasePass_1980"
+ OpMemberName %type_TranslucentBasePass 185 "PrePadding_TranslucentBasePass_1984"
+ OpMemberName %type_TranslucentBasePass 186 "PrePadding_TranslucentBasePass_1988"
+ OpMemberName %type_TranslucentBasePass 187 "PrePadding_TranslucentBasePass_1992"
+ OpMemberName %type_TranslucentBasePass 188 "PrePadding_TranslucentBasePass_1996"
+ OpMemberName %type_TranslucentBasePass 189 "PrePadding_TranslucentBasePass_2000"
+ OpMemberName %type_TranslucentBasePass 190 "PrePadding_TranslucentBasePass_2004"
+ OpMemberName %type_TranslucentBasePass 191 "PrePadding_TranslucentBasePass_2008"
+ OpMemberName %type_TranslucentBasePass 192 "PrePadding_TranslucentBasePass_2012"
+ OpMemberName %type_TranslucentBasePass 193 "PrePadding_TranslucentBasePass_2016"
+ OpMemberName %type_TranslucentBasePass 194 "PrePadding_TranslucentBasePass_2020"
+ OpMemberName %type_TranslucentBasePass 195 "PrePadding_TranslucentBasePass_2024"
+ OpMemberName %type_TranslucentBasePass 196 "PrePadding_TranslucentBasePass_2028"
+ OpMemberName %type_TranslucentBasePass 197 "PrePadding_TranslucentBasePass_2032"
+ OpMemberName %type_TranslucentBasePass 198 "PrePadding_TranslucentBasePass_2036"
+ OpMemberName %type_TranslucentBasePass 199 "PrePadding_TranslucentBasePass_2040"
+ OpMemberName %type_TranslucentBasePass 200 "PrePadding_TranslucentBasePass_2044"
+ OpMemberName %type_TranslucentBasePass 201 "PrePadding_TranslucentBasePass_2048"
+ OpMemberName %type_TranslucentBasePass 202 "PrePadding_TranslucentBasePass_2052"
+ OpMemberName %type_TranslucentBasePass 203 "PrePadding_TranslucentBasePass_2056"
+ OpMemberName %type_TranslucentBasePass 204 "PrePadding_TranslucentBasePass_2060"
+ OpMemberName %type_TranslucentBasePass 205 "PrePadding_TranslucentBasePass_2064"
+ OpMemberName %type_TranslucentBasePass 206 "PrePadding_TranslucentBasePass_2068"
+ OpMemberName %type_TranslucentBasePass 207 "PrePadding_TranslucentBasePass_2072"
+ OpMemberName %type_TranslucentBasePass 208 "PrePadding_TranslucentBasePass_2076"
+ OpMemberName %type_TranslucentBasePass 209 "PrePadding_TranslucentBasePass_2080"
+ OpMemberName %type_TranslucentBasePass 210 "PrePadding_TranslucentBasePass_2084"
+ OpMemberName %type_TranslucentBasePass 211 "PrePadding_TranslucentBasePass_2088"
+ OpMemberName %type_TranslucentBasePass 212 "PrePadding_TranslucentBasePass_2092"
+ OpMemberName %type_TranslucentBasePass 213 "PrePadding_TranslucentBasePass_2096"
+ OpMemberName %type_TranslucentBasePass 214 "PrePadding_TranslucentBasePass_2100"
+ OpMemberName %type_TranslucentBasePass 215 "PrePadding_TranslucentBasePass_2104"
+ OpMemberName %type_TranslucentBasePass 216 "PrePadding_TranslucentBasePass_2108"
+ OpMemberName %type_TranslucentBasePass 217 "PrePadding_TranslucentBasePass_2112"
+ OpMemberName %type_TranslucentBasePass 218 "PrePadding_TranslucentBasePass_2116"
+ OpMemberName %type_TranslucentBasePass 219 "PrePadding_TranslucentBasePass_2120"
+ OpMemberName %type_TranslucentBasePass 220 "PrePadding_TranslucentBasePass_2124"
+ OpMemberName %type_TranslucentBasePass 221 "PrePadding_TranslucentBasePass_2128"
+ OpMemberName %type_TranslucentBasePass 222 "PrePadding_TranslucentBasePass_2132"
+ OpMemberName %type_TranslucentBasePass 223 "PrePadding_TranslucentBasePass_2136"
+ OpMemberName %type_TranslucentBasePass 224 "PrePadding_TranslucentBasePass_2140"
+ OpMemberName %type_TranslucentBasePass 225 "TranslucentBasePass_HZBUvFactorAndInvFactor"
+ OpMemberName %type_TranslucentBasePass 226 "TranslucentBasePass_PrevScreenPositionScaleBias"
+ OpMemberName %type_TranslucentBasePass 227 "TranslucentBasePass_PrevSceneColorPreExposureInv"
+ OpName %TranslucentBasePass "TranslucentBasePass"
+ OpName %TranslucentBasePass_Shared_Fog_IntegratedLightScattering "TranslucentBasePass_Shared_Fog_IntegratedLightScattering"
+ OpName %type_Material "type.Material"
+ OpMemberName %type_Material 0 "Material_VectorExpressions"
+ OpMemberName %type_Material 1 "Material_ScalarExpressions"
+ OpName %Material "Material"
+ OpName %in_var_TEXCOORD10_centroid "in.var.TEXCOORD10_centroid"
+ OpName %in_var_TEXCOORD11_centroid "in.var.TEXCOORD11_centroid"
+ OpName %in_var_PRIMITIVE_ID "in.var.PRIMITIVE_ID"
+ OpName %in_var_TEXCOORD7 "in.var.TEXCOORD7"
+ OpName %out_var_SV_Target0 "out.var.SV_Target0"
+ OpName %MainPS "MainPS"
+ OpName %type_sampled_image "type.sampled.image"
+ OpDecorateString %in_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %in_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %in_var_PRIMITIVE_ID UserSemantic "PRIMITIVE_ID"
+ OpDecorate %in_var_PRIMITIVE_ID Flat
+ OpDecorateString %in_var_TEXCOORD7 UserSemantic "TEXCOORD7"
+ OpDecorate %gl_FragCoord BuiltIn FragCoord
+ OpDecorateString %gl_FragCoord UserSemantic "SV_Position"
+ OpDecorate %gl_FrontFacing BuiltIn FrontFacing
+ OpDecorateString %gl_FrontFacing UserSemantic "SV_IsFrontFace"
+ OpDecorate %gl_FrontFacing Flat
+ OpDecorate %gl_SampleMask BuiltIn SampleMask
+ OpDecorateString %gl_SampleMask UserSemantic "SV_Coverage"
+ OpDecorate %gl_SampleMask Flat
+ OpDecorateString %out_var_SV_Target0 UserSemantic "SV_Target0"
+ OpDecorate %gl_SampleMask_0 BuiltIn SampleMask
+ OpDecorateString %gl_SampleMask_0 UserSemantic "SV_Coverage"
+ OpDecorate %in_var_TEXCOORD10_centroid Location 0
+ OpDecorate %in_var_TEXCOORD11_centroid Location 1
+ OpDecorate %in_var_PRIMITIVE_ID Location 2
+ OpDecorate %in_var_TEXCOORD7 Location 3
+ OpDecorate %out_var_SV_Target0 Location 0
+ OpDecorate %View DescriptorSet 0
+ OpDecorate %View Binding 1
+ OpDecorate %View_SharedBilinearClampedSampler DescriptorSet 0
+ OpDecorate %View_SharedBilinearClampedSampler Binding 0
+ OpDecorate %View_PrimitiveSceneData DescriptorSet 0
+ OpDecorate %View_PrimitiveSceneData Binding 0
+ OpDecorate %TranslucentBasePass DescriptorSet 0
+ OpDecorate %TranslucentBasePass Binding 2
+ OpDecorate %TranslucentBasePass_Shared_Fog_IntegratedLightScattering DescriptorSet 0
+ OpDecorate %TranslucentBasePass_Shared_Fog_IntegratedLightScattering Binding 0
+ OpDecorate %Material DescriptorSet 0
+ OpDecorate %Material Binding 3
+ OpDecorate %_arr_v4float_uint_2 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_7 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpMemberDecorate %type_View 0 Offset 0
+ OpMemberDecorate %type_View 0 MatrixStride 16
+ OpMemberDecorate %type_View 0 ColMajor
+ OpMemberDecorate %type_View 1 Offset 64
+ OpMemberDecorate %type_View 1 MatrixStride 16
+ OpMemberDecorate %type_View 1 ColMajor
+ OpMemberDecorate %type_View 2 Offset 128
+ OpMemberDecorate %type_View 2 MatrixStride 16
+ OpMemberDecorate %type_View 2 ColMajor
+ OpMemberDecorate %type_View 3 Offset 192
+ OpMemberDecorate %type_View 3 MatrixStride 16
+ OpMemberDecorate %type_View 3 ColMajor
+ OpMemberDecorate %type_View 4 Offset 256
+ OpMemberDecorate %type_View 4 MatrixStride 16
+ OpMemberDecorate %type_View 4 ColMajor
+ OpMemberDecorate %type_View 5 Offset 320
+ OpMemberDecorate %type_View 5 MatrixStride 16
+ OpMemberDecorate %type_View 5 ColMajor
+ OpMemberDecorate %type_View 6 Offset 384
+ OpMemberDecorate %type_View 6 MatrixStride 16
+ OpMemberDecorate %type_View 6 ColMajor
+ OpMemberDecorate %type_View 7 Offset 448
+ OpMemberDecorate %type_View 7 MatrixStride 16
+ OpMemberDecorate %type_View 7 ColMajor
+ OpMemberDecorate %type_View 8 Offset 512
+ OpMemberDecorate %type_View 8 MatrixStride 16
+ OpMemberDecorate %type_View 8 ColMajor
+ OpMemberDecorate %type_View 9 Offset 576
+ OpMemberDecorate %type_View 9 MatrixStride 16
+ OpMemberDecorate %type_View 9 ColMajor
+ OpMemberDecorate %type_View 10 Offset 640
+ OpMemberDecorate %type_View 10 MatrixStride 16
+ OpMemberDecorate %type_View 10 ColMajor
+ OpMemberDecorate %type_View 11 Offset 704
+ OpMemberDecorate %type_View 11 MatrixStride 16
+ OpMemberDecorate %type_View 11 ColMajor
+ OpMemberDecorate %type_View 12 Offset 768
+ OpMemberDecorate %type_View 12 MatrixStride 16
+ OpMemberDecorate %type_View 12 ColMajor
+ OpMemberDecorate %type_View 13 Offset 832
+ OpMemberDecorate %type_View 14 Offset 844
+ OpMemberDecorate %type_View 15 Offset 848
+ OpMemberDecorate %type_View 16 Offset 860
+ OpMemberDecorate %type_View 17 Offset 864
+ OpMemberDecorate %type_View 18 Offset 876
+ OpMemberDecorate %type_View 19 Offset 880
+ OpMemberDecorate %type_View 20 Offset 892
+ OpMemberDecorate %type_View 21 Offset 896
+ OpMemberDecorate %type_View 22 Offset 908
+ OpMemberDecorate %type_View 23 Offset 912
+ OpMemberDecorate %type_View 24 Offset 928
+ OpMemberDecorate %type_View 25 Offset 944
+ OpMemberDecorate %type_View 26 Offset 956
+ OpMemberDecorate %type_View 27 Offset 960
+ OpMemberDecorate %type_View 28 Offset 972
+ OpMemberDecorate %type_View 29 Offset 976
+ OpMemberDecorate %type_View 30 Offset 988
+ OpMemberDecorate %type_View 31 Offset 992
+ OpMemberDecorate %type_View 32 Offset 1004
+ OpMemberDecorate %type_View 33 Offset 1008
+ OpMemberDecorate %type_View 33 MatrixStride 16
+ OpMemberDecorate %type_View 33 ColMajor
+ OpMemberDecorate %type_View 34 Offset 1072
+ OpMemberDecorate %type_View 34 MatrixStride 16
+ OpMemberDecorate %type_View 34 ColMajor
+ OpMemberDecorate %type_View 35 Offset 1136
+ OpMemberDecorate %type_View 35 MatrixStride 16
+ OpMemberDecorate %type_View 35 ColMajor
+ OpMemberDecorate %type_View 36 Offset 1200
+ OpMemberDecorate %type_View 36 MatrixStride 16
+ OpMemberDecorate %type_View 36 ColMajor
+ OpMemberDecorate %type_View 37 Offset 1264
+ OpMemberDecorate %type_View 37 MatrixStride 16
+ OpMemberDecorate %type_View 37 ColMajor
+ OpMemberDecorate %type_View 38 Offset 1328
+ OpMemberDecorate %type_View 38 MatrixStride 16
+ OpMemberDecorate %type_View 38 ColMajor
+ OpMemberDecorate %type_View 39 Offset 1392
+ OpMemberDecorate %type_View 39 MatrixStride 16
+ OpMemberDecorate %type_View 39 ColMajor
+ OpMemberDecorate %type_View 40 Offset 1456
+ OpMemberDecorate %type_View 40 MatrixStride 16
+ OpMemberDecorate %type_View 40 ColMajor
+ OpMemberDecorate %type_View 41 Offset 1520
+ OpMemberDecorate %type_View 41 MatrixStride 16
+ OpMemberDecorate %type_View 41 ColMajor
+ OpMemberDecorate %type_View 42 Offset 1584
+ OpMemberDecorate %type_View 42 MatrixStride 16
+ OpMemberDecorate %type_View 42 ColMajor
+ OpMemberDecorate %type_View 43 Offset 1648
+ OpMemberDecorate %type_View 44 Offset 1660
+ OpMemberDecorate %type_View 45 Offset 1664
+ OpMemberDecorate %type_View 46 Offset 1676
+ OpMemberDecorate %type_View 47 Offset 1680
+ OpMemberDecorate %type_View 48 Offset 1692
+ OpMemberDecorate %type_View 49 Offset 1696
+ OpMemberDecorate %type_View 49 MatrixStride 16
+ OpMemberDecorate %type_View 49 ColMajor
+ OpMemberDecorate %type_View 50 Offset 1760
+ OpMemberDecorate %type_View 50 MatrixStride 16
+ OpMemberDecorate %type_View 50 ColMajor
+ OpMemberDecorate %type_View 51 Offset 1824
+ OpMemberDecorate %type_View 51 MatrixStride 16
+ OpMemberDecorate %type_View 51 ColMajor
+ OpMemberDecorate %type_View 52 Offset 1888
+ OpMemberDecorate %type_View 53 Offset 1904
+ OpMemberDecorate %type_View 54 Offset 1920
+ OpMemberDecorate %type_View 55 Offset 1928
+ OpMemberDecorate %type_View 56 Offset 1936
+ OpMemberDecorate %type_View 57 Offset 1952
+ OpMemberDecorate %type_View 58 Offset 1968
+ OpMemberDecorate %type_View 59 Offset 1984
+ OpMemberDecorate %type_View 60 Offset 2000
+ OpMemberDecorate %type_View 61 Offset 2004
+ OpMemberDecorate %type_View 62 Offset 2008
+ OpMemberDecorate %type_View 63 Offset 2012
+ OpMemberDecorate %type_View 64 Offset 2016
+ OpMemberDecorate %type_View 65 Offset 2032
+ OpMemberDecorate %type_View 66 Offset 2048
+ OpMemberDecorate %type_View 67 Offset 2064
+ OpMemberDecorate %type_View 68 Offset 2072
+ OpMemberDecorate %type_View 69 Offset 2076
+ OpMemberDecorate %type_View 70 Offset 2080
+ OpMemberDecorate %type_View 71 Offset 2084
+ OpMemberDecorate %type_View 72 Offset 2088
+ OpMemberDecorate %type_View 73 Offset 2092
+ OpMemberDecorate %type_View 74 Offset 2096
+ OpMemberDecorate %type_View 75 Offset 2108
+ OpMemberDecorate %type_View 76 Offset 2112
+ OpMemberDecorate %type_View 77 Offset 2116
+ OpMemberDecorate %type_View 78 Offset 2120
+ OpMemberDecorate %type_View 79 Offset 2124
+ OpMemberDecorate %type_View 80 Offset 2128
+ OpMemberDecorate %type_View 81 Offset 2132
+ OpMemberDecorate %type_View 82 Offset 2136
+ OpMemberDecorate %type_View 83 Offset 2140
+ OpMemberDecorate %type_View 84 Offset 2144
+ OpMemberDecorate %type_View 85 Offset 2148
+ OpMemberDecorate %type_View 86 Offset 2152
+ OpMemberDecorate %type_View 87 Offset 2156
+ OpMemberDecorate %type_View 88 Offset 2160
+ OpMemberDecorate %type_View 89 Offset 2164
+ OpMemberDecorate %type_View 90 Offset 2168
+ OpMemberDecorate %type_View 91 Offset 2172
+ OpMemberDecorate %type_View 92 Offset 2176
+ OpMemberDecorate %type_View 93 Offset 2192
+ OpMemberDecorate %type_View 94 Offset 2204
+ OpMemberDecorate %type_View 95 Offset 2208
+ OpMemberDecorate %type_View 96 Offset 2240
+ OpMemberDecorate %type_View 97 Offset 2272
+ OpMemberDecorate %type_View 98 Offset 2288
+ OpMemberDecorate %type_View 99 Offset 2304
+ OpMemberDecorate %type_View 100 Offset 2308
+ OpMemberDecorate %type_View 101 Offset 2312
+ OpMemberDecorate %type_View 102 Offset 2316
+ OpMemberDecorate %type_View 103 Offset 2320
+ OpMemberDecorate %type_View 104 Offset 2324
+ OpMemberDecorate %type_View 105 Offset 2328
+ OpMemberDecorate %type_View 106 Offset 2332
+ OpMemberDecorate %type_View 107 Offset 2336
+ OpMemberDecorate %type_View 108 Offset 2340
+ OpMemberDecorate %type_View 109 Offset 2344
+ OpMemberDecorate %type_View 110 Offset 2348
+ OpMemberDecorate %type_View 111 Offset 2352
+ OpMemberDecorate %type_View 112 Offset 2364
+ OpMemberDecorate %type_View 113 Offset 2368
+ OpMemberDecorate %type_View 114 Offset 2380
+ OpMemberDecorate %type_View 115 Offset 2384
+ OpMemberDecorate %type_View 116 Offset 2388
+ OpMemberDecorate %type_View 117 Offset 2392
+ OpMemberDecorate %type_View 118 Offset 2396
+ OpMemberDecorate %type_View 119 Offset 2400
+ OpMemberDecorate %type_View 120 Offset 2404
+ OpMemberDecorate %type_View 121 Offset 2408
+ OpMemberDecorate %type_View 122 Offset 2412
+ OpMemberDecorate %type_View 123 Offset 2416
+ OpMemberDecorate %type_View 124 Offset 2420
+ OpMemberDecorate %type_View 125 Offset 2424
+ OpMemberDecorate %type_View 126 Offset 2428
+ OpMemberDecorate %type_View 127 Offset 2432
+ OpMemberDecorate %type_View 128 Offset 2448
+ OpMemberDecorate %type_View 129 Offset 2460
+ OpMemberDecorate %type_View 130 Offset 2464
+ OpMemberDecorate %type_View 131 Offset 2480
+ OpMemberDecorate %type_View 132 Offset 2484
+ OpMemberDecorate %type_View 133 Offset 2488
+ OpMemberDecorate %type_View 134 Offset 2492
+ OpMemberDecorate %type_View 135 Offset 2496
+ OpMemberDecorate %type_View 136 Offset 2512
+ OpMemberDecorate %type_View 137 Offset 2624
+ OpMemberDecorate %type_View 138 Offset 2628
+ OpMemberDecorate %type_View 139 Offset 2632
+ OpMemberDecorate %type_View 140 Offset 2636
+ OpMemberDecorate %type_View 141 Offset 2640
+ OpMemberDecorate %type_View 142 Offset 2644
+ OpMemberDecorate %type_View 143 Offset 2648
+ OpMemberDecorate %type_View 144 Offset 2652
+ OpMemberDecorate %type_View 145 Offset 2656
+ OpMemberDecorate %type_View 146 Offset 2668
+ OpMemberDecorate %type_View 147 Offset 2672
+ OpMemberDecorate %type_View 148 Offset 2736
+ OpMemberDecorate %type_View 149 Offset 2800
+ OpMemberDecorate %type_View 150 Offset 2804
+ OpMemberDecorate %type_View 151 Offset 2808
+ OpMemberDecorate %type_View 152 Offset 2812
+ OpMemberDecorate %type_View 153 Offset 2816
+ OpMemberDecorate %type_View 154 Offset 2828
+ OpMemberDecorate %type_View 155 Offset 2832
+ OpMemberDecorate %type_View 156 Offset 2844
+ OpMemberDecorate %type_View 157 Offset 2848
+ OpMemberDecorate %type_View 158 Offset 2856
+ OpMemberDecorate %type_View 159 Offset 2860
+ OpMemberDecorate %type_View 160 Offset 2864
+ OpMemberDecorate %type_View 161 Offset 2876
+ OpMemberDecorate %type_View 162 Offset 2880
+ OpMemberDecorate %type_View 163 Offset 2892
+ OpMemberDecorate %type_View 164 Offset 2896
+ OpMemberDecorate %type_View 165 Offset 2908
+ OpMemberDecorate %type_View 166 Offset 2912
+ OpMemberDecorate %type_View 167 Offset 2924
+ OpMemberDecorate %type_View 168 Offset 2928
+ OpMemberDecorate %type_View 169 Offset 2932
+ OpDecorate %type_View Block
+ OpDecorate %_runtimearr_v4float ArrayStride 16
+ OpMemberDecorate %type_StructuredBuffer_v4float 0 Offset 0
+ OpMemberDecorate %type_StructuredBuffer_v4float 0 NonWritable
+ OpDecorate %type_StructuredBuffer_v4float BufferBlock
+ OpDecorate %_arr_mat4v4float_uint_4 ArrayStride 64
+ OpDecorate %_arr_mat4v4float_uint_2 ArrayStride 64
+ OpMemberDecorate %type_TranslucentBasePass 0 Offset 0
+ OpMemberDecorate %type_TranslucentBasePass 1 Offset 4
+ OpMemberDecorate %type_TranslucentBasePass 2 Offset 8
+ OpMemberDecorate %type_TranslucentBasePass 3 Offset 12
+ OpMemberDecorate %type_TranslucentBasePass 4 Offset 16
+ OpMemberDecorate %type_TranslucentBasePass 5 Offset 28
+ OpMemberDecorate %type_TranslucentBasePass 6 Offset 32
+ OpMemberDecorate %type_TranslucentBasePass 7 Offset 36
+ OpMemberDecorate %type_TranslucentBasePass 8 Offset 40
+ OpMemberDecorate %type_TranslucentBasePass 9 Offset 44
+ OpMemberDecorate %type_TranslucentBasePass 10 Offset 48
+ OpMemberDecorate %type_TranslucentBasePass 11 Offset 60
+ OpMemberDecorate %type_TranslucentBasePass 12 Offset 64
+ OpMemberDecorate %type_TranslucentBasePass 13 Offset 76
+ OpMemberDecorate %type_TranslucentBasePass 14 Offset 80
+ OpMemberDecorate %type_TranslucentBasePass 15 Offset 92
+ OpMemberDecorate %type_TranslucentBasePass 16 Offset 96
+ OpMemberDecorate %type_TranslucentBasePass 17 Offset 100
+ OpMemberDecorate %type_TranslucentBasePass 18 Offset 104
+ OpMemberDecorate %type_TranslucentBasePass 19 Offset 112
+ OpMemberDecorate %type_TranslucentBasePass 20 Offset 116
+ OpMemberDecorate %type_TranslucentBasePass 21 Offset 120
+ OpMemberDecorate %type_TranslucentBasePass 22 Offset 124
+ OpMemberDecorate %type_TranslucentBasePass 23 Offset 128
+ OpMemberDecorate %type_TranslucentBasePass 24 Offset 144
+ OpMemberDecorate %type_TranslucentBasePass 24 MatrixStride 16
+ OpMemberDecorate %type_TranslucentBasePass 24 ColMajor
+ OpMemberDecorate %type_TranslucentBasePass 25 Offset 400
+ OpMemberDecorate %type_TranslucentBasePass 26 Offset 464
+ OpMemberDecorate %type_TranslucentBasePass 27 Offset 480
+ OpMemberDecorate %type_TranslucentBasePass 28 Offset 484
+ OpMemberDecorate %type_TranslucentBasePass 29 Offset 488
+ OpMemberDecorate %type_TranslucentBasePass 30 Offset 492
+ OpMemberDecorate %type_TranslucentBasePass 31 Offset 496
+ OpMemberDecorate %type_TranslucentBasePass 32 Offset 512
+ OpMemberDecorate %type_TranslucentBasePass 32 MatrixStride 16
+ OpMemberDecorate %type_TranslucentBasePass 32 ColMajor
+ OpMemberDecorate %type_TranslucentBasePass 33 Offset 576
+ OpMemberDecorate %type_TranslucentBasePass 34 Offset 580
+ OpMemberDecorate %type_TranslucentBasePass 35 Offset 584
+ OpMemberDecorate %type_TranslucentBasePass 36 Offset 588
+ OpMemberDecorate %type_TranslucentBasePass 37 Offset 592
+ OpMemberDecorate %type_TranslucentBasePass 38 Offset 596
+ OpMemberDecorate %type_TranslucentBasePass 39 Offset 600
+ OpMemberDecorate %type_TranslucentBasePass 40 Offset 604
+ OpMemberDecorate %type_TranslucentBasePass 41 Offset 608
+ OpMemberDecorate %type_TranslucentBasePass 42 Offset 612
+ OpMemberDecorate %type_TranslucentBasePass 43 Offset 616
+ OpMemberDecorate %type_TranslucentBasePass 44 Offset 620
+ OpMemberDecorate %type_TranslucentBasePass 45 Offset 624
+ OpMemberDecorate %type_TranslucentBasePass 46 Offset 628
+ OpMemberDecorate %type_TranslucentBasePass 47 Offset 632
+ OpMemberDecorate %type_TranslucentBasePass 48 Offset 636
+ OpMemberDecorate %type_TranslucentBasePass 49 Offset 640
+ OpMemberDecorate %type_TranslucentBasePass 50 Offset 644
+ OpMemberDecorate %type_TranslucentBasePass 51 Offset 648
+ OpMemberDecorate %type_TranslucentBasePass 52 Offset 652
+ OpMemberDecorate %type_TranslucentBasePass 53 Offset 656
+ OpMemberDecorate %type_TranslucentBasePass 54 Offset 668
+ OpMemberDecorate %type_TranslucentBasePass 55 Offset 672
+ OpMemberDecorate %type_TranslucentBasePass 56 Offset 676
+ OpMemberDecorate %type_TranslucentBasePass 57 Offset 680
+ OpMemberDecorate %type_TranslucentBasePass 58 Offset 684
+ OpMemberDecorate %type_TranslucentBasePass 59 Offset 688
+ OpMemberDecorate %type_TranslucentBasePass 60 Offset 700
+ OpMemberDecorate %type_TranslucentBasePass 61 Offset 704
+ OpMemberDecorate %type_TranslucentBasePass 62 Offset 716
+ OpMemberDecorate %type_TranslucentBasePass 63 Offset 720
+ OpMemberDecorate %type_TranslucentBasePass 64 Offset 732
+ OpMemberDecorate %type_TranslucentBasePass 65 Offset 736
+ OpMemberDecorate %type_TranslucentBasePass 66 Offset 740
+ OpMemberDecorate %type_TranslucentBasePass 67 Offset 744
+ OpMemberDecorate %type_TranslucentBasePass 68 Offset 752
+ OpMemberDecorate %type_TranslucentBasePass 69 Offset 756
+ OpMemberDecorate %type_TranslucentBasePass 70 Offset 760
+ OpMemberDecorate %type_TranslucentBasePass 71 Offset 764
+ OpMemberDecorate %type_TranslucentBasePass 72 Offset 768
+ OpMemberDecorate %type_TranslucentBasePass 73 Offset 784
+ OpMemberDecorate %type_TranslucentBasePass 73 MatrixStride 16
+ OpMemberDecorate %type_TranslucentBasePass 73 ColMajor
+ OpMemberDecorate %type_TranslucentBasePass 74 Offset 1040
+ OpMemberDecorate %type_TranslucentBasePass 75 Offset 1104
+ OpMemberDecorate %type_TranslucentBasePass 76 Offset 1120
+ OpMemberDecorate %type_TranslucentBasePass 77 Offset 1124
+ OpMemberDecorate %type_TranslucentBasePass 78 Offset 1128
+ OpMemberDecorate %type_TranslucentBasePass 79 Offset 1132
+ OpMemberDecorate %type_TranslucentBasePass 80 Offset 1136
+ OpMemberDecorate %type_TranslucentBasePass 81 Offset 1152
+ OpMemberDecorate %type_TranslucentBasePass 81 MatrixStride 16
+ OpMemberDecorate %type_TranslucentBasePass 81 ColMajor
+ OpMemberDecorate %type_TranslucentBasePass 82 Offset 1216
+ OpMemberDecorate %type_TranslucentBasePass 83 Offset 1220
+ OpMemberDecorate %type_TranslucentBasePass 84 Offset 1224
+ OpMemberDecorate %type_TranslucentBasePass 85 Offset 1228
+ OpMemberDecorate %type_TranslucentBasePass 86 Offset 1232
+ OpMemberDecorate %type_TranslucentBasePass 87 Offset 1236
+ OpMemberDecorate %type_TranslucentBasePass 88 Offset 1240
+ OpMemberDecorate %type_TranslucentBasePass 89 Offset 1244
+ OpMemberDecorate %type_TranslucentBasePass 90 Offset 1248
+ OpMemberDecorate %type_TranslucentBasePass 91 Offset 1252
+ OpMemberDecorate %type_TranslucentBasePass 92 Offset 1256
+ OpMemberDecorate %type_TranslucentBasePass 93 Offset 1260
+ OpMemberDecorate %type_TranslucentBasePass 94 Offset 1264
+ OpMemberDecorate %type_TranslucentBasePass 95 Offset 1268
+ OpMemberDecorate %type_TranslucentBasePass 96 Offset 1272
+ OpMemberDecorate %type_TranslucentBasePass 97 Offset 1276
+ OpMemberDecorate %type_TranslucentBasePass 98 Offset 1280
+ OpMemberDecorate %type_TranslucentBasePass 99 Offset 1296
+ OpMemberDecorate %type_TranslucentBasePass 100 Offset 1300
+ OpMemberDecorate %type_TranslucentBasePass 101 Offset 1304
+ OpMemberDecorate %type_TranslucentBasePass 102 Offset 1308
+ OpMemberDecorate %type_TranslucentBasePass 103 Offset 1312
+ OpMemberDecorate %type_TranslucentBasePass 104 Offset 1316
+ OpMemberDecorate %type_TranslucentBasePass 105 Offset 1320
+ OpMemberDecorate %type_TranslucentBasePass 106 Offset 1324
+ OpMemberDecorate %type_TranslucentBasePass 107 Offset 1328
+ OpMemberDecorate %type_TranslucentBasePass 108 Offset 1332
+ OpMemberDecorate %type_TranslucentBasePass 109 Offset 1336
+ OpMemberDecorate %type_TranslucentBasePass 110 Offset 1340
+ OpMemberDecorate %type_TranslucentBasePass 111 Offset 1344
+ OpMemberDecorate %type_TranslucentBasePass 112 Offset 1348
+ OpMemberDecorate %type_TranslucentBasePass 113 Offset 1352
+ OpMemberDecorate %type_TranslucentBasePass 114 Offset 1356
+ OpMemberDecorate %type_TranslucentBasePass 115 Offset 1360
+ OpMemberDecorate %type_TranslucentBasePass 116 Offset 1376
+ OpMemberDecorate %type_TranslucentBasePass 117 Offset 1392
+ OpMemberDecorate %type_TranslucentBasePass 118 Offset 1408
+ OpMemberDecorate %type_TranslucentBasePass 119 Offset 1424
+ OpMemberDecorate %type_TranslucentBasePass 119 MatrixStride 16
+ OpMemberDecorate %type_TranslucentBasePass 119 ColMajor
+ OpMemberDecorate %type_TranslucentBasePass 120 Offset 1472
+ OpMemberDecorate %type_TranslucentBasePass 121 Offset 1484
+ OpMemberDecorate %type_TranslucentBasePass 122 Offset 1488
+ OpMemberDecorate %type_TranslucentBasePass 123 Offset 1496
+ OpMemberDecorate %type_TranslucentBasePass 124 Offset 1500
+ OpMemberDecorate %type_TranslucentBasePass 125 Offset 1504
+ OpMemberDecorate %type_TranslucentBasePass 125 MatrixStride 16
+ OpMemberDecorate %type_TranslucentBasePass 125 ColMajor
+ OpMemberDecorate %type_TranslucentBasePass 126 Offset 1632
+ OpMemberDecorate %type_TranslucentBasePass 127 Offset 1664
+ OpMemberDecorate %type_TranslucentBasePass 128 Offset 1672
+ OpMemberDecorate %type_TranslucentBasePass 129 Offset 1676
+ OpMemberDecorate %type_TranslucentBasePass 130 Offset 1680
+ OpMemberDecorate %type_TranslucentBasePass 131 Offset 1684
+ OpMemberDecorate %type_TranslucentBasePass 132 Offset 1688
+ OpMemberDecorate %type_TranslucentBasePass 133 Offset 1692
+ OpMemberDecorate %type_TranslucentBasePass 134 Offset 1696
+ OpMemberDecorate %type_TranslucentBasePass 135 Offset 1712
+ OpMemberDecorate %type_TranslucentBasePass 136 Offset 1728
+ OpMemberDecorate %type_TranslucentBasePass 137 Offset 1744
+ OpMemberDecorate %type_TranslucentBasePass 138 Offset 1760
+ OpMemberDecorate %type_TranslucentBasePass 139 Offset 1776
+ OpMemberDecorate %type_TranslucentBasePass 140 Offset 1792
+ OpMemberDecorate %type_TranslucentBasePass 141 Offset 1800
+ OpMemberDecorate %type_TranslucentBasePass 142 Offset 1804
+ OpMemberDecorate %type_TranslucentBasePass 143 Offset 1808
+ OpMemberDecorate %type_TranslucentBasePass 144 Offset 1820
+ OpMemberDecorate %type_TranslucentBasePass 145 Offset 1824
+ OpMemberDecorate %type_TranslucentBasePass 146 Offset 1828
+ OpMemberDecorate %type_TranslucentBasePass 147 Offset 1832
+ OpMemberDecorate %type_TranslucentBasePass 148 Offset 1836
+ OpMemberDecorate %type_TranslucentBasePass 149 Offset 1840
+ OpMemberDecorate %type_TranslucentBasePass 150 Offset 1844
+ OpMemberDecorate %type_TranslucentBasePass 151 Offset 1848
+ OpMemberDecorate %type_TranslucentBasePass 152 Offset 1852
+ OpMemberDecorate %type_TranslucentBasePass 153 Offset 1856
+ OpMemberDecorate %type_TranslucentBasePass 154 Offset 1860
+ OpMemberDecorate %type_TranslucentBasePass 155 Offset 1864
+ OpMemberDecorate %type_TranslucentBasePass 156 Offset 1868
+ OpMemberDecorate %type_TranslucentBasePass 157 Offset 1872
+ OpMemberDecorate %type_TranslucentBasePass 158 Offset 1876
+ OpMemberDecorate %type_TranslucentBasePass 159 Offset 1880
+ OpMemberDecorate %type_TranslucentBasePass 160 Offset 1884
+ OpMemberDecorate %type_TranslucentBasePass 161 Offset 1888
+ OpMemberDecorate %type_TranslucentBasePass 162 Offset 1892
+ OpMemberDecorate %type_TranslucentBasePass 163 Offset 1896
+ OpMemberDecorate %type_TranslucentBasePass 164 Offset 1900
+ OpMemberDecorate %type_TranslucentBasePass 165 Offset 1904
+ OpMemberDecorate %type_TranslucentBasePass 166 Offset 1908
+ OpMemberDecorate %type_TranslucentBasePass 167 Offset 1912
+ OpMemberDecorate %type_TranslucentBasePass 168 Offset 1916
+ OpMemberDecorate %type_TranslucentBasePass 169 Offset 1920
+ OpMemberDecorate %type_TranslucentBasePass 170 Offset 1924
+ OpMemberDecorate %type_TranslucentBasePass 171 Offset 1928
+ OpMemberDecorate %type_TranslucentBasePass 172 Offset 1932
+ OpMemberDecorate %type_TranslucentBasePass 173 Offset 1936
+ OpMemberDecorate %type_TranslucentBasePass 174 Offset 1940
+ OpMemberDecorate %type_TranslucentBasePass 175 Offset 1944
+ OpMemberDecorate %type_TranslucentBasePass 176 Offset 1948
+ OpMemberDecorate %type_TranslucentBasePass 177 Offset 1952
+ OpMemberDecorate %type_TranslucentBasePass 178 Offset 1956
+ OpMemberDecorate %type_TranslucentBasePass 179 Offset 1960
+ OpMemberDecorate %type_TranslucentBasePass 180 Offset 1964
+ OpMemberDecorate %type_TranslucentBasePass 181 Offset 1968
+ OpMemberDecorate %type_TranslucentBasePass 182 Offset 1972
+ OpMemberDecorate %type_TranslucentBasePass 183 Offset 1976
+ OpMemberDecorate %type_TranslucentBasePass 184 Offset 1980
+ OpMemberDecorate %type_TranslucentBasePass 185 Offset 1984
+ OpMemberDecorate %type_TranslucentBasePass 186 Offset 1988
+ OpMemberDecorate %type_TranslucentBasePass 187 Offset 1992
+ OpMemberDecorate %type_TranslucentBasePass 188 Offset 1996
+ OpMemberDecorate %type_TranslucentBasePass 189 Offset 2000
+ OpMemberDecorate %type_TranslucentBasePass 190 Offset 2004
+ OpMemberDecorate %type_TranslucentBasePass 191 Offset 2008
+ OpMemberDecorate %type_TranslucentBasePass 192 Offset 2012
+ OpMemberDecorate %type_TranslucentBasePass 193 Offset 2016
+ OpMemberDecorate %type_TranslucentBasePass 194 Offset 2020
+ OpMemberDecorate %type_TranslucentBasePass 195 Offset 2024
+ OpMemberDecorate %type_TranslucentBasePass 196 Offset 2028
+ OpMemberDecorate %type_TranslucentBasePass 197 Offset 2032
+ OpMemberDecorate %type_TranslucentBasePass 198 Offset 2036
+ OpMemberDecorate %type_TranslucentBasePass 199 Offset 2040
+ OpMemberDecorate %type_TranslucentBasePass 200 Offset 2044
+ OpMemberDecorate %type_TranslucentBasePass 201 Offset 2048
+ OpMemberDecorate %type_TranslucentBasePass 202 Offset 2052
+ OpMemberDecorate %type_TranslucentBasePass 203 Offset 2056
+ OpMemberDecorate %type_TranslucentBasePass 204 Offset 2060
+ OpMemberDecorate %type_TranslucentBasePass 205 Offset 2064
+ OpMemberDecorate %type_TranslucentBasePass 206 Offset 2068
+ OpMemberDecorate %type_TranslucentBasePass 207 Offset 2072
+ OpMemberDecorate %type_TranslucentBasePass 208 Offset 2076
+ OpMemberDecorate %type_TranslucentBasePass 209 Offset 2080
+ OpMemberDecorate %type_TranslucentBasePass 210 Offset 2084
+ OpMemberDecorate %type_TranslucentBasePass 211 Offset 2088
+ OpMemberDecorate %type_TranslucentBasePass 212 Offset 2092
+ OpMemberDecorate %type_TranslucentBasePass 213 Offset 2096
+ OpMemberDecorate %type_TranslucentBasePass 214 Offset 2100
+ OpMemberDecorate %type_TranslucentBasePass 215 Offset 2104
+ OpMemberDecorate %type_TranslucentBasePass 216 Offset 2108
+ OpMemberDecorate %type_TranslucentBasePass 217 Offset 2112
+ OpMemberDecorate %type_TranslucentBasePass 218 Offset 2116
+ OpMemberDecorate %type_TranslucentBasePass 219 Offset 2120
+ OpMemberDecorate %type_TranslucentBasePass 220 Offset 2124
+ OpMemberDecorate %type_TranslucentBasePass 221 Offset 2128
+ OpMemberDecorate %type_TranslucentBasePass 222 Offset 2132
+ OpMemberDecorate %type_TranslucentBasePass 223 Offset 2136
+ OpMemberDecorate %type_TranslucentBasePass 224 Offset 2140
+ OpMemberDecorate %type_TranslucentBasePass 225 Offset 2144
+ OpMemberDecorate %type_TranslucentBasePass 226 Offset 2160
+ OpMemberDecorate %type_TranslucentBasePass 227 Offset 2176
+ OpDecorate %type_TranslucentBasePass Block
+ OpDecorate %_arr_v4float_uint_1 ArrayStride 16
+ OpMemberDecorate %type_Material 0 Offset 0
+ OpMemberDecorate %type_Material 1 Offset 32
+ OpDecorate %type_Material Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+ %uint_0 = OpConstant %uint 0
+ %bool = OpTypeBool
+ %int_1 = OpConstant %int 1
+ %int_0 = OpConstant %int 0
+ %int_2 = OpConstant %int 2
+ %float_0 = OpConstant %float 0
+ %48 = OpConstantComposite %v3float %float_0 %float_0 %float_0
+ %int_10 = OpConstant %int 10
+ %int_144 = OpConstant %int 144
+ %int_70 = OpConstant %int 70
+ %float_1 = OpConstant %float 1
+ %53 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+%float_0_577000022 = OpConstant %float 0.577000022
+ %55 = OpConstantComposite %v3float %float_0_577000022 %float_0_577000022 %float_0_577000022
+ %56 = OpConstantComposite %v3float %float_1 %float_1 %float_0
+ %57 = OpConstantComposite %v3float %float_0 %float_1 %float_1
+ %float_0_5 = OpConstant %float 0.5
+ %59 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
+ %int_60 = OpConstant %int 60
+ %61 = OpConstantComposite %v2float %float_0_5 %float_0_5
+ %uint_26 = OpConstant %uint 26
+ %uint_1 = OpConstant %uint 1
+ %uint_5 = OpConstant %uint 5
+ %uint_19 = OpConstant %uint 19
+ %float_n0_5 = OpConstant %float -0.5
+ %67 = OpConstantComposite %v2float %float_0_5 %float_n0_5
+ %68 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
+ %float_0_25 = OpConstant %float 0.25
+ %int_31 = OpConstant %int 31
+ %int_66 = OpConstant %int 66
+ %int_153 = OpConstant %int 153
+ %int_155 = OpConstant %int 155
+%mat3v3float = OpTypeMatrix %v3float 3
+ %75 = OpConstantComposite %v3float %float_0 %float_0 %float_1
+ %float_n1 = OpConstant %float -1
+%float_0_200000003 = OpConstant %float 0.200000003
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_arr_v4float_uint_7 = OpTypeArray %v4float %uint_7
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+ %type_View = OpTypeStruct %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %v3float %float %v3float %float %v4float %v4float %v3float %float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %v4float %v4float %v2float %v2float %v4float %v4float %v4float %v4float %int %float %float %float %v4float %v4float %v4float %v2float %float %float %float %float %float %float %v3float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %float %float %float %float %float %v4float %v3float %float %_arr_v4float_uint_2 %_arr_v4float_uint_2 %v4float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %v3float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %uint %uint %v4float %v3float %float %v4float %float %float %float %float %v4float %_arr_v4float_uint_7 %float %float %float %float %uint %float %float %float %v3float %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %float %float %float %float %v3float %float %v3float %float %v2float %float %float %v3float %float %v3float %float %v3float %float %v3float %float %float %float
+%_ptr_Uniform_type_View = OpTypePointer Uniform %type_View
+%type_3d_image = OpTypeImage %float 3D 2 0 0 1 Unknown
+%_ptr_UniformConstant_type_3d_image = OpTypePointer UniformConstant %type_3d_image
+%type_sampler = OpTypeSampler
+%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler
+%_runtimearr_v4float = OpTypeRuntimeArray %v4float
+%type_StructuredBuffer_v4float = OpTypeStruct %_runtimearr_v4float
+%_ptr_Uniform_type_StructuredBuffer_v4float = OpTypePointer Uniform %type_StructuredBuffer_v4float
+ %v3int = OpTypeVector %int 3
+%_arr_mat4v4float_uint_4 = OpTypeArray %mat4v4float %uint_4
+%mat3v4float = OpTypeMatrix %v4float 3
+%_arr_mat4v4float_uint_2 = OpTypeArray %mat4v4float %uint_2
+%type_TranslucentBasePass = OpTypeStruct %uint %uint %uint %uint %v3int %uint %uint %uint %uint %uint %v3float %float %v3float %float %v3float %float %uint %uint %v2float %uint %uint %uint %uint %v4float %_arr_mat4v4float_uint_4 %_arr_v4float_uint_4 %v4float %float %uint %uint %uint %v4float %mat4v4float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %v3int %uint %uint %uint %uint %uint %v3float %float %v3float %float %v3float %float %uint %uint %v2float %uint %uint %uint %uint %v4float %_arr_mat4v4float_uint_4 %_arr_v4float_uint_4 %v4float %float %uint %uint %uint %v4float %mat4v4float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %v4float %v4float %v4float %v4float %mat3v4float %v3float %float %v2float %float %float %_arr_mat4v4float_uint_2 %_arr_v4float_uint_2 %v2float %uint %float %float %float %float %float %v4float %v4float %v4float %v4float %v4float %v4float %v2float %float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %v4float %v4float %float
+%_ptr_Uniform_type_TranslucentBasePass = OpTypePointer Uniform %type_TranslucentBasePass
+%_arr_v4float_uint_1 = OpTypeArray %v4float %uint_1
+%type_Material = OpTypeStruct %_arr_v4float_uint_2 %_arr_v4float_uint_1
+%_ptr_Uniform_type_Material = OpTypePointer Uniform %type_Material
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Input_uint = OpTypePointer Input %uint
+%_ptr_Input_bool = OpTypePointer Input %bool
+%_arr_uint_uint_1 = OpTypeArray %uint %uint_1
+%_ptr_Input__arr_uint_uint_1 = OpTypePointer Input %_arr_uint_uint_1
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%_ptr_Output__arr_uint_uint_1 = OpTypePointer Output %_arr_uint_uint_1
+ %void = OpTypeVoid
+ %94 = OpTypeFunction %void
+%_ptr_Output_uint = OpTypePointer Output %uint
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+ %v3bool = OpTypeVector %bool 3
+%_ptr_Uniform_int = OpTypePointer Uniform %int
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+%type_sampled_image = OpTypeSampledImage %type_3d_image
+ %View = OpVariable %_ptr_Uniform_type_View Uniform
+%View_SharedBilinearClampedSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%View_PrimitiveSceneData = OpVariable %_ptr_Uniform_type_StructuredBuffer_v4float Uniform
+%TranslucentBasePass = OpVariable %_ptr_Uniform_type_TranslucentBasePass Uniform
+%TranslucentBasePass_Shared_Fog_IntegratedLightScattering = OpVariable %_ptr_UniformConstant_type_3d_image UniformConstant
+ %Material = OpVariable %_ptr_Uniform_type_Material Uniform
+%in_var_TEXCOORD10_centroid = OpVariable %_ptr_Input_v4float Input
+%in_var_TEXCOORD11_centroid = OpVariable %_ptr_Input_v4float Input
+%in_var_PRIMITIVE_ID = OpVariable %_ptr_Input_uint Input
+%in_var_TEXCOORD7 = OpVariable %_ptr_Input_v4float Input
+%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
+%gl_FrontFacing = OpVariable %_ptr_Input_bool Input
+%gl_SampleMask = OpVariable %_ptr_Input__arr_uint_uint_1 Input
+%out_var_SV_Target0 = OpVariable %_ptr_Output_v4float Output
+%gl_SampleMask_0 = OpVariable %_ptr_Output__arr_uint_uint_1 Output
+ %102 = OpConstantNull %v4float
+ %float_n1_5 = OpConstant %float -1.5
+ %float_3 = OpConstant %float 3
+ %105 = OpConstantComposite %v3float %float_n1 %float_n1_5 %float_3
+%float_12_25 = OpConstant %float 12.25
+%float_0_00200000009 = OpConstant %float 0.00200000009
+ %108 = OpUndef %float
+ %uint_15 = OpConstant %uint 15
+ %MainPS = OpFunction %void None %94
+ %110 = OpLabel
+ %111 = OpLoad %v4float %in_var_TEXCOORD10_centroid
+ %112 = OpLoad %v4float %in_var_TEXCOORD11_centroid
+ %113 = OpLoad %uint %in_var_PRIMITIVE_ID
+ %114 = OpLoad %v4float %in_var_TEXCOORD7
+ %115 = OpLoad %v4float %gl_FragCoord
+ %116 = OpLoad %_arr_uint_uint_1 %gl_SampleMask
+ %117 = OpCompositeExtract %uint %116 0
+ %118 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_1
+ %119 = OpLoad %mat4v4float %118
+ %120 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_10
+ %121 = OpLoad %mat4v4float %120
+ %122 = OpAccessChain %_ptr_Uniform_v3float %View %int_31
+ %123 = OpLoad %v3float %122
+ %124 = OpAccessChain %_ptr_Uniform_v4float %View %int_66
+ %125 = OpLoad %v4float %124
+ %126 = OpVectorShuffle %v3float %111 %111 0 1 2
+ %127 = OpVectorShuffle %v3float %112 %112 0 1 2
+ %128 = OpExtInst %v3float %1 Cross %127 %126
+ %129 = OpCompositeExtract %float %112 3
+ %130 = OpCompositeConstruct %v3float %129 %129 %129
+ %131 = OpFMul %v3float %128 %130
+ %132 = OpCompositeConstruct %mat3v3float %126 %131 %127
+ %133 = OpCompositeExtract %float %115 0
+ %134 = OpCompositeExtract %float %115 1
+ %135 = OpCompositeExtract %float %115 2
+ %136 = OpCompositeConstruct %v4float %133 %134 %135 %float_1
+ %137 = OpMatrixTimesVector %v4float %121 %136
+ %138 = OpVectorShuffle %v3float %137 %137 0 1 2
+ %139 = OpCompositeExtract %float %137 3
+ %140 = OpCompositeConstruct %v3float %139 %139 %139
+ %141 = OpFDiv %v3float %138 %140
+ %142 = OpFSub %v3float %141 %123
+ %143 = OpVectorShuffle %v3float %125 %125 0 1 2
+ %144 = OpCompositeExtract %float %125 3
+ %145 = OpCompositeConstruct %v3float %144 %144 %144
+ %146 = OpFMul %v3float %75 %145
+ %147 = OpFAdd %v3float %146 %143
+ %148 = OpExtInst %v3float %1 Normalize %147
+ %149 = OpMatrixTimesVector %v3float %132 %148
+ %150 = OpExtInst %v3float %1 Normalize %149
+ %151 = OpExtInst %float %1 Sqrt %float_12_25
+ %152 = OpCompositeConstruct %v3float %151 %151 %151
+ %153 = OpFDiv %v3float %105 %152
+ %154 = OpDot %float %153 %150
+ %155 = OpFAdd %float %float_1 %154
+ %156 = OpFMul %float %155 %float_0_5
+ %157 = OpFAdd %float %156 %float_0_200000003
+ %158 = OpAccessChain %_ptr_Uniform_v4float %Material %int_0 %int_1
+ %159 = OpLoad %v4float %158
+ %160 = OpVectorShuffle %v3float %159 %159 0 1 2
+ %161 = OpCompositeConstruct %v3float %157 %157 %157
+ %162 = OpFMul %v3float %160 %161
+ %163 = OpAccessChain %_ptr_Uniform_float %TranslucentBasePass %int_144
+ %164 = OpLoad %float %163
+ %165 = OpFOrdGreaterThan %bool %164 %float_0
+ OpSelectionMerge %166 None
+ OpBranchConditional %165 %167 %166
+ %167 = OpLabel
+ %168 = OpCompositeExtract %float %142 0
+ %169 = OpCompositeExtract %float %142 1
+ %170 = OpCompositeExtract %float %142 2
+ %171 = OpCompositeConstruct %v4float %168 %169 %170 %float_1
+ %172 = OpMatrixTimesVector %v4float %119 %171
+ %173 = OpCompositeExtract %float %172 3
+ %174 = OpCompositeConstruct %v2float %173 %173
+ %175 = OpVectorShuffle %v2float %172 %172 0 1
+ %176 = OpFDiv %v2float %175 %174
+ %177 = OpVectorShuffle %v2float %176 %102 0 1
+ %178 = OpFMul %v2float %177 %67
+ %179 = OpFAdd %v2float %178 %61
+ %180 = OpCompositeExtract %float %179 0
+ %181 = OpCompositeExtract %float %179 1
+ %182 = OpAccessChain %_ptr_Uniform_float %View %int_155 %int_0
+ %183 = OpLoad %float %182
+ %184 = OpFMul %float %173 %183
+ %185 = OpAccessChain %_ptr_Uniform_float %View %int_155 %int_1
+ %186 = OpLoad %float %185
+ %187 = OpFAdd %float %184 %186
+ %188 = OpExtInst %float %1 Log2 %187
+ %189 = OpAccessChain %_ptr_Uniform_float %View %int_155 %int_2
+ %190 = OpLoad %float %189
+ %191 = OpFMul %float %188 %190
+ %192 = OpAccessChain %_ptr_Uniform_float %View %int_153 %int_2
+ %193 = OpLoad %float %192
+ %194 = OpFMul %float %191 %193
+ %195 = OpCompositeConstruct %v3float %180 %181 %194
+ OpSelectionMerge %196 None
+ OpBranchConditional %165 %197 %196
+ %197 = OpLabel
+ %198 = OpLoad %type_3d_image %TranslucentBasePass_Shared_Fog_IntegratedLightScattering
+ %199 = OpLoad %type_sampler %View_SharedBilinearClampedSampler
+ %200 = OpSampledImage %type_sampled_image %198 %199
+ %201 = OpImageSampleExplicitLod %v4float %200 %195 Lod %float_0
+ OpBranch %196
+ %196 = OpLabel
+ %202 = OpPhi %v4float %68 %167 %201 %197
+ %203 = OpVectorShuffle %v3float %202 %202 0 1 2
+ %204 = OpVectorShuffle %v3float %114 %114 0 1 2
+ %205 = OpCompositeExtract %float %202 3
+ %206 = OpCompositeConstruct %v3float %205 %205 %205
+ %207 = OpFMul %v3float %204 %206
+ %208 = OpFAdd %v3float %203 %207
+ %209 = OpCompositeExtract %float %208 0
+ %210 = OpCompositeExtract %float %208 1
+ %211 = OpCompositeExtract %float %208 2
+ %212 = OpCompositeExtract %float %114 3
+ %213 = OpFMul %float %205 %212
+ %214 = OpCompositeConstruct %v4float %209 %210 %211 %213
+ OpBranch %166
+ %166 = OpLabel
+ %215 = OpPhi %v4float %114 %110 %214 %196
+ %216 = OpExtInst %v3float %1 FMax %162 %48
+ %217 = OpAccessChain %_ptr_Uniform_float %View %int_70
+ %218 = OpLoad %float %217
+ %219 = OpFOrdGreaterThan %bool %218 %float_0
+ OpSelectionMerge %220 DontFlatten
+ OpBranchConditional %219 %221 %220
+ %221 = OpLabel
+ %222 = OpIMul %uint %113 %uint_26
+ %223 = OpIAdd %uint %222 %uint_5
+ %224 = OpAccessChain %_ptr_Uniform_v4float %View_PrimitiveSceneData %int_0 %223
+ %225 = OpLoad %v4float %224
+ %226 = OpVectorShuffle %v3float %225 %225 0 1 2
+ %227 = OpFSub %v3float %142 %226
+ %228 = OpExtInst %v3float %1 FAbs %227
+ %229 = OpIAdd %uint %222 %uint_19
+ %230 = OpAccessChain %_ptr_Uniform_v4float %View_PrimitiveSceneData %int_0 %229
+ %231 = OpLoad %v4float %230
+ %232 = OpVectorShuffle %v3float %231 %231 0 1 2
+ %233 = OpFAdd %v3float %232 %53
+ %234 = OpFOrdGreaterThan %v3bool %228 %233
+ %235 = OpAny %bool %234
+ OpSelectionMerge %236 None
+ OpBranchConditional %235 %237 %236
+ %237 = OpLabel
+ %238 = OpDot %float %142 %55
+ %239 = OpFMul %float %238 %float_0_00200000009
+ %240 = OpExtInst %float %1 Fract %239
+ %241 = OpCompositeConstruct %v3float %240 %240 %240
+ %242 = OpFOrdGreaterThan %v3bool %241 %59
+ %243 = OpSelect %v3float %242 %53 %48
+ %244 = OpExtInst %v3float %1 FMix %56 %57 %243
+ OpBranch %236
+ %236 = OpLabel
+ %245 = OpPhi %v3float %216 %221 %244 %237
+ OpBranch %220
+ %220 = OpLabel
+ %246 = OpPhi %v3float %216 %166 %245 %236
+ %247 = OpCompositeExtract %float %215 3
+ %248 = OpCompositeConstruct %v3float %247 %247 %247
+ %249 = OpFMul %v3float %246 %248
+ %250 = OpVectorShuffle %v3float %215 %215 0 1 2
+ %251 = OpFAdd %v3float %249 %250
+ %252 = OpCompositeExtract %float %251 0
+ %253 = OpCompositeExtract %float %251 1
+ %254 = OpCompositeExtract %float %251 2
+ %255 = OpCompositeConstruct %v4float %252 %253 %254 %108
+ %256 = OpCompositeInsert %v4float %float_1 %255 3
+ %257 = OpAccessChain %_ptr_Uniform_int %View %int_60
+ %258 = OpLoad %int %257
+ %259 = OpSGreaterThan %bool %258 %int_1
+ OpSelectionMerge %260 None
+ OpBranchConditional %259 %261 %262
+ %262 = OpLabel
+ OpBranch %260
+ %261 = OpLabel
+ %263 = OpConvertSToF %float %258
+ %264 = OpFMul %float %263 %float_0_25
+ %265 = OpCompositeConstruct %v4float %264 %264 %264 %264
+ %266 = OpFMul %v4float %256 %265
+ %267 = OpBitwiseAnd %uint %117 %uint_15
+ OpBranch %260
+ %260 = OpLabel
+ %268 = OpPhi %v4float %266 %261 %256 %262
+ %269 = OpPhi %uint %267 %261 %117 %262
+ OpStore %out_var_SV_Target0 %268
+ %270 = OpAccessChain %_ptr_Output_uint %gl_SampleMask_0 %uint_0
+ OpStore %270 %269
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag
new file mode 100644
index 00000000000..e6565873a01
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag
@@ -0,0 +1,589 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 130
+; Schema: 0
+ OpCapability Shader
+ OpCapability InputAttachment
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %Main "main" %gl_FragCoord %out_var_SV_Target0
+ OpExecutionMode %Main OriginUpperLeft
+ OpSource HLSL 600
+ OpName %type_subpass_image "type.subpass.image"
+ OpName %gl_LastFragData "gl_LastFragData"
+ OpName %type_View "type.View"
+ OpMemberName %type_View 0 "View_TranslatedWorldToClip"
+ OpMemberName %type_View 1 "View_WorldToClip"
+ OpMemberName %type_View 2 "View_TranslatedWorldToView"
+ OpMemberName %type_View 3 "View_ViewToTranslatedWorld"
+ OpMemberName %type_View 4 "View_TranslatedWorldToCameraView"
+ OpMemberName %type_View 5 "View_CameraViewToTranslatedWorld"
+ OpMemberName %type_View 6 "View_ViewToClip"
+ OpMemberName %type_View 7 "View_ViewToClipNoAA"
+ OpMemberName %type_View 8 "View_ClipToView"
+ OpMemberName %type_View 9 "View_ClipToTranslatedWorld"
+ OpMemberName %type_View 10 "View_SVPositionToTranslatedWorld"
+ OpMemberName %type_View 11 "View_ScreenToWorld"
+ OpMemberName %type_View 12 "View_ScreenToTranslatedWorld"
+ OpMemberName %type_View 13 "View_ViewForward"
+ OpMemberName %type_View 14 "PrePadding_View_844"
+ OpMemberName %type_View 15 "View_ViewUp"
+ OpMemberName %type_View 16 "PrePadding_View_860"
+ OpMemberName %type_View 17 "View_ViewRight"
+ OpMemberName %type_View 18 "PrePadding_View_876"
+ OpMemberName %type_View 19 "View_HMDViewNoRollUp"
+ OpMemberName %type_View 20 "PrePadding_View_892"
+ OpMemberName %type_View 21 "View_HMDViewNoRollRight"
+ OpMemberName %type_View 22 "PrePadding_View_908"
+ OpMemberName %type_View 23 "View_InvDeviceZToWorldZTransform"
+ OpMemberName %type_View 24 "View_ScreenPositionScaleBias"
+ OpMemberName %type_View 25 "View_WorldCameraOrigin"
+ OpMemberName %type_View 26 "PrePadding_View_956"
+ OpMemberName %type_View 27 "View_TranslatedWorldCameraOrigin"
+ OpMemberName %type_View 28 "PrePadding_View_972"
+ OpMemberName %type_View 29 "View_WorldViewOrigin"
+ OpMemberName %type_View 30 "PrePadding_View_988"
+ OpMemberName %type_View 31 "View_PreViewTranslation"
+ OpMemberName %type_View 32 "PrePadding_View_1004"
+ OpMemberName %type_View 33 "View_PrevProjection"
+ OpMemberName %type_View 34 "View_PrevViewProj"
+ OpMemberName %type_View 35 "View_PrevViewRotationProj"
+ OpMemberName %type_View 36 "View_PrevViewToClip"
+ OpMemberName %type_View 37 "View_PrevClipToView"
+ OpMemberName %type_View 38 "View_PrevTranslatedWorldToClip"
+ OpMemberName %type_View 39 "View_PrevTranslatedWorldToView"
+ OpMemberName %type_View 40 "View_PrevViewToTranslatedWorld"
+ OpMemberName %type_View 41 "View_PrevTranslatedWorldToCameraView"
+ OpMemberName %type_View 42 "View_PrevCameraViewToTranslatedWorld"
+ OpMemberName %type_View 43 "View_PrevWorldCameraOrigin"
+ OpMemberName %type_View 44 "PrePadding_View_1660"
+ OpMemberName %type_View 45 "View_PrevWorldViewOrigin"
+ OpMemberName %type_View 46 "PrePadding_View_1676"
+ OpMemberName %type_View 47 "View_PrevPreViewTranslation"
+ OpMemberName %type_View 48 "PrePadding_View_1692"
+ OpMemberName %type_View 49 "View_PrevInvViewProj"
+ OpMemberName %type_View 50 "View_PrevScreenToTranslatedWorld"
+ OpMemberName %type_View 51 "View_ClipToPrevClip"
+ OpMemberName %type_View 52 "View_TemporalAAJitter"
+ OpMemberName %type_View 53 "View_GlobalClippingPlane"
+ OpMemberName %type_View 54 "View_FieldOfViewWideAngles"
+ OpMemberName %type_View 55 "View_PrevFieldOfViewWideAngles"
+ OpMemberName %type_View 56 "View_ViewRectMin"
+ OpMemberName %type_View 57 "View_ViewSizeAndInvSize"
+ OpMemberName %type_View 58 "View_BufferSizeAndInvSize"
+ OpMemberName %type_View 59 "View_BufferBilinearUVMinMax"
+ OpMemberName %type_View 60 "View_NumSceneColorMSAASamples"
+ OpMemberName %type_View 61 "View_PreExposure"
+ OpMemberName %type_View 62 "View_OneOverPreExposure"
+ OpMemberName %type_View 63 "PrePadding_View_2012"
+ OpMemberName %type_View 64 "View_DiffuseOverrideParameter"
+ OpMemberName %type_View 65 "View_SpecularOverrideParameter"
+ OpMemberName %type_View 66 "View_NormalOverrideParameter"
+ OpMemberName %type_View 67 "View_RoughnessOverrideParameter"
+ OpMemberName %type_View 68 "View_PrevFrameGameTime"
+ OpMemberName %type_View 69 "View_PrevFrameRealTime"
+ OpMemberName %type_View 70 "View_OutOfBoundsMask"
+ OpMemberName %type_View 71 "PrePadding_View_2084"
+ OpMemberName %type_View 72 "PrePadding_View_2088"
+ OpMemberName %type_View 73 "PrePadding_View_2092"
+ OpMemberName %type_View 74 "View_WorldCameraMovementSinceLastFrame"
+ OpMemberName %type_View 75 "View_CullingSign"
+ OpMemberName %type_View 76 "View_NearPlane"
+ OpMemberName %type_View 77 "View_AdaptiveTessellationFactor"
+ OpMemberName %type_View 78 "View_GameTime"
+ OpMemberName %type_View 79 "View_RealTime"
+ OpMemberName %type_View 80 "View_DeltaTime"
+ OpMemberName %type_View 81 "View_MaterialTextureMipBias"
+ OpMemberName %type_View 82 "View_MaterialTextureDerivativeMultiply"
+ OpMemberName %type_View 83 "View_Random"
+ OpMemberName %type_View 84 "View_FrameNumber"
+ OpMemberName %type_View 85 "View_StateFrameIndexMod8"
+ OpMemberName %type_View 86 "View_StateFrameIndex"
+ OpMemberName %type_View 87 "View_CameraCut"
+ OpMemberName %type_View 88 "View_UnlitViewmodeMask"
+ OpMemberName %type_View 89 "PrePadding_View_2164"
+ OpMemberName %type_View 90 "PrePadding_View_2168"
+ OpMemberName %type_View 91 "PrePadding_View_2172"
+ OpMemberName %type_View 92 "View_DirectionalLightColor"
+ OpMemberName %type_View 93 "View_DirectionalLightDirection"
+ OpMemberName %type_View 94 "PrePadding_View_2204"
+ OpMemberName %type_View 95 "View_TranslucencyLightingVolumeMin"
+ OpMemberName %type_View 96 "View_TranslucencyLightingVolumeInvSize"
+ OpMemberName %type_View 97 "View_TemporalAAParams"
+ OpMemberName %type_View 98 "View_CircleDOFParams"
+ OpMemberName %type_View 99 "View_DepthOfFieldSensorWidth"
+ OpMemberName %type_View 100 "View_DepthOfFieldFocalDistance"
+ OpMemberName %type_View 101 "View_DepthOfFieldScale"
+ OpMemberName %type_View 102 "View_DepthOfFieldFocalLength"
+ OpMemberName %type_View 103 "View_DepthOfFieldFocalRegion"
+ OpMemberName %type_View 104 "View_DepthOfFieldNearTransitionRegion"
+ OpMemberName %type_View 105 "View_DepthOfFieldFarTransitionRegion"
+ OpMemberName %type_View 106 "View_MotionBlurNormalizedToPixel"
+ OpMemberName %type_View 107 "View_bSubsurfacePostprocessEnabled"
+ OpMemberName %type_View 108 "View_GeneralPurposeTweak"
+ OpMemberName %type_View 109 "View_DemosaicVposOffset"
+ OpMemberName %type_View 110 "PrePadding_View_2348"
+ OpMemberName %type_View 111 "View_IndirectLightingColorScale"
+ OpMemberName %type_View 112 "View_HDR32bppEncodingMode"
+ OpMemberName %type_View 113 "View_AtmosphericFogSunDirection"
+ OpMemberName %type_View 114 "View_AtmosphericFogSunPower"
+ OpMemberName %type_View 115 "View_AtmosphericFogPower"
+ OpMemberName %type_View 116 "View_AtmosphericFogDensityScale"
+ OpMemberName %type_View 117 "View_AtmosphericFogDensityOffset"
+ OpMemberName %type_View 118 "View_AtmosphericFogGroundOffset"
+ OpMemberName %type_View 119 "View_AtmosphericFogDistanceScale"
+ OpMemberName %type_View 120 "View_AtmosphericFogAltitudeScale"
+ OpMemberName %type_View 121 "View_AtmosphericFogHeightScaleRayleigh"
+ OpMemberName %type_View 122 "View_AtmosphericFogStartDistance"
+ OpMemberName %type_View 123 "View_AtmosphericFogDistanceOffset"
+ OpMemberName %type_View 124 "View_AtmosphericFogSunDiscScale"
+ OpMemberName %type_View 125 "View_AtmosphericFogRenderMask"
+ OpMemberName %type_View 126 "View_AtmosphericFogInscatterAltitudeSampleNum"
+ OpMemberName %type_View 127 "View_AtmosphericFogSunColor"
+ OpMemberName %type_View 128 "View_NormalCurvatureToRoughnessScaleBias"
+ OpMemberName %type_View 129 "View_RenderingReflectionCaptureMask"
+ OpMemberName %type_View 130 "View_AmbientCubemapTint"
+ OpMemberName %type_View 131 "View_AmbientCubemapIntensity"
+ OpMemberName %type_View 132 "View_SkyLightParameters"
+ OpMemberName %type_View 133 "PrePadding_View_2488"
+ OpMemberName %type_View 134 "PrePadding_View_2492"
+ OpMemberName %type_View 135 "View_SkyLightColor"
+ OpMemberName %type_View 136 "View_SkyIrradianceEnvironmentMap"
+ OpMemberName %type_View 137 "View_MobilePreviewMode"
+ OpMemberName %type_View 138 "View_HMDEyePaddingOffset"
+ OpMemberName %type_View 139 "View_ReflectionCubemapMaxMip"
+ OpMemberName %type_View 140 "View_ShowDecalsMask"
+ OpMemberName %type_View 141 "View_DistanceFieldAOSpecularOcclusionMode"
+ OpMemberName %type_View 142 "View_IndirectCapsuleSelfShadowingIntensity"
+ OpMemberName %type_View 143 "PrePadding_View_2648"
+ OpMemberName %type_View 144 "PrePadding_View_2652"
+ OpMemberName %type_View 145 "View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight"
+ OpMemberName %type_View 146 "View_StereoPassIndex"
+ OpMemberName %type_View 147 "View_GlobalVolumeCenterAndExtent"
+ OpMemberName %type_View 148 "View_GlobalVolumeWorldToUVAddAndMul"
+ OpMemberName %type_View 149 "View_GlobalVolumeDimension"
+ OpMemberName %type_View 150 "View_GlobalVolumeTexelSize"
+ OpMemberName %type_View 151 "View_MaxGlobalDistance"
+ OpMemberName %type_View 152 "View_bCheckerboardSubsurfaceProfileRendering"
+ OpMemberName %type_View 153 "View_VolumetricFogInvGridSize"
+ OpMemberName %type_View 154 "PrePadding_View_2828"
+ OpMemberName %type_View 155 "View_VolumetricFogGridZParams"
+ OpMemberName %type_View 156 "PrePadding_View_2844"
+ OpMemberName %type_View 157 "View_VolumetricFogSVPosToVolumeUV"
+ OpMemberName %type_View 158 "View_VolumetricFogMaxDistance"
+ OpMemberName %type_View 159 "PrePadding_View_2860"
+ OpMemberName %type_View 160 "View_VolumetricLightmapWorldToUVScale"
+ OpMemberName %type_View 161 "PrePadding_View_2876"
+ OpMemberName %type_View 162 "View_VolumetricLightmapWorldToUVAdd"
+ OpMemberName %type_View 163 "PrePadding_View_2892"
+ OpMemberName %type_View 164 "View_VolumetricLightmapIndirectionTextureSize"
+ OpMemberName %type_View 165 "View_VolumetricLightmapBrickSize"
+ OpMemberName %type_View 166 "View_VolumetricLightmapBrickTexelSize"
+ OpMemberName %type_View 167 "View_StereoIPD"
+ OpMemberName %type_View 168 "View_IndirectLightingCacheShowFlag"
+ OpMemberName %type_View 169 "View_EyeToPixelSpreadAngle"
+ OpName %View "View"
+ OpName %type_sampler "type.sampler"
+ OpName %type_2d_image "type.2d.image"
+ OpName %ShadowDepthTexture "ShadowDepthTexture"
+ OpName %ShadowDepthTextureSampler "ShadowDepthTextureSampler"
+ OpName %type__Globals "type.$Globals"
+ OpMemberName %type__Globals 0 "SoftTransitionScale"
+ OpMemberName %type__Globals 1 "ShadowBufferSize"
+ OpMemberName %type__Globals 2 "ShadowFadeFraction"
+ OpMemberName %type__Globals 3 "ShadowSharpen"
+ OpMemberName %type__Globals 4 "LightPositionAndInvRadius"
+ OpMemberName %type__Globals 5 "ScreenToShadowMatrix"
+ OpMemberName %type__Globals 6 "ProjectionDepthBiasParameters"
+ OpMemberName %type__Globals 7 "ModulatedShadowColor"
+ OpMemberName %type__Globals 8 "ShadowTileOffsetAndSize"
+ OpName %_Globals "$Globals"
+ OpName %out_var_SV_Target0 "out.var.SV_Target0"
+ OpName %Main "Main"
+ OpName %type_sampled_image "type.sampled.image"
+ OpDecorate %gl_LastFragData InputAttachmentIndex 0
+ OpDecorate %gl_FragCoord BuiltIn FragCoord
+ OpDecorateString %gl_FragCoord UserSemantic "SV_POSITION"
+ OpDecorateString %out_var_SV_Target0 UserSemantic "SV_Target0"
+ OpDecorate %out_var_SV_Target0 Location 0
+ OpDecorate %gl_LastFragData DescriptorSet 0
+ OpDecorate %gl_LastFragData Binding 0
+ OpDecorate %View DescriptorSet 0
+ OpDecorate %View Binding 0
+ OpDecorate %ShadowDepthTexture DescriptorSet 0
+ OpDecorate %ShadowDepthTexture Binding 0
+ OpDecorate %ShadowDepthTextureSampler DescriptorSet 0
+ OpDecorate %ShadowDepthTextureSampler Binding 0
+ OpDecorate %_Globals DescriptorSet 0
+ OpDecorate %_Globals Binding 1
+ OpDecorate %_arr_v4float_uint_2 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_7 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpMemberDecorate %type_View 0 Offset 0
+ OpMemberDecorate %type_View 0 MatrixStride 16
+ OpMemberDecorate %type_View 0 ColMajor
+ OpMemberDecorate %type_View 1 Offset 64
+ OpMemberDecorate %type_View 1 MatrixStride 16
+ OpMemberDecorate %type_View 1 ColMajor
+ OpMemberDecorate %type_View 2 Offset 128
+ OpMemberDecorate %type_View 2 MatrixStride 16
+ OpMemberDecorate %type_View 2 ColMajor
+ OpMemberDecorate %type_View 3 Offset 192
+ OpMemberDecorate %type_View 3 MatrixStride 16
+ OpMemberDecorate %type_View 3 ColMajor
+ OpMemberDecorate %type_View 4 Offset 256
+ OpMemberDecorate %type_View 4 MatrixStride 16
+ OpMemberDecorate %type_View 4 ColMajor
+ OpMemberDecorate %type_View 5 Offset 320
+ OpMemberDecorate %type_View 5 MatrixStride 16
+ OpMemberDecorate %type_View 5 ColMajor
+ OpMemberDecorate %type_View 6 Offset 384
+ OpMemberDecorate %type_View 6 MatrixStride 16
+ OpMemberDecorate %type_View 6 ColMajor
+ OpMemberDecorate %type_View 7 Offset 448
+ OpMemberDecorate %type_View 7 MatrixStride 16
+ OpMemberDecorate %type_View 7 ColMajor
+ OpMemberDecorate %type_View 8 Offset 512
+ OpMemberDecorate %type_View 8 MatrixStride 16
+ OpMemberDecorate %type_View 8 ColMajor
+ OpMemberDecorate %type_View 9 Offset 576
+ OpMemberDecorate %type_View 9 MatrixStride 16
+ OpMemberDecorate %type_View 9 ColMajor
+ OpMemberDecorate %type_View 10 Offset 640
+ OpMemberDecorate %type_View 10 MatrixStride 16
+ OpMemberDecorate %type_View 10 ColMajor
+ OpMemberDecorate %type_View 11 Offset 704
+ OpMemberDecorate %type_View 11 MatrixStride 16
+ OpMemberDecorate %type_View 11 ColMajor
+ OpMemberDecorate %type_View 12 Offset 768
+ OpMemberDecorate %type_View 12 MatrixStride 16
+ OpMemberDecorate %type_View 12 ColMajor
+ OpMemberDecorate %type_View 13 Offset 832
+ OpMemberDecorate %type_View 14 Offset 844
+ OpMemberDecorate %type_View 15 Offset 848
+ OpMemberDecorate %type_View 16 Offset 860
+ OpMemberDecorate %type_View 17 Offset 864
+ OpMemberDecorate %type_View 18 Offset 876
+ OpMemberDecorate %type_View 19 Offset 880
+ OpMemberDecorate %type_View 20 Offset 892
+ OpMemberDecorate %type_View 21 Offset 896
+ OpMemberDecorate %type_View 22 Offset 908
+ OpMemberDecorate %type_View 23 Offset 912
+ OpMemberDecorate %type_View 24 Offset 928
+ OpMemberDecorate %type_View 25 Offset 944
+ OpMemberDecorate %type_View 26 Offset 956
+ OpMemberDecorate %type_View 27 Offset 960
+ OpMemberDecorate %type_View 28 Offset 972
+ OpMemberDecorate %type_View 29 Offset 976
+ OpMemberDecorate %type_View 30 Offset 988
+ OpMemberDecorate %type_View 31 Offset 992
+ OpMemberDecorate %type_View 32 Offset 1004
+ OpMemberDecorate %type_View 33 Offset 1008
+ OpMemberDecorate %type_View 33 MatrixStride 16
+ OpMemberDecorate %type_View 33 ColMajor
+ OpMemberDecorate %type_View 34 Offset 1072
+ OpMemberDecorate %type_View 34 MatrixStride 16
+ OpMemberDecorate %type_View 34 ColMajor
+ OpMemberDecorate %type_View 35 Offset 1136
+ OpMemberDecorate %type_View 35 MatrixStride 16
+ OpMemberDecorate %type_View 35 ColMajor
+ OpMemberDecorate %type_View 36 Offset 1200
+ OpMemberDecorate %type_View 36 MatrixStride 16
+ OpMemberDecorate %type_View 36 ColMajor
+ OpMemberDecorate %type_View 37 Offset 1264
+ OpMemberDecorate %type_View 37 MatrixStride 16
+ OpMemberDecorate %type_View 37 ColMajor
+ OpMemberDecorate %type_View 38 Offset 1328
+ OpMemberDecorate %type_View 38 MatrixStride 16
+ OpMemberDecorate %type_View 38 ColMajor
+ OpMemberDecorate %type_View 39 Offset 1392
+ OpMemberDecorate %type_View 39 MatrixStride 16
+ OpMemberDecorate %type_View 39 ColMajor
+ OpMemberDecorate %type_View 40 Offset 1456
+ OpMemberDecorate %type_View 40 MatrixStride 16
+ OpMemberDecorate %type_View 40 ColMajor
+ OpMemberDecorate %type_View 41 Offset 1520
+ OpMemberDecorate %type_View 41 MatrixStride 16
+ OpMemberDecorate %type_View 41 ColMajor
+ OpMemberDecorate %type_View 42 Offset 1584
+ OpMemberDecorate %type_View 42 MatrixStride 16
+ OpMemberDecorate %type_View 42 ColMajor
+ OpMemberDecorate %type_View 43 Offset 1648
+ OpMemberDecorate %type_View 44 Offset 1660
+ OpMemberDecorate %type_View 45 Offset 1664
+ OpMemberDecorate %type_View 46 Offset 1676
+ OpMemberDecorate %type_View 47 Offset 1680
+ OpMemberDecorate %type_View 48 Offset 1692
+ OpMemberDecorate %type_View 49 Offset 1696
+ OpMemberDecorate %type_View 49 MatrixStride 16
+ OpMemberDecorate %type_View 49 ColMajor
+ OpMemberDecorate %type_View 50 Offset 1760
+ OpMemberDecorate %type_View 50 MatrixStride 16
+ OpMemberDecorate %type_View 50 ColMajor
+ OpMemberDecorate %type_View 51 Offset 1824
+ OpMemberDecorate %type_View 51 MatrixStride 16
+ OpMemberDecorate %type_View 51 ColMajor
+ OpMemberDecorate %type_View 52 Offset 1888
+ OpMemberDecorate %type_View 53 Offset 1904
+ OpMemberDecorate %type_View 54 Offset 1920
+ OpMemberDecorate %type_View 55 Offset 1928
+ OpMemberDecorate %type_View 56 Offset 1936
+ OpMemberDecorate %type_View 57 Offset 1952
+ OpMemberDecorate %type_View 58 Offset 1968
+ OpMemberDecorate %type_View 59 Offset 1984
+ OpMemberDecorate %type_View 60 Offset 2000
+ OpMemberDecorate %type_View 61 Offset 2004
+ OpMemberDecorate %type_View 62 Offset 2008
+ OpMemberDecorate %type_View 63 Offset 2012
+ OpMemberDecorate %type_View 64 Offset 2016
+ OpMemberDecorate %type_View 65 Offset 2032
+ OpMemberDecorate %type_View 66 Offset 2048
+ OpMemberDecorate %type_View 67 Offset 2064
+ OpMemberDecorate %type_View 68 Offset 2072
+ OpMemberDecorate %type_View 69 Offset 2076
+ OpMemberDecorate %type_View 70 Offset 2080
+ OpMemberDecorate %type_View 71 Offset 2084
+ OpMemberDecorate %type_View 72 Offset 2088
+ OpMemberDecorate %type_View 73 Offset 2092
+ OpMemberDecorate %type_View 74 Offset 2096
+ OpMemberDecorate %type_View 75 Offset 2108
+ OpMemberDecorate %type_View 76 Offset 2112
+ OpMemberDecorate %type_View 77 Offset 2116
+ OpMemberDecorate %type_View 78 Offset 2120
+ OpMemberDecorate %type_View 79 Offset 2124
+ OpMemberDecorate %type_View 80 Offset 2128
+ OpMemberDecorate %type_View 81 Offset 2132
+ OpMemberDecorate %type_View 82 Offset 2136
+ OpMemberDecorate %type_View 83 Offset 2140
+ OpMemberDecorate %type_View 84 Offset 2144
+ OpMemberDecorate %type_View 85 Offset 2148
+ OpMemberDecorate %type_View 86 Offset 2152
+ OpMemberDecorate %type_View 87 Offset 2156
+ OpMemberDecorate %type_View 88 Offset 2160
+ OpMemberDecorate %type_View 89 Offset 2164
+ OpMemberDecorate %type_View 90 Offset 2168
+ OpMemberDecorate %type_View 91 Offset 2172
+ OpMemberDecorate %type_View 92 Offset 2176
+ OpMemberDecorate %type_View 93 Offset 2192
+ OpMemberDecorate %type_View 94 Offset 2204
+ OpMemberDecorate %type_View 95 Offset 2208
+ OpMemberDecorate %type_View 96 Offset 2240
+ OpMemberDecorate %type_View 97 Offset 2272
+ OpMemberDecorate %type_View 98 Offset 2288
+ OpMemberDecorate %type_View 99 Offset 2304
+ OpMemberDecorate %type_View 100 Offset 2308
+ OpMemberDecorate %type_View 101 Offset 2312
+ OpMemberDecorate %type_View 102 Offset 2316
+ OpMemberDecorate %type_View 103 Offset 2320
+ OpMemberDecorate %type_View 104 Offset 2324
+ OpMemberDecorate %type_View 105 Offset 2328
+ OpMemberDecorate %type_View 106 Offset 2332
+ OpMemberDecorate %type_View 107 Offset 2336
+ OpMemberDecorate %type_View 108 Offset 2340
+ OpMemberDecorate %type_View 109 Offset 2344
+ OpMemberDecorate %type_View 110 Offset 2348
+ OpMemberDecorate %type_View 111 Offset 2352
+ OpMemberDecorate %type_View 112 Offset 2364
+ OpMemberDecorate %type_View 113 Offset 2368
+ OpMemberDecorate %type_View 114 Offset 2380
+ OpMemberDecorate %type_View 115 Offset 2384
+ OpMemberDecorate %type_View 116 Offset 2388
+ OpMemberDecorate %type_View 117 Offset 2392
+ OpMemberDecorate %type_View 118 Offset 2396
+ OpMemberDecorate %type_View 119 Offset 2400
+ OpMemberDecorate %type_View 120 Offset 2404
+ OpMemberDecorate %type_View 121 Offset 2408
+ OpMemberDecorate %type_View 122 Offset 2412
+ OpMemberDecorate %type_View 123 Offset 2416
+ OpMemberDecorate %type_View 124 Offset 2420
+ OpMemberDecorate %type_View 125 Offset 2424
+ OpMemberDecorate %type_View 126 Offset 2428
+ OpMemberDecorate %type_View 127 Offset 2432
+ OpMemberDecorate %type_View 128 Offset 2448
+ OpMemberDecorate %type_View 129 Offset 2460
+ OpMemberDecorate %type_View 130 Offset 2464
+ OpMemberDecorate %type_View 131 Offset 2480
+ OpMemberDecorate %type_View 132 Offset 2484
+ OpMemberDecorate %type_View 133 Offset 2488
+ OpMemberDecorate %type_View 134 Offset 2492
+ OpMemberDecorate %type_View 135 Offset 2496
+ OpMemberDecorate %type_View 136 Offset 2512
+ OpMemberDecorate %type_View 137 Offset 2624
+ OpMemberDecorate %type_View 138 Offset 2628
+ OpMemberDecorate %type_View 139 Offset 2632
+ OpMemberDecorate %type_View 140 Offset 2636
+ OpMemberDecorate %type_View 141 Offset 2640
+ OpMemberDecorate %type_View 142 Offset 2644
+ OpMemberDecorate %type_View 143 Offset 2648
+ OpMemberDecorate %type_View 144 Offset 2652
+ OpMemberDecorate %type_View 145 Offset 2656
+ OpMemberDecorate %type_View 146 Offset 2668
+ OpMemberDecorate %type_View 147 Offset 2672
+ OpMemberDecorate %type_View 148 Offset 2736
+ OpMemberDecorate %type_View 149 Offset 2800
+ OpMemberDecorate %type_View 150 Offset 2804
+ OpMemberDecorate %type_View 151 Offset 2808
+ OpMemberDecorate %type_View 152 Offset 2812
+ OpMemberDecorate %type_View 153 Offset 2816
+ OpMemberDecorate %type_View 154 Offset 2828
+ OpMemberDecorate %type_View 155 Offset 2832
+ OpMemberDecorate %type_View 156 Offset 2844
+ OpMemberDecorate %type_View 157 Offset 2848
+ OpMemberDecorate %type_View 158 Offset 2856
+ OpMemberDecorate %type_View 159 Offset 2860
+ OpMemberDecorate %type_View 160 Offset 2864
+ OpMemberDecorate %type_View 161 Offset 2876
+ OpMemberDecorate %type_View 162 Offset 2880
+ OpMemberDecorate %type_View 163 Offset 2892
+ OpMemberDecorate %type_View 164 Offset 2896
+ OpMemberDecorate %type_View 165 Offset 2908
+ OpMemberDecorate %type_View 166 Offset 2912
+ OpMemberDecorate %type_View 167 Offset 2924
+ OpMemberDecorate %type_View 168 Offset 2928
+ OpMemberDecorate %type_View 169 Offset 2932
+ OpDecorate %type_View Block
+ OpMemberDecorate %type__Globals 0 Offset 0
+ OpMemberDecorate %type__Globals 1 Offset 16
+ OpMemberDecorate %type__Globals 2 Offset 32
+ OpMemberDecorate %type__Globals 3 Offset 36
+ OpMemberDecorate %type__Globals 4 Offset 48
+ OpMemberDecorate %type__Globals 5 Offset 64
+ OpMemberDecorate %type__Globals 5 MatrixStride 16
+ OpMemberDecorate %type__Globals 5 ColMajor
+ OpMemberDecorate %type__Globals 6 Offset 128
+ OpMemberDecorate %type__Globals 7 Offset 144
+ OpMemberDecorate %type__Globals 8 Offset 160
+ OpDecorate %type__Globals Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+ %float_1 = OpConstant %float 1
+ %int_58 = OpConstant %int 58
+ %int_24 = OpConstant %int 24
+ %int_5 = OpConstant %int 5
+ %int_2 = OpConstant %int 2
+ %int_3 = OpConstant %int 3
+ %int_8 = OpConstant %int 8
+%float_0_999989986 = OpConstant %float 0.999989986
+ %int_0 = OpConstant %int 0
+ %float_0 = OpConstant %float 0
+ %int_7 = OpConstant %int 7
+ %float_0_5 = OpConstant %float 0.5
+ %41 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+ %v2int = OpTypeVector %int 2
+ %43 = OpConstantComposite %v2int %int_0 %int_0
+ %44 = OpConstantComposite %v3float %float_0 %float_0 %float_0
+%type_subpass_image = OpTypeImage %float SubpassData 2 0 0 2 Unknown
+%_ptr_UniformConstant_type_subpass_image = OpTypePointer UniformConstant %type_subpass_image
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_arr_v4float_uint_7 = OpTypeArray %v4float %uint_7
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+ %type_View = OpTypeStruct %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %v3float %float %v3float %float %v4float %v4float %v3float %float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %v4float %v4float %v2float %v2float %v4float %v4float %v4float %v4float %int %float %float %float %v4float %v4float %v4float %v2float %float %float %float %float %float %float %v3float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %float %float %float %float %float %v4float %v3float %float %_arr_v4float_uint_2 %_arr_v4float_uint_2 %v4float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %v3float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %uint %uint %v4float %v3float %float %v4float %float %float %float %float %v4float %_arr_v4float_uint_7 %float %float %float %float %uint %float %float %float %v3float %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %float %float %float %float %v3float %float %v3float %float %v2float %float %float %v3float %float %v3float %float %v3float %float %v3float %float %float %float
+%_ptr_Uniform_type_View = OpTypePointer Uniform %type_View
+%type_sampler = OpTypeSampler
+%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler
+%type_2d_image = OpTypeImage %float 2D 2 0 0 1 Unknown
+%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image
+%type__Globals = OpTypeStruct %v3float %v4float %float %float %v4float %mat4v4float %v2float %v4float %v4float
+%_ptr_Uniform_type__Globals = OpTypePointer Uniform %type__Globals
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %53 = OpTypeFunction %void
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%type_sampled_image = OpTypeSampledImage %type_2d_image
+%gl_LastFragData = OpVariable %_ptr_UniformConstant_type_subpass_image UniformConstant
+ %View = OpVariable %_ptr_Uniform_type_View Uniform
+%ShadowDepthTexture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%ShadowDepthTextureSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+ %_Globals = OpVariable %_ptr_Uniform_type__Globals Uniform
+%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
+%out_var_SV_Target0 = OpVariable %_ptr_Output_v4float Output
+ %57 = OpConstantNull %v4float
+ %58 = OpUndef %v4float
+ %Main = OpFunction %void None %53
+ %59 = OpLabel
+ %60 = OpLoad %v4float %gl_FragCoord
+ %61 = OpVectorShuffle %v2float %60 %60 0 1
+ %62 = OpAccessChain %_ptr_Uniform_v4float %View %int_58
+ %63 = OpLoad %v4float %62
+ %64 = OpVectorShuffle %v2float %63 %63 2 3
+ %65 = OpFMul %v2float %61 %64
+ %66 = OpLoad %type_subpass_image %gl_LastFragData
+ %67 = OpImageRead %v4float %66 %43 None
+ %68 = OpCompositeExtract %float %67 3
+ %69 = OpAccessChain %_ptr_Uniform_v4float %View %int_24
+ %70 = OpLoad %v4float %69
+ %71 = OpVectorShuffle %v2float %70 %70 3 2
+ %72 = OpFSub %v2float %65 %71
+ %73 = OpVectorShuffle %v2float %70 %70 0 1
+ %74 = OpFDiv %v2float %72 %73
+ %75 = OpCompositeConstruct %v2float %68 %68
+ %76 = OpFMul %v2float %74 %75
+ %77 = OpCompositeExtract %float %76 0
+ %78 = OpCompositeExtract %float %76 1
+ %79 = OpCompositeConstruct %v4float %77 %78 %68 %float_1
+ %80 = OpAccessChain %_ptr_Uniform_mat4v4float %_Globals %int_5
+ %81 = OpLoad %mat4v4float %80
+ %82 = OpMatrixTimesVector %v4float %81 %79
+ %83 = OpCompositeExtract %float %82 2
+ %84 = OpCompositeExtract %float %82 3
+ %85 = OpCompositeConstruct %v3float %84 %84 %84
+ %86 = OpVectorShuffle %v3float %82 %82 0 1 2
+ %87 = OpFDiv %v3float %86 %85
+ %88 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_8
+ %89 = OpLoad %v4float %88
+ %90 = OpVectorShuffle %v2float %89 %89 2 3
+ %91 = OpVectorShuffle %v2float %87 %57 0 1
+ %92 = OpFMul %v2float %91 %90
+ %93 = OpVectorShuffle %v2float %89 %89 0 1
+ %94 = OpVectorShuffle %v2float %92 %57 0 1
+ %95 = OpFAdd %v2float %94 %93
+ %96 = OpExtInst %float %1 FMin %83 %float_0_999989986
+ %97 = OpLoad %type_2d_image %ShadowDepthTexture
+ %98 = OpLoad %type_sampler %ShadowDepthTextureSampler
+ %99 = OpAccessChain %_ptr_Uniform_float %_Globals %int_0 %int_2
+ %100 = OpLoad %float %99
+ %101 = OpVectorShuffle %v2float %95 %57 0 1
+ %102 = OpSampledImage %type_sampled_image %97 %98
+ %103 = OpImageSampleExplicitLod %v4float %102 %101 Lod %float_0
+ %104 = OpVectorShuffle %v3float %103 %103 0 0 0
+ %105 = OpFMul %float %96 %100
+ %106 = OpFSub %float %105 %float_1
+ %107 = OpCompositeConstruct %v3float %100 %100 %100
+ %108 = OpFMul %v3float %104 %107
+ %109 = OpCompositeConstruct %v3float %106 %106 %106
+ %110 = OpFSub %v3float %108 %109
+ %111 = OpExtInst %v3float %1 FClamp %110 %44 %41
+ %112 = OpCompositeExtract %float %111 0
+ %113 = OpFSub %float %112 %float_0_5
+ %114 = OpAccessChain %_ptr_Uniform_float %_Globals %int_3
+ %115 = OpLoad %float %114
+ %116 = OpFMul %float %113 %115
+ %117 = OpFAdd %float %116 %float_0_5
+ %118 = OpExtInst %float %1 FClamp %117 %float_0 %float_1
+ %119 = OpFMul %float %118 %118
+ %120 = OpAccessChain %_ptr_Uniform_float %_Globals %int_2
+ %121 = OpLoad %float %120
+ %122 = OpExtInst %float %1 FMix %float_1 %119 %121
+ %123 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_7
+ %124 = OpLoad %v4float %123
+ %125 = OpVectorShuffle %v3float %124 %124 0 1 2
+ %126 = OpCompositeConstruct %v3float %122 %122 %122
+ %127 = OpExtInst %v3float %1 FMix %125 %41 %126
+ %128 = OpVectorShuffle %v4float %58 %127 4 5 6 3
+ %129 = OpCompositeInsert %v4float %float_0 %128 3
+ OpStore %out_var_SV_Target0 %129
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/texture-atomics.asm.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/texture-atomics.asm.frag
new file mode 100644
index 00000000000..270a1978fcf
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/texture-atomics.asm.frag
@@ -0,0 +1,242 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 180
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledBuffer
+ OpCapability ImageBuffer
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %ShadowObjectCullPS "main" %in_var_TEXCOORD0 %gl_FragCoord %out_var_SV_Target0
+ OpExecutionMode %ShadowObjectCullPS OriginUpperLeft
+ OpSource HLSL 600
+ OpName %type_StructuredBuffer_v4float "type.StructuredBuffer.v4float"
+ OpName %CulledObjectBoxBounds "CulledObjectBoxBounds"
+ OpName %type__Globals "type.$Globals"
+ OpMemberName %type__Globals 0 "ShadowTileListGroupSize"
+ OpName %_Globals "$Globals"
+ OpName %type_buffer_image "type.buffer.image"
+ OpName %RWShadowTileNumCulledObjects "RWShadowTileNumCulledObjects"
+ OpName %in_var_TEXCOORD0 "in.var.TEXCOORD0"
+ OpName %out_var_SV_Target0 "out.var.SV_Target0"
+ OpName %ShadowObjectCullPS "ShadowObjectCullPS"
+ OpDecorateString %in_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorate %in_var_TEXCOORD0 Flat
+ OpDecorate %gl_FragCoord BuiltIn FragCoord
+ OpDecorateString %gl_FragCoord UserSemantic "SV_POSITION"
+ OpDecorateString %out_var_SV_Target0 UserSemantic "SV_Target0"
+ OpDecorate %in_var_TEXCOORD0 Location 0
+ OpDecorate %out_var_SV_Target0 Location 0
+ OpDecorate %CulledObjectBoxBounds DescriptorSet 0
+ OpDecorate %CulledObjectBoxBounds Binding 1
+ OpDecorate %_Globals DescriptorSet 0
+ OpDecorate %_Globals Binding 2
+ OpDecorate %RWShadowTileNumCulledObjects DescriptorSet 0
+ OpDecorate %RWShadowTileNumCulledObjects Binding 0
+ OpDecorate %_runtimearr_v4float ArrayStride 16
+ OpMemberDecorate %type_StructuredBuffer_v4float 0 Offset 0
+ OpMemberDecorate %type_StructuredBuffer_v4float 0 NonWritable
+ OpDecorate %type_StructuredBuffer_v4float BufferBlock
+ OpMemberDecorate %type__Globals 0 Offset 0
+ OpDecorate %type__Globals Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_4 = OpConstant %uint 4
+ %float_0 = OpConstant %float 0
+ %22 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+ %int_1 = OpConstant %int 1
+ %int_0 = OpConstant %int 0
+ %uint_1 = OpConstant %uint 1
+ %float_2 = OpConstant %float 2
+ %27 = OpConstantComposite %v2float %float_2 %float_2
+ %float_1 = OpConstant %float 1
+ %29 = OpConstantComposite %v2float %float_1 %float_1
+%float_n1000 = OpConstant %float -1000
+ %int_2 = OpConstant %int 2
+ %float_0_5 = OpConstant %float 0.5
+ %33 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
+%float_500000 = OpConstant %float 500000
+ %35 = OpConstantComposite %v3float %float_500000 %float_500000 %float_500000
+%float_n500000 = OpConstant %float -500000
+ %37 = OpConstantComposite %v3float %float_n500000 %float_n500000 %float_n500000
+ %int_3 = OpConstant %int 3
+ %int_4 = OpConstant %int 4
+ %int_5 = OpConstant %int 5
+ %int_6 = OpConstant %int 6
+ %int_7 = OpConstant %int 7
+ %int_8 = OpConstant %int 8
+ %44 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+ %float_n1 = OpConstant %float -1
+ %46 = OpConstantComposite %v3float %float_n1 %float_n1 %float_n1
+ %uint_5 = OpConstant %uint 5
+ %uint_0 = OpConstant %uint 0
+ %uint_3 = OpConstant %uint 3
+%_runtimearr_v4float = OpTypeRuntimeArray %v4float
+%type_StructuredBuffer_v4float = OpTypeStruct %_runtimearr_v4float
+%_ptr_Uniform_type_StructuredBuffer_v4float = OpTypePointer Uniform %type_StructuredBuffer_v4float
+ %v2uint = OpTypeVector %uint 2
+%type__Globals = OpTypeStruct %v2uint
+%_ptr_Uniform_type__Globals = OpTypePointer Uniform %type__Globals
+%type_buffer_image = OpTypeImage %uint Buffer 2 0 0 2 R32ui
+%_ptr_UniformConstant_type_buffer_image = OpTypePointer UniformConstant %type_buffer_image
+%_ptr_Input_uint = OpTypePointer Input %uint
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %58 = OpTypeFunction %void
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %uint_8 = OpConstant %uint 8
+%_arr_v3float_uint_8 = OpTypeArray %v3float %uint_8
+%_ptr_Function__arr_v3float_uint_8 = OpTypePointer Function %_arr_v3float_uint_8
+%_ptr_Uniform_v2uint = OpTypePointer Uniform %v2uint
+%_ptr_Uniform_uint = OpTypePointer Uniform %uint
+ %bool = OpTypeBool
+ %v2bool = OpTypeVector %bool 2
+ %v3bool = OpTypeVector %bool 3
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Image_uint = OpTypePointer Image %uint
+%CulledObjectBoxBounds = OpVariable %_ptr_Uniform_type_StructuredBuffer_v4float Uniform
+ %_Globals = OpVariable %_ptr_Uniform_type__Globals Uniform
+%RWShadowTileNumCulledObjects = OpVariable %_ptr_UniformConstant_type_buffer_image UniformConstant
+%in_var_TEXCOORD0 = OpVariable %_ptr_Input_uint Input
+%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
+%out_var_SV_Target0 = OpVariable %_ptr_Output_v4float Output
+ %70 = OpUndef %v3float
+ %71 = OpConstantNull %v3float
+%ShadowObjectCullPS = OpFunction %void None %58
+ %72 = OpLabel
+ %73 = OpVariable %_ptr_Function__arr_v3float_uint_8 Function
+ %74 = OpLoad %uint %in_var_TEXCOORD0
+ %75 = OpLoad %v4float %gl_FragCoord
+ %76 = OpVectorShuffle %v2float %75 %75 0 1
+ %77 = OpConvertFToU %v2uint %76
+ %78 = OpCompositeExtract %uint %77 1
+ %79 = OpAccessChain %_ptr_Uniform_v2uint %_Globals %int_0
+ %80 = OpAccessChain %_ptr_Uniform_uint %_Globals %int_0 %int_0
+ %81 = OpLoad %uint %80
+ %82 = OpIMul %uint %78 %81
+ %83 = OpCompositeExtract %uint %77 0
+ %84 = OpIAdd %uint %82 %83
+ %85 = OpConvertUToF %float %83
+ %86 = OpAccessChain %_ptr_Uniform_uint %_Globals %int_0 %int_1
+ %87 = OpLoad %uint %86
+ %88 = OpISub %uint %87 %uint_1
+ %89 = OpISub %uint %88 %78
+ %90 = OpConvertUToF %float %89
+ %91 = OpCompositeConstruct %v2float %85 %90
+ %92 = OpLoad %v2uint %79
+ %93 = OpConvertUToF %v2float %92
+ %94 = OpFDiv %v2float %91 %93
+ %95 = OpFMul %v2float %94 %27
+ %96 = OpFSub %v2float %95 %29
+ %97 = OpFAdd %v2float %91 %29
+ %98 = OpFDiv %v2float %97 %93
+ %99 = OpFMul %v2float %98 %27
+ %100 = OpFSub %v2float %99 %29
+ %101 = OpVectorShuffle %v3float %70 %100 3 4 2
+ %102 = OpCompositeInsert %v3float %float_1 %101 2
+ %103 = OpIMul %uint %74 %uint_5
+ %104 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %103
+ %105 = OpLoad %v4float %104
+ %106 = OpVectorShuffle %v3float %105 %105 0 1 2
+ %107 = OpIAdd %uint %103 %uint_1
+ %108 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %107
+ %109 = OpLoad %v4float %108
+ %110 = OpVectorShuffle %v3float %109 %109 0 1 2
+ %111 = OpVectorShuffle %v2float %109 %71 0 1
+ %112 = OpVectorShuffle %v2float %96 %71 0 1
+ %113 = OpFOrdGreaterThan %v2bool %111 %112
+ %114 = OpAll %bool %113
+ %115 = OpFOrdLessThan %v3bool %106 %102
+ %116 = OpAll %bool %115
+ %117 = OpLogicalAnd %bool %114 %116
+ OpSelectionMerge %118 DontFlatten
+ OpBranchConditional %117 %119 %118
+ %119 = OpLabel
+ %120 = OpFAdd %v3float %106 %110
+ %121 = OpFMul %v3float %33 %120
+ %122 = OpCompositeExtract %float %96 0
+ %123 = OpCompositeExtract %float %96 1
+ %124 = OpCompositeConstruct %v3float %122 %123 %float_n1000
+ %125 = OpAccessChain %_ptr_Function_v3float %73 %int_0
+ OpStore %125 %124
+ %126 = OpCompositeExtract %float %100 0
+ %127 = OpCompositeConstruct %v3float %126 %123 %float_n1000
+ %128 = OpAccessChain %_ptr_Function_v3float %73 %int_1
+ OpStore %128 %127
+ %129 = OpCompositeExtract %float %100 1
+ %130 = OpCompositeConstruct %v3float %122 %129 %float_n1000
+ %131 = OpAccessChain %_ptr_Function_v3float %73 %int_2
+ OpStore %131 %130
+ %132 = OpCompositeConstruct %v3float %126 %129 %float_n1000
+ %133 = OpAccessChain %_ptr_Function_v3float %73 %int_3
+ OpStore %133 %132
+ %134 = OpCompositeConstruct %v3float %122 %123 %float_1
+ %135 = OpAccessChain %_ptr_Function_v3float %73 %int_4
+ OpStore %135 %134
+ %136 = OpCompositeConstruct %v3float %126 %123 %float_1
+ %137 = OpAccessChain %_ptr_Function_v3float %73 %int_5
+ OpStore %137 %136
+ %138 = OpCompositeConstruct %v3float %122 %129 %float_1
+ %139 = OpAccessChain %_ptr_Function_v3float %73 %int_6
+ OpStore %139 %138
+ %140 = OpCompositeConstruct %v3float %126 %129 %float_1
+ %141 = OpAccessChain %_ptr_Function_v3float %73 %int_7
+ OpStore %141 %140
+ %142 = OpIAdd %uint %103 %uint_2
+ %143 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %142
+ %144 = OpLoad %v4float %143
+ %145 = OpVectorShuffle %v3float %144 %144 0 1 2
+ %146 = OpIAdd %uint %103 %uint_3
+ %147 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %146
+ %148 = OpLoad %v4float %147
+ %149 = OpVectorShuffle %v3float %148 %148 0 1 2
+ %150 = OpIAdd %uint %103 %uint_4
+ %151 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %150
+ %152 = OpLoad %v4float %151
+ %153 = OpVectorShuffle %v3float %152 %152 0 1 2
+ OpBranch %154
+ %154 = OpLabel
+ %155 = OpPhi %v3float %37 %119 %156 %157
+ %158 = OpPhi %v3float %35 %119 %159 %157
+ %160 = OpPhi %int %int_0 %119 %161 %157
+ %162 = OpSLessThan %bool %160 %int_8
+ OpLoopMerge %163 %157 Unroll
+ OpBranchConditional %162 %157 %163
+ %157 = OpLabel
+ %164 = OpAccessChain %_ptr_Function_v3float %73 %160
+ %165 = OpLoad %v3float %164
+ %166 = OpFSub %v3float %165 %121
+ %167 = OpDot %float %166 %145
+ %168 = OpDot %float %166 %149
+ %169 = OpDot %float %166 %153
+ %170 = OpCompositeConstruct %v3float %167 %168 %169
+ %159 = OpExtInst %v3float %1 FMin %158 %170
+ %156 = OpExtInst %v3float %1 FMax %155 %170
+ %161 = OpIAdd %int %160 %int_1
+ OpBranch %154
+ %163 = OpLabel
+ %171 = OpFOrdLessThan %v3bool %158 %44
+ %172 = OpAll %bool %171
+ %173 = OpFOrdGreaterThan %v3bool %155 %46
+ %174 = OpAll %bool %173
+ %175 = OpLogicalAnd %bool %172 %174
+ OpSelectionMerge %176 DontFlatten
+ OpBranchConditional %175 %177 %176
+ %177 = OpLabel
+ %178 = OpImageTexelPointer %_ptr_Image_uint %RWShadowTileNumCulledObjects %84 %uint_0
+ %179 = OpAtomicIAdd %uint %178 %uint_1 %uint_0 %uint_1
+ OpBranch %176
+ %176 = OpLabel
+ OpBranch %118
+ %118 = OpLabel
+ OpStore %out_var_SV_Target0 %22
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag
new file mode 100644
index 00000000000..270a1978fcf
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag
@@ -0,0 +1,242 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 180
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledBuffer
+ OpCapability ImageBuffer
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %ShadowObjectCullPS "main" %in_var_TEXCOORD0 %gl_FragCoord %out_var_SV_Target0
+ OpExecutionMode %ShadowObjectCullPS OriginUpperLeft
+ OpSource HLSL 600
+ OpName %type_StructuredBuffer_v4float "type.StructuredBuffer.v4float"
+ OpName %CulledObjectBoxBounds "CulledObjectBoxBounds"
+ OpName %type__Globals "type.$Globals"
+ OpMemberName %type__Globals 0 "ShadowTileListGroupSize"
+ OpName %_Globals "$Globals"
+ OpName %type_buffer_image "type.buffer.image"
+ OpName %RWShadowTileNumCulledObjects "RWShadowTileNumCulledObjects"
+ OpName %in_var_TEXCOORD0 "in.var.TEXCOORD0"
+ OpName %out_var_SV_Target0 "out.var.SV_Target0"
+ OpName %ShadowObjectCullPS "ShadowObjectCullPS"
+ OpDecorateString %in_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorate %in_var_TEXCOORD0 Flat
+ OpDecorate %gl_FragCoord BuiltIn FragCoord
+ OpDecorateString %gl_FragCoord UserSemantic "SV_POSITION"
+ OpDecorateString %out_var_SV_Target0 UserSemantic "SV_Target0"
+ OpDecorate %in_var_TEXCOORD0 Location 0
+ OpDecorate %out_var_SV_Target0 Location 0
+ OpDecorate %CulledObjectBoxBounds DescriptorSet 0
+ OpDecorate %CulledObjectBoxBounds Binding 1
+ OpDecorate %_Globals DescriptorSet 0
+ OpDecorate %_Globals Binding 2
+ OpDecorate %RWShadowTileNumCulledObjects DescriptorSet 0
+ OpDecorate %RWShadowTileNumCulledObjects Binding 0
+ OpDecorate %_runtimearr_v4float ArrayStride 16
+ OpMemberDecorate %type_StructuredBuffer_v4float 0 Offset 0
+ OpMemberDecorate %type_StructuredBuffer_v4float 0 NonWritable
+ OpDecorate %type_StructuredBuffer_v4float BufferBlock
+ OpMemberDecorate %type__Globals 0 Offset 0
+ OpDecorate %type__Globals Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_4 = OpConstant %uint 4
+ %float_0 = OpConstant %float 0
+ %22 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+ %int_1 = OpConstant %int 1
+ %int_0 = OpConstant %int 0
+ %uint_1 = OpConstant %uint 1
+ %float_2 = OpConstant %float 2
+ %27 = OpConstantComposite %v2float %float_2 %float_2
+ %float_1 = OpConstant %float 1
+ %29 = OpConstantComposite %v2float %float_1 %float_1
+%float_n1000 = OpConstant %float -1000
+ %int_2 = OpConstant %int 2
+ %float_0_5 = OpConstant %float 0.5
+ %33 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
+%float_500000 = OpConstant %float 500000
+ %35 = OpConstantComposite %v3float %float_500000 %float_500000 %float_500000
+%float_n500000 = OpConstant %float -500000
+ %37 = OpConstantComposite %v3float %float_n500000 %float_n500000 %float_n500000
+ %int_3 = OpConstant %int 3
+ %int_4 = OpConstant %int 4
+ %int_5 = OpConstant %int 5
+ %int_6 = OpConstant %int 6
+ %int_7 = OpConstant %int 7
+ %int_8 = OpConstant %int 8
+ %44 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+ %float_n1 = OpConstant %float -1
+ %46 = OpConstantComposite %v3float %float_n1 %float_n1 %float_n1
+ %uint_5 = OpConstant %uint 5
+ %uint_0 = OpConstant %uint 0
+ %uint_3 = OpConstant %uint 3
+%_runtimearr_v4float = OpTypeRuntimeArray %v4float
+%type_StructuredBuffer_v4float = OpTypeStruct %_runtimearr_v4float
+%_ptr_Uniform_type_StructuredBuffer_v4float = OpTypePointer Uniform %type_StructuredBuffer_v4float
+ %v2uint = OpTypeVector %uint 2
+%type__Globals = OpTypeStruct %v2uint
+%_ptr_Uniform_type__Globals = OpTypePointer Uniform %type__Globals
+%type_buffer_image = OpTypeImage %uint Buffer 2 0 0 2 R32ui
+%_ptr_UniformConstant_type_buffer_image = OpTypePointer UniformConstant %type_buffer_image
+%_ptr_Input_uint = OpTypePointer Input %uint
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %58 = OpTypeFunction %void
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %uint_8 = OpConstant %uint 8
+%_arr_v3float_uint_8 = OpTypeArray %v3float %uint_8
+%_ptr_Function__arr_v3float_uint_8 = OpTypePointer Function %_arr_v3float_uint_8
+%_ptr_Uniform_v2uint = OpTypePointer Uniform %v2uint
+%_ptr_Uniform_uint = OpTypePointer Uniform %uint
+ %bool = OpTypeBool
+ %v2bool = OpTypeVector %bool 2
+ %v3bool = OpTypeVector %bool 3
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Image_uint = OpTypePointer Image %uint
+%CulledObjectBoxBounds = OpVariable %_ptr_Uniform_type_StructuredBuffer_v4float Uniform
+ %_Globals = OpVariable %_ptr_Uniform_type__Globals Uniform
+%RWShadowTileNumCulledObjects = OpVariable %_ptr_UniformConstant_type_buffer_image UniformConstant
+%in_var_TEXCOORD0 = OpVariable %_ptr_Input_uint Input
+%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
+%out_var_SV_Target0 = OpVariable %_ptr_Output_v4float Output
+ %70 = OpUndef %v3float
+ %71 = OpConstantNull %v3float
+%ShadowObjectCullPS = OpFunction %void None %58
+ %72 = OpLabel
+ %73 = OpVariable %_ptr_Function__arr_v3float_uint_8 Function
+ %74 = OpLoad %uint %in_var_TEXCOORD0
+ %75 = OpLoad %v4float %gl_FragCoord
+ %76 = OpVectorShuffle %v2float %75 %75 0 1
+ %77 = OpConvertFToU %v2uint %76
+ %78 = OpCompositeExtract %uint %77 1
+ %79 = OpAccessChain %_ptr_Uniform_v2uint %_Globals %int_0
+ %80 = OpAccessChain %_ptr_Uniform_uint %_Globals %int_0 %int_0
+ %81 = OpLoad %uint %80
+ %82 = OpIMul %uint %78 %81
+ %83 = OpCompositeExtract %uint %77 0
+ %84 = OpIAdd %uint %82 %83
+ %85 = OpConvertUToF %float %83
+ %86 = OpAccessChain %_ptr_Uniform_uint %_Globals %int_0 %int_1
+ %87 = OpLoad %uint %86
+ %88 = OpISub %uint %87 %uint_1
+ %89 = OpISub %uint %88 %78
+ %90 = OpConvertUToF %float %89
+ %91 = OpCompositeConstruct %v2float %85 %90
+ %92 = OpLoad %v2uint %79
+ %93 = OpConvertUToF %v2float %92
+ %94 = OpFDiv %v2float %91 %93
+ %95 = OpFMul %v2float %94 %27
+ %96 = OpFSub %v2float %95 %29
+ %97 = OpFAdd %v2float %91 %29
+ %98 = OpFDiv %v2float %97 %93
+ %99 = OpFMul %v2float %98 %27
+ %100 = OpFSub %v2float %99 %29
+ %101 = OpVectorShuffle %v3float %70 %100 3 4 2
+ %102 = OpCompositeInsert %v3float %float_1 %101 2
+ %103 = OpIMul %uint %74 %uint_5
+ %104 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %103
+ %105 = OpLoad %v4float %104
+ %106 = OpVectorShuffle %v3float %105 %105 0 1 2
+ %107 = OpIAdd %uint %103 %uint_1
+ %108 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %107
+ %109 = OpLoad %v4float %108
+ %110 = OpVectorShuffle %v3float %109 %109 0 1 2
+ %111 = OpVectorShuffle %v2float %109 %71 0 1
+ %112 = OpVectorShuffle %v2float %96 %71 0 1
+ %113 = OpFOrdGreaterThan %v2bool %111 %112
+ %114 = OpAll %bool %113
+ %115 = OpFOrdLessThan %v3bool %106 %102
+ %116 = OpAll %bool %115
+ %117 = OpLogicalAnd %bool %114 %116
+ OpSelectionMerge %118 DontFlatten
+ OpBranchConditional %117 %119 %118
+ %119 = OpLabel
+ %120 = OpFAdd %v3float %106 %110
+ %121 = OpFMul %v3float %33 %120
+ %122 = OpCompositeExtract %float %96 0
+ %123 = OpCompositeExtract %float %96 1
+ %124 = OpCompositeConstruct %v3float %122 %123 %float_n1000
+ %125 = OpAccessChain %_ptr_Function_v3float %73 %int_0
+ OpStore %125 %124
+ %126 = OpCompositeExtract %float %100 0
+ %127 = OpCompositeConstruct %v3float %126 %123 %float_n1000
+ %128 = OpAccessChain %_ptr_Function_v3float %73 %int_1
+ OpStore %128 %127
+ %129 = OpCompositeExtract %float %100 1
+ %130 = OpCompositeConstruct %v3float %122 %129 %float_n1000
+ %131 = OpAccessChain %_ptr_Function_v3float %73 %int_2
+ OpStore %131 %130
+ %132 = OpCompositeConstruct %v3float %126 %129 %float_n1000
+ %133 = OpAccessChain %_ptr_Function_v3float %73 %int_3
+ OpStore %133 %132
+ %134 = OpCompositeConstruct %v3float %122 %123 %float_1
+ %135 = OpAccessChain %_ptr_Function_v3float %73 %int_4
+ OpStore %135 %134
+ %136 = OpCompositeConstruct %v3float %126 %123 %float_1
+ %137 = OpAccessChain %_ptr_Function_v3float %73 %int_5
+ OpStore %137 %136
+ %138 = OpCompositeConstruct %v3float %122 %129 %float_1
+ %139 = OpAccessChain %_ptr_Function_v3float %73 %int_6
+ OpStore %139 %138
+ %140 = OpCompositeConstruct %v3float %126 %129 %float_1
+ %141 = OpAccessChain %_ptr_Function_v3float %73 %int_7
+ OpStore %141 %140
+ %142 = OpIAdd %uint %103 %uint_2
+ %143 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %142
+ %144 = OpLoad %v4float %143
+ %145 = OpVectorShuffle %v3float %144 %144 0 1 2
+ %146 = OpIAdd %uint %103 %uint_3
+ %147 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %146
+ %148 = OpLoad %v4float %147
+ %149 = OpVectorShuffle %v3float %148 %148 0 1 2
+ %150 = OpIAdd %uint %103 %uint_4
+ %151 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %150
+ %152 = OpLoad %v4float %151
+ %153 = OpVectorShuffle %v3float %152 %152 0 1 2
+ OpBranch %154
+ %154 = OpLabel
+ %155 = OpPhi %v3float %37 %119 %156 %157
+ %158 = OpPhi %v3float %35 %119 %159 %157
+ %160 = OpPhi %int %int_0 %119 %161 %157
+ %162 = OpSLessThan %bool %160 %int_8
+ OpLoopMerge %163 %157 Unroll
+ OpBranchConditional %162 %157 %163
+ %157 = OpLabel
+ %164 = OpAccessChain %_ptr_Function_v3float %73 %160
+ %165 = OpLoad %v3float %164
+ %166 = OpFSub %v3float %165 %121
+ %167 = OpDot %float %166 %145
+ %168 = OpDot %float %166 %149
+ %169 = OpDot %float %166 %153
+ %170 = OpCompositeConstruct %v3float %167 %168 %169
+ %159 = OpExtInst %v3float %1 FMin %158 %170
+ %156 = OpExtInst %v3float %1 FMax %155 %170
+ %161 = OpIAdd %int %160 %int_1
+ OpBranch %154
+ %163 = OpLabel
+ %171 = OpFOrdLessThan %v3bool %158 %44
+ %172 = OpAll %bool %171
+ %173 = OpFOrdGreaterThan %v3bool %155 %46
+ %174 = OpAll %bool %173
+ %175 = OpLogicalAnd %bool %172 %174
+ OpSelectionMerge %176 DontFlatten
+ OpBranchConditional %175 %177 %176
+ %177 = OpLabel
+ %178 = OpImageTexelPointer %_ptr_Image_uint %RWShadowTileNumCulledObjects %84 %uint_0
+ %179 = OpAtomicIAdd %uint %178 %uint_1 %uint_0 %uint_1
+ OpBranch %176
+ %176 = OpLabel
+ OpBranch %118
+ %118 = OpLabel
+ OpStore %out_var_SV_Target0 %22
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/hs-incorrect-base-type.asm.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/hs-incorrect-base-type.asm.tesc
new file mode 100644
index 00000000000..4c70e14cb72
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/hs-incorrect-base-type.asm.tesc
@@ -0,0 +1,1158 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 598
+; Schema: 0
+ OpCapability Tessellation
+ OpCapability SampledBuffer
+ OpCapability StorageImageExtendedFormats
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint TessellationControl %MainHull "main" %in_var_TEXCOORD10_centroid %in_var_TEXCOORD11_centroid %in_var_COLOR0 %in_var_TEXCOORD0 %in_var_TEXCOORD4 %in_var_PRIMITIVE_ID %in_var_LIGHTMAP_ID %in_var_VS_To_DS_Position %gl_InvocationID %out_var_TEXCOORD10_centroid %out_var_TEXCOORD11_centroid %out_var_COLOR0 %out_var_TEXCOORD0 %out_var_TEXCOORD4 %out_var_PRIMITIVE_ID %out_var_LIGHTMAP_ID %out_var_VS_To_DS_Position %out_var_PN_POSITION %out_var_PN_DisplacementScales %out_var_PN_TessellationMultiplier %out_var_PN_WorldDisplacementMultiplier %gl_TessLevelOuter %gl_TessLevelInner %out_var_PN_POSITION9
+ OpExecutionMode %MainHull Triangles
+ OpExecutionMode %MainHull SpacingFractionalOdd
+ OpExecutionMode %MainHull VertexOrderCw
+ OpExecutionMode %MainHull OutputVertices 3
+ OpSource HLSL 600
+ OpName %FPNTessellationHSToDS "FPNTessellationHSToDS"
+ OpMemberName %FPNTessellationHSToDS 0 "PassSpecificData"
+ OpMemberName %FPNTessellationHSToDS 1 "WorldPosition"
+ OpMemberName %FPNTessellationHSToDS 2 "DisplacementScale"
+ OpMemberName %FPNTessellationHSToDS 3 "TessellationMultiplier"
+ OpMemberName %FPNTessellationHSToDS 4 "WorldDisplacementMultiplier"
+ OpName %FBasePassVSToDS "FBasePassVSToDS"
+ OpMemberName %FBasePassVSToDS 0 "FactoryInterpolants"
+ OpMemberName %FBasePassVSToDS 1 "BasePassInterpolants"
+ OpMemberName %FBasePassVSToDS 2 "Position"
+ OpName %FVertexFactoryInterpolantsVSToDS "FVertexFactoryInterpolantsVSToDS"
+ OpMemberName %FVertexFactoryInterpolantsVSToDS 0 "InterpolantsVSToPS"
+ OpName %FVertexFactoryInterpolantsVSToPS "FVertexFactoryInterpolantsVSToPS"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 0 "TangentToWorld0"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 1 "TangentToWorld2"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 2 "Color"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 3 "TexCoords"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 4 "LightMapCoordinate"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 5 "PrimitiveId"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 6 "LightmapDataIndex"
+ OpName %FBasePassInterpolantsVSToDS "FBasePassInterpolantsVSToDS"
+ OpName %FSharedBasePassInterpolants "FSharedBasePassInterpolants"
+ OpName %type_View "type.View"
+ OpMemberName %type_View 0 "View_TranslatedWorldToClip"
+ OpMemberName %type_View 1 "View_WorldToClip"
+ OpMemberName %type_View 2 "View_TranslatedWorldToView"
+ OpMemberName %type_View 3 "View_ViewToTranslatedWorld"
+ OpMemberName %type_View 4 "View_TranslatedWorldToCameraView"
+ OpMemberName %type_View 5 "View_CameraViewToTranslatedWorld"
+ OpMemberName %type_View 6 "View_ViewToClip"
+ OpMemberName %type_View 7 "View_ViewToClipNoAA"
+ OpMemberName %type_View 8 "View_ClipToView"
+ OpMemberName %type_View 9 "View_ClipToTranslatedWorld"
+ OpMemberName %type_View 10 "View_SVPositionToTranslatedWorld"
+ OpMemberName %type_View 11 "View_ScreenToWorld"
+ OpMemberName %type_View 12 "View_ScreenToTranslatedWorld"
+ OpMemberName %type_View 13 "View_ViewForward"
+ OpMemberName %type_View 14 "PrePadding_View_844"
+ OpMemberName %type_View 15 "View_ViewUp"
+ OpMemberName %type_View 16 "PrePadding_View_860"
+ OpMemberName %type_View 17 "View_ViewRight"
+ OpMemberName %type_View 18 "PrePadding_View_876"
+ OpMemberName %type_View 19 "View_HMDViewNoRollUp"
+ OpMemberName %type_View 20 "PrePadding_View_892"
+ OpMemberName %type_View 21 "View_HMDViewNoRollRight"
+ OpMemberName %type_View 22 "PrePadding_View_908"
+ OpMemberName %type_View 23 "View_InvDeviceZToWorldZTransform"
+ OpMemberName %type_View 24 "View_ScreenPositionScaleBias"
+ OpMemberName %type_View 25 "View_WorldCameraOrigin"
+ OpMemberName %type_View 26 "PrePadding_View_956"
+ OpMemberName %type_View 27 "View_TranslatedWorldCameraOrigin"
+ OpMemberName %type_View 28 "PrePadding_View_972"
+ OpMemberName %type_View 29 "View_WorldViewOrigin"
+ OpMemberName %type_View 30 "PrePadding_View_988"
+ OpMemberName %type_View 31 "View_PreViewTranslation"
+ OpMemberName %type_View 32 "PrePadding_View_1004"
+ OpMemberName %type_View 33 "View_PrevProjection"
+ OpMemberName %type_View 34 "View_PrevViewProj"
+ OpMemberName %type_View 35 "View_PrevViewRotationProj"
+ OpMemberName %type_View 36 "View_PrevViewToClip"
+ OpMemberName %type_View 37 "View_PrevClipToView"
+ OpMemberName %type_View 38 "View_PrevTranslatedWorldToClip"
+ OpMemberName %type_View 39 "View_PrevTranslatedWorldToView"
+ OpMemberName %type_View 40 "View_PrevViewToTranslatedWorld"
+ OpMemberName %type_View 41 "View_PrevTranslatedWorldToCameraView"
+ OpMemberName %type_View 42 "View_PrevCameraViewToTranslatedWorld"
+ OpMemberName %type_View 43 "View_PrevWorldCameraOrigin"
+ OpMemberName %type_View 44 "PrePadding_View_1660"
+ OpMemberName %type_View 45 "View_PrevWorldViewOrigin"
+ OpMemberName %type_View 46 "PrePadding_View_1676"
+ OpMemberName %type_View 47 "View_PrevPreViewTranslation"
+ OpMemberName %type_View 48 "PrePadding_View_1692"
+ OpMemberName %type_View 49 "View_PrevInvViewProj"
+ OpMemberName %type_View 50 "View_PrevScreenToTranslatedWorld"
+ OpMemberName %type_View 51 "View_ClipToPrevClip"
+ OpMemberName %type_View 52 "View_TemporalAAJitter"
+ OpMemberName %type_View 53 "View_GlobalClippingPlane"
+ OpMemberName %type_View 54 "View_FieldOfViewWideAngles"
+ OpMemberName %type_View 55 "View_PrevFieldOfViewWideAngles"
+ OpMemberName %type_View 56 "View_ViewRectMin"
+ OpMemberName %type_View 57 "View_ViewSizeAndInvSize"
+ OpMemberName %type_View 58 "View_BufferSizeAndInvSize"
+ OpMemberName %type_View 59 "View_BufferBilinearUVMinMax"
+ OpMemberName %type_View 60 "View_NumSceneColorMSAASamples"
+ OpMemberName %type_View 61 "View_PreExposure"
+ OpMemberName %type_View 62 "View_OneOverPreExposure"
+ OpMemberName %type_View 63 "PrePadding_View_2012"
+ OpMemberName %type_View 64 "View_DiffuseOverrideParameter"
+ OpMemberName %type_View 65 "View_SpecularOverrideParameter"
+ OpMemberName %type_View 66 "View_NormalOverrideParameter"
+ OpMemberName %type_View 67 "View_RoughnessOverrideParameter"
+ OpMemberName %type_View 68 "View_PrevFrameGameTime"
+ OpMemberName %type_View 69 "View_PrevFrameRealTime"
+ OpMemberName %type_View 70 "View_OutOfBoundsMask"
+ OpMemberName %type_View 71 "PrePadding_View_2084"
+ OpMemberName %type_View 72 "PrePadding_View_2088"
+ OpMemberName %type_View 73 "PrePadding_View_2092"
+ OpMemberName %type_View 74 "View_WorldCameraMovementSinceLastFrame"
+ OpMemberName %type_View 75 "View_CullingSign"
+ OpMemberName %type_View 76 "View_NearPlane"
+ OpMemberName %type_View 77 "View_AdaptiveTessellationFactor"
+ OpMemberName %type_View 78 "View_GameTime"
+ OpMemberName %type_View 79 "View_RealTime"
+ OpMemberName %type_View 80 "View_DeltaTime"
+ OpMemberName %type_View 81 "View_MaterialTextureMipBias"
+ OpMemberName %type_View 82 "View_MaterialTextureDerivativeMultiply"
+ OpMemberName %type_View 83 "View_Random"
+ OpMemberName %type_View 84 "View_FrameNumber"
+ OpMemberName %type_View 85 "View_StateFrameIndexMod8"
+ OpMemberName %type_View 86 "View_StateFrameIndex"
+ OpMemberName %type_View 87 "View_CameraCut"
+ OpMemberName %type_View 88 "View_UnlitViewmodeMask"
+ OpMemberName %type_View 89 "PrePadding_View_2164"
+ OpMemberName %type_View 90 "PrePadding_View_2168"
+ OpMemberName %type_View 91 "PrePadding_View_2172"
+ OpMemberName %type_View 92 "View_DirectionalLightColor"
+ OpMemberName %type_View 93 "View_DirectionalLightDirection"
+ OpMemberName %type_View 94 "PrePadding_View_2204"
+ OpMemberName %type_View 95 "View_TranslucencyLightingVolumeMin"
+ OpMemberName %type_View 96 "View_TranslucencyLightingVolumeInvSize"
+ OpMemberName %type_View 97 "View_TemporalAAParams"
+ OpMemberName %type_View 98 "View_CircleDOFParams"
+ OpMemberName %type_View 99 "View_DepthOfFieldSensorWidth"
+ OpMemberName %type_View 100 "View_DepthOfFieldFocalDistance"
+ OpMemberName %type_View 101 "View_DepthOfFieldScale"
+ OpMemberName %type_View 102 "View_DepthOfFieldFocalLength"
+ OpMemberName %type_View 103 "View_DepthOfFieldFocalRegion"
+ OpMemberName %type_View 104 "View_DepthOfFieldNearTransitionRegion"
+ OpMemberName %type_View 105 "View_DepthOfFieldFarTransitionRegion"
+ OpMemberName %type_View 106 "View_MotionBlurNormalizedToPixel"
+ OpMemberName %type_View 107 "View_bSubsurfacePostprocessEnabled"
+ OpMemberName %type_View 108 "View_GeneralPurposeTweak"
+ OpMemberName %type_View 109 "View_DemosaicVposOffset"
+ OpMemberName %type_View 110 "PrePadding_View_2348"
+ OpMemberName %type_View 111 "View_IndirectLightingColorScale"
+ OpMemberName %type_View 112 "View_HDR32bppEncodingMode"
+ OpMemberName %type_View 113 "View_AtmosphericFogSunDirection"
+ OpMemberName %type_View 114 "View_AtmosphericFogSunPower"
+ OpMemberName %type_View 115 "View_AtmosphericFogPower"
+ OpMemberName %type_View 116 "View_AtmosphericFogDensityScale"
+ OpMemberName %type_View 117 "View_AtmosphericFogDensityOffset"
+ OpMemberName %type_View 118 "View_AtmosphericFogGroundOffset"
+ OpMemberName %type_View 119 "View_AtmosphericFogDistanceScale"
+ OpMemberName %type_View 120 "View_AtmosphericFogAltitudeScale"
+ OpMemberName %type_View 121 "View_AtmosphericFogHeightScaleRayleigh"
+ OpMemberName %type_View 122 "View_AtmosphericFogStartDistance"
+ OpMemberName %type_View 123 "View_AtmosphericFogDistanceOffset"
+ OpMemberName %type_View 124 "View_AtmosphericFogSunDiscScale"
+ OpMemberName %type_View 125 "View_AtmosphericFogRenderMask"
+ OpMemberName %type_View 126 "View_AtmosphericFogInscatterAltitudeSampleNum"
+ OpMemberName %type_View 127 "View_AtmosphericFogSunColor"
+ OpMemberName %type_View 128 "View_NormalCurvatureToRoughnessScaleBias"
+ OpMemberName %type_View 129 "View_RenderingReflectionCaptureMask"
+ OpMemberName %type_View 130 "View_AmbientCubemapTint"
+ OpMemberName %type_View 131 "View_AmbientCubemapIntensity"
+ OpMemberName %type_View 132 "View_SkyLightParameters"
+ OpMemberName %type_View 133 "PrePadding_View_2488"
+ OpMemberName %type_View 134 "PrePadding_View_2492"
+ OpMemberName %type_View 135 "View_SkyLightColor"
+ OpMemberName %type_View 136 "View_SkyIrradianceEnvironmentMap"
+ OpMemberName %type_View 137 "View_MobilePreviewMode"
+ OpMemberName %type_View 138 "View_HMDEyePaddingOffset"
+ OpMemberName %type_View 139 "View_ReflectionCubemapMaxMip"
+ OpMemberName %type_View 140 "View_ShowDecalsMask"
+ OpMemberName %type_View 141 "View_DistanceFieldAOSpecularOcclusionMode"
+ OpMemberName %type_View 142 "View_IndirectCapsuleSelfShadowingIntensity"
+ OpMemberName %type_View 143 "PrePadding_View_2648"
+ OpMemberName %type_View 144 "PrePadding_View_2652"
+ OpMemberName %type_View 145 "View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight"
+ OpMemberName %type_View 146 "View_StereoPassIndex"
+ OpMemberName %type_View 147 "View_GlobalVolumeCenterAndExtent"
+ OpMemberName %type_View 148 "View_GlobalVolumeWorldToUVAddAndMul"
+ OpMemberName %type_View 149 "View_GlobalVolumeDimension"
+ OpMemberName %type_View 150 "View_GlobalVolumeTexelSize"
+ OpMemberName %type_View 151 "View_MaxGlobalDistance"
+ OpMemberName %type_View 152 "View_bCheckerboardSubsurfaceProfileRendering"
+ OpMemberName %type_View 153 "View_VolumetricFogInvGridSize"
+ OpMemberName %type_View 154 "PrePadding_View_2828"
+ OpMemberName %type_View 155 "View_VolumetricFogGridZParams"
+ OpMemberName %type_View 156 "PrePadding_View_2844"
+ OpMemberName %type_View 157 "View_VolumetricFogSVPosToVolumeUV"
+ OpMemberName %type_View 158 "View_VolumetricFogMaxDistance"
+ OpMemberName %type_View 159 "PrePadding_View_2860"
+ OpMemberName %type_View 160 "View_VolumetricLightmapWorldToUVScale"
+ OpMemberName %type_View 161 "PrePadding_View_2876"
+ OpMemberName %type_View 162 "View_VolumetricLightmapWorldToUVAdd"
+ OpMemberName %type_View 163 "PrePadding_View_2892"
+ OpMemberName %type_View 164 "View_VolumetricLightmapIndirectionTextureSize"
+ OpMemberName %type_View 165 "View_VolumetricLightmapBrickSize"
+ OpMemberName %type_View 166 "View_VolumetricLightmapBrickTexelSize"
+ OpMemberName %type_View 167 "View_StereoIPD"
+ OpMemberName %type_View 168 "View_IndirectLightingCacheShowFlag"
+ OpMemberName %type_View 169 "View_EyeToPixelSpreadAngle"
+ OpName %View "View"
+ OpName %type_StructuredBuffer_v4float "type.StructuredBuffer.v4float"
+ OpName %View_PrimitiveSceneData "View_PrimitiveSceneData"
+ OpName %in_var_TEXCOORD10_centroid "in.var.TEXCOORD10_centroid"
+ OpName %in_var_TEXCOORD11_centroid "in.var.TEXCOORD11_centroid"
+ OpName %in_var_COLOR0 "in.var.COLOR0"
+ OpName %in_var_TEXCOORD0 "in.var.TEXCOORD0"
+ OpName %in_var_TEXCOORD4 "in.var.TEXCOORD4"
+ OpName %in_var_PRIMITIVE_ID "in.var.PRIMITIVE_ID"
+ OpName %in_var_LIGHTMAP_ID "in.var.LIGHTMAP_ID"
+ OpName %in_var_VS_To_DS_Position "in.var.VS_To_DS_Position"
+ OpName %out_var_TEXCOORD10_centroid "out.var.TEXCOORD10_centroid"
+ OpName %out_var_TEXCOORD11_centroid "out.var.TEXCOORD11_centroid"
+ OpName %out_var_COLOR0 "out.var.COLOR0"
+ OpName %out_var_TEXCOORD0 "out.var.TEXCOORD0"
+ OpName %out_var_TEXCOORD4 "out.var.TEXCOORD4"
+ OpName %out_var_PRIMITIVE_ID "out.var.PRIMITIVE_ID"
+ OpName %out_var_LIGHTMAP_ID "out.var.LIGHTMAP_ID"
+ OpName %out_var_VS_To_DS_Position "out.var.VS_To_DS_Position"
+ OpName %out_var_PN_POSITION "out.var.PN_POSITION"
+ OpName %out_var_PN_DisplacementScales "out.var.PN_DisplacementScales"
+ OpName %out_var_PN_TessellationMultiplier "out.var.PN_TessellationMultiplier"
+ OpName %out_var_PN_WorldDisplacementMultiplier "out.var.PN_WorldDisplacementMultiplier"
+ OpName %out_var_PN_POSITION9 "out.var.PN_POSITION9"
+ OpName %MainHull "MainHull"
+ OpName %param_var_I "param.var.I"
+ OpName %temp_var_hullMainRetVal "temp.var.hullMainRetVal"
+ OpName %if_merge "if.merge"
+ OpDecorateString %in_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %in_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %in_var_COLOR0 UserSemantic "COLOR0"
+ OpDecorateString %in_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorateString %in_var_TEXCOORD4 UserSemantic "TEXCOORD4"
+ OpDecorateString %in_var_PRIMITIVE_ID UserSemantic "PRIMITIVE_ID"
+ OpDecorateString %in_var_LIGHTMAP_ID UserSemantic "LIGHTMAP_ID"
+ OpDecorateString %in_var_VS_To_DS_Position UserSemantic "VS_To_DS_Position"
+ OpDecorate %gl_InvocationID BuiltIn InvocationId
+ OpDecorateString %gl_InvocationID UserSemantic "SV_OutputControlPointID"
+ OpDecorateString %out_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %out_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %out_var_COLOR0 UserSemantic "COLOR0"
+ OpDecorateString %out_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorateString %out_var_TEXCOORD4 UserSemantic "TEXCOORD4"
+ OpDecorateString %out_var_PRIMITIVE_ID UserSemantic "PRIMITIVE_ID"
+ OpDecorateString %out_var_LIGHTMAP_ID UserSemantic "LIGHTMAP_ID"
+ OpDecorateString %out_var_VS_To_DS_Position UserSemantic "VS_To_DS_Position"
+ OpDecorateString %out_var_PN_POSITION UserSemantic "PN_POSITION"
+ OpDecorateString %out_var_PN_DisplacementScales UserSemantic "PN_DisplacementScales"
+ OpDecorateString %out_var_PN_TessellationMultiplier UserSemantic "PN_TessellationMultiplier"
+ OpDecorateString %out_var_PN_WorldDisplacementMultiplier UserSemantic "PN_WorldDisplacementMultiplier"
+ OpDecorate %gl_TessLevelOuter BuiltIn TessLevelOuter
+ OpDecorateString %gl_TessLevelOuter UserSemantic "SV_TessFactor"
+ OpDecorate %gl_TessLevelOuter Patch
+ OpDecorate %gl_TessLevelInner BuiltIn TessLevelInner
+ OpDecorateString %gl_TessLevelInner UserSemantic "SV_InsideTessFactor"
+ OpDecorate %gl_TessLevelInner Patch
+ OpDecorateString %out_var_PN_POSITION9 UserSemantic "PN_POSITION9"
+ OpDecorate %out_var_PN_POSITION9 Patch
+ OpDecorate %in_var_TEXCOORD10_centroid Location 0
+ OpDecorate %in_var_TEXCOORD11_centroid Location 1
+ OpDecorate %in_var_COLOR0 Location 2
+ OpDecorate %in_var_TEXCOORD0 Location 3
+ OpDecorate %in_var_TEXCOORD4 Location 4
+ OpDecorate %in_var_PRIMITIVE_ID Location 5
+ OpDecorate %in_var_LIGHTMAP_ID Location 6
+ OpDecorate %in_var_VS_To_DS_Position Location 7
+ OpDecorate %out_var_COLOR0 Location 0
+ OpDecorate %out_var_LIGHTMAP_ID Location 1
+ OpDecorate %out_var_PN_DisplacementScales Location 2
+ OpDecorate %out_var_PN_POSITION Location 3
+ OpDecorate %out_var_PN_POSITION9 Location 6
+ OpDecorate %out_var_PN_TessellationMultiplier Location 7
+ OpDecorate %out_var_PN_WorldDisplacementMultiplier Location 8
+ OpDecorate %out_var_PRIMITIVE_ID Location 9
+ OpDecorate %out_var_TEXCOORD0 Location 10
+ OpDecorate %out_var_TEXCOORD10_centroid Location 11
+ OpDecorate %out_var_TEXCOORD11_centroid Location 12
+ OpDecorate %out_var_TEXCOORD4 Location 13
+ OpDecorate %out_var_VS_To_DS_Position Location 14
+ OpDecorate %View DescriptorSet 0
+ OpDecorate %View Binding 1
+ OpDecorate %View_PrimitiveSceneData DescriptorSet 0
+ OpDecorate %View_PrimitiveSceneData Binding 0
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_2 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_7 ArrayStride 16
+ OpMemberDecorate %type_View 0 Offset 0
+ OpMemberDecorate %type_View 0 MatrixStride 16
+ OpMemberDecorate %type_View 0 ColMajor
+ OpMemberDecorate %type_View 1 Offset 64
+ OpMemberDecorate %type_View 1 MatrixStride 16
+ OpMemberDecorate %type_View 1 ColMajor
+ OpMemberDecorate %type_View 2 Offset 128
+ OpMemberDecorate %type_View 2 MatrixStride 16
+ OpMemberDecorate %type_View 2 ColMajor
+ OpMemberDecorate %type_View 3 Offset 192
+ OpMemberDecorate %type_View 3 MatrixStride 16
+ OpMemberDecorate %type_View 3 ColMajor
+ OpMemberDecorate %type_View 4 Offset 256
+ OpMemberDecorate %type_View 4 MatrixStride 16
+ OpMemberDecorate %type_View 4 ColMajor
+ OpMemberDecorate %type_View 5 Offset 320
+ OpMemberDecorate %type_View 5 MatrixStride 16
+ OpMemberDecorate %type_View 5 ColMajor
+ OpMemberDecorate %type_View 6 Offset 384
+ OpMemberDecorate %type_View 6 MatrixStride 16
+ OpMemberDecorate %type_View 6 ColMajor
+ OpMemberDecorate %type_View 7 Offset 448
+ OpMemberDecorate %type_View 7 MatrixStride 16
+ OpMemberDecorate %type_View 7 ColMajor
+ OpMemberDecorate %type_View 8 Offset 512
+ OpMemberDecorate %type_View 8 MatrixStride 16
+ OpMemberDecorate %type_View 8 ColMajor
+ OpMemberDecorate %type_View 9 Offset 576
+ OpMemberDecorate %type_View 9 MatrixStride 16
+ OpMemberDecorate %type_View 9 ColMajor
+ OpMemberDecorate %type_View 10 Offset 640
+ OpMemberDecorate %type_View 10 MatrixStride 16
+ OpMemberDecorate %type_View 10 ColMajor
+ OpMemberDecorate %type_View 11 Offset 704
+ OpMemberDecorate %type_View 11 MatrixStride 16
+ OpMemberDecorate %type_View 11 ColMajor
+ OpMemberDecorate %type_View 12 Offset 768
+ OpMemberDecorate %type_View 12 MatrixStride 16
+ OpMemberDecorate %type_View 12 ColMajor
+ OpMemberDecorate %type_View 13 Offset 832
+ OpMemberDecorate %type_View 14 Offset 844
+ OpMemberDecorate %type_View 15 Offset 848
+ OpMemberDecorate %type_View 16 Offset 860
+ OpMemberDecorate %type_View 17 Offset 864
+ OpMemberDecorate %type_View 18 Offset 876
+ OpMemberDecorate %type_View 19 Offset 880
+ OpMemberDecorate %type_View 20 Offset 892
+ OpMemberDecorate %type_View 21 Offset 896
+ OpMemberDecorate %type_View 22 Offset 908
+ OpMemberDecorate %type_View 23 Offset 912
+ OpMemberDecorate %type_View 24 Offset 928
+ OpMemberDecorate %type_View 25 Offset 944
+ OpMemberDecorate %type_View 26 Offset 956
+ OpMemberDecorate %type_View 27 Offset 960
+ OpMemberDecorate %type_View 28 Offset 972
+ OpMemberDecorate %type_View 29 Offset 976
+ OpMemberDecorate %type_View 30 Offset 988
+ OpMemberDecorate %type_View 31 Offset 992
+ OpMemberDecorate %type_View 32 Offset 1004
+ OpMemberDecorate %type_View 33 Offset 1008
+ OpMemberDecorate %type_View 33 MatrixStride 16
+ OpMemberDecorate %type_View 33 ColMajor
+ OpMemberDecorate %type_View 34 Offset 1072
+ OpMemberDecorate %type_View 34 MatrixStride 16
+ OpMemberDecorate %type_View 34 ColMajor
+ OpMemberDecorate %type_View 35 Offset 1136
+ OpMemberDecorate %type_View 35 MatrixStride 16
+ OpMemberDecorate %type_View 35 ColMajor
+ OpMemberDecorate %type_View 36 Offset 1200
+ OpMemberDecorate %type_View 36 MatrixStride 16
+ OpMemberDecorate %type_View 36 ColMajor
+ OpMemberDecorate %type_View 37 Offset 1264
+ OpMemberDecorate %type_View 37 MatrixStride 16
+ OpMemberDecorate %type_View 37 ColMajor
+ OpMemberDecorate %type_View 38 Offset 1328
+ OpMemberDecorate %type_View 38 MatrixStride 16
+ OpMemberDecorate %type_View 38 ColMajor
+ OpMemberDecorate %type_View 39 Offset 1392
+ OpMemberDecorate %type_View 39 MatrixStride 16
+ OpMemberDecorate %type_View 39 ColMajor
+ OpMemberDecorate %type_View 40 Offset 1456
+ OpMemberDecorate %type_View 40 MatrixStride 16
+ OpMemberDecorate %type_View 40 ColMajor
+ OpMemberDecorate %type_View 41 Offset 1520
+ OpMemberDecorate %type_View 41 MatrixStride 16
+ OpMemberDecorate %type_View 41 ColMajor
+ OpMemberDecorate %type_View 42 Offset 1584
+ OpMemberDecorate %type_View 42 MatrixStride 16
+ OpMemberDecorate %type_View 42 ColMajor
+ OpMemberDecorate %type_View 43 Offset 1648
+ OpMemberDecorate %type_View 44 Offset 1660
+ OpMemberDecorate %type_View 45 Offset 1664
+ OpMemberDecorate %type_View 46 Offset 1676
+ OpMemberDecorate %type_View 47 Offset 1680
+ OpMemberDecorate %type_View 48 Offset 1692
+ OpMemberDecorate %type_View 49 Offset 1696
+ OpMemberDecorate %type_View 49 MatrixStride 16
+ OpMemberDecorate %type_View 49 ColMajor
+ OpMemberDecorate %type_View 50 Offset 1760
+ OpMemberDecorate %type_View 50 MatrixStride 16
+ OpMemberDecorate %type_View 50 ColMajor
+ OpMemberDecorate %type_View 51 Offset 1824
+ OpMemberDecorate %type_View 51 MatrixStride 16
+ OpMemberDecorate %type_View 51 ColMajor
+ OpMemberDecorate %type_View 52 Offset 1888
+ OpMemberDecorate %type_View 53 Offset 1904
+ OpMemberDecorate %type_View 54 Offset 1920
+ OpMemberDecorate %type_View 55 Offset 1928
+ OpMemberDecorate %type_View 56 Offset 1936
+ OpMemberDecorate %type_View 57 Offset 1952
+ OpMemberDecorate %type_View 58 Offset 1968
+ OpMemberDecorate %type_View 59 Offset 1984
+ OpMemberDecorate %type_View 60 Offset 2000
+ OpMemberDecorate %type_View 61 Offset 2004
+ OpMemberDecorate %type_View 62 Offset 2008
+ OpMemberDecorate %type_View 63 Offset 2012
+ OpMemberDecorate %type_View 64 Offset 2016
+ OpMemberDecorate %type_View 65 Offset 2032
+ OpMemberDecorate %type_View 66 Offset 2048
+ OpMemberDecorate %type_View 67 Offset 2064
+ OpMemberDecorate %type_View 68 Offset 2072
+ OpMemberDecorate %type_View 69 Offset 2076
+ OpMemberDecorate %type_View 70 Offset 2080
+ OpMemberDecorate %type_View 71 Offset 2084
+ OpMemberDecorate %type_View 72 Offset 2088
+ OpMemberDecorate %type_View 73 Offset 2092
+ OpMemberDecorate %type_View 74 Offset 2096
+ OpMemberDecorate %type_View 75 Offset 2108
+ OpMemberDecorate %type_View 76 Offset 2112
+ OpMemberDecorate %type_View 77 Offset 2116
+ OpMemberDecorate %type_View 78 Offset 2120
+ OpMemberDecorate %type_View 79 Offset 2124
+ OpMemberDecorate %type_View 80 Offset 2128
+ OpMemberDecorate %type_View 81 Offset 2132
+ OpMemberDecorate %type_View 82 Offset 2136
+ OpMemberDecorate %type_View 83 Offset 2140
+ OpMemberDecorate %type_View 84 Offset 2144
+ OpMemberDecorate %type_View 85 Offset 2148
+ OpMemberDecorate %type_View 86 Offset 2152
+ OpMemberDecorate %type_View 87 Offset 2156
+ OpMemberDecorate %type_View 88 Offset 2160
+ OpMemberDecorate %type_View 89 Offset 2164
+ OpMemberDecorate %type_View 90 Offset 2168
+ OpMemberDecorate %type_View 91 Offset 2172
+ OpMemberDecorate %type_View 92 Offset 2176
+ OpMemberDecorate %type_View 93 Offset 2192
+ OpMemberDecorate %type_View 94 Offset 2204
+ OpMemberDecorate %type_View 95 Offset 2208
+ OpMemberDecorate %type_View 96 Offset 2240
+ OpMemberDecorate %type_View 97 Offset 2272
+ OpMemberDecorate %type_View 98 Offset 2288
+ OpMemberDecorate %type_View 99 Offset 2304
+ OpMemberDecorate %type_View 100 Offset 2308
+ OpMemberDecorate %type_View 101 Offset 2312
+ OpMemberDecorate %type_View 102 Offset 2316
+ OpMemberDecorate %type_View 103 Offset 2320
+ OpMemberDecorate %type_View 104 Offset 2324
+ OpMemberDecorate %type_View 105 Offset 2328
+ OpMemberDecorate %type_View 106 Offset 2332
+ OpMemberDecorate %type_View 107 Offset 2336
+ OpMemberDecorate %type_View 108 Offset 2340
+ OpMemberDecorate %type_View 109 Offset 2344
+ OpMemberDecorate %type_View 110 Offset 2348
+ OpMemberDecorate %type_View 111 Offset 2352
+ OpMemberDecorate %type_View 112 Offset 2364
+ OpMemberDecorate %type_View 113 Offset 2368
+ OpMemberDecorate %type_View 114 Offset 2380
+ OpMemberDecorate %type_View 115 Offset 2384
+ OpMemberDecorate %type_View 116 Offset 2388
+ OpMemberDecorate %type_View 117 Offset 2392
+ OpMemberDecorate %type_View 118 Offset 2396
+ OpMemberDecorate %type_View 119 Offset 2400
+ OpMemberDecorate %type_View 120 Offset 2404
+ OpMemberDecorate %type_View 121 Offset 2408
+ OpMemberDecorate %type_View 122 Offset 2412
+ OpMemberDecorate %type_View 123 Offset 2416
+ OpMemberDecorate %type_View 124 Offset 2420
+ OpMemberDecorate %type_View 125 Offset 2424
+ OpMemberDecorate %type_View 126 Offset 2428
+ OpMemberDecorate %type_View 127 Offset 2432
+ OpMemberDecorate %type_View 128 Offset 2448
+ OpMemberDecorate %type_View 129 Offset 2460
+ OpMemberDecorate %type_View 130 Offset 2464
+ OpMemberDecorate %type_View 131 Offset 2480
+ OpMemberDecorate %type_View 132 Offset 2484
+ OpMemberDecorate %type_View 133 Offset 2488
+ OpMemberDecorate %type_View 134 Offset 2492
+ OpMemberDecorate %type_View 135 Offset 2496
+ OpMemberDecorate %type_View 136 Offset 2512
+ OpMemberDecorate %type_View 137 Offset 2624
+ OpMemberDecorate %type_View 138 Offset 2628
+ OpMemberDecorate %type_View 139 Offset 2632
+ OpMemberDecorate %type_View 140 Offset 2636
+ OpMemberDecorate %type_View 141 Offset 2640
+ OpMemberDecorate %type_View 142 Offset 2644
+ OpMemberDecorate %type_View 143 Offset 2648
+ OpMemberDecorate %type_View 144 Offset 2652
+ OpMemberDecorate %type_View 145 Offset 2656
+ OpMemberDecorate %type_View 146 Offset 2668
+ OpMemberDecorate %type_View 147 Offset 2672
+ OpMemberDecorate %type_View 148 Offset 2736
+ OpMemberDecorate %type_View 149 Offset 2800
+ OpMemberDecorate %type_View 150 Offset 2804
+ OpMemberDecorate %type_View 151 Offset 2808
+ OpMemberDecorate %type_View 152 Offset 2812
+ OpMemberDecorate %type_View 153 Offset 2816
+ OpMemberDecorate %type_View 154 Offset 2828
+ OpMemberDecorate %type_View 155 Offset 2832
+ OpMemberDecorate %type_View 156 Offset 2844
+ OpMemberDecorate %type_View 157 Offset 2848
+ OpMemberDecorate %type_View 158 Offset 2856
+ OpMemberDecorate %type_View 159 Offset 2860
+ OpMemberDecorate %type_View 160 Offset 2864
+ OpMemberDecorate %type_View 161 Offset 2876
+ OpMemberDecorate %type_View 162 Offset 2880
+ OpMemberDecorate %type_View 163 Offset 2892
+ OpMemberDecorate %type_View 164 Offset 2896
+ OpMemberDecorate %type_View 165 Offset 2908
+ OpMemberDecorate %type_View 166 Offset 2912
+ OpMemberDecorate %type_View 167 Offset 2924
+ OpMemberDecorate %type_View 168 Offset 2928
+ OpMemberDecorate %type_View 169 Offset 2932
+ OpDecorate %type_View Block
+ OpDecorate %_runtimearr_v4float ArrayStride 16
+ OpMemberDecorate %type_StructuredBuffer_v4float 0 Offset 0
+ OpMemberDecorate %type_StructuredBuffer_v4float 0 NonWritable
+ OpDecorate %type_StructuredBuffer_v4float BufferBlock
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %uint_3 = OpConstant %uint 3
+%_arr_float_uint_3 = OpTypeArray %float %uint_3
+ %int_1 = OpConstant %int 1
+ %int_0 = OpConstant %int 0
+ %int_2 = OpConstant %int 2
+ %float_2 = OpConstant %float 2
+ %62 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
+ %float_0_5 = OpConstant %float 0.5
+ %int_3 = OpConstant %int 3
+%float_0_333000004 = OpConstant %float 0.333000004
+ %float_1 = OpConstant %float 1
+ %67 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %float_15 = OpConstant %float 15
+ %69 = OpConstantComposite %v4float %float_15 %float_15 %float_15 %float_15
+%_arr_v4float_uint_1 = OpTypeArray %v4float %uint_1
+%FVertexFactoryInterpolantsVSToPS = OpTypeStruct %v4float %v4float %v4float %_arr_v4float_uint_1 %v4float %uint %uint
+%FVertexFactoryInterpolantsVSToDS = OpTypeStruct %FVertexFactoryInterpolantsVSToPS
+%FSharedBasePassInterpolants = OpTypeStruct
+%FBasePassInterpolantsVSToDS = OpTypeStruct %FSharedBasePassInterpolants
+%FBasePassVSToDS = OpTypeStruct %FVertexFactoryInterpolantsVSToDS %FBasePassInterpolantsVSToDS %v4float
+%_arr_v4float_uint_3 = OpTypeArray %v4float %uint_3
+%FPNTessellationHSToDS = OpTypeStruct %FBasePassVSToDS %_arr_v4float_uint_3 %v3float %float %float
+ %v3int = OpTypeVector %int 3
+ %73 = OpConstantComposite %v3int %int_0 %int_0 %int_0
+ %74 = OpConstantComposite %v3int %int_3 %int_3 %int_3
+ %float_0 = OpConstant %float 0
+ %76 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+ %77 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
+ %int_77 = OpConstant %int 77
+ %int_6 = OpConstant %int 6
+ %int_27 = OpConstant %int 27
+ %81 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %82 = OpConstantComposite %v3int %int_2 %int_2 %int_2
+ %uint_26 = OpConstant %uint 26
+ %uint_12 = OpConstant %uint 12
+ %uint_22 = OpConstant %uint 22
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_arr_v4float_uint_7 = OpTypeArray %v4float %uint_7
+ %type_View = OpTypeStruct %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %v3float %float %v3float %float %v4float %v4float %v3float %float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %v4float %v4float %v2float %v2float %v4float %v4float %v4float %v4float %int %float %float %float %v4float %v4float %v4float %v2float %float %float %float %float %float %float %v3float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %float %float %float %float %float %v4float %v3float %float %_arr_v4float_uint_2 %_arr_v4float_uint_2 %v4float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %v3float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %uint %uint %v4float %v3float %float %v4float %float %float %float %float %v4float %_arr_v4float_uint_7 %float %float %float %float %uint %float %float %float %v3float %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %float %float %float %float %v3float %float %v3float %float %v2float %float %float %v3float %float %v3float %float %v3float %float %v3float %float %float %float
+%_ptr_Uniform_type_View = OpTypePointer Uniform %type_View
+%_runtimearr_v4float = OpTypeRuntimeArray %v4float
+%type_StructuredBuffer_v4float = OpTypeStruct %_runtimearr_v4float
+%_ptr_Uniform_type_StructuredBuffer_v4float = OpTypePointer Uniform %type_StructuredBuffer_v4float
+%_arr_v4float_uint_12 = OpTypeArray %v4float %uint_12
+%_ptr_Input__arr_v4float_uint_12 = OpTypePointer Input %_arr_v4float_uint_12
+%_arr__arr_v4float_uint_1_uint_12 = OpTypeArray %_arr_v4float_uint_1 %uint_12
+%_ptr_Input__arr__arr_v4float_uint_1_uint_12 = OpTypePointer Input %_arr__arr_v4float_uint_1_uint_12
+%_arr_uint_uint_12 = OpTypeArray %uint %uint_12
+%_ptr_Input__arr_uint_uint_12 = OpTypePointer Input %_arr_uint_uint_12
+%_ptr_Input_uint = OpTypePointer Input %uint
+%_ptr_Output__arr_v4float_uint_3 = OpTypePointer Output %_arr_v4float_uint_3
+%_arr__arr_v4float_uint_1_uint_3 = OpTypeArray %_arr_v4float_uint_1 %uint_3
+%_ptr_Output__arr__arr_v4float_uint_1_uint_3 = OpTypePointer Output %_arr__arr_v4float_uint_1_uint_3
+%_arr_uint_uint_3 = OpTypeArray %uint %uint_3
+%_ptr_Output__arr_uint_uint_3 = OpTypePointer Output %_arr_uint_uint_3
+%_arr__arr_v4float_uint_3_uint_3 = OpTypeArray %_arr_v4float_uint_3 %uint_3
+%_ptr_Output__arr__arr_v4float_uint_3_uint_3 = OpTypePointer Output %_arr__arr_v4float_uint_3_uint_3
+%_arr_v3float_uint_3 = OpTypeArray %v3float %uint_3
+%_ptr_Output__arr_v3float_uint_3 = OpTypePointer Output %_arr_v3float_uint_3
+%_ptr_Output__arr_float_uint_3 = OpTypePointer Output %_arr_float_uint_3
+%_arr_float_uint_4 = OpTypeArray %float %uint_4
+%_ptr_Output__arr_float_uint_4 = OpTypePointer Output %_arr_float_uint_4
+%_arr_float_uint_2 = OpTypeArray %float %uint_2
+%_ptr_Output__arr_float_uint_2 = OpTypePointer Output %_arr_float_uint_2
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %111 = OpTypeFunction %void
+%_arr_FBasePassVSToDS_uint_12 = OpTypeArray %FBasePassVSToDS %uint_12
+%_ptr_Function__arr_FBasePassVSToDS_uint_12 = OpTypePointer Function %_arr_FBasePassVSToDS_uint_12
+%_arr_FPNTessellationHSToDS_uint_3 = OpTypeArray %FPNTessellationHSToDS %uint_3
+%_ptr_Workgroup__arr_FPNTessellationHSToDS_uint_3 = OpTypePointer Workgroup %_arr_FPNTessellationHSToDS_uint_3
+%_ptr_Output__arr_v4float_uint_1 = OpTypePointer Output %_arr_v4float_uint_1
+%_ptr_Output_uint = OpTypePointer Output %uint
+%_ptr_Output_v3float = OpTypePointer Output %v3float
+%_ptr_Output_float = OpTypePointer Output %float
+%_ptr_Workgroup_FPNTessellationHSToDS = OpTypePointer Workgroup %FPNTessellationHSToDS
+ %bool = OpTypeBool
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%_ptr_Workgroup_v4float = OpTypePointer Workgroup %v4float
+%_ptr_Function_float = OpTypePointer Function %float
+%_ptr_Workgroup_float = OpTypePointer Workgroup %float
+%mat3v3float = OpTypeMatrix %v3float 3
+%_ptr_Function_FVertexFactoryInterpolantsVSToDS = OpTypePointer Function %FVertexFactoryInterpolantsVSToDS
+%_ptr_Function_FVertexFactoryInterpolantsVSToPS = OpTypePointer Function %FVertexFactoryInterpolantsVSToPS
+%_ptr_Function_FBasePassVSToDS = OpTypePointer Function %FBasePassVSToDS
+ %v3bool = OpTypeVector %bool 3
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+ %View = OpVariable %_ptr_Uniform_type_View Uniform
+%View_PrimitiveSceneData = OpVariable %_ptr_Uniform_type_StructuredBuffer_v4float Uniform
+%in_var_TEXCOORD10_centroid = OpVariable %_ptr_Input__arr_v4float_uint_12 Input
+%in_var_TEXCOORD11_centroid = OpVariable %_ptr_Input__arr_v4float_uint_12 Input
+%in_var_COLOR0 = OpVariable %_ptr_Input__arr_v4float_uint_12 Input
+%in_var_TEXCOORD0 = OpVariable %_ptr_Input__arr__arr_v4float_uint_1_uint_12 Input
+%in_var_TEXCOORD4 = OpVariable %_ptr_Input__arr_v4float_uint_12 Input
+%in_var_PRIMITIVE_ID = OpVariable %_ptr_Input__arr_uint_uint_12 Input
+%in_var_LIGHTMAP_ID = OpVariable %_ptr_Input__arr_uint_uint_12 Input
+%in_var_VS_To_DS_Position = OpVariable %_ptr_Input__arr_v4float_uint_12 Input
+%gl_InvocationID = OpVariable %_ptr_Input_uint Input
+%out_var_TEXCOORD10_centroid = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_TEXCOORD11_centroid = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_COLOR0 = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_TEXCOORD0 = OpVariable %_ptr_Output__arr__arr_v4float_uint_1_uint_3 Output
+%out_var_TEXCOORD4 = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_PRIMITIVE_ID = OpVariable %_ptr_Output__arr_uint_uint_3 Output
+%out_var_LIGHTMAP_ID = OpVariable %_ptr_Output__arr_uint_uint_3 Output
+%out_var_VS_To_DS_Position = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_PN_POSITION = OpVariable %_ptr_Output__arr__arr_v4float_uint_3_uint_3 Output
+%out_var_PN_DisplacementScales = OpVariable %_ptr_Output__arr_v3float_uint_3 Output
+%out_var_PN_TessellationMultiplier = OpVariable %_ptr_Output__arr_float_uint_3 Output
+%out_var_PN_WorldDisplacementMultiplier = OpVariable %_ptr_Output__arr_float_uint_3 Output
+%gl_TessLevelOuter = OpVariable %_ptr_Output__arr_float_uint_4 Output
+%gl_TessLevelInner = OpVariable %_ptr_Output__arr_float_uint_2 Output
+%out_var_PN_POSITION9 = OpVariable %_ptr_Output_v4float Output
+ %133 = OpConstantNull %FSharedBasePassInterpolants
+ %134 = OpConstantComposite %FBasePassInterpolantsVSToDS %133
+%float_0_333333343 = OpConstant %float 0.333333343
+ %136 = OpConstantComposite %v4float %float_0_333333343 %float_0_333333343 %float_0_333333343 %float_0_333333343
+ %137 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
+%float_0_166666672 = OpConstant %float 0.166666672
+ %139 = OpConstantComposite %v4float %float_0_166666672 %float_0_166666672 %float_0_166666672 %float_0_166666672
+ %140 = OpUndef %v4float
+
+; XXX: Original asm used Function here, which is wrong.
+; This patches the SPIR-V to be correct.
+%temp_var_hullMainRetVal = OpVariable %_ptr_Workgroup__arr_FPNTessellationHSToDS_uint_3 Workgroup
+
+ %MainHull = OpFunction %void None %111
+ %141 = OpLabel
+%param_var_I = OpVariable %_ptr_Function__arr_FBasePassVSToDS_uint_12 Function
+ %142 = OpLoad %_arr_v4float_uint_12 %in_var_TEXCOORD10_centroid
+ %143 = OpLoad %_arr_v4float_uint_12 %in_var_TEXCOORD11_centroid
+ %144 = OpLoad %_arr_v4float_uint_12 %in_var_COLOR0
+ %145 = OpLoad %_arr__arr_v4float_uint_1_uint_12 %in_var_TEXCOORD0
+ %146 = OpLoad %_arr_v4float_uint_12 %in_var_TEXCOORD4
+ %147 = OpLoad %_arr_uint_uint_12 %in_var_PRIMITIVE_ID
+ %148 = OpLoad %_arr_uint_uint_12 %in_var_LIGHTMAP_ID
+ %149 = OpCompositeExtract %v4float %142 0
+ %150 = OpCompositeExtract %v4float %143 0
+ %151 = OpCompositeExtract %v4float %144 0
+ %152 = OpCompositeExtract %_arr_v4float_uint_1 %145 0
+ %153 = OpCompositeExtract %v4float %146 0
+ %154 = OpCompositeExtract %uint %147 0
+ %155 = OpCompositeExtract %uint %148 0
+ %156 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %149 %150 %151 %152 %153 %154 %155
+ %157 = OpCompositeExtract %v4float %142 1
+ %158 = OpCompositeExtract %v4float %143 1
+ %159 = OpCompositeExtract %v4float %144 1
+ %160 = OpCompositeExtract %_arr_v4float_uint_1 %145 1
+ %161 = OpCompositeExtract %v4float %146 1
+ %162 = OpCompositeExtract %uint %147 1
+ %163 = OpCompositeExtract %uint %148 1
+ %164 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %157 %158 %159 %160 %161 %162 %163
+ %165 = OpCompositeExtract %v4float %142 2
+ %166 = OpCompositeExtract %v4float %143 2
+ %167 = OpCompositeExtract %v4float %144 2
+ %168 = OpCompositeExtract %_arr_v4float_uint_1 %145 2
+ %169 = OpCompositeExtract %v4float %146 2
+ %170 = OpCompositeExtract %uint %147 2
+ %171 = OpCompositeExtract %uint %148 2
+ %172 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %165 %166 %167 %168 %169 %170 %171
+ %173 = OpCompositeExtract %v4float %142 3
+ %174 = OpCompositeExtract %v4float %143 3
+ %175 = OpCompositeExtract %v4float %144 3
+ %176 = OpCompositeExtract %_arr_v4float_uint_1 %145 3
+ %177 = OpCompositeExtract %v4float %146 3
+ %178 = OpCompositeExtract %uint %147 3
+ %179 = OpCompositeExtract %uint %148 3
+ %180 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %173 %174 %175 %176 %177 %178 %179
+ %181 = OpCompositeExtract %v4float %142 4
+ %182 = OpCompositeExtract %v4float %143 4
+ %183 = OpCompositeExtract %v4float %144 4
+ %184 = OpCompositeExtract %_arr_v4float_uint_1 %145 4
+ %185 = OpCompositeExtract %v4float %146 4
+ %186 = OpCompositeExtract %uint %147 4
+ %187 = OpCompositeExtract %uint %148 4
+ %188 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %181 %182 %183 %184 %185 %186 %187
+ %189 = OpCompositeExtract %v4float %142 5
+ %190 = OpCompositeExtract %v4float %143 5
+ %191 = OpCompositeExtract %v4float %144 5
+ %192 = OpCompositeExtract %_arr_v4float_uint_1 %145 5
+ %193 = OpCompositeExtract %v4float %146 5
+ %194 = OpCompositeExtract %uint %147 5
+ %195 = OpCompositeExtract %uint %148 5
+ %196 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %189 %190 %191 %192 %193 %194 %195
+ %197 = OpCompositeExtract %v4float %142 6
+ %198 = OpCompositeExtract %v4float %143 6
+ %199 = OpCompositeExtract %v4float %144 6
+ %200 = OpCompositeExtract %_arr_v4float_uint_1 %145 6
+ %201 = OpCompositeExtract %v4float %146 6
+ %202 = OpCompositeExtract %uint %147 6
+ %203 = OpCompositeExtract %uint %148 6
+ %204 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %197 %198 %199 %200 %201 %202 %203
+ %205 = OpCompositeExtract %v4float %142 7
+ %206 = OpCompositeExtract %v4float %143 7
+ %207 = OpCompositeExtract %v4float %144 7
+ %208 = OpCompositeExtract %_arr_v4float_uint_1 %145 7
+ %209 = OpCompositeExtract %v4float %146 7
+ %210 = OpCompositeExtract %uint %147 7
+ %211 = OpCompositeExtract %uint %148 7
+ %212 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %205 %206 %207 %208 %209 %210 %211
+ %213 = OpCompositeExtract %v4float %142 8
+ %214 = OpCompositeExtract %v4float %143 8
+ %215 = OpCompositeExtract %v4float %144 8
+ %216 = OpCompositeExtract %_arr_v4float_uint_1 %145 8
+ %217 = OpCompositeExtract %v4float %146 8
+ %218 = OpCompositeExtract %uint %147 8
+ %219 = OpCompositeExtract %uint %148 8
+ %220 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %213 %214 %215 %216 %217 %218 %219
+ %221 = OpCompositeExtract %v4float %142 9
+ %222 = OpCompositeExtract %v4float %143 9
+ %223 = OpCompositeExtract %v4float %144 9
+ %224 = OpCompositeExtract %_arr_v4float_uint_1 %145 9
+ %225 = OpCompositeExtract %v4float %146 9
+ %226 = OpCompositeExtract %uint %147 9
+ %227 = OpCompositeExtract %uint %148 9
+ %228 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %221 %222 %223 %224 %225 %226 %227
+ %229 = OpCompositeExtract %v4float %142 10
+ %230 = OpCompositeExtract %v4float %143 10
+ %231 = OpCompositeExtract %v4float %144 10
+ %232 = OpCompositeExtract %_arr_v4float_uint_1 %145 10
+ %233 = OpCompositeExtract %v4float %146 10
+ %234 = OpCompositeExtract %uint %147 10
+ %235 = OpCompositeExtract %uint %148 10
+ %236 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %229 %230 %231 %232 %233 %234 %235
+ %237 = OpCompositeExtract %v4float %142 11
+ %238 = OpCompositeExtract %v4float %143 11
+ %239 = OpCompositeExtract %v4float %144 11
+ %240 = OpCompositeExtract %_arr_v4float_uint_1 %145 11
+ %241 = OpCompositeExtract %v4float %146 11
+ %242 = OpCompositeExtract %uint %147 11
+ %243 = OpCompositeExtract %uint %148 11
+ %244 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %237 %238 %239 %240 %241 %242 %243
+ %245 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %156
+ %246 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %164
+ %247 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %172
+ %248 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %180
+ %249 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %188
+ %250 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %196
+ %251 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %204
+ %252 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %212
+ %253 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %220
+ %254 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %228
+ %255 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %236
+ %256 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %244
+ %257 = OpLoad %_arr_v4float_uint_12 %in_var_VS_To_DS_Position
+ %258 = OpCompositeExtract %v4float %257 0
+ %259 = OpCompositeConstruct %FBasePassVSToDS %245 %134 %258
+ %260 = OpCompositeExtract %v4float %257 1
+ %261 = OpCompositeConstruct %FBasePassVSToDS %246 %134 %260
+ %262 = OpCompositeExtract %v4float %257 2
+ %263 = OpCompositeConstruct %FBasePassVSToDS %247 %134 %262
+ %264 = OpCompositeExtract %v4float %257 3
+ %265 = OpCompositeConstruct %FBasePassVSToDS %248 %134 %264
+ %266 = OpCompositeExtract %v4float %257 4
+ %267 = OpCompositeConstruct %FBasePassVSToDS %249 %134 %266
+ %268 = OpCompositeExtract %v4float %257 5
+ %269 = OpCompositeConstruct %FBasePassVSToDS %250 %134 %268
+ %270 = OpCompositeExtract %v4float %257 6
+ %271 = OpCompositeConstruct %FBasePassVSToDS %251 %134 %270
+ %272 = OpCompositeExtract %v4float %257 7
+ %273 = OpCompositeConstruct %FBasePassVSToDS %252 %134 %272
+ %274 = OpCompositeExtract %v4float %257 8
+ %275 = OpCompositeConstruct %FBasePassVSToDS %253 %134 %274
+ %276 = OpCompositeExtract %v4float %257 9
+ %277 = OpCompositeConstruct %FBasePassVSToDS %254 %134 %276
+ %278 = OpCompositeExtract %v4float %257 10
+ %279 = OpCompositeConstruct %FBasePassVSToDS %255 %134 %278
+ %280 = OpCompositeExtract %v4float %257 11
+ %281 = OpCompositeConstruct %FBasePassVSToDS %256 %134 %280
+ %282 = OpCompositeConstruct %_arr_FBasePassVSToDS_uint_12 %259 %261 %263 %265 %267 %269 %271 %273 %275 %277 %279 %281
+ OpStore %param_var_I %282
+ %283 = OpLoad %uint %gl_InvocationID
+ %284 = OpAccessChain %_ptr_Function_FVertexFactoryInterpolantsVSToDS %param_var_I %283 %int_0
+ %285 = OpLoad %FVertexFactoryInterpolantsVSToDS %284
+ %286 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %285 0
+ %287 = OpCompositeExtract %v4float %286 0
+ %288 = OpCompositeExtract %v4float %286 1
+ %289 = OpVectorShuffle %v3float %287 %287 0 1 2
+ %290 = OpVectorShuffle %v3float %288 %288 0 1 2
+ %291 = OpExtInst %v3float %1 Cross %290 %289
+ %292 = OpCompositeExtract %float %288 3
+ %293 = OpCompositeConstruct %v3float %292 %292 %292
+ %294 = OpFMul %v3float %291 %293
+ %295 = OpCompositeConstruct %mat3v3float %289 %294 %290
+ %296 = OpCompositeExtract %float %288 0
+ %297 = OpCompositeExtract %float %288 1
+ %298 = OpCompositeExtract %float %288 2
+ %299 = OpCompositeConstruct %v4float %296 %297 %298 %float_0
+ %300 = OpAccessChain %_ptr_Function_FVertexFactoryInterpolantsVSToPS %param_var_I %283 %int_0 %int_0
+ %301 = OpLoad %FVertexFactoryInterpolantsVSToPS %300
+ %302 = OpCompositeExtract %uint %301 5
+ %303 = OpIMul %uint %302 %uint_26
+ %304 = OpIAdd %uint %303 %uint_22
+ %305 = OpAccessChain %_ptr_Uniform_v4float %View_PrimitiveSceneData %int_0 %304
+ %306 = OpLoad %v4float %305
+ %307 = OpVectorShuffle %v3float %306 %306 0 1 2
+ %308 = OpVectorTimesMatrix %v3float %307 %295
+ %309 = OpULessThan %bool %283 %uint_2
+ %310 = OpIAdd %uint %283 %uint_1
+ %311 = OpSelect %uint %309 %310 %uint_0
+ %312 = OpIMul %uint %uint_2 %283
+ %313 = OpIAdd %uint %uint_3 %312
+ %314 = OpIAdd %uint %312 %uint_4
+ %315 = OpAccessChain %_ptr_Function_FBasePassVSToDS %param_var_I %283
+ %316 = OpLoad %FBasePassVSToDS %315
+ %317 = OpAccessChain %_ptr_Function_v4float %param_var_I %283 %int_2
+ %318 = OpLoad %v4float %317
+ %319 = OpAccessChain %_ptr_Function_FVertexFactoryInterpolantsVSToDS %param_var_I %311 %int_0
+ %320 = OpLoad %FVertexFactoryInterpolantsVSToDS %319
+ %321 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %320 0
+ %322 = OpCompositeExtract %v4float %321 1
+ %323 = OpCompositeExtract %float %322 0
+ %324 = OpCompositeExtract %float %322 1
+ %325 = OpCompositeExtract %float %322 2
+ %326 = OpCompositeConstruct %v4float %323 %324 %325 %float_0
+ %327 = OpAccessChain %_ptr_Function_FVertexFactoryInterpolantsVSToDS %param_var_I %313 %int_0
+ %328 = OpLoad %FVertexFactoryInterpolantsVSToDS %327
+ %329 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %328 0
+ %330 = OpCompositeExtract %v4float %329 1
+ %331 = OpCompositeExtract %float %330 0
+ %332 = OpCompositeExtract %float %330 1
+ %333 = OpCompositeExtract %float %330 2
+ %334 = OpCompositeConstruct %v4float %331 %332 %333 %float_0
+ %335 = OpAccessChain %_ptr_Function_FVertexFactoryInterpolantsVSToDS %param_var_I %314 %int_0
+ %336 = OpLoad %FVertexFactoryInterpolantsVSToDS %335
+ %337 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %336 0
+ %338 = OpCompositeExtract %v4float %337 1
+ %339 = OpCompositeExtract %float %338 0
+ %340 = OpCompositeExtract %float %338 1
+ %341 = OpCompositeExtract %float %338 2
+ %342 = OpCompositeConstruct %v4float %339 %340 %341 %float_0
+ %343 = OpLoad %v4float %317
+ %344 = OpAccessChain %_ptr_Function_v4float %param_var_I %311 %int_2
+ %345 = OpLoad %v4float %344
+ %346 = OpFMul %v4float %62 %343
+ %347 = OpFAdd %v4float %346 %345
+ %348 = OpFSub %v4float %345 %343
+ %349 = OpDot %float %348 %299
+ %350 = OpCompositeConstruct %v4float %349 %349 %349 %349
+ %351 = OpFMul %v4float %350 %299
+ %352 = OpFSub %v4float %347 %351
+ %353 = OpFMul %v4float %352 %136
+ %354 = OpAccessChain %_ptr_Function_v4float %param_var_I %313 %int_2
+ %355 = OpLoad %v4float %354
+ %356 = OpAccessChain %_ptr_Function_v4float %param_var_I %314 %int_2
+ %357 = OpLoad %v4float %356
+ %358 = OpFMul %v4float %62 %355
+ %359 = OpFAdd %v4float %358 %357
+ %360 = OpFSub %v4float %357 %355
+ %361 = OpDot %float %360 %334
+ %362 = OpCompositeConstruct %v4float %361 %361 %361 %361
+ %363 = OpFMul %v4float %362 %334
+ %364 = OpFSub %v4float %359 %363
+ %365 = OpFMul %v4float %364 %136
+ %366 = OpFAdd %v4float %353 %365
+ %367 = OpFMul %v4float %366 %137
+ %368 = OpLoad %v4float %344
+ %369 = OpLoad %v4float %317
+ %370 = OpFMul %v4float %62 %368
+ %371 = OpFAdd %v4float %370 %369
+ %372 = OpFSub %v4float %369 %368
+ %373 = OpDot %float %372 %326
+ %374 = OpCompositeConstruct %v4float %373 %373 %373 %373
+ %375 = OpFMul %v4float %374 %326
+ %376 = OpFSub %v4float %371 %375
+ %377 = OpFMul %v4float %376 %136
+ %378 = OpLoad %v4float %356
+ %379 = OpLoad %v4float %354
+ %380 = OpFMul %v4float %62 %378
+ %381 = OpFAdd %v4float %380 %379
+ %382 = OpFSub %v4float %379 %378
+ %383 = OpDot %float %382 %342
+ %384 = OpCompositeConstruct %v4float %383 %383 %383 %383
+ %385 = OpFMul %v4float %384 %342
+ %386 = OpFSub %v4float %381 %385
+ %387 = OpFMul %v4float %386 %136
+ %388 = OpFAdd %v4float %377 %387
+ %389 = OpFMul %v4float %388 %137
+ %390 = OpCompositeConstruct %_arr_v4float_uint_3 %318 %367 %389
+ %391 = OpCompositeConstruct %FPNTessellationHSToDS %316 %390 %308 %float_1 %float_1
+ %392 = OpCompositeExtract %FVertexFactoryInterpolantsVSToDS %316 0
+ %393 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %392 0
+ %394 = OpCompositeExtract %v4float %393 0
+ %395 = OpAccessChain %_ptr_Output_v4float %out_var_TEXCOORD10_centroid %283
+ OpStore %395 %394
+ %396 = OpCompositeExtract %v4float %393 1
+ %397 = OpAccessChain %_ptr_Output_v4float %out_var_TEXCOORD11_centroid %283
+ OpStore %397 %396
+ %398 = OpCompositeExtract %v4float %393 2
+ %399 = OpAccessChain %_ptr_Output_v4float %out_var_COLOR0 %283
+ OpStore %399 %398
+ %400 = OpCompositeExtract %_arr_v4float_uint_1 %393 3
+ %401 = OpAccessChain %_ptr_Output__arr_v4float_uint_1 %out_var_TEXCOORD0 %283
+ OpStore %401 %400
+ %402 = OpCompositeExtract %v4float %393 4
+ %403 = OpAccessChain %_ptr_Output_v4float %out_var_TEXCOORD4 %283
+ OpStore %403 %402
+ %404 = OpCompositeExtract %uint %393 5
+ %405 = OpAccessChain %_ptr_Output_uint %out_var_PRIMITIVE_ID %283
+ OpStore %405 %404
+ %406 = OpCompositeExtract %uint %393 6
+ %407 = OpAccessChain %_ptr_Output_uint %out_var_LIGHTMAP_ID %283
+ OpStore %407 %406
+ %408 = OpCompositeExtract %v4float %316 2
+ %409 = OpAccessChain %_ptr_Output_v4float %out_var_VS_To_DS_Position %283
+ OpStore %409 %408
+ %410 = OpAccessChain %_ptr_Output__arr_v4float_uint_3 %out_var_PN_POSITION %283
+ OpStore %410 %390
+ %411 = OpAccessChain %_ptr_Output_v3float %out_var_PN_DisplacementScales %283
+ OpStore %411 %308
+ %412 = OpAccessChain %_ptr_Output_float %out_var_PN_TessellationMultiplier %283
+ OpStore %412 %float_1
+ %413 = OpAccessChain %_ptr_Output_float %out_var_PN_WorldDisplacementMultiplier %283
+ OpStore %413 %float_1
+ %414 = OpAccessChain %_ptr_Workgroup_FPNTessellationHSToDS %temp_var_hullMainRetVal %283
+ OpStore %414 %391
+ OpControlBarrier %uint_2 %uint_4 %uint_0
+ %415 = OpIEqual %bool %283 %uint_0
+ OpSelectionMerge %if_merge None
+ OpBranchConditional %415 %416 %if_merge
+ %416 = OpLabel
+ %417 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_0
+ %418 = OpLoad %mat4v4float %417
+ %419 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_6
+ %420 = OpLoad %mat4v4float %419
+ %421 = OpAccessChain %_ptr_Uniform_v3float %View %int_27
+ %422 = OpLoad %v3float %421
+ %423 = OpAccessChain %_ptr_Uniform_float %View %int_77
+ %424 = OpLoad %float %423
+ %425 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_0 %int_1 %int_0
+ %426 = OpLoad %v4float %425
+ %427 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_0 %int_1 %int_1
+ %428 = OpLoad %v4float %427
+ %429 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_0 %int_1 %int_2
+ %430 = OpLoad %v4float %429
+ %431 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_1 %int_1 %int_0
+ %432 = OpLoad %v4float %431
+ %433 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_1 %int_1 %int_1
+ %434 = OpLoad %v4float %433
+ %435 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_1 %int_1 %int_2
+ %436 = OpLoad %v4float %435
+ %437 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_2 %int_1 %int_0
+ %438 = OpLoad %v4float %437
+ %439 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_2 %int_1 %int_1
+ %440 = OpLoad %v4float %439
+ %441 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_2 %int_1 %int_2
+ %442 = OpLoad %v4float %441
+ %443 = OpFAdd %v4float %428 %430
+ %444 = OpFAdd %v4float %443 %434
+ %445 = OpFAdd %v4float %444 %436
+ %446 = OpFAdd %v4float %445 %440
+ %447 = OpFAdd %v4float %446 %442
+ %448 = OpFMul %v4float %447 %139
+ %449 = OpFAdd %v4float %438 %432
+ %450 = OpFAdd %v4float %449 %426
+ %451 = OpFMul %v4float %450 %136
+ %452 = OpFSub %v4float %448 %451
+ %453 = OpFMul %v4float %452 %137
+ %454 = OpFAdd %v4float %448 %453
+ %455 = OpAccessChain %_ptr_Workgroup_float %temp_var_hullMainRetVal %uint_1 %int_3
+ %456 = OpLoad %float %455
+ %457 = OpAccessChain %_ptr_Workgroup_float %temp_var_hullMainRetVal %uint_2 %int_3
+ %458 = OpLoad %float %457
+ %459 = OpFAdd %float %456 %458
+ %460 = OpFMul %float %float_0_5 %459
+ %461 = OpCompositeInsert %v4float %460 %140 0
+ %462 = OpLoad %float %457
+ %463 = OpAccessChain %_ptr_Workgroup_float %temp_var_hullMainRetVal %uint_0 %int_3
+ %464 = OpLoad %float %463
+ %465 = OpFAdd %float %462 %464
+ %466 = OpFMul %float %float_0_5 %465
+ %467 = OpCompositeInsert %v4float %466 %461 1
+ %468 = OpLoad %float %463
+ %469 = OpLoad %float %455
+ %470 = OpFAdd %float %468 %469
+ %471 = OpFMul %float %float_0_5 %470
+ %472 = OpCompositeInsert %v4float %471 %467 2
+ %473 = OpLoad %float %463
+ %474 = OpLoad %float %455
+ %475 = OpFAdd %float %473 %474
+ %476 = OpLoad %float %457
+ %477 = OpFAdd %float %475 %476
+ %478 = OpFMul %float %float_0_333000004 %477
+ %479 = OpCompositeInsert %v4float %478 %472 3
+ %480 = OpVectorShuffle %v3float %426 %426 0 1 2
+ %481 = OpVectorShuffle %v3float %432 %432 0 1 2
+ %482 = OpVectorShuffle %v3float %438 %438 0 1 2
+ OpBranch %483
+ %483 = OpLabel
+ OpLoopMerge %484 %485 None
+ OpBranch %486
+ %486 = OpLabel
+ %487 = OpMatrixTimesVector %v4float %420 %76
+ %488 = OpCompositeExtract %float %426 0
+ %489 = OpCompositeExtract %float %426 1
+ %490 = OpCompositeExtract %float %426 2
+ %491 = OpCompositeConstruct %v4float %488 %489 %490 %float_1
+ %492 = OpMatrixTimesVector %v4float %418 %491
+ %493 = OpVectorShuffle %v3float %492 %492 0 1 2
+ %494 = OpVectorShuffle %v3float %487 %487 0 1 2
+ %495 = OpFSub %v3float %493 %494
+ %496 = OpCompositeExtract %float %492 3
+ %497 = OpCompositeExtract %float %487 3
+ %498 = OpFAdd %float %496 %497
+ %499 = OpCompositeConstruct %v3float %498 %498 %498
+ %500 = OpFOrdLessThan %v3bool %495 %499
+ %501 = OpSelect %v3int %500 %81 %73
+ %502 = OpFAdd %v3float %493 %494
+ %503 = OpFNegate %float %496
+ %504 = OpFSub %float %503 %497
+ %505 = OpCompositeConstruct %v3float %504 %504 %504
+ %506 = OpFOrdGreaterThan %v3bool %502 %505
+ %507 = OpSelect %v3int %506 %81 %73
+ %508 = OpIMul %v3int %82 %507
+ %509 = OpIAdd %v3int %501 %508
+ %510 = OpCompositeExtract %float %432 0
+ %511 = OpCompositeExtract %float %432 1
+ %512 = OpCompositeExtract %float %432 2
+ %513 = OpCompositeConstruct %v4float %510 %511 %512 %float_1
+ %514 = OpMatrixTimesVector %v4float %418 %513
+ %515 = OpVectorShuffle %v3float %514 %514 0 1 2
+ %516 = OpFSub %v3float %515 %494
+ %517 = OpCompositeExtract %float %514 3
+ %518 = OpFAdd %float %517 %497
+ %519 = OpCompositeConstruct %v3float %518 %518 %518
+ %520 = OpFOrdLessThan %v3bool %516 %519
+ %521 = OpSelect %v3int %520 %81 %73
+ %522 = OpFAdd %v3float %515 %494
+ %523 = OpFNegate %float %517
+ %524 = OpFSub %float %523 %497
+ %525 = OpCompositeConstruct %v3float %524 %524 %524
+ %526 = OpFOrdGreaterThan %v3bool %522 %525
+ %527 = OpSelect %v3int %526 %81 %73
+ %528 = OpIMul %v3int %82 %527
+ %529 = OpIAdd %v3int %521 %528
+ %530 = OpBitwiseOr %v3int %509 %529
+ %531 = OpCompositeExtract %float %438 0
+ %532 = OpCompositeExtract %float %438 1
+ %533 = OpCompositeExtract %float %438 2
+ %534 = OpCompositeConstruct %v4float %531 %532 %533 %float_1
+ %535 = OpMatrixTimesVector %v4float %418 %534
+ %536 = OpVectorShuffle %v3float %535 %535 0 1 2
+ %537 = OpFSub %v3float %536 %494
+ %538 = OpCompositeExtract %float %535 3
+ %539 = OpFAdd %float %538 %497
+ %540 = OpCompositeConstruct %v3float %539 %539 %539
+ %541 = OpFOrdLessThan %v3bool %537 %540
+ %542 = OpSelect %v3int %541 %81 %73
+ %543 = OpFAdd %v3float %536 %494
+ %544 = OpFNegate %float %538
+ %545 = OpFSub %float %544 %497
+ %546 = OpCompositeConstruct %v3float %545 %545 %545
+ %547 = OpFOrdGreaterThan %v3bool %543 %546
+ %548 = OpSelect %v3int %547 %81 %73
+ %549 = OpIMul %v3int %82 %548
+ %550 = OpIAdd %v3int %542 %549
+ %551 = OpBitwiseOr %v3int %530 %550
+ %552 = OpINotEqual %v3bool %551 %74
+ %553 = OpAny %bool %552
+ OpSelectionMerge %554 None
+ OpBranchConditional %553 %555 %554
+ %555 = OpLabel
+ OpBranch %484
+ %554 = OpLabel
+ %556 = OpFSub %v3float %480 %481
+ %557 = OpFSub %v3float %481 %482
+ %558 = OpFSub %v3float %482 %480
+ %559 = OpFAdd %v3float %480 %481
+ %560 = OpFMul %v3float %77 %559
+ %561 = OpFSub %v3float %560 %422
+ %562 = OpFAdd %v3float %481 %482
+ %563 = OpFMul %v3float %77 %562
+ %564 = OpFSub %v3float %563 %422
+ %565 = OpFAdd %v3float %482 %480
+ %566 = OpFMul %v3float %77 %565
+ %567 = OpFSub %v3float %566 %422
+ %568 = OpDot %float %557 %557
+ %569 = OpDot %float %564 %564
+ %570 = OpFDiv %float %568 %569
+ %571 = OpExtInst %float %1 Sqrt %570
+ %572 = OpDot %float %558 %558
+ %573 = OpDot %float %567 %567
+ %574 = OpFDiv %float %572 %573
+ %575 = OpExtInst %float %1 Sqrt %574
+ %576 = OpDot %float %556 %556
+ %577 = OpDot %float %561 %561
+ %578 = OpFDiv %float %576 %577
+ %579 = OpExtInst %float %1 Sqrt %578
+ %580 = OpCompositeConstruct %v4float %571 %575 %579 %float_1
+ %581 = OpFAdd %float %571 %575
+ %582 = OpFAdd %float %581 %579
+ %583 = OpFMul %float %float_0_333000004 %582
+ %584 = OpCompositeInsert %v4float %583 %580 3
+ %585 = OpCompositeConstruct %v4float %424 %424 %424 %424
+ %586 = OpFMul %v4float %585 %584
+ OpBranch %484
+ %485 = OpLabel
+ OpBranch %483
+ %484 = OpLabel
+ %587 = OpPhi %v4float %76 %555 %586 %554
+ %588 = OpFMul %v4float %479 %587
+ %589 = OpExtInst %v4float %1 FClamp %588 %67 %69
+ %590 = OpCompositeExtract %float %589 0
+ %591 = OpCompositeExtract %float %589 1
+ %592 = OpCompositeExtract %float %589 2
+ %593 = OpCompositeExtract %float %589 3
+ %594 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %uint_0
+ OpStore %594 %590
+ %595 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %uint_1
+ OpStore %595 %591
+ %596 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %uint_2
+ OpStore %596 %592
+ %597 = OpAccessChain %_ptr_Output_float %gl_TessLevelInner %uint_0
+ OpStore %597 %593
+ OpStore %out_var_PN_POSITION9 %454
+ OpBranch %if_merge
+ %if_merge = OpLabel
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/hs-input-array-access.asm.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/hs-input-array-access.asm.tesc
new file mode 100644
index 00000000000..a146896b90b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/hs-input-array-access.asm.tesc
@@ -0,0 +1,1264 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 607
+; Schema: 0
+ OpCapability Tessellation
+ OpCapability SampledBuffer
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint TessellationControl %MainHull "main" %in_var_TEXCOORD10_centroid %in_var_TEXCOORD11_centroid %in_var_VS_To_DS_Position %in_var_VS_To_DS_VertexID %gl_InvocationID %out_var_TEXCOORD10_centroid %out_var_TEXCOORD11_centroid %out_var_VS_To_DS_Position %out_var_VS_To_DS_VertexID %out_var_PN_POSITION %out_var_PN_DisplacementScales %out_var_PN_TessellationMultiplier %out_var_PN_WorldDisplacementMultiplier %out_var_PN_DominantVertex %out_var_PN_DominantVertex1 %out_var_PN_DominantVertex2 %out_var_PN_DominantEdge %out_var_PN_DominantEdge1 %out_var_PN_DominantEdge2 %out_var_PN_DominantEdge3 %out_var_PN_DominantEdge4 %out_var_PN_DominantEdge5 %gl_TessLevelOuter %gl_TessLevelInner %out_var_PN_POSITION9
+ OpExecutionMode %MainHull Triangles
+ OpExecutionMode %MainHull SpacingFractionalOdd
+ OpExecutionMode %MainHull VertexOrderCw
+ OpExecutionMode %MainHull OutputVertices 3
+ OpSource HLSL 600
+ OpName %FPNTessellationHSToDS "FPNTessellationHSToDS"
+ OpMemberName %FPNTessellationHSToDS 0 "PassSpecificData"
+ OpMemberName %FPNTessellationHSToDS 1 "WorldPosition"
+ OpMemberName %FPNTessellationHSToDS 2 "DisplacementScale"
+ OpMemberName %FPNTessellationHSToDS 3 "TessellationMultiplier"
+ OpMemberName %FPNTessellationHSToDS 4 "WorldDisplacementMultiplier"
+ OpMemberName %FPNTessellationHSToDS 5 "DominantVertex"
+ OpMemberName %FPNTessellationHSToDS 6 "DominantEdge"
+ OpName %FHitProxyVSToDS "FHitProxyVSToDS"
+ OpMemberName %FHitProxyVSToDS 0 "FactoryInterpolants"
+ OpMemberName %FHitProxyVSToDS 1 "Position"
+ OpMemberName %FHitProxyVSToDS 2 "VertexID"
+ OpName %FVertexFactoryInterpolantsVSToDS "FVertexFactoryInterpolantsVSToDS"
+ OpMemberName %FVertexFactoryInterpolantsVSToDS 0 "InterpolantsVSToPS"
+ OpName %FVertexFactoryInterpolantsVSToPS "FVertexFactoryInterpolantsVSToPS"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 0 "TangentToWorld0"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 1 "TangentToWorld2"
+ OpName %FHullShaderConstantDominantVertexData "FHullShaderConstantDominantVertexData"
+ OpMemberName %FHullShaderConstantDominantVertexData 0 "UV"
+ OpMemberName %FHullShaderConstantDominantVertexData 1 "Normal"
+ OpMemberName %FHullShaderConstantDominantVertexData 2 "Tangent"
+ OpName %FHullShaderConstantDominantEdgeData "FHullShaderConstantDominantEdgeData"
+ OpMemberName %FHullShaderConstantDominantEdgeData 0 "UV0"
+ OpMemberName %FHullShaderConstantDominantEdgeData 1 "UV1"
+ OpMemberName %FHullShaderConstantDominantEdgeData 2 "Normal0"
+ OpMemberName %FHullShaderConstantDominantEdgeData 3 "Normal1"
+ OpMemberName %FHullShaderConstantDominantEdgeData 4 "Tangent0"
+ OpMemberName %FHullShaderConstantDominantEdgeData 5 "Tangent1"
+ OpName %type_View "type.View"
+ OpMemberName %type_View 0 "View_TranslatedWorldToClip"
+ OpMemberName %type_View 1 "View_WorldToClip"
+ OpMemberName %type_View 2 "View_ClipToWorld"
+ OpMemberName %type_View 3 "View_TranslatedWorldToView"
+ OpMemberName %type_View 4 "View_ViewToTranslatedWorld"
+ OpMemberName %type_View 5 "View_TranslatedWorldToCameraView"
+ OpMemberName %type_View 6 "View_CameraViewToTranslatedWorld"
+ OpMemberName %type_View 7 "View_ViewToClip"
+ OpMemberName %type_View 8 "View_ViewToClipNoAA"
+ OpMemberName %type_View 9 "View_ClipToView"
+ OpMemberName %type_View 10 "View_ClipToTranslatedWorld"
+ OpMemberName %type_View 11 "View_SVPositionToTranslatedWorld"
+ OpMemberName %type_View 12 "View_ScreenToWorld"
+ OpMemberName %type_View 13 "View_ScreenToTranslatedWorld"
+ OpMemberName %type_View 14 "View_ViewForward"
+ OpMemberName %type_View 15 "PrePadding_View_908"
+ OpMemberName %type_View 16 "View_ViewUp"
+ OpMemberName %type_View 17 "PrePadding_View_924"
+ OpMemberName %type_View 18 "View_ViewRight"
+ OpMemberName %type_View 19 "PrePadding_View_940"
+ OpMemberName %type_View 20 "View_HMDViewNoRollUp"
+ OpMemberName %type_View 21 "PrePadding_View_956"
+ OpMemberName %type_View 22 "View_HMDViewNoRollRight"
+ OpMemberName %type_View 23 "PrePadding_View_972"
+ OpMemberName %type_View 24 "View_InvDeviceZToWorldZTransform"
+ OpMemberName %type_View 25 "View_ScreenPositionScaleBias"
+ OpMemberName %type_View 26 "View_WorldCameraOrigin"
+ OpMemberName %type_View 27 "PrePadding_View_1020"
+ OpMemberName %type_View 28 "View_TranslatedWorldCameraOrigin"
+ OpMemberName %type_View 29 "PrePadding_View_1036"
+ OpMemberName %type_View 30 "View_WorldViewOrigin"
+ OpMemberName %type_View 31 "PrePadding_View_1052"
+ OpMemberName %type_View 32 "View_PreViewTranslation"
+ OpMemberName %type_View 33 "PrePadding_View_1068"
+ OpMemberName %type_View 34 "View_PrevProjection"
+ OpMemberName %type_View 35 "View_PrevViewProj"
+ OpMemberName %type_View 36 "View_PrevViewRotationProj"
+ OpMemberName %type_View 37 "View_PrevViewToClip"
+ OpMemberName %type_View 38 "View_PrevClipToView"
+ OpMemberName %type_View 39 "View_PrevTranslatedWorldToClip"
+ OpMemberName %type_View 40 "View_PrevTranslatedWorldToView"
+ OpMemberName %type_View 41 "View_PrevViewToTranslatedWorld"
+ OpMemberName %type_View 42 "View_PrevTranslatedWorldToCameraView"
+ OpMemberName %type_View 43 "View_PrevCameraViewToTranslatedWorld"
+ OpMemberName %type_View 44 "View_PrevWorldCameraOrigin"
+ OpMemberName %type_View 45 "PrePadding_View_1724"
+ OpMemberName %type_View 46 "View_PrevWorldViewOrigin"
+ OpMemberName %type_View 47 "PrePadding_View_1740"
+ OpMemberName %type_View 48 "View_PrevPreViewTranslation"
+ OpMemberName %type_View 49 "PrePadding_View_1756"
+ OpMemberName %type_View 50 "View_PrevInvViewProj"
+ OpMemberName %type_View 51 "View_PrevScreenToTranslatedWorld"
+ OpMemberName %type_View 52 "View_ClipToPrevClip"
+ OpMemberName %type_View 53 "View_TemporalAAJitter"
+ OpMemberName %type_View 54 "View_GlobalClippingPlane"
+ OpMemberName %type_View 55 "View_FieldOfViewWideAngles"
+ OpMemberName %type_View 56 "View_PrevFieldOfViewWideAngles"
+ OpMemberName %type_View 57 "View_ViewRectMin"
+ OpMemberName %type_View 58 "View_ViewSizeAndInvSize"
+ OpMemberName %type_View 59 "View_BufferSizeAndInvSize"
+ OpMemberName %type_View 60 "View_BufferBilinearUVMinMax"
+ OpMemberName %type_View 61 "View_NumSceneColorMSAASamples"
+ OpMemberName %type_View 62 "View_PreExposure"
+ OpMemberName %type_View 63 "View_OneOverPreExposure"
+ OpMemberName %type_View 64 "PrePadding_View_2076"
+ OpMemberName %type_View 65 "View_DiffuseOverrideParameter"
+ OpMemberName %type_View 66 "View_SpecularOverrideParameter"
+ OpMemberName %type_View 67 "View_NormalOverrideParameter"
+ OpMemberName %type_View 68 "View_RoughnessOverrideParameter"
+ OpMemberName %type_View 69 "View_PrevFrameGameTime"
+ OpMemberName %type_View 70 "View_PrevFrameRealTime"
+ OpMemberName %type_View 71 "View_OutOfBoundsMask"
+ OpMemberName %type_View 72 "PrePadding_View_2148"
+ OpMemberName %type_View 73 "PrePadding_View_2152"
+ OpMemberName %type_View 74 "PrePadding_View_2156"
+ OpMemberName %type_View 75 "View_WorldCameraMovementSinceLastFrame"
+ OpMemberName %type_View 76 "View_CullingSign"
+ OpMemberName %type_View 77 "View_NearPlane"
+ OpMemberName %type_View 78 "View_AdaptiveTessellationFactor"
+ OpMemberName %type_View 79 "View_GameTime"
+ OpMemberName %type_View 80 "View_RealTime"
+ OpMemberName %type_View 81 "View_DeltaTime"
+ OpMemberName %type_View 82 "View_MaterialTextureMipBias"
+ OpMemberName %type_View 83 "View_MaterialTextureDerivativeMultiply"
+ OpMemberName %type_View 84 "View_Random"
+ OpMemberName %type_View 85 "View_FrameNumber"
+ OpMemberName %type_View 86 "View_StateFrameIndexMod8"
+ OpMemberName %type_View 87 "View_StateFrameIndex"
+ OpMemberName %type_View 88 "View_CameraCut"
+ OpMemberName %type_View 89 "View_UnlitViewmodeMask"
+ OpMemberName %type_View 90 "PrePadding_View_2228"
+ OpMemberName %type_View 91 "PrePadding_View_2232"
+ OpMemberName %type_View 92 "PrePadding_View_2236"
+ OpMemberName %type_View 93 "View_DirectionalLightColor"
+ OpMemberName %type_View 94 "View_DirectionalLightDirection"
+ OpMemberName %type_View 95 "PrePadding_View_2268"
+ OpMemberName %type_View 96 "View_TranslucencyLightingVolumeMin"
+ OpMemberName %type_View 97 "View_TranslucencyLightingVolumeInvSize"
+ OpMemberName %type_View 98 "View_TemporalAAParams"
+ OpMemberName %type_View 99 "View_CircleDOFParams"
+ OpMemberName %type_View 100 "View_DepthOfFieldSensorWidth"
+ OpMemberName %type_View 101 "View_DepthOfFieldFocalDistance"
+ OpMemberName %type_View 102 "View_DepthOfFieldScale"
+ OpMemberName %type_View 103 "View_DepthOfFieldFocalLength"
+ OpMemberName %type_View 104 "View_DepthOfFieldFocalRegion"
+ OpMemberName %type_View 105 "View_DepthOfFieldNearTransitionRegion"
+ OpMemberName %type_View 106 "View_DepthOfFieldFarTransitionRegion"
+ OpMemberName %type_View 107 "View_MotionBlurNormalizedToPixel"
+ OpMemberName %type_View 108 "View_bSubsurfacePostprocessEnabled"
+ OpMemberName %type_View 109 "View_GeneralPurposeTweak"
+ OpMemberName %type_View 110 "View_DemosaicVposOffset"
+ OpMemberName %type_View 111 "PrePadding_View_2412"
+ OpMemberName %type_View 112 "View_IndirectLightingColorScale"
+ OpMemberName %type_View 113 "View_HDR32bppEncodingMode"
+ OpMemberName %type_View 114 "View_AtmosphericFogSunDirection"
+ OpMemberName %type_View 115 "View_AtmosphericFogSunPower"
+ OpMemberName %type_View 116 "View_AtmosphericFogPower"
+ OpMemberName %type_View 117 "View_AtmosphericFogDensityScale"
+ OpMemberName %type_View 118 "View_AtmosphericFogDensityOffset"
+ OpMemberName %type_View 119 "View_AtmosphericFogGroundOffset"
+ OpMemberName %type_View 120 "View_AtmosphericFogDistanceScale"
+ OpMemberName %type_View 121 "View_AtmosphericFogAltitudeScale"
+ OpMemberName %type_View 122 "View_AtmosphericFogHeightScaleRayleigh"
+ OpMemberName %type_View 123 "View_AtmosphericFogStartDistance"
+ OpMemberName %type_View 124 "View_AtmosphericFogDistanceOffset"
+ OpMemberName %type_View 125 "View_AtmosphericFogSunDiscScale"
+ OpMemberName %type_View 126 "View_AtmosphericFogSunDiscHalfApexAngleRadian"
+ OpMemberName %type_View 127 "PrePadding_View_2492"
+ OpMemberName %type_View 128 "View_AtmosphericFogSunDiscLuminance"
+ OpMemberName %type_View 129 "View_AtmosphericFogRenderMask"
+ OpMemberName %type_View 130 "View_AtmosphericFogInscatterAltitudeSampleNum"
+ OpMemberName %type_View 131 "PrePadding_View_2520"
+ OpMemberName %type_View 132 "PrePadding_View_2524"
+ OpMemberName %type_View 133 "View_AtmosphericFogSunColor"
+ OpMemberName %type_View 134 "View_NormalCurvatureToRoughnessScaleBias"
+ OpMemberName %type_View 135 "View_RenderingReflectionCaptureMask"
+ OpMemberName %type_View 136 "View_AmbientCubemapTint"
+ OpMemberName %type_View 137 "View_AmbientCubemapIntensity"
+ OpMemberName %type_View 138 "View_SkyLightParameters"
+ OpMemberName %type_View 139 "PrePadding_View_2584"
+ OpMemberName %type_View 140 "PrePadding_View_2588"
+ OpMemberName %type_View 141 "View_SkyLightColor"
+ OpMemberName %type_View 142 "View_SkyIrradianceEnvironmentMap"
+ OpMemberName %type_View 143 "View_MobilePreviewMode"
+ OpMemberName %type_View 144 "View_HMDEyePaddingOffset"
+ OpMemberName %type_View 145 "View_ReflectionCubemapMaxMip"
+ OpMemberName %type_View 146 "View_ShowDecalsMask"
+ OpMemberName %type_View 147 "View_DistanceFieldAOSpecularOcclusionMode"
+ OpMemberName %type_View 148 "View_IndirectCapsuleSelfShadowingIntensity"
+ OpMemberName %type_View 149 "PrePadding_View_2744"
+ OpMemberName %type_View 150 "PrePadding_View_2748"
+ OpMemberName %type_View 151 "View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight"
+ OpMemberName %type_View 152 "View_StereoPassIndex"
+ OpMemberName %type_View 153 "View_GlobalVolumeCenterAndExtent"
+ OpMemberName %type_View 154 "View_GlobalVolumeWorldToUVAddAndMul"
+ OpMemberName %type_View 155 "View_GlobalVolumeDimension"
+ OpMemberName %type_View 156 "View_GlobalVolumeTexelSize"
+ OpMemberName %type_View 157 "View_MaxGlobalDistance"
+ OpMemberName %type_View 158 "PrePadding_View_2908"
+ OpMemberName %type_View 159 "View_CursorPosition"
+ OpMemberName %type_View 160 "View_bCheckerboardSubsurfaceProfileRendering"
+ OpMemberName %type_View 161 "PrePadding_View_2924"
+ OpMemberName %type_View 162 "View_VolumetricFogInvGridSize"
+ OpMemberName %type_View 163 "PrePadding_View_2940"
+ OpMemberName %type_View 164 "View_VolumetricFogGridZParams"
+ OpMemberName %type_View 165 "PrePadding_View_2956"
+ OpMemberName %type_View 166 "View_VolumetricFogSVPosToVolumeUV"
+ OpMemberName %type_View 167 "View_VolumetricFogMaxDistance"
+ OpMemberName %type_View 168 "PrePadding_View_2972"
+ OpMemberName %type_View 169 "View_VolumetricLightmapWorldToUVScale"
+ OpMemberName %type_View 170 "PrePadding_View_2988"
+ OpMemberName %type_View 171 "View_VolumetricLightmapWorldToUVAdd"
+ OpMemberName %type_View 172 "PrePadding_View_3004"
+ OpMemberName %type_View 173 "View_VolumetricLightmapIndirectionTextureSize"
+ OpMemberName %type_View 174 "View_VolumetricLightmapBrickSize"
+ OpMemberName %type_View 175 "View_VolumetricLightmapBrickTexelSize"
+ OpMemberName %type_View 176 "View_StereoIPD"
+ OpMemberName %type_View 177 "View_IndirectLightingCacheShowFlag"
+ OpMemberName %type_View 178 "View_EyeToPixelSpreadAngle"
+ OpName %View "View"
+ OpName %type_Primitive "type.Primitive"
+ OpMemberName %type_Primitive 0 "Primitive_LocalToWorld"
+ OpMemberName %type_Primitive 1 "Primitive_InvNonUniformScaleAndDeterminantSign"
+ OpMemberName %type_Primitive 2 "Primitive_ObjectWorldPositionAndRadius"
+ OpMemberName %type_Primitive 3 "Primitive_WorldToLocal"
+ OpMemberName %type_Primitive 4 "Primitive_PreviousLocalToWorld"
+ OpMemberName %type_Primitive 5 "Primitive_PreviousWorldToLocal"
+ OpMemberName %type_Primitive 6 "Primitive_ActorWorldPosition"
+ OpMemberName %type_Primitive 7 "Primitive_UseSingleSampleShadowFromStationaryLights"
+ OpMemberName %type_Primitive 8 "Primitive_ObjectBounds"
+ OpMemberName %type_Primitive 9 "Primitive_LpvBiasMultiplier"
+ OpMemberName %type_Primitive 10 "Primitive_DecalReceiverMask"
+ OpMemberName %type_Primitive 11 "Primitive_PerObjectGBufferData"
+ OpMemberName %type_Primitive 12 "Primitive_UseVolumetricLightmapShadowFromStationaryLights"
+ OpMemberName %type_Primitive 13 "Primitive_DrawsVelocity"
+ OpMemberName %type_Primitive 14 "Primitive_ObjectOrientation"
+ OpMemberName %type_Primitive 15 "Primitive_NonUniformScale"
+ OpMemberName %type_Primitive 16 "Primitive_LocalObjectBoundsMin"
+ OpMemberName %type_Primitive 17 "Primitive_LightingChannelMask"
+ OpMemberName %type_Primitive 18 "Primitive_LocalObjectBoundsMax"
+ OpMemberName %type_Primitive 19 "Primitive_LightmapDataIndex"
+ OpMemberName %type_Primitive 20 "Primitive_PreSkinnedLocalBounds"
+ OpMemberName %type_Primitive 21 "Primitive_SingleCaptureIndex"
+ OpMemberName %type_Primitive 22 "Primitive_OutputVelocity"
+ OpMemberName %type_Primitive 23 "PrePadding_Primitive_420"
+ OpMemberName %type_Primitive 24 "PrePadding_Primitive_424"
+ OpMemberName %type_Primitive 25 "PrePadding_Primitive_428"
+ OpMemberName %type_Primitive 26 "Primitive_CustomPrimitiveData"
+ OpName %Primitive "Primitive"
+ OpName %in_var_TEXCOORD10_centroid "in.var.TEXCOORD10_centroid"
+ OpName %in_var_TEXCOORD11_centroid "in.var.TEXCOORD11_centroid"
+ OpName %in_var_VS_To_DS_Position "in.var.VS_To_DS_Position"
+ OpName %in_var_VS_To_DS_VertexID "in.var.VS_To_DS_VertexID"
+ OpName %out_var_TEXCOORD10_centroid "out.var.TEXCOORD10_centroid"
+ OpName %out_var_TEXCOORD11_centroid "out.var.TEXCOORD11_centroid"
+ OpName %out_var_VS_To_DS_Position "out.var.VS_To_DS_Position"
+ OpName %out_var_VS_To_DS_VertexID "out.var.VS_To_DS_VertexID"
+ OpName %out_var_PN_POSITION "out.var.PN_POSITION"
+ OpName %out_var_PN_DisplacementScales "out.var.PN_DisplacementScales"
+ OpName %out_var_PN_TessellationMultiplier "out.var.PN_TessellationMultiplier"
+ OpName %out_var_PN_WorldDisplacementMultiplier "out.var.PN_WorldDisplacementMultiplier"
+ OpName %out_var_PN_DominantVertex "out.var.PN_DominantVertex"
+ OpName %out_var_PN_DominantVertex1 "out.var.PN_DominantVertex1"
+ OpName %out_var_PN_DominantVertex2 "out.var.PN_DominantVertex2"
+ OpName %out_var_PN_DominantEdge "out.var.PN_DominantEdge"
+ OpName %out_var_PN_DominantEdge1 "out.var.PN_DominantEdge1"
+ OpName %out_var_PN_DominantEdge2 "out.var.PN_DominantEdge2"
+ OpName %out_var_PN_DominantEdge3 "out.var.PN_DominantEdge3"
+ OpName %out_var_PN_DominantEdge4 "out.var.PN_DominantEdge4"
+ OpName %out_var_PN_DominantEdge5 "out.var.PN_DominantEdge5"
+ OpName %out_var_PN_POSITION9 "out.var.PN_POSITION9"
+ OpName %MainHull "MainHull"
+ OpName %param_var_I "param.var.I"
+ OpName %temp_var_hullMainRetVal "temp.var.hullMainRetVal"
+ OpName %if_merge "if.merge"
+ OpDecorateString %in_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %in_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %in_var_VS_To_DS_Position UserSemantic "VS_To_DS_Position"
+ OpDecorateString %in_var_VS_To_DS_VertexID UserSemantic "VS_To_DS_VertexID"
+ OpDecorate %gl_InvocationID BuiltIn InvocationId
+ OpDecorateString %gl_InvocationID UserSemantic "SV_OutputControlPointID"
+ OpDecorateString %out_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %out_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %out_var_VS_To_DS_Position UserSemantic "VS_To_DS_Position"
+ OpDecorateString %out_var_VS_To_DS_VertexID UserSemantic "VS_To_DS_VertexID"
+ OpDecorateString %out_var_PN_POSITION UserSemantic "PN_POSITION"
+ OpDecorateString %out_var_PN_DisplacementScales UserSemantic "PN_DisplacementScales"
+ OpDecorateString %out_var_PN_TessellationMultiplier UserSemantic "PN_TessellationMultiplier"
+ OpDecorateString %out_var_PN_WorldDisplacementMultiplier UserSemantic "PN_WorldDisplacementMultiplier"
+ OpDecorateString %out_var_PN_DominantVertex UserSemantic "PN_DominantVertex"
+ OpDecorateString %out_var_PN_DominantVertex1 UserSemantic "PN_DominantVertex"
+ OpDecorateString %out_var_PN_DominantVertex2 UserSemantic "PN_DominantVertex"
+ OpDecorateString %out_var_PN_DominantEdge UserSemantic "PN_DominantEdge"
+ OpDecorateString %out_var_PN_DominantEdge1 UserSemantic "PN_DominantEdge"
+ OpDecorateString %out_var_PN_DominantEdge2 UserSemantic "PN_DominantEdge"
+ OpDecorateString %out_var_PN_DominantEdge3 UserSemantic "PN_DominantEdge"
+ OpDecorateString %out_var_PN_DominantEdge4 UserSemantic "PN_DominantEdge"
+ OpDecorateString %out_var_PN_DominantEdge5 UserSemantic "PN_DominantEdge"
+ OpDecorate %gl_TessLevelOuter BuiltIn TessLevelOuter
+ OpDecorateString %gl_TessLevelOuter UserSemantic "SV_TessFactor"
+ OpDecorate %gl_TessLevelOuter Patch
+ OpDecorate %gl_TessLevelInner BuiltIn TessLevelInner
+ OpDecorateString %gl_TessLevelInner UserSemantic "SV_InsideTessFactor"
+ OpDecorate %gl_TessLevelInner Patch
+ OpDecorateString %out_var_PN_POSITION9 UserSemantic "PN_POSITION9"
+ OpDecorate %out_var_PN_POSITION9 Patch
+ OpDecorate %in_var_TEXCOORD10_centroid Location 0
+ OpDecorate %in_var_TEXCOORD11_centroid Location 1
+ OpDecorate %in_var_VS_To_DS_Position Location 2
+ OpDecorate %in_var_VS_To_DS_VertexID Location 3
+ OpDecorate %out_var_PN_DisplacementScales Location 0
+ OpDecorate %out_var_PN_DominantEdge Location 1
+ OpDecorate %out_var_PN_DominantEdge1 Location 2
+ OpDecorate %out_var_PN_DominantEdge2 Location 3
+ OpDecorate %out_var_PN_DominantEdge3 Location 4
+ OpDecorate %out_var_PN_DominantEdge4 Location 5
+ OpDecorate %out_var_PN_DominantEdge5 Location 6
+ OpDecorate %out_var_PN_DominantVertex Location 7
+ OpDecorate %out_var_PN_DominantVertex1 Location 8
+ OpDecorate %out_var_PN_DominantVertex2 Location 9
+ OpDecorate %out_var_PN_POSITION Location 10
+ OpDecorate %out_var_PN_POSITION9 Location 13
+ OpDecorate %out_var_PN_TessellationMultiplier Location 14
+ OpDecorate %out_var_PN_WorldDisplacementMultiplier Location 15
+ OpDecorate %out_var_TEXCOORD10_centroid Location 16
+ OpDecorate %out_var_TEXCOORD11_centroid Location 17
+ OpDecorate %out_var_VS_To_DS_Position Location 18
+ OpDecorate %out_var_VS_To_DS_VertexID Location 19
+ OpDecorate %View DescriptorSet 0
+ OpDecorate %View Binding 0
+ OpDecorate %Primitive DescriptorSet 0
+ OpDecorate %Primitive Binding 1
+ OpDecorate %_arr_v4float_uint_2 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_7 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpMemberDecorate %type_View 0 Offset 0
+ OpMemberDecorate %type_View 0 MatrixStride 16
+ OpMemberDecorate %type_View 0 ColMajor
+ OpMemberDecorate %type_View 1 Offset 64
+ OpMemberDecorate %type_View 1 MatrixStride 16
+ OpMemberDecorate %type_View 1 ColMajor
+ OpMemberDecorate %type_View 2 Offset 128
+ OpMemberDecorate %type_View 2 MatrixStride 16
+ OpMemberDecorate %type_View 2 ColMajor
+ OpMemberDecorate %type_View 3 Offset 192
+ OpMemberDecorate %type_View 3 MatrixStride 16
+ OpMemberDecorate %type_View 3 ColMajor
+ OpMemberDecorate %type_View 4 Offset 256
+ OpMemberDecorate %type_View 4 MatrixStride 16
+ OpMemberDecorate %type_View 4 ColMajor
+ OpMemberDecorate %type_View 5 Offset 320
+ OpMemberDecorate %type_View 5 MatrixStride 16
+ OpMemberDecorate %type_View 5 ColMajor
+ OpMemberDecorate %type_View 6 Offset 384
+ OpMemberDecorate %type_View 6 MatrixStride 16
+ OpMemberDecorate %type_View 6 ColMajor
+ OpMemberDecorate %type_View 7 Offset 448
+ OpMemberDecorate %type_View 7 MatrixStride 16
+ OpMemberDecorate %type_View 7 ColMajor
+ OpMemberDecorate %type_View 8 Offset 512
+ OpMemberDecorate %type_View 8 MatrixStride 16
+ OpMemberDecorate %type_View 8 ColMajor
+ OpMemberDecorate %type_View 9 Offset 576
+ OpMemberDecorate %type_View 9 MatrixStride 16
+ OpMemberDecorate %type_View 9 ColMajor
+ OpMemberDecorate %type_View 10 Offset 640
+ OpMemberDecorate %type_View 10 MatrixStride 16
+ OpMemberDecorate %type_View 10 ColMajor
+ OpMemberDecorate %type_View 11 Offset 704
+ OpMemberDecorate %type_View 11 MatrixStride 16
+ OpMemberDecorate %type_View 11 ColMajor
+ OpMemberDecorate %type_View 12 Offset 768
+ OpMemberDecorate %type_View 12 MatrixStride 16
+ OpMemberDecorate %type_View 12 ColMajor
+ OpMemberDecorate %type_View 13 Offset 832
+ OpMemberDecorate %type_View 13 MatrixStride 16
+ OpMemberDecorate %type_View 13 ColMajor
+ OpMemberDecorate %type_View 14 Offset 896
+ OpMemberDecorate %type_View 15 Offset 908
+ OpMemberDecorate %type_View 16 Offset 912
+ OpMemberDecorate %type_View 17 Offset 924
+ OpMemberDecorate %type_View 18 Offset 928
+ OpMemberDecorate %type_View 19 Offset 940
+ OpMemberDecorate %type_View 20 Offset 944
+ OpMemberDecorate %type_View 21 Offset 956
+ OpMemberDecorate %type_View 22 Offset 960
+ OpMemberDecorate %type_View 23 Offset 972
+ OpMemberDecorate %type_View 24 Offset 976
+ OpMemberDecorate %type_View 25 Offset 992
+ OpMemberDecorate %type_View 26 Offset 1008
+ OpMemberDecorate %type_View 27 Offset 1020
+ OpMemberDecorate %type_View 28 Offset 1024
+ OpMemberDecorate %type_View 29 Offset 1036
+ OpMemberDecorate %type_View 30 Offset 1040
+ OpMemberDecorate %type_View 31 Offset 1052
+ OpMemberDecorate %type_View 32 Offset 1056
+ OpMemberDecorate %type_View 33 Offset 1068
+ OpMemberDecorate %type_View 34 Offset 1072
+ OpMemberDecorate %type_View 34 MatrixStride 16
+ OpMemberDecorate %type_View 34 ColMajor
+ OpMemberDecorate %type_View 35 Offset 1136
+ OpMemberDecorate %type_View 35 MatrixStride 16
+ OpMemberDecorate %type_View 35 ColMajor
+ OpMemberDecorate %type_View 36 Offset 1200
+ OpMemberDecorate %type_View 36 MatrixStride 16
+ OpMemberDecorate %type_View 36 ColMajor
+ OpMemberDecorate %type_View 37 Offset 1264
+ OpMemberDecorate %type_View 37 MatrixStride 16
+ OpMemberDecorate %type_View 37 ColMajor
+ OpMemberDecorate %type_View 38 Offset 1328
+ OpMemberDecorate %type_View 38 MatrixStride 16
+ OpMemberDecorate %type_View 38 ColMajor
+ OpMemberDecorate %type_View 39 Offset 1392
+ OpMemberDecorate %type_View 39 MatrixStride 16
+ OpMemberDecorate %type_View 39 ColMajor
+ OpMemberDecorate %type_View 40 Offset 1456
+ OpMemberDecorate %type_View 40 MatrixStride 16
+ OpMemberDecorate %type_View 40 ColMajor
+ OpMemberDecorate %type_View 41 Offset 1520
+ OpMemberDecorate %type_View 41 MatrixStride 16
+ OpMemberDecorate %type_View 41 ColMajor
+ OpMemberDecorate %type_View 42 Offset 1584
+ OpMemberDecorate %type_View 42 MatrixStride 16
+ OpMemberDecorate %type_View 42 ColMajor
+ OpMemberDecorate %type_View 43 Offset 1648
+ OpMemberDecorate %type_View 43 MatrixStride 16
+ OpMemberDecorate %type_View 43 ColMajor
+ OpMemberDecorate %type_View 44 Offset 1712
+ OpMemberDecorate %type_View 45 Offset 1724
+ OpMemberDecorate %type_View 46 Offset 1728
+ OpMemberDecorate %type_View 47 Offset 1740
+ OpMemberDecorate %type_View 48 Offset 1744
+ OpMemberDecorate %type_View 49 Offset 1756
+ OpMemberDecorate %type_View 50 Offset 1760
+ OpMemberDecorate %type_View 50 MatrixStride 16
+ OpMemberDecorate %type_View 50 ColMajor
+ OpMemberDecorate %type_View 51 Offset 1824
+ OpMemberDecorate %type_View 51 MatrixStride 16
+ OpMemberDecorate %type_View 51 ColMajor
+ OpMemberDecorate %type_View 52 Offset 1888
+ OpMemberDecorate %type_View 52 MatrixStride 16
+ OpMemberDecorate %type_View 52 ColMajor
+ OpMemberDecorate %type_View 53 Offset 1952
+ OpMemberDecorate %type_View 54 Offset 1968
+ OpMemberDecorate %type_View 55 Offset 1984
+ OpMemberDecorate %type_View 56 Offset 1992
+ OpMemberDecorate %type_View 57 Offset 2000
+ OpMemberDecorate %type_View 58 Offset 2016
+ OpMemberDecorate %type_View 59 Offset 2032
+ OpMemberDecorate %type_View 60 Offset 2048
+ OpMemberDecorate %type_View 61 Offset 2064
+ OpMemberDecorate %type_View 62 Offset 2068
+ OpMemberDecorate %type_View 63 Offset 2072
+ OpMemberDecorate %type_View 64 Offset 2076
+ OpMemberDecorate %type_View 65 Offset 2080
+ OpMemberDecorate %type_View 66 Offset 2096
+ OpMemberDecorate %type_View 67 Offset 2112
+ OpMemberDecorate %type_View 68 Offset 2128
+ OpMemberDecorate %type_View 69 Offset 2136
+ OpMemberDecorate %type_View 70 Offset 2140
+ OpMemberDecorate %type_View 71 Offset 2144
+ OpMemberDecorate %type_View 72 Offset 2148
+ OpMemberDecorate %type_View 73 Offset 2152
+ OpMemberDecorate %type_View 74 Offset 2156
+ OpMemberDecorate %type_View 75 Offset 2160
+ OpMemberDecorate %type_View 76 Offset 2172
+ OpMemberDecorate %type_View 77 Offset 2176
+ OpMemberDecorate %type_View 78 Offset 2180
+ OpMemberDecorate %type_View 79 Offset 2184
+ OpMemberDecorate %type_View 80 Offset 2188
+ OpMemberDecorate %type_View 81 Offset 2192
+ OpMemberDecorate %type_View 82 Offset 2196
+ OpMemberDecorate %type_View 83 Offset 2200
+ OpMemberDecorate %type_View 84 Offset 2204
+ OpMemberDecorate %type_View 85 Offset 2208
+ OpMemberDecorate %type_View 86 Offset 2212
+ OpMemberDecorate %type_View 87 Offset 2216
+ OpMemberDecorate %type_View 88 Offset 2220
+ OpMemberDecorate %type_View 89 Offset 2224
+ OpMemberDecorate %type_View 90 Offset 2228
+ OpMemberDecorate %type_View 91 Offset 2232
+ OpMemberDecorate %type_View 92 Offset 2236
+ OpMemberDecorate %type_View 93 Offset 2240
+ OpMemberDecorate %type_View 94 Offset 2256
+ OpMemberDecorate %type_View 95 Offset 2268
+ OpMemberDecorate %type_View 96 Offset 2272
+ OpMemberDecorate %type_View 97 Offset 2304
+ OpMemberDecorate %type_View 98 Offset 2336
+ OpMemberDecorate %type_View 99 Offset 2352
+ OpMemberDecorate %type_View 100 Offset 2368
+ OpMemberDecorate %type_View 101 Offset 2372
+ OpMemberDecorate %type_View 102 Offset 2376
+ OpMemberDecorate %type_View 103 Offset 2380
+ OpMemberDecorate %type_View 104 Offset 2384
+ OpMemberDecorate %type_View 105 Offset 2388
+ OpMemberDecorate %type_View 106 Offset 2392
+ OpMemberDecorate %type_View 107 Offset 2396
+ OpMemberDecorate %type_View 108 Offset 2400
+ OpMemberDecorate %type_View 109 Offset 2404
+ OpMemberDecorate %type_View 110 Offset 2408
+ OpMemberDecorate %type_View 111 Offset 2412
+ OpMemberDecorate %type_View 112 Offset 2416
+ OpMemberDecorate %type_View 113 Offset 2428
+ OpMemberDecorate %type_View 114 Offset 2432
+ OpMemberDecorate %type_View 115 Offset 2444
+ OpMemberDecorate %type_View 116 Offset 2448
+ OpMemberDecorate %type_View 117 Offset 2452
+ OpMemberDecorate %type_View 118 Offset 2456
+ OpMemberDecorate %type_View 119 Offset 2460
+ OpMemberDecorate %type_View 120 Offset 2464
+ OpMemberDecorate %type_View 121 Offset 2468
+ OpMemberDecorate %type_View 122 Offset 2472
+ OpMemberDecorate %type_View 123 Offset 2476
+ OpMemberDecorate %type_View 124 Offset 2480
+ OpMemberDecorate %type_View 125 Offset 2484
+ OpMemberDecorate %type_View 126 Offset 2488
+ OpMemberDecorate %type_View 127 Offset 2492
+ OpMemberDecorate %type_View 128 Offset 2496
+ OpMemberDecorate %type_View 129 Offset 2512
+ OpMemberDecorate %type_View 130 Offset 2516
+ OpMemberDecorate %type_View 131 Offset 2520
+ OpMemberDecorate %type_View 132 Offset 2524
+ OpMemberDecorate %type_View 133 Offset 2528
+ OpMemberDecorate %type_View 134 Offset 2544
+ OpMemberDecorate %type_View 135 Offset 2556
+ OpMemberDecorate %type_View 136 Offset 2560
+ OpMemberDecorate %type_View 137 Offset 2576
+ OpMemberDecorate %type_View 138 Offset 2580
+ OpMemberDecorate %type_View 139 Offset 2584
+ OpMemberDecorate %type_View 140 Offset 2588
+ OpMemberDecorate %type_View 141 Offset 2592
+ OpMemberDecorate %type_View 142 Offset 2608
+ OpMemberDecorate %type_View 143 Offset 2720
+ OpMemberDecorate %type_View 144 Offset 2724
+ OpMemberDecorate %type_View 145 Offset 2728
+ OpMemberDecorate %type_View 146 Offset 2732
+ OpMemberDecorate %type_View 147 Offset 2736
+ OpMemberDecorate %type_View 148 Offset 2740
+ OpMemberDecorate %type_View 149 Offset 2744
+ OpMemberDecorate %type_View 150 Offset 2748
+ OpMemberDecorate %type_View 151 Offset 2752
+ OpMemberDecorate %type_View 152 Offset 2764
+ OpMemberDecorate %type_View 153 Offset 2768
+ OpMemberDecorate %type_View 154 Offset 2832
+ OpMemberDecorate %type_View 155 Offset 2896
+ OpMemberDecorate %type_View 156 Offset 2900
+ OpMemberDecorate %type_View 157 Offset 2904
+ OpMemberDecorate %type_View 158 Offset 2908
+ OpMemberDecorate %type_View 159 Offset 2912
+ OpMemberDecorate %type_View 160 Offset 2920
+ OpMemberDecorate %type_View 161 Offset 2924
+ OpMemberDecorate %type_View 162 Offset 2928
+ OpMemberDecorate %type_View 163 Offset 2940
+ OpMemberDecorate %type_View 164 Offset 2944
+ OpMemberDecorate %type_View 165 Offset 2956
+ OpMemberDecorate %type_View 166 Offset 2960
+ OpMemberDecorate %type_View 167 Offset 2968
+ OpMemberDecorate %type_View 168 Offset 2972
+ OpMemberDecorate %type_View 169 Offset 2976
+ OpMemberDecorate %type_View 170 Offset 2988
+ OpMemberDecorate %type_View 171 Offset 2992
+ OpMemberDecorate %type_View 172 Offset 3004
+ OpMemberDecorate %type_View 173 Offset 3008
+ OpMemberDecorate %type_View 174 Offset 3020
+ OpMemberDecorate %type_View 175 Offset 3024
+ OpMemberDecorate %type_View 176 Offset 3036
+ OpMemberDecorate %type_View 177 Offset 3040
+ OpMemberDecorate %type_View 178 Offset 3044
+ OpDecorate %type_View Block
+ OpMemberDecorate %type_Primitive 0 Offset 0
+ OpMemberDecorate %type_Primitive 0 MatrixStride 16
+ OpMemberDecorate %type_Primitive 0 ColMajor
+ OpMemberDecorate %type_Primitive 1 Offset 64
+ OpMemberDecorate %type_Primitive 2 Offset 80
+ OpMemberDecorate %type_Primitive 3 Offset 96
+ OpMemberDecorate %type_Primitive 3 MatrixStride 16
+ OpMemberDecorate %type_Primitive 3 ColMajor
+ OpMemberDecorate %type_Primitive 4 Offset 160
+ OpMemberDecorate %type_Primitive 4 MatrixStride 16
+ OpMemberDecorate %type_Primitive 4 ColMajor
+ OpMemberDecorate %type_Primitive 5 Offset 224
+ OpMemberDecorate %type_Primitive 5 MatrixStride 16
+ OpMemberDecorate %type_Primitive 5 ColMajor
+ OpMemberDecorate %type_Primitive 6 Offset 288
+ OpMemberDecorate %type_Primitive 7 Offset 300
+ OpMemberDecorate %type_Primitive 8 Offset 304
+ OpMemberDecorate %type_Primitive 9 Offset 316
+ OpMemberDecorate %type_Primitive 10 Offset 320
+ OpMemberDecorate %type_Primitive 11 Offset 324
+ OpMemberDecorate %type_Primitive 12 Offset 328
+ OpMemberDecorate %type_Primitive 13 Offset 332
+ OpMemberDecorate %type_Primitive 14 Offset 336
+ OpMemberDecorate %type_Primitive 15 Offset 352
+ OpMemberDecorate %type_Primitive 16 Offset 368
+ OpMemberDecorate %type_Primitive 17 Offset 380
+ OpMemberDecorate %type_Primitive 18 Offset 384
+ OpMemberDecorate %type_Primitive 19 Offset 396
+ OpMemberDecorate %type_Primitive 20 Offset 400
+ OpMemberDecorate %type_Primitive 21 Offset 412
+ OpMemberDecorate %type_Primitive 22 Offset 416
+ OpMemberDecorate %type_Primitive 23 Offset 420
+ OpMemberDecorate %type_Primitive 24 Offset 424
+ OpMemberDecorate %type_Primitive 25 Offset 428
+ OpMemberDecorate %type_Primitive 26 Offset 432
+ OpDecorate %type_Primitive Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+ %v2int = OpTypeVector %int 2
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %uint_3 = OpConstant %uint 3
+%_arr_float_uint_3 = OpTypeArray %float %uint_3
+ %int_1 = OpConstant %int 1
+ %int_0 = OpConstant %int 0
+ %int_2 = OpConstant %int 2
+ %float_2 = OpConstant %float 2
+ %63 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
+ %float_0_5 = OpConstant %float 0.5
+ %int_3 = OpConstant %int 3
+%float_0_333000004 = OpConstant %float 0.333000004
+ %float_1 = OpConstant %float 1
+ %68 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %float_15 = OpConstant %float 15
+ %70 = OpConstantComposite %v4float %float_15 %float_15 %float_15 %float_15
+%FVertexFactoryInterpolantsVSToPS = OpTypeStruct %v4float %v4float
+%FVertexFactoryInterpolantsVSToDS = OpTypeStruct %FVertexFactoryInterpolantsVSToPS
+%FHitProxyVSToDS = OpTypeStruct %FVertexFactoryInterpolantsVSToDS %v4float %uint
+%_arr_v4float_uint_3 = OpTypeArray %v4float %uint_3
+%FHullShaderConstantDominantVertexData = OpTypeStruct %v2float %v4float %v3float
+%FHullShaderConstantDominantEdgeData = OpTypeStruct %v2float %v2float %v4float %v4float %v3float %v3float
+%FPNTessellationHSToDS = OpTypeStruct %FHitProxyVSToDS %_arr_v4float_uint_3 %v3float %float %float %FHullShaderConstantDominantVertexData %FHullShaderConstantDominantEdgeData
+ %uint_9 = OpConstant %uint 9
+ %v3int = OpTypeVector %int 3
+ %74 = OpConstantComposite %v3int %int_0 %int_0 %int_0
+ %75 = OpConstantComposite %v3int %int_3 %int_3 %int_3
+ %float_0 = OpConstant %float 0
+ %77 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+ %78 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
+ %int_78 = OpConstant %int 78
+ %int_15 = OpConstant %int 15
+ %int_7 = OpConstant %int 7
+ %int_28 = OpConstant %int 28
+ %83 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %84 = OpConstantComposite %v3int %int_2 %int_2 %int_2
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_arr_v4float_uint_7 = OpTypeArray %v4float %uint_7
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+ %type_View = OpTypeStruct %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %v3float %float %v3float %float %v4float %v4float %v3float %float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %v4float %v4float %v2float %v2float %v4float %v4float %v4float %v4float %int %float %float %float %v4float %v4float %v4float %v2float %float %float %float %float %float %float %v3float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %float %float %float %float %float %v4float %v3float %float %_arr_v4float_uint_2 %_arr_v4float_uint_2 %v4float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %v3float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %float %float %v4float %uint %uint %uint %uint %v4float %v3float %float %v4float %float %float %float %float %v4float %_arr_v4float_uint_7 %float %float %float %float %uint %float %float %float %v3float %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %float %float %float %float %v2int %float %float %v3float %float %v3float %float %v2float %float %float %v3float %float %v3float %float %v3float %float %v3float %float %float %float
+%_ptr_Uniform_type_View = OpTypePointer Uniform %type_View
+%type_Primitive = OpTypeStruct %mat4v4float %v4float %v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %float %float %float %float %v4float %v4float %v3float %uint %v3float %uint %v3float %int %uint %uint %uint %uint %_arr_v4float_uint_4
+%_ptr_Uniform_type_Primitive = OpTypePointer Uniform %type_Primitive
+ %uint_12 = OpConstant %uint 12
+%_arr_v4float_uint_12 = OpTypeArray %v4float %uint_12
+%_ptr_Input__arr_v4float_uint_12 = OpTypePointer Input %_arr_v4float_uint_12
+%_arr_uint_uint_12 = OpTypeArray %uint %uint_12
+%_ptr_Input__arr_uint_uint_12 = OpTypePointer Input %_arr_uint_uint_12
+%_ptr_Input_uint = OpTypePointer Input %uint
+%_ptr_Output__arr_v4float_uint_3 = OpTypePointer Output %_arr_v4float_uint_3
+%_arr_uint_uint_3 = OpTypeArray %uint %uint_3
+%_ptr_Output__arr_uint_uint_3 = OpTypePointer Output %_arr_uint_uint_3
+%_arr__arr_v4float_uint_3_uint_3 = OpTypeArray %_arr_v4float_uint_3 %uint_3
+%_ptr_Output__arr__arr_v4float_uint_3_uint_3 = OpTypePointer Output %_arr__arr_v4float_uint_3_uint_3
+%_arr_v3float_uint_3 = OpTypeArray %v3float %uint_3
+%_ptr_Output__arr_v3float_uint_3 = OpTypePointer Output %_arr_v3float_uint_3
+%_ptr_Output__arr_float_uint_3 = OpTypePointer Output %_arr_float_uint_3
+%_arr_v2float_uint_3 = OpTypeArray %v2float %uint_3
+%_ptr_Output__arr_v2float_uint_3 = OpTypePointer Output %_arr_v2float_uint_3
+%_arr_float_uint_4 = OpTypeArray %float %uint_4
+%_ptr_Output__arr_float_uint_4 = OpTypePointer Output %_arr_float_uint_4
+%_arr_float_uint_2 = OpTypeArray %float %uint_2
+%_ptr_Output__arr_float_uint_2 = OpTypePointer Output %_arr_float_uint_2
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %109 = OpTypeFunction %void
+%_arr_FHitProxyVSToDS_uint_12 = OpTypeArray %FHitProxyVSToDS %uint_12
+%_ptr_Function__arr_FHitProxyVSToDS_uint_12 = OpTypePointer Function %_arr_FHitProxyVSToDS_uint_12
+%_arr_FPNTessellationHSToDS_uint_3 = OpTypeArray %FPNTessellationHSToDS %uint_3
+%_ptr_Function__arr_FPNTessellationHSToDS_uint_3 = OpTypePointer Function %_arr_FPNTessellationHSToDS_uint_3
+%_ptr_Workgroup__arr_FPNTessellationHSToDS_uint_3 = OpTypePointer Workgroup %_arr_FPNTessellationHSToDS_uint_3
+%_ptr_Output_uint = OpTypePointer Output %uint
+%_ptr_Output_v3float = OpTypePointer Output %v3float
+%_ptr_Output_float = OpTypePointer Output %float
+%_ptr_Output_v2float = OpTypePointer Output %v2float
+%_ptr_Function_FPNTessellationHSToDS = OpTypePointer Function %FPNTessellationHSToDS
+%_ptr_Workgroup_FPNTessellationHSToDS = OpTypePointer Workgroup %FPNTessellationHSToDS
+ %bool = OpTypeBool
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%_ptr_Function_float = OpTypePointer Function %float
+%_ptr_Workgroup_v4float = OpTypePointer Workgroup %v4float
+%_ptr_Workgroup_float = OpTypePointer Workgroup %float
+%mat3v3float = OpTypeMatrix %v3float 3
+%_ptr_Function_FVertexFactoryInterpolantsVSToDS = OpTypePointer Function %FVertexFactoryInterpolantsVSToDS
+%_ptr_Function_FHitProxyVSToDS = OpTypePointer Function %FHitProxyVSToDS
+ %v3bool = OpTypeVector %bool 3
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+ %View = OpVariable %_ptr_Uniform_type_View Uniform
+ %Primitive = OpVariable %_ptr_Uniform_type_Primitive Uniform
+%in_var_TEXCOORD10_centroid = OpVariable %_ptr_Input__arr_v4float_uint_12 Input
+%in_var_TEXCOORD11_centroid = OpVariable %_ptr_Input__arr_v4float_uint_12 Input
+%in_var_VS_To_DS_Position = OpVariable %_ptr_Input__arr_v4float_uint_12 Input
+%in_var_VS_To_DS_VertexID = OpVariable %_ptr_Input__arr_uint_uint_12 Input
+%gl_InvocationID = OpVariable %_ptr_Input_uint Input
+%out_var_TEXCOORD10_centroid = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_TEXCOORD11_centroid = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_VS_To_DS_Position = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_VS_To_DS_VertexID = OpVariable %_ptr_Output__arr_uint_uint_3 Output
+%out_var_PN_POSITION = OpVariable %_ptr_Output__arr__arr_v4float_uint_3_uint_3 Output
+%out_var_PN_DisplacementScales = OpVariable %_ptr_Output__arr_v3float_uint_3 Output
+%out_var_PN_TessellationMultiplier = OpVariable %_ptr_Output__arr_float_uint_3 Output
+%out_var_PN_WorldDisplacementMultiplier = OpVariable %_ptr_Output__arr_float_uint_3 Output
+%out_var_PN_DominantVertex = OpVariable %_ptr_Output__arr_v2float_uint_3 Output
+%out_var_PN_DominantVertex1 = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_PN_DominantVertex2 = OpVariable %_ptr_Output__arr_v3float_uint_3 Output
+%out_var_PN_DominantEdge = OpVariable %_ptr_Output__arr_v2float_uint_3 Output
+%out_var_PN_DominantEdge1 = OpVariable %_ptr_Output__arr_v2float_uint_3 Output
+%out_var_PN_DominantEdge2 = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_PN_DominantEdge3 = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_PN_DominantEdge4 = OpVariable %_ptr_Output__arr_v3float_uint_3 Output
+%out_var_PN_DominantEdge5 = OpVariable %_ptr_Output__arr_v3float_uint_3 Output
+%gl_TessLevelOuter = OpVariable %_ptr_Output__arr_float_uint_4 Output
+%gl_TessLevelInner = OpVariable %_ptr_Output__arr_float_uint_2 Output
+%out_var_PN_POSITION9 = OpVariable %_ptr_Output_v4float Output
+ %130 = OpConstantNull %v2float
+%float_0_333333343 = OpConstant %float 0.333333343
+ %132 = OpConstantComposite %v4float %float_0_333333343 %float_0_333333343 %float_0_333333343 %float_0_333333343
+ %133 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
+%float_0_166666672 = OpConstant %float 0.166666672
+ %135 = OpConstantComposite %v4float %float_0_166666672 %float_0_166666672 %float_0_166666672 %float_0_166666672
+ %136 = OpUndef %v4float
+
+; XXX: Original asm used Function here, which is wrong.
+; This patches the SPIR-V to be correct.
+%temp_var_hullMainRetVal = OpVariable %_ptr_Workgroup__arr_FPNTessellationHSToDS_uint_3 Workgroup
+
+ %MainHull = OpFunction %void None %109
+ %137 = OpLabel
+%param_var_I = OpVariable %_ptr_Function__arr_FHitProxyVSToDS_uint_12 Function
+ %138 = OpLoad %_arr_v4float_uint_12 %in_var_TEXCOORD10_centroid
+ %139 = OpLoad %_arr_v4float_uint_12 %in_var_TEXCOORD11_centroid
+ %140 = OpCompositeExtract %v4float %138 0
+ %141 = OpCompositeExtract %v4float %139 0
+ %142 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %140 %141
+ %143 = OpCompositeExtract %v4float %138 1
+ %144 = OpCompositeExtract %v4float %139 1
+ %145 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %143 %144
+ %146 = OpCompositeExtract %v4float %138 2
+ %147 = OpCompositeExtract %v4float %139 2
+ %148 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %146 %147
+ %149 = OpCompositeExtract %v4float %138 3
+ %150 = OpCompositeExtract %v4float %139 3
+ %151 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %149 %150
+ %152 = OpCompositeExtract %v4float %138 4
+ %153 = OpCompositeExtract %v4float %139 4
+ %154 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %152 %153
+ %155 = OpCompositeExtract %v4float %138 5
+ %156 = OpCompositeExtract %v4float %139 5
+ %157 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %155 %156
+ %158 = OpCompositeExtract %v4float %138 6
+ %159 = OpCompositeExtract %v4float %139 6
+ %160 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %158 %159
+ %161 = OpCompositeExtract %v4float %138 7
+ %162 = OpCompositeExtract %v4float %139 7
+ %163 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %161 %162
+ %164 = OpCompositeExtract %v4float %138 8
+ %165 = OpCompositeExtract %v4float %139 8
+ %166 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %164 %165
+ %167 = OpCompositeExtract %v4float %138 9
+ %168 = OpCompositeExtract %v4float %139 9
+ %169 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %167 %168
+ %170 = OpCompositeExtract %v4float %138 10
+ %171 = OpCompositeExtract %v4float %139 10
+ %172 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %170 %171
+ %173 = OpCompositeExtract %v4float %138 11
+ %174 = OpCompositeExtract %v4float %139 11
+ %175 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %173 %174
+ %176 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %142
+ %177 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %145
+ %178 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %148
+ %179 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %151
+ %180 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %154
+ %181 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %157
+ %182 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %160
+ %183 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %163
+ %184 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %166
+ %185 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %169
+ %186 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %172
+ %187 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %175
+ %188 = OpLoad %_arr_v4float_uint_12 %in_var_VS_To_DS_Position
+ %189 = OpLoad %_arr_uint_uint_12 %in_var_VS_To_DS_VertexID
+ %190 = OpCompositeExtract %v4float %188 0
+ %191 = OpCompositeExtract %uint %189 0
+ %192 = OpCompositeConstruct %FHitProxyVSToDS %176 %190 %191
+ %193 = OpCompositeExtract %v4float %188 1
+ %194 = OpCompositeExtract %uint %189 1
+ %195 = OpCompositeConstruct %FHitProxyVSToDS %177 %193 %194
+ %196 = OpCompositeExtract %v4float %188 2
+ %197 = OpCompositeExtract %uint %189 2
+ %198 = OpCompositeConstruct %FHitProxyVSToDS %178 %196 %197
+ %199 = OpCompositeExtract %v4float %188 3
+ %200 = OpCompositeExtract %uint %189 3
+ %201 = OpCompositeConstruct %FHitProxyVSToDS %179 %199 %200
+ %202 = OpCompositeExtract %v4float %188 4
+ %203 = OpCompositeExtract %uint %189 4
+ %204 = OpCompositeConstruct %FHitProxyVSToDS %180 %202 %203
+ %205 = OpCompositeExtract %v4float %188 5
+ %206 = OpCompositeExtract %uint %189 5
+ %207 = OpCompositeConstruct %FHitProxyVSToDS %181 %205 %206
+ %208 = OpCompositeExtract %v4float %188 6
+ %209 = OpCompositeExtract %uint %189 6
+ %210 = OpCompositeConstruct %FHitProxyVSToDS %182 %208 %209
+ %211 = OpCompositeExtract %v4float %188 7
+ %212 = OpCompositeExtract %uint %189 7
+ %213 = OpCompositeConstruct %FHitProxyVSToDS %183 %211 %212
+ %214 = OpCompositeExtract %v4float %188 8
+ %215 = OpCompositeExtract %uint %189 8
+ %216 = OpCompositeConstruct %FHitProxyVSToDS %184 %214 %215
+ %217 = OpCompositeExtract %v4float %188 9
+ %218 = OpCompositeExtract %uint %189 9
+ %219 = OpCompositeConstruct %FHitProxyVSToDS %185 %217 %218
+ %220 = OpCompositeExtract %v4float %188 10
+ %221 = OpCompositeExtract %uint %189 10
+ %222 = OpCompositeConstruct %FHitProxyVSToDS %186 %220 %221
+ %223 = OpCompositeExtract %v4float %188 11
+ %224 = OpCompositeExtract %uint %189 11
+ %225 = OpCompositeConstruct %FHitProxyVSToDS %187 %223 %224
+ %226 = OpCompositeConstruct %_arr_FHitProxyVSToDS_uint_12 %192 %195 %198 %201 %204 %207 %210 %213 %216 %219 %222 %225
+ OpStore %param_var_I %226
+ %227 = OpLoad %uint %gl_InvocationID
+ %228 = OpAccessChain %_ptr_Function_FVertexFactoryInterpolantsVSToDS %param_var_I %227 %int_0
+ %229 = OpLoad %FVertexFactoryInterpolantsVSToDS %228
+ %230 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %229 0
+ %231 = OpCompositeExtract %v4float %230 0
+ %232 = OpCompositeExtract %v4float %230 1
+ %233 = OpVectorShuffle %v3float %231 %231 0 1 2
+ %234 = OpVectorShuffle %v3float %232 %232 0 1 2
+ %235 = OpExtInst %v3float %1 Cross %234 %233
+ %236 = OpCompositeExtract %float %232 3
+ %237 = OpCompositeConstruct %v3float %236 %236 %236
+ %238 = OpFMul %v3float %235 %237
+ %239 = OpCompositeConstruct %mat3v3float %233 %238 %234
+ %240 = OpCompositeExtract %float %232 0
+ %241 = OpCompositeExtract %float %232 1
+ %242 = OpCompositeExtract %float %232 2
+ %243 = OpCompositeConstruct %v4float %240 %241 %242 %float_0
+ %244 = OpAccessChain %_ptr_Uniform_v4float %Primitive %int_15
+ %245 = OpLoad %v4float %244
+ %246 = OpVectorShuffle %v3float %245 %245 0 1 2
+ %247 = OpVectorTimesMatrix %v3float %246 %239
+ %248 = OpULessThan %bool %227 %uint_2
+ %249 = OpIAdd %uint %227 %uint_1
+ %250 = OpSelect %uint %248 %249 %uint_0
+ %251 = OpIMul %uint %uint_2 %227
+ %252 = OpIAdd %uint %uint_3 %251
+ %253 = OpIAdd %uint %251 %uint_4
+ %254 = OpAccessChain %_ptr_Function_FHitProxyVSToDS %param_var_I %227
+ %255 = OpLoad %FHitProxyVSToDS %254
+ %256 = OpAccessChain %_ptr_Function_v4float %param_var_I %227 %int_1
+ %257 = OpLoad %v4float %256
+ %258 = OpULessThan %bool %250 %uint_2
+ %259 = OpIAdd %uint %250 %uint_1
+ %260 = OpSelect %uint %258 %259 %uint_0
+ %261 = OpIMul %uint %uint_2 %250
+ %262 = OpIAdd %uint %uint_3 %261
+ %263 = OpIAdd %uint %261 %uint_4
+ %264 = OpIAdd %uint %uint_9 %227
+ %265 = OpAccessChain %_ptr_Function_FHitProxyVSToDS %param_var_I %264
+ %266 = OpLoad %FHitProxyVSToDS %265
+ %267 = OpCompositeExtract %FVertexFactoryInterpolantsVSToDS %266 0
+ %268 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %267 0
+ %269 = OpCompositeExtract %v4float %268 0
+ %270 = OpCompositeExtract %v4float %268 1
+ %271 = OpVectorShuffle %v3float %269 %269 0 1 2
+ %272 = OpCompositeExtract %float %270 0
+ %273 = OpCompositeExtract %float %270 1
+ %274 = OpCompositeExtract %float %270 2
+ %275 = OpCompositeConstruct %v4float %272 %273 %274 %float_0
+ %276 = OpAccessChain %_ptr_Function_FHitProxyVSToDS %param_var_I %250
+ %277 = OpLoad %FHitProxyVSToDS %276
+ %278 = OpCompositeExtract %uint %277 2
+ %279 = OpAccessChain %_ptr_Function_FHitProxyVSToDS %param_var_I %260
+ %280 = OpLoad %FHitProxyVSToDS %279
+ %281 = OpCompositeExtract %uint %280 2
+ %282 = OpAccessChain %_ptr_Function_FHitProxyVSToDS %param_var_I %262
+ %283 = OpLoad %FHitProxyVSToDS %282
+ %284 = OpCompositeExtract %uint %283 2
+ %285 = OpAccessChain %_ptr_Function_FHitProxyVSToDS %param_var_I %263
+ %286 = OpLoad %FHitProxyVSToDS %285
+ %287 = OpCompositeExtract %uint %286 2
+ %288 = OpCompositeExtract %FVertexFactoryInterpolantsVSToDS %277 0
+ %289 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %288 0
+ %290 = OpCompositeExtract %v4float %289 0
+ %291 = OpCompositeExtract %v4float %289 1
+ %292 = OpCompositeExtract %FVertexFactoryInterpolantsVSToDS %280 0
+ %293 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %292 0
+ %294 = OpCompositeExtract %v4float %293 0
+ %295 = OpCompositeExtract %v4float %293 1
+ %296 = OpULessThan %bool %284 %278
+ %297 = OpIEqual %bool %284 %278
+ %298 = OpULessThan %bool %287 %281
+ %299 = OpLogicalAnd %bool %297 %298
+ %300 = OpLogicalOr %bool %296 %299
+ OpSelectionMerge %301 None
+ OpBranchConditional %300 %302 %301
+ %302 = OpLabel
+ %303 = OpCompositeExtract %FVertexFactoryInterpolantsVSToDS %283 0
+ %304 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %303 0
+ %305 = OpCompositeExtract %v4float %304 0
+ %306 = OpCompositeExtract %v4float %304 1
+ %307 = OpCompositeExtract %FVertexFactoryInterpolantsVSToDS %286 0
+ %308 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %307 0
+ %309 = OpCompositeExtract %v4float %308 0
+ %310 = OpCompositeExtract %v4float %308 1
+ OpBranch %301
+ %301 = OpLabel
+ %311 = OpPhi %v4float %294 %137 %309 %302
+ %312 = OpPhi %v4float %295 %137 %310 %302
+ %313 = OpPhi %v4float %290 %137 %305 %302
+ %314 = OpPhi %v4float %291 %137 %306 %302
+ %315 = OpVectorShuffle %v3float %313 %313 0 1 2
+ %316 = OpVectorShuffle %v3float %311 %311 0 1 2
+ %317 = OpCompositeExtract %float %314 0
+ %318 = OpCompositeExtract %float %314 1
+ %319 = OpCompositeExtract %float %314 2
+ %320 = OpCompositeConstruct %v4float %317 %318 %319 %float_0
+ %321 = OpCompositeExtract %float %312 0
+ %322 = OpCompositeExtract %float %312 1
+ %323 = OpCompositeExtract %float %312 2
+ %324 = OpCompositeConstruct %v4float %321 %322 %323 %float_0
+ %325 = OpAccessChain %_ptr_Function_FVertexFactoryInterpolantsVSToDS %param_var_I %250 %int_0
+ %326 = OpLoad %FVertexFactoryInterpolantsVSToDS %325
+ %327 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %326 0
+ %328 = OpCompositeExtract %v4float %327 1
+ %329 = OpCompositeExtract %float %328 0
+ %330 = OpCompositeExtract %float %328 1
+ %331 = OpCompositeExtract %float %328 2
+ %332 = OpCompositeConstruct %v4float %329 %330 %331 %float_0
+ %333 = OpAccessChain %_ptr_Function_FVertexFactoryInterpolantsVSToDS %param_var_I %252 %int_0
+ %334 = OpLoad %FVertexFactoryInterpolantsVSToDS %333
+ %335 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %334 0
+ %336 = OpCompositeExtract %v4float %335 1
+ %337 = OpCompositeExtract %float %336 0
+ %338 = OpCompositeExtract %float %336 1
+ %339 = OpCompositeExtract %float %336 2
+ %340 = OpCompositeConstruct %v4float %337 %338 %339 %float_0
+ %341 = OpAccessChain %_ptr_Function_FVertexFactoryInterpolantsVSToDS %param_var_I %253 %int_0
+ %342 = OpLoad %FVertexFactoryInterpolantsVSToDS %341
+ %343 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %342 0
+ %344 = OpCompositeExtract %v4float %343 1
+ %345 = OpCompositeExtract %float %344 0
+ %346 = OpCompositeExtract %float %344 1
+ %347 = OpCompositeExtract %float %344 2
+ %348 = OpCompositeConstruct %v4float %345 %346 %347 %float_0
+ %349 = OpLoad %v4float %256
+ %350 = OpAccessChain %_ptr_Function_v4float %param_var_I %250 %int_1
+ %351 = OpLoad %v4float %350
+ %352 = OpFMul %v4float %63 %349
+ %353 = OpFAdd %v4float %352 %351
+ %354 = OpFSub %v4float %351 %349
+ %355 = OpDot %float %354 %243
+ %356 = OpCompositeConstruct %v4float %355 %355 %355 %355
+ %357 = OpFMul %v4float %356 %243
+ %358 = OpFSub %v4float %353 %357
+ %359 = OpFMul %v4float %358 %132
+ %360 = OpAccessChain %_ptr_Function_v4float %param_var_I %252 %int_1
+ %361 = OpLoad %v4float %360
+ %362 = OpAccessChain %_ptr_Function_v4float %param_var_I %253 %int_1
+ %363 = OpLoad %v4float %362
+ %364 = OpFMul %v4float %63 %361
+ %365 = OpFAdd %v4float %364 %363
+ %366 = OpFSub %v4float %363 %361
+ %367 = OpDot %float %366 %340
+ %368 = OpCompositeConstruct %v4float %367 %367 %367 %367
+ %369 = OpFMul %v4float %368 %340
+ %370 = OpFSub %v4float %365 %369
+ %371 = OpFMul %v4float %370 %132
+ %372 = OpFAdd %v4float %359 %371
+ %373 = OpFMul %v4float %372 %133
+ %374 = OpLoad %v4float %350
+ %375 = OpLoad %v4float %256
+ %376 = OpFMul %v4float %63 %374
+ %377 = OpFAdd %v4float %376 %375
+ %378 = OpFSub %v4float %375 %374
+ %379 = OpDot %float %378 %332
+ %380 = OpCompositeConstruct %v4float %379 %379 %379 %379
+ %381 = OpFMul %v4float %380 %332
+ %382 = OpFSub %v4float %377 %381
+ %383 = OpFMul %v4float %382 %132
+ %384 = OpLoad %v4float %362
+ %385 = OpLoad %v4float %360
+ %386 = OpFMul %v4float %63 %384
+ %387 = OpFAdd %v4float %386 %385
+ %388 = OpFSub %v4float %385 %384
+ %389 = OpDot %float %388 %348
+ %390 = OpCompositeConstruct %v4float %389 %389 %389 %389
+ %391 = OpFMul %v4float %390 %348
+ %392 = OpFSub %v4float %387 %391
+ %393 = OpFMul %v4float %392 %132
+ %394 = OpFAdd %v4float %383 %393
+ %395 = OpFMul %v4float %394 %133
+ %396 = OpCompositeConstruct %FHullShaderConstantDominantEdgeData %130 %130 %320 %324 %315 %316
+ %397 = OpCompositeConstruct %FHullShaderConstantDominantVertexData %130 %275 %271
+ %398 = OpCompositeConstruct %_arr_v4float_uint_3 %257 %373 %395
+ %399 = OpCompositeConstruct %FPNTessellationHSToDS %255 %398 %247 %float_1 %float_1 %397 %396
+ %400 = OpCompositeExtract %FVertexFactoryInterpolantsVSToDS %255 0
+ %401 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %400 0
+ %402 = OpCompositeExtract %v4float %401 0
+ %403 = OpAccessChain %_ptr_Output_v4float %out_var_TEXCOORD10_centroid %227
+ OpStore %403 %402
+ %404 = OpCompositeExtract %v4float %401 1
+ %405 = OpAccessChain %_ptr_Output_v4float %out_var_TEXCOORD11_centroid %227
+ OpStore %405 %404
+ %406 = OpCompositeExtract %v4float %255 1
+ %407 = OpAccessChain %_ptr_Output_v4float %out_var_VS_To_DS_Position %227
+ OpStore %407 %406
+ %408 = OpCompositeExtract %uint %255 2
+ %409 = OpAccessChain %_ptr_Output_uint %out_var_VS_To_DS_VertexID %227
+ OpStore %409 %408
+ %410 = OpAccessChain %_ptr_Output__arr_v4float_uint_3 %out_var_PN_POSITION %227
+ OpStore %410 %398
+ %411 = OpAccessChain %_ptr_Output_v3float %out_var_PN_DisplacementScales %227
+ OpStore %411 %247
+ %412 = OpAccessChain %_ptr_Output_float %out_var_PN_TessellationMultiplier %227
+ OpStore %412 %float_1
+ %413 = OpAccessChain %_ptr_Output_float %out_var_PN_WorldDisplacementMultiplier %227
+ OpStore %413 %float_1
+ %414 = OpAccessChain %_ptr_Output_v2float %out_var_PN_DominantVertex %227
+ OpStore %414 %130
+ %415 = OpAccessChain %_ptr_Output_v4float %out_var_PN_DominantVertex1 %227
+ OpStore %415 %275
+ %416 = OpAccessChain %_ptr_Output_v3float %out_var_PN_DominantVertex2 %227
+ OpStore %416 %271
+ %417 = OpAccessChain %_ptr_Output_v2float %out_var_PN_DominantEdge %227
+ OpStore %417 %130
+ %418 = OpAccessChain %_ptr_Output_v2float %out_var_PN_DominantEdge1 %227
+ OpStore %418 %130
+ %419 = OpAccessChain %_ptr_Output_v4float %out_var_PN_DominantEdge2 %227
+ OpStore %419 %320
+ %420 = OpAccessChain %_ptr_Output_v4float %out_var_PN_DominantEdge3 %227
+ OpStore %420 %324
+ %421 = OpAccessChain %_ptr_Output_v3float %out_var_PN_DominantEdge4 %227
+ OpStore %421 %315
+ %422 = OpAccessChain %_ptr_Output_v3float %out_var_PN_DominantEdge5 %227
+ OpStore %422 %316
+ %423 = OpAccessChain %_ptr_Workgroup_FPNTessellationHSToDS %temp_var_hullMainRetVal %227
+ OpStore %423 %399
+ OpControlBarrier %uint_2 %uint_4 %uint_0
+ %424 = OpIEqual %bool %227 %uint_0
+ OpSelectionMerge %if_merge None
+ OpBranchConditional %424 %425 %if_merge
+ %425 = OpLabel
+ %426 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_0
+ %427 = OpLoad %mat4v4float %426
+ %428 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_7
+ %429 = OpLoad %mat4v4float %428
+ %430 = OpAccessChain %_ptr_Uniform_v3float %View %int_28
+ %431 = OpLoad %v3float %430
+ %432 = OpAccessChain %_ptr_Uniform_float %View %int_78
+ %433 = OpLoad %float %432
+ %434 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_0 %int_1 %int_0
+ %435 = OpLoad %v4float %434
+ %436 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_0 %int_1 %int_1
+ %437 = OpLoad %v4float %436
+ %438 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_0 %int_1 %int_2
+ %439 = OpLoad %v4float %438
+ %440 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_1 %int_1 %int_0
+ %441 = OpLoad %v4float %440
+ %442 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_1 %int_1 %int_1
+ %443 = OpLoad %v4float %442
+ %444 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_1 %int_1 %int_2
+ %445 = OpLoad %v4float %444
+ %446 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_2 %int_1 %int_0
+ %447 = OpLoad %v4float %446
+ %448 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_2 %int_1 %int_1
+ %449 = OpLoad %v4float %448
+ %450 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_2 %int_1 %int_2
+ %451 = OpLoad %v4float %450
+ %452 = OpFAdd %v4float %437 %439
+ %453 = OpFAdd %v4float %452 %443
+ %454 = OpFAdd %v4float %453 %445
+ %455 = OpFAdd %v4float %454 %449
+ %456 = OpFAdd %v4float %455 %451
+ %457 = OpFMul %v4float %456 %135
+ %458 = OpFAdd %v4float %447 %441
+ %459 = OpFAdd %v4float %458 %435
+ %460 = OpFMul %v4float %459 %132
+ %461 = OpFSub %v4float %457 %460
+ %462 = OpFMul %v4float %461 %133
+ %463 = OpFAdd %v4float %457 %462
+ %464 = OpAccessChain %_ptr_Workgroup_float %temp_var_hullMainRetVal %uint_1 %int_3
+ %465 = OpLoad %float %464
+ %466 = OpAccessChain %_ptr_Workgroup_float %temp_var_hullMainRetVal %uint_2 %int_3
+ %467 = OpLoad %float %466
+ %468 = OpFAdd %float %465 %467
+ %469 = OpFMul %float %float_0_5 %468
+ %470 = OpCompositeInsert %v4float %469 %136 0
+ %471 = OpLoad %float %466
+ %472 = OpAccessChain %_ptr_Workgroup_float %temp_var_hullMainRetVal %uint_0 %int_3
+ %473 = OpLoad %float %472
+ %474 = OpFAdd %float %471 %473
+ %475 = OpFMul %float %float_0_5 %474
+ %476 = OpCompositeInsert %v4float %475 %470 1
+ %477 = OpLoad %float %472
+ %478 = OpLoad %float %464
+ %479 = OpFAdd %float %477 %478
+ %480 = OpFMul %float %float_0_5 %479
+ %481 = OpCompositeInsert %v4float %480 %476 2
+ %482 = OpLoad %float %472
+ %483 = OpLoad %float %464
+ %484 = OpFAdd %float %482 %483
+ %485 = OpLoad %float %466
+ %486 = OpFAdd %float %484 %485
+ %487 = OpFMul %float %float_0_333000004 %486
+ %488 = OpCompositeInsert %v4float %487 %481 3
+ %489 = OpVectorShuffle %v3float %435 %435 0 1 2
+ %490 = OpVectorShuffle %v3float %441 %441 0 1 2
+ %491 = OpVectorShuffle %v3float %447 %447 0 1 2
+ OpBranch %492
+ %492 = OpLabel
+ OpLoopMerge %493 %494 None
+ OpBranch %495
+ %495 = OpLabel
+ %496 = OpMatrixTimesVector %v4float %429 %77
+ %497 = OpCompositeExtract %float %435 0
+ %498 = OpCompositeExtract %float %435 1
+ %499 = OpCompositeExtract %float %435 2
+ %500 = OpCompositeConstruct %v4float %497 %498 %499 %float_1
+ %501 = OpMatrixTimesVector %v4float %427 %500
+ %502 = OpVectorShuffle %v3float %501 %501 0 1 2
+ %503 = OpVectorShuffle %v3float %496 %496 0 1 2
+ %504 = OpFSub %v3float %502 %503
+ %505 = OpCompositeExtract %float %501 3
+ %506 = OpCompositeExtract %float %496 3
+ %507 = OpFAdd %float %505 %506
+ %508 = OpCompositeConstruct %v3float %507 %507 %507
+ %509 = OpFOrdLessThan %v3bool %504 %508
+ %510 = OpSelect %v3int %509 %83 %74
+ %511 = OpFAdd %v3float %502 %503
+ %512 = OpFNegate %float %505
+ %513 = OpFSub %float %512 %506
+ %514 = OpCompositeConstruct %v3float %513 %513 %513
+ %515 = OpFOrdGreaterThan %v3bool %511 %514
+ %516 = OpSelect %v3int %515 %83 %74
+ %517 = OpIMul %v3int %84 %516
+ %518 = OpIAdd %v3int %510 %517
+ %519 = OpCompositeExtract %float %441 0
+ %520 = OpCompositeExtract %float %441 1
+ %521 = OpCompositeExtract %float %441 2
+ %522 = OpCompositeConstruct %v4float %519 %520 %521 %float_1
+ %523 = OpMatrixTimesVector %v4float %427 %522
+ %524 = OpVectorShuffle %v3float %523 %523 0 1 2
+ %525 = OpFSub %v3float %524 %503
+ %526 = OpCompositeExtract %float %523 3
+ %527 = OpFAdd %float %526 %506
+ %528 = OpCompositeConstruct %v3float %527 %527 %527
+ %529 = OpFOrdLessThan %v3bool %525 %528
+ %530 = OpSelect %v3int %529 %83 %74
+ %531 = OpFAdd %v3float %524 %503
+ %532 = OpFNegate %float %526
+ %533 = OpFSub %float %532 %506
+ %534 = OpCompositeConstruct %v3float %533 %533 %533
+ %535 = OpFOrdGreaterThan %v3bool %531 %534
+ %536 = OpSelect %v3int %535 %83 %74
+ %537 = OpIMul %v3int %84 %536
+ %538 = OpIAdd %v3int %530 %537
+ %539 = OpBitwiseOr %v3int %518 %538
+ %540 = OpCompositeExtract %float %447 0
+ %541 = OpCompositeExtract %float %447 1
+ %542 = OpCompositeExtract %float %447 2
+ %543 = OpCompositeConstruct %v4float %540 %541 %542 %float_1
+ %544 = OpMatrixTimesVector %v4float %427 %543
+ %545 = OpVectorShuffle %v3float %544 %544 0 1 2
+ %546 = OpFSub %v3float %545 %503
+ %547 = OpCompositeExtract %float %544 3
+ %548 = OpFAdd %float %547 %506
+ %549 = OpCompositeConstruct %v3float %548 %548 %548
+ %550 = OpFOrdLessThan %v3bool %546 %549
+ %551 = OpSelect %v3int %550 %83 %74
+ %552 = OpFAdd %v3float %545 %503
+ %553 = OpFNegate %float %547
+ %554 = OpFSub %float %553 %506
+ %555 = OpCompositeConstruct %v3float %554 %554 %554
+ %556 = OpFOrdGreaterThan %v3bool %552 %555
+ %557 = OpSelect %v3int %556 %83 %74
+ %558 = OpIMul %v3int %84 %557
+ %559 = OpIAdd %v3int %551 %558
+ %560 = OpBitwiseOr %v3int %539 %559
+ %561 = OpINotEqual %v3bool %560 %75
+ %562 = OpAny %bool %561
+ OpSelectionMerge %563 None
+ OpBranchConditional %562 %564 %563
+ %564 = OpLabel
+ OpBranch %493
+ %563 = OpLabel
+ %565 = OpFSub %v3float %489 %490
+ %566 = OpFSub %v3float %490 %491
+ %567 = OpFSub %v3float %491 %489
+ %568 = OpFAdd %v3float %489 %490
+ %569 = OpFMul %v3float %78 %568
+ %570 = OpFSub %v3float %569 %431
+ %571 = OpFAdd %v3float %490 %491
+ %572 = OpFMul %v3float %78 %571
+ %573 = OpFSub %v3float %572 %431
+ %574 = OpFAdd %v3float %491 %489
+ %575 = OpFMul %v3float %78 %574
+ %576 = OpFSub %v3float %575 %431
+ %577 = OpDot %float %566 %566
+ %578 = OpDot %float %573 %573
+ %579 = OpFDiv %float %577 %578
+ %580 = OpExtInst %float %1 Sqrt %579
+ %581 = OpDot %float %567 %567
+ %582 = OpDot %float %576 %576
+ %583 = OpFDiv %float %581 %582
+ %584 = OpExtInst %float %1 Sqrt %583
+ %585 = OpDot %float %565 %565
+ %586 = OpDot %float %570 %570
+ %587 = OpFDiv %float %585 %586
+ %588 = OpExtInst %float %1 Sqrt %587
+ %589 = OpCompositeConstruct %v4float %580 %584 %588 %float_1
+ %590 = OpFAdd %float %580 %584
+ %591 = OpFAdd %float %590 %588
+ %592 = OpFMul %float %float_0_333000004 %591
+ %593 = OpCompositeInsert %v4float %592 %589 3
+ %594 = OpCompositeConstruct %v4float %433 %433 %433 %433
+ %595 = OpFMul %v4float %594 %593
+ OpBranch %493
+ %494 = OpLabel
+ OpBranch %492
+ %493 = OpLabel
+ %596 = OpPhi %v4float %77 %564 %595 %563
+ %597 = OpFMul %v4float %488 %596
+ %598 = OpExtInst %v4float %1 FClamp %597 %68 %70
+ %599 = OpCompositeExtract %float %598 0
+ %600 = OpCompositeExtract %float %598 1
+ %601 = OpCompositeExtract %float %598 2
+ %602 = OpCompositeExtract %float %598 3
+ %603 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %uint_0
+ OpStore %603 %599
+ %604 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %uint_1
+ OpStore %604 %600
+ %605 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %uint_2
+ OpStore %605 %601
+ %606 = OpAccessChain %_ptr_Output_float %gl_TessLevelInner %uint_0
+ OpStore %606 %602
+ OpStore %out_var_PN_POSITION9 %463
+ OpBranch %if_merge
+ %if_merge = OpLabel
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/hs-texcoord-array.asm.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/hs-texcoord-array.asm.tesc
new file mode 100644
index 00000000000..1a9b95e085a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/hs-texcoord-array.asm.tesc
@@ -0,0 +1,1144 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 531
+; Schema: 0
+ OpCapability Tessellation
+ OpCapability SampledBuffer
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint TessellationControl %MainHull "main" %in_var_TEXCOORD10_centroid %in_var_TEXCOORD11_centroid %in_var_COLOR0 %in_var_TEXCOORD0 %in_var_VS_To_DS_Position %gl_InvocationID %out_var_TEXCOORD10_centroid %out_var_TEXCOORD11_centroid %out_var_COLOR0 %out_var_TEXCOORD0 %out_var_VS_To_DS_Position %out_var_PN_POSITION %out_var_PN_DisplacementScales %out_var_PN_TessellationMultiplier %out_var_PN_WorldDisplacementMultiplier %gl_TessLevelOuter %gl_TessLevelInner %out_var_PN_POSITION9
+ OpExecutionMode %MainHull Triangles
+ OpExecutionMode %MainHull SpacingFractionalOdd
+ OpExecutionMode %MainHull VertexOrderCw
+ OpExecutionMode %MainHull OutputVertices 3
+ OpSource HLSL 600
+ OpName %FPNTessellationHSToDS "FPNTessellationHSToDS"
+ OpMemberName %FPNTessellationHSToDS 0 "PassSpecificData"
+ OpMemberName %FPNTessellationHSToDS 1 "WorldPosition"
+ OpMemberName %FPNTessellationHSToDS 2 "DisplacementScale"
+ OpMemberName %FPNTessellationHSToDS 3 "TessellationMultiplier"
+ OpMemberName %FPNTessellationHSToDS 4 "WorldDisplacementMultiplier"
+ OpName %FHitProxyVSToDS "FHitProxyVSToDS"
+ OpMemberName %FHitProxyVSToDS 0 "FactoryInterpolants"
+ OpMemberName %FHitProxyVSToDS 1 "Position"
+ OpName %FVertexFactoryInterpolantsVSToDS "FVertexFactoryInterpolantsVSToDS"
+ OpMemberName %FVertexFactoryInterpolantsVSToDS 0 "InterpolantsVSToPS"
+ OpName %FVertexFactoryInterpolantsVSToPS "FVertexFactoryInterpolantsVSToPS"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 0 "TangentToWorld0"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 1 "TangentToWorld2"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 2 "Color"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 3 "TexCoords"
+ OpName %type_View "type.View"
+ OpMemberName %type_View 0 "View_TranslatedWorldToClip"
+ OpMemberName %type_View 1 "View_WorldToClip"
+ OpMemberName %type_View 2 "View_ClipToWorld"
+ OpMemberName %type_View 3 "View_TranslatedWorldToView"
+ OpMemberName %type_View 4 "View_ViewToTranslatedWorld"
+ OpMemberName %type_View 5 "View_TranslatedWorldToCameraView"
+ OpMemberName %type_View 6 "View_CameraViewToTranslatedWorld"
+ OpMemberName %type_View 7 "View_ViewToClip"
+ OpMemberName %type_View 8 "View_ViewToClipNoAA"
+ OpMemberName %type_View 9 "View_ClipToView"
+ OpMemberName %type_View 10 "View_ClipToTranslatedWorld"
+ OpMemberName %type_View 11 "View_SVPositionToTranslatedWorld"
+ OpMemberName %type_View 12 "View_ScreenToWorld"
+ OpMemberName %type_View 13 "View_ScreenToTranslatedWorld"
+ OpMemberName %type_View 14 "View_ViewForward"
+ OpMemberName %type_View 15 "PrePadding_View_908"
+ OpMemberName %type_View 16 "View_ViewUp"
+ OpMemberName %type_View 17 "PrePadding_View_924"
+ OpMemberName %type_View 18 "View_ViewRight"
+ OpMemberName %type_View 19 "PrePadding_View_940"
+ OpMemberName %type_View 20 "View_HMDViewNoRollUp"
+ OpMemberName %type_View 21 "PrePadding_View_956"
+ OpMemberName %type_View 22 "View_HMDViewNoRollRight"
+ OpMemberName %type_View 23 "PrePadding_View_972"
+ OpMemberName %type_View 24 "View_InvDeviceZToWorldZTransform"
+ OpMemberName %type_View 25 "View_ScreenPositionScaleBias"
+ OpMemberName %type_View 26 "View_WorldCameraOrigin"
+ OpMemberName %type_View 27 "PrePadding_View_1020"
+ OpMemberName %type_View 28 "View_TranslatedWorldCameraOrigin"
+ OpMemberName %type_View 29 "PrePadding_View_1036"
+ OpMemberName %type_View 30 "View_WorldViewOrigin"
+ OpMemberName %type_View 31 "PrePadding_View_1052"
+ OpMemberName %type_View 32 "View_PreViewTranslation"
+ OpMemberName %type_View 33 "PrePadding_View_1068"
+ OpMemberName %type_View 34 "View_PrevProjection"
+ OpMemberName %type_View 35 "View_PrevViewProj"
+ OpMemberName %type_View 36 "View_PrevViewRotationProj"
+ OpMemberName %type_View 37 "View_PrevViewToClip"
+ OpMemberName %type_View 38 "View_PrevClipToView"
+ OpMemberName %type_View 39 "View_PrevTranslatedWorldToClip"
+ OpMemberName %type_View 40 "View_PrevTranslatedWorldToView"
+ OpMemberName %type_View 41 "View_PrevViewToTranslatedWorld"
+ OpMemberName %type_View 42 "View_PrevTranslatedWorldToCameraView"
+ OpMemberName %type_View 43 "View_PrevCameraViewToTranslatedWorld"
+ OpMemberName %type_View 44 "View_PrevWorldCameraOrigin"
+ OpMemberName %type_View 45 "PrePadding_View_1724"
+ OpMemberName %type_View 46 "View_PrevWorldViewOrigin"
+ OpMemberName %type_View 47 "PrePadding_View_1740"
+ OpMemberName %type_View 48 "View_PrevPreViewTranslation"
+ OpMemberName %type_View 49 "PrePadding_View_1756"
+ OpMemberName %type_View 50 "View_PrevInvViewProj"
+ OpMemberName %type_View 51 "View_PrevScreenToTranslatedWorld"
+ OpMemberName %type_View 52 "View_ClipToPrevClip"
+ OpMemberName %type_View 53 "View_TemporalAAJitter"
+ OpMemberName %type_View 54 "View_GlobalClippingPlane"
+ OpMemberName %type_View 55 "View_FieldOfViewWideAngles"
+ OpMemberName %type_View 56 "View_PrevFieldOfViewWideAngles"
+ OpMemberName %type_View 57 "View_ViewRectMin"
+ OpMemberName %type_View 58 "View_ViewSizeAndInvSize"
+ OpMemberName %type_View 59 "View_BufferSizeAndInvSize"
+ OpMemberName %type_View 60 "View_BufferBilinearUVMinMax"
+ OpMemberName %type_View 61 "View_NumSceneColorMSAASamples"
+ OpMemberName %type_View 62 "View_PreExposure"
+ OpMemberName %type_View 63 "View_OneOverPreExposure"
+ OpMemberName %type_View 64 "PrePadding_View_2076"
+ OpMemberName %type_View 65 "View_DiffuseOverrideParameter"
+ OpMemberName %type_View 66 "View_SpecularOverrideParameter"
+ OpMemberName %type_View 67 "View_NormalOverrideParameter"
+ OpMemberName %type_View 68 "View_RoughnessOverrideParameter"
+ OpMemberName %type_View 69 "View_PrevFrameGameTime"
+ OpMemberName %type_View 70 "View_PrevFrameRealTime"
+ OpMemberName %type_View 71 "View_OutOfBoundsMask"
+ OpMemberName %type_View 72 "PrePadding_View_2148"
+ OpMemberName %type_View 73 "PrePadding_View_2152"
+ OpMemberName %type_View 74 "PrePadding_View_2156"
+ OpMemberName %type_View 75 "View_WorldCameraMovementSinceLastFrame"
+ OpMemberName %type_View 76 "View_CullingSign"
+ OpMemberName %type_View 77 "View_NearPlane"
+ OpMemberName %type_View 78 "View_AdaptiveTessellationFactor"
+ OpMemberName %type_View 79 "View_GameTime"
+ OpMemberName %type_View 80 "View_RealTime"
+ OpMemberName %type_View 81 "View_DeltaTime"
+ OpMemberName %type_View 82 "View_MaterialTextureMipBias"
+ OpMemberName %type_View 83 "View_MaterialTextureDerivativeMultiply"
+ OpMemberName %type_View 84 "View_Random"
+ OpMemberName %type_View 85 "View_FrameNumber"
+ OpMemberName %type_View 86 "View_StateFrameIndexMod8"
+ OpMemberName %type_View 87 "View_StateFrameIndex"
+ OpMemberName %type_View 88 "View_CameraCut"
+ OpMemberName %type_View 89 "View_UnlitViewmodeMask"
+ OpMemberName %type_View 90 "PrePadding_View_2228"
+ OpMemberName %type_View 91 "PrePadding_View_2232"
+ OpMemberName %type_View 92 "PrePadding_View_2236"
+ OpMemberName %type_View 93 "View_DirectionalLightColor"
+ OpMemberName %type_View 94 "View_DirectionalLightDirection"
+ OpMemberName %type_View 95 "PrePadding_View_2268"
+ OpMemberName %type_View 96 "View_TranslucencyLightingVolumeMin"
+ OpMemberName %type_View 97 "View_TranslucencyLightingVolumeInvSize"
+ OpMemberName %type_View 98 "View_TemporalAAParams"
+ OpMemberName %type_View 99 "View_CircleDOFParams"
+ OpMemberName %type_View 100 "View_DepthOfFieldSensorWidth"
+ OpMemberName %type_View 101 "View_DepthOfFieldFocalDistance"
+ OpMemberName %type_View 102 "View_DepthOfFieldScale"
+ OpMemberName %type_View 103 "View_DepthOfFieldFocalLength"
+ OpMemberName %type_View 104 "View_DepthOfFieldFocalRegion"
+ OpMemberName %type_View 105 "View_DepthOfFieldNearTransitionRegion"
+ OpMemberName %type_View 106 "View_DepthOfFieldFarTransitionRegion"
+ OpMemberName %type_View 107 "View_MotionBlurNormalizedToPixel"
+ OpMemberName %type_View 108 "View_bSubsurfacePostprocessEnabled"
+ OpMemberName %type_View 109 "View_GeneralPurposeTweak"
+ OpMemberName %type_View 110 "View_DemosaicVposOffset"
+ OpMemberName %type_View 111 "PrePadding_View_2412"
+ OpMemberName %type_View 112 "View_IndirectLightingColorScale"
+ OpMemberName %type_View 113 "View_HDR32bppEncodingMode"
+ OpMemberName %type_View 114 "View_AtmosphericFogSunDirection"
+ OpMemberName %type_View 115 "View_AtmosphericFogSunPower"
+ OpMemberName %type_View 116 "View_AtmosphericFogPower"
+ OpMemberName %type_View 117 "View_AtmosphericFogDensityScale"
+ OpMemberName %type_View 118 "View_AtmosphericFogDensityOffset"
+ OpMemberName %type_View 119 "View_AtmosphericFogGroundOffset"
+ OpMemberName %type_View 120 "View_AtmosphericFogDistanceScale"
+ OpMemberName %type_View 121 "View_AtmosphericFogAltitudeScale"
+ OpMemberName %type_View 122 "View_AtmosphericFogHeightScaleRayleigh"
+ OpMemberName %type_View 123 "View_AtmosphericFogStartDistance"
+ OpMemberName %type_View 124 "View_AtmosphericFogDistanceOffset"
+ OpMemberName %type_View 125 "View_AtmosphericFogSunDiscScale"
+ OpMemberName %type_View 126 "View_AtmosphericFogSunDiscHalfApexAngleRadian"
+ OpMemberName %type_View 127 "PrePadding_View_2492"
+ OpMemberName %type_View 128 "View_AtmosphericFogSunDiscLuminance"
+ OpMemberName %type_View 129 "View_AtmosphericFogRenderMask"
+ OpMemberName %type_View 130 "View_AtmosphericFogInscatterAltitudeSampleNum"
+ OpMemberName %type_View 131 "PrePadding_View_2520"
+ OpMemberName %type_View 132 "PrePadding_View_2524"
+ OpMemberName %type_View 133 "View_AtmosphericFogSunColor"
+ OpMemberName %type_View 134 "View_NormalCurvatureToRoughnessScaleBias"
+ OpMemberName %type_View 135 "View_RenderingReflectionCaptureMask"
+ OpMemberName %type_View 136 "View_AmbientCubemapTint"
+ OpMemberName %type_View 137 "View_AmbientCubemapIntensity"
+ OpMemberName %type_View 138 "View_SkyLightParameters"
+ OpMemberName %type_View 139 "PrePadding_View_2584"
+ OpMemberName %type_View 140 "PrePadding_View_2588"
+ OpMemberName %type_View 141 "View_SkyLightColor"
+ OpMemberName %type_View 142 "View_SkyIrradianceEnvironmentMap"
+ OpMemberName %type_View 143 "View_MobilePreviewMode"
+ OpMemberName %type_View 144 "View_HMDEyePaddingOffset"
+ OpMemberName %type_View 145 "View_ReflectionCubemapMaxMip"
+ OpMemberName %type_View 146 "View_ShowDecalsMask"
+ OpMemberName %type_View 147 "View_DistanceFieldAOSpecularOcclusionMode"
+ OpMemberName %type_View 148 "View_IndirectCapsuleSelfShadowingIntensity"
+ OpMemberName %type_View 149 "PrePadding_View_2744"
+ OpMemberName %type_View 150 "PrePadding_View_2748"
+ OpMemberName %type_View 151 "View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight"
+ OpMemberName %type_View 152 "View_StereoPassIndex"
+ OpMemberName %type_View 153 "View_GlobalVolumeCenterAndExtent"
+ OpMemberName %type_View 154 "View_GlobalVolumeWorldToUVAddAndMul"
+ OpMemberName %type_View 155 "View_GlobalVolumeDimension"
+ OpMemberName %type_View 156 "View_GlobalVolumeTexelSize"
+ OpMemberName %type_View 157 "View_MaxGlobalDistance"
+ OpMemberName %type_View 158 "PrePadding_View_2908"
+ OpMemberName %type_View 159 "View_CursorPosition"
+ OpMemberName %type_View 160 "View_bCheckerboardSubsurfaceProfileRendering"
+ OpMemberName %type_View 161 "PrePadding_View_2924"
+ OpMemberName %type_View 162 "View_VolumetricFogInvGridSize"
+ OpMemberName %type_View 163 "PrePadding_View_2940"
+ OpMemberName %type_View 164 "View_VolumetricFogGridZParams"
+ OpMemberName %type_View 165 "PrePadding_View_2956"
+ OpMemberName %type_View 166 "View_VolumetricFogSVPosToVolumeUV"
+ OpMemberName %type_View 167 "View_VolumetricFogMaxDistance"
+ OpMemberName %type_View 168 "PrePadding_View_2972"
+ OpMemberName %type_View 169 "View_VolumetricLightmapWorldToUVScale"
+ OpMemberName %type_View 170 "PrePadding_View_2988"
+ OpMemberName %type_View 171 "View_VolumetricLightmapWorldToUVAdd"
+ OpMemberName %type_View 172 "PrePadding_View_3004"
+ OpMemberName %type_View 173 "View_VolumetricLightmapIndirectionTextureSize"
+ OpMemberName %type_View 174 "View_VolumetricLightmapBrickSize"
+ OpMemberName %type_View 175 "View_VolumetricLightmapBrickTexelSize"
+ OpMemberName %type_View 176 "View_StereoIPD"
+ OpMemberName %type_View 177 "View_IndirectLightingCacheShowFlag"
+ OpMemberName %type_View 178 "View_EyeToPixelSpreadAngle"
+ OpName %View "View"
+ OpName %type_Primitive "type.Primitive"
+ OpMemberName %type_Primitive 0 "Primitive_LocalToWorld"
+ OpMemberName %type_Primitive 1 "Primitive_InvNonUniformScaleAndDeterminantSign"
+ OpMemberName %type_Primitive 2 "Primitive_ObjectWorldPositionAndRadius"
+ OpMemberName %type_Primitive 3 "Primitive_WorldToLocal"
+ OpMemberName %type_Primitive 4 "Primitive_PreviousLocalToWorld"
+ OpMemberName %type_Primitive 5 "Primitive_PreviousWorldToLocal"
+ OpMemberName %type_Primitive 6 "Primitive_ActorWorldPosition"
+ OpMemberName %type_Primitive 7 "Primitive_UseSingleSampleShadowFromStationaryLights"
+ OpMemberName %type_Primitive 8 "Primitive_ObjectBounds"
+ OpMemberName %type_Primitive 9 "Primitive_LpvBiasMultiplier"
+ OpMemberName %type_Primitive 10 "Primitive_DecalReceiverMask"
+ OpMemberName %type_Primitive 11 "Primitive_PerObjectGBufferData"
+ OpMemberName %type_Primitive 12 "Primitive_UseVolumetricLightmapShadowFromStationaryLights"
+ OpMemberName %type_Primitive 13 "Primitive_DrawsVelocity"
+ OpMemberName %type_Primitive 14 "Primitive_ObjectOrientation"
+ OpMemberName %type_Primitive 15 "Primitive_NonUniformScale"
+ OpMemberName %type_Primitive 16 "Primitive_LocalObjectBoundsMin"
+ OpMemberName %type_Primitive 17 "Primitive_LightingChannelMask"
+ OpMemberName %type_Primitive 18 "Primitive_LocalObjectBoundsMax"
+ OpMemberName %type_Primitive 19 "Primitive_LightmapDataIndex"
+ OpMemberName %type_Primitive 20 "Primitive_PreSkinnedLocalBounds"
+ OpMemberName %type_Primitive 21 "Primitive_SingleCaptureIndex"
+ OpMemberName %type_Primitive 22 "Primitive_OutputVelocity"
+ OpMemberName %type_Primitive 23 "PrePadding_Primitive_420"
+ OpMemberName %type_Primitive 24 "PrePadding_Primitive_424"
+ OpMemberName %type_Primitive 25 "PrePadding_Primitive_428"
+ OpMemberName %type_Primitive 26 "Primitive_CustomPrimitiveData"
+ OpName %Primitive "Primitive"
+ OpName %in_var_TEXCOORD10_centroid "in.var.TEXCOORD10_centroid"
+ OpName %in_var_TEXCOORD11_centroid "in.var.TEXCOORD11_centroid"
+ OpName %in_var_COLOR0 "in.var.COLOR0"
+ OpName %in_var_TEXCOORD0 "in.var.TEXCOORD0"
+ OpName %in_var_VS_To_DS_Position "in.var.VS_To_DS_Position"
+ OpName %out_var_TEXCOORD10_centroid "out.var.TEXCOORD10_centroid"
+ OpName %out_var_TEXCOORD11_centroid "out.var.TEXCOORD11_centroid"
+ OpName %out_var_COLOR0 "out.var.COLOR0"
+ OpName %out_var_TEXCOORD0 "out.var.TEXCOORD0"
+ OpName %out_var_VS_To_DS_Position "out.var.VS_To_DS_Position"
+ OpName %out_var_PN_POSITION "out.var.PN_POSITION"
+ OpName %out_var_PN_DisplacementScales "out.var.PN_DisplacementScales"
+ OpName %out_var_PN_TessellationMultiplier "out.var.PN_TessellationMultiplier"
+ OpName %out_var_PN_WorldDisplacementMultiplier "out.var.PN_WorldDisplacementMultiplier"
+ OpName %out_var_PN_POSITION9 "out.var.PN_POSITION9"
+ OpName %MainHull "MainHull"
+ OpName %param_var_I "param.var.I"
+ OpName %temp_var_hullMainRetVal "temp.var.hullMainRetVal"
+ OpName %if_merge "if.merge"
+ OpDecorateString %in_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %in_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %in_var_COLOR0 UserSemantic "COLOR0"
+ OpDecorateString %in_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorateString %in_var_VS_To_DS_Position UserSemantic "VS_To_DS_Position"
+ OpDecorate %gl_InvocationID BuiltIn InvocationId
+ OpDecorateString %gl_InvocationID UserSemantic "SV_OutputControlPointID"
+ OpDecorateString %out_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %out_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %out_var_COLOR0 UserSemantic "COLOR0"
+ OpDecorateString %out_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorateString %out_var_VS_To_DS_Position UserSemantic "VS_To_DS_Position"
+ OpDecorateString %out_var_PN_POSITION UserSemantic "PN_POSITION"
+ OpDecorateString %out_var_PN_DisplacementScales UserSemantic "PN_DisplacementScales"
+ OpDecorateString %out_var_PN_TessellationMultiplier UserSemantic "PN_TessellationMultiplier"
+ OpDecorateString %out_var_PN_WorldDisplacementMultiplier UserSemantic "PN_WorldDisplacementMultiplier"
+ OpDecorate %gl_TessLevelOuter BuiltIn TessLevelOuter
+ OpDecorateString %gl_TessLevelOuter UserSemantic "SV_TessFactor"
+ OpDecorate %gl_TessLevelOuter Patch
+ OpDecorate %gl_TessLevelInner BuiltIn TessLevelInner
+ OpDecorateString %gl_TessLevelInner UserSemantic "SV_InsideTessFactor"
+ OpDecorate %gl_TessLevelInner Patch
+ OpDecorateString %out_var_PN_POSITION9 UserSemantic "PN_POSITION9"
+ OpDecorate %out_var_PN_POSITION9 Patch
+ OpDecorate %in_var_TEXCOORD10_centroid Location 0
+ OpDecorate %in_var_TEXCOORD11_centroid Location 1
+ OpDecorate %in_var_COLOR0 Location 2
+ OpDecorate %in_var_TEXCOORD0 Location 3
+ OpDecorate %in_var_VS_To_DS_Position Location 5
+ OpDecorate %out_var_COLOR0 Location 0
+ OpDecorate %out_var_PN_DisplacementScales Location 1
+ OpDecorate %out_var_PN_POSITION Location 2
+ OpDecorate %out_var_PN_POSITION9 Location 5
+ OpDecorate %out_var_PN_TessellationMultiplier Location 6
+ OpDecorate %out_var_PN_WorldDisplacementMultiplier Location 7
+ OpDecorate %out_var_TEXCOORD0 Location 8
+ OpDecorate %out_var_TEXCOORD10_centroid Location 10
+ OpDecorate %out_var_TEXCOORD11_centroid Location 11
+ OpDecorate %out_var_VS_To_DS_Position Location 12
+ OpDecorate %View DescriptorSet 0
+ OpDecorate %View Binding 0
+ OpDecorate %Primitive DescriptorSet 0
+ OpDecorate %Primitive Binding 1
+ OpDecorate %_arr_v4float_uint_2 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_7 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpMemberDecorate %type_View 0 Offset 0
+ OpMemberDecorate %type_View 0 MatrixStride 16
+ OpMemberDecorate %type_View 0 ColMajor
+ OpMemberDecorate %type_View 1 Offset 64
+ OpMemberDecorate %type_View 1 MatrixStride 16
+ OpMemberDecorate %type_View 1 ColMajor
+ OpMemberDecorate %type_View 2 Offset 128
+ OpMemberDecorate %type_View 2 MatrixStride 16
+ OpMemberDecorate %type_View 2 ColMajor
+ OpMemberDecorate %type_View 3 Offset 192
+ OpMemberDecorate %type_View 3 MatrixStride 16
+ OpMemberDecorate %type_View 3 ColMajor
+ OpMemberDecorate %type_View 4 Offset 256
+ OpMemberDecorate %type_View 4 MatrixStride 16
+ OpMemberDecorate %type_View 4 ColMajor
+ OpMemberDecorate %type_View 5 Offset 320
+ OpMemberDecorate %type_View 5 MatrixStride 16
+ OpMemberDecorate %type_View 5 ColMajor
+ OpMemberDecorate %type_View 6 Offset 384
+ OpMemberDecorate %type_View 6 MatrixStride 16
+ OpMemberDecorate %type_View 6 ColMajor
+ OpMemberDecorate %type_View 7 Offset 448
+ OpMemberDecorate %type_View 7 MatrixStride 16
+ OpMemberDecorate %type_View 7 ColMajor
+ OpMemberDecorate %type_View 8 Offset 512
+ OpMemberDecorate %type_View 8 MatrixStride 16
+ OpMemberDecorate %type_View 8 ColMajor
+ OpMemberDecorate %type_View 9 Offset 576
+ OpMemberDecorate %type_View 9 MatrixStride 16
+ OpMemberDecorate %type_View 9 ColMajor
+ OpMemberDecorate %type_View 10 Offset 640
+ OpMemberDecorate %type_View 10 MatrixStride 16
+ OpMemberDecorate %type_View 10 ColMajor
+ OpMemberDecorate %type_View 11 Offset 704
+ OpMemberDecorate %type_View 11 MatrixStride 16
+ OpMemberDecorate %type_View 11 ColMajor
+ OpMemberDecorate %type_View 12 Offset 768
+ OpMemberDecorate %type_View 12 MatrixStride 16
+ OpMemberDecorate %type_View 12 ColMajor
+ OpMemberDecorate %type_View 13 Offset 832
+ OpMemberDecorate %type_View 13 MatrixStride 16
+ OpMemberDecorate %type_View 13 ColMajor
+ OpMemberDecorate %type_View 14 Offset 896
+ OpMemberDecorate %type_View 15 Offset 908
+ OpMemberDecorate %type_View 16 Offset 912
+ OpMemberDecorate %type_View 17 Offset 924
+ OpMemberDecorate %type_View 18 Offset 928
+ OpMemberDecorate %type_View 19 Offset 940
+ OpMemberDecorate %type_View 20 Offset 944
+ OpMemberDecorate %type_View 21 Offset 956
+ OpMemberDecorate %type_View 22 Offset 960
+ OpMemberDecorate %type_View 23 Offset 972
+ OpMemberDecorate %type_View 24 Offset 976
+ OpMemberDecorate %type_View 25 Offset 992
+ OpMemberDecorate %type_View 26 Offset 1008
+ OpMemberDecorate %type_View 27 Offset 1020
+ OpMemberDecorate %type_View 28 Offset 1024
+ OpMemberDecorate %type_View 29 Offset 1036
+ OpMemberDecorate %type_View 30 Offset 1040
+ OpMemberDecorate %type_View 31 Offset 1052
+ OpMemberDecorate %type_View 32 Offset 1056
+ OpMemberDecorate %type_View 33 Offset 1068
+ OpMemberDecorate %type_View 34 Offset 1072
+ OpMemberDecorate %type_View 34 MatrixStride 16
+ OpMemberDecorate %type_View 34 ColMajor
+ OpMemberDecorate %type_View 35 Offset 1136
+ OpMemberDecorate %type_View 35 MatrixStride 16
+ OpMemberDecorate %type_View 35 ColMajor
+ OpMemberDecorate %type_View 36 Offset 1200
+ OpMemberDecorate %type_View 36 MatrixStride 16
+ OpMemberDecorate %type_View 36 ColMajor
+ OpMemberDecorate %type_View 37 Offset 1264
+ OpMemberDecorate %type_View 37 MatrixStride 16
+ OpMemberDecorate %type_View 37 ColMajor
+ OpMemberDecorate %type_View 38 Offset 1328
+ OpMemberDecorate %type_View 38 MatrixStride 16
+ OpMemberDecorate %type_View 38 ColMajor
+ OpMemberDecorate %type_View 39 Offset 1392
+ OpMemberDecorate %type_View 39 MatrixStride 16
+ OpMemberDecorate %type_View 39 ColMajor
+ OpMemberDecorate %type_View 40 Offset 1456
+ OpMemberDecorate %type_View 40 MatrixStride 16
+ OpMemberDecorate %type_View 40 ColMajor
+ OpMemberDecorate %type_View 41 Offset 1520
+ OpMemberDecorate %type_View 41 MatrixStride 16
+ OpMemberDecorate %type_View 41 ColMajor
+ OpMemberDecorate %type_View 42 Offset 1584
+ OpMemberDecorate %type_View 42 MatrixStride 16
+ OpMemberDecorate %type_View 42 ColMajor
+ OpMemberDecorate %type_View 43 Offset 1648
+ OpMemberDecorate %type_View 43 MatrixStride 16
+ OpMemberDecorate %type_View 43 ColMajor
+ OpMemberDecorate %type_View 44 Offset 1712
+ OpMemberDecorate %type_View 45 Offset 1724
+ OpMemberDecorate %type_View 46 Offset 1728
+ OpMemberDecorate %type_View 47 Offset 1740
+ OpMemberDecorate %type_View 48 Offset 1744
+ OpMemberDecorate %type_View 49 Offset 1756
+ OpMemberDecorate %type_View 50 Offset 1760
+ OpMemberDecorate %type_View 50 MatrixStride 16
+ OpMemberDecorate %type_View 50 ColMajor
+ OpMemberDecorate %type_View 51 Offset 1824
+ OpMemberDecorate %type_View 51 MatrixStride 16
+ OpMemberDecorate %type_View 51 ColMajor
+ OpMemberDecorate %type_View 52 Offset 1888
+ OpMemberDecorate %type_View 52 MatrixStride 16
+ OpMemberDecorate %type_View 52 ColMajor
+ OpMemberDecorate %type_View 53 Offset 1952
+ OpMemberDecorate %type_View 54 Offset 1968
+ OpMemberDecorate %type_View 55 Offset 1984
+ OpMemberDecorate %type_View 56 Offset 1992
+ OpMemberDecorate %type_View 57 Offset 2000
+ OpMemberDecorate %type_View 58 Offset 2016
+ OpMemberDecorate %type_View 59 Offset 2032
+ OpMemberDecorate %type_View 60 Offset 2048
+ OpMemberDecorate %type_View 61 Offset 2064
+ OpMemberDecorate %type_View 62 Offset 2068
+ OpMemberDecorate %type_View 63 Offset 2072
+ OpMemberDecorate %type_View 64 Offset 2076
+ OpMemberDecorate %type_View 65 Offset 2080
+ OpMemberDecorate %type_View 66 Offset 2096
+ OpMemberDecorate %type_View 67 Offset 2112
+ OpMemberDecorate %type_View 68 Offset 2128
+ OpMemberDecorate %type_View 69 Offset 2136
+ OpMemberDecorate %type_View 70 Offset 2140
+ OpMemberDecorate %type_View 71 Offset 2144
+ OpMemberDecorate %type_View 72 Offset 2148
+ OpMemberDecorate %type_View 73 Offset 2152
+ OpMemberDecorate %type_View 74 Offset 2156
+ OpMemberDecorate %type_View 75 Offset 2160
+ OpMemberDecorate %type_View 76 Offset 2172
+ OpMemberDecorate %type_View 77 Offset 2176
+ OpMemberDecorate %type_View 78 Offset 2180
+ OpMemberDecorate %type_View 79 Offset 2184
+ OpMemberDecorate %type_View 80 Offset 2188
+ OpMemberDecorate %type_View 81 Offset 2192
+ OpMemberDecorate %type_View 82 Offset 2196
+ OpMemberDecorate %type_View 83 Offset 2200
+ OpMemberDecorate %type_View 84 Offset 2204
+ OpMemberDecorate %type_View 85 Offset 2208
+ OpMemberDecorate %type_View 86 Offset 2212
+ OpMemberDecorate %type_View 87 Offset 2216
+ OpMemberDecorate %type_View 88 Offset 2220
+ OpMemberDecorate %type_View 89 Offset 2224
+ OpMemberDecorate %type_View 90 Offset 2228
+ OpMemberDecorate %type_View 91 Offset 2232
+ OpMemberDecorate %type_View 92 Offset 2236
+ OpMemberDecorate %type_View 93 Offset 2240
+ OpMemberDecorate %type_View 94 Offset 2256
+ OpMemberDecorate %type_View 95 Offset 2268
+ OpMemberDecorate %type_View 96 Offset 2272
+ OpMemberDecorate %type_View 97 Offset 2304
+ OpMemberDecorate %type_View 98 Offset 2336
+ OpMemberDecorate %type_View 99 Offset 2352
+ OpMemberDecorate %type_View 100 Offset 2368
+ OpMemberDecorate %type_View 101 Offset 2372
+ OpMemberDecorate %type_View 102 Offset 2376
+ OpMemberDecorate %type_View 103 Offset 2380
+ OpMemberDecorate %type_View 104 Offset 2384
+ OpMemberDecorate %type_View 105 Offset 2388
+ OpMemberDecorate %type_View 106 Offset 2392
+ OpMemberDecorate %type_View 107 Offset 2396
+ OpMemberDecorate %type_View 108 Offset 2400
+ OpMemberDecorate %type_View 109 Offset 2404
+ OpMemberDecorate %type_View 110 Offset 2408
+ OpMemberDecorate %type_View 111 Offset 2412
+ OpMemberDecorate %type_View 112 Offset 2416
+ OpMemberDecorate %type_View 113 Offset 2428
+ OpMemberDecorate %type_View 114 Offset 2432
+ OpMemberDecorate %type_View 115 Offset 2444
+ OpMemberDecorate %type_View 116 Offset 2448
+ OpMemberDecorate %type_View 117 Offset 2452
+ OpMemberDecorate %type_View 118 Offset 2456
+ OpMemberDecorate %type_View 119 Offset 2460
+ OpMemberDecorate %type_View 120 Offset 2464
+ OpMemberDecorate %type_View 121 Offset 2468
+ OpMemberDecorate %type_View 122 Offset 2472
+ OpMemberDecorate %type_View 123 Offset 2476
+ OpMemberDecorate %type_View 124 Offset 2480
+ OpMemberDecorate %type_View 125 Offset 2484
+ OpMemberDecorate %type_View 126 Offset 2488
+ OpMemberDecorate %type_View 127 Offset 2492
+ OpMemberDecorate %type_View 128 Offset 2496
+ OpMemberDecorate %type_View 129 Offset 2512
+ OpMemberDecorate %type_View 130 Offset 2516
+ OpMemberDecorate %type_View 131 Offset 2520
+ OpMemberDecorate %type_View 132 Offset 2524
+ OpMemberDecorate %type_View 133 Offset 2528
+ OpMemberDecorate %type_View 134 Offset 2544
+ OpMemberDecorate %type_View 135 Offset 2556
+ OpMemberDecorate %type_View 136 Offset 2560
+ OpMemberDecorate %type_View 137 Offset 2576
+ OpMemberDecorate %type_View 138 Offset 2580
+ OpMemberDecorate %type_View 139 Offset 2584
+ OpMemberDecorate %type_View 140 Offset 2588
+ OpMemberDecorate %type_View 141 Offset 2592
+ OpMemberDecorate %type_View 142 Offset 2608
+ OpMemberDecorate %type_View 143 Offset 2720
+ OpMemberDecorate %type_View 144 Offset 2724
+ OpMemberDecorate %type_View 145 Offset 2728
+ OpMemberDecorate %type_View 146 Offset 2732
+ OpMemberDecorate %type_View 147 Offset 2736
+ OpMemberDecorate %type_View 148 Offset 2740
+ OpMemberDecorate %type_View 149 Offset 2744
+ OpMemberDecorate %type_View 150 Offset 2748
+ OpMemberDecorate %type_View 151 Offset 2752
+ OpMemberDecorate %type_View 152 Offset 2764
+ OpMemberDecorate %type_View 153 Offset 2768
+ OpMemberDecorate %type_View 154 Offset 2832
+ OpMemberDecorate %type_View 155 Offset 2896
+ OpMemberDecorate %type_View 156 Offset 2900
+ OpMemberDecorate %type_View 157 Offset 2904
+ OpMemberDecorate %type_View 158 Offset 2908
+ OpMemberDecorate %type_View 159 Offset 2912
+ OpMemberDecorate %type_View 160 Offset 2920
+ OpMemberDecorate %type_View 161 Offset 2924
+ OpMemberDecorate %type_View 162 Offset 2928
+ OpMemberDecorate %type_View 163 Offset 2940
+ OpMemberDecorate %type_View 164 Offset 2944
+ OpMemberDecorate %type_View 165 Offset 2956
+ OpMemberDecorate %type_View 166 Offset 2960
+ OpMemberDecorate %type_View 167 Offset 2968
+ OpMemberDecorate %type_View 168 Offset 2972
+ OpMemberDecorate %type_View 169 Offset 2976
+ OpMemberDecorate %type_View 170 Offset 2988
+ OpMemberDecorate %type_View 171 Offset 2992
+ OpMemberDecorate %type_View 172 Offset 3004
+ OpMemberDecorate %type_View 173 Offset 3008
+ OpMemberDecorate %type_View 174 Offset 3020
+ OpMemberDecorate %type_View 175 Offset 3024
+ OpMemberDecorate %type_View 176 Offset 3036
+ OpMemberDecorate %type_View 177 Offset 3040
+ OpMemberDecorate %type_View 178 Offset 3044
+ OpDecorate %type_View Block
+ OpMemberDecorate %type_Primitive 0 Offset 0
+ OpMemberDecorate %type_Primitive 0 MatrixStride 16
+ OpMemberDecorate %type_Primitive 0 ColMajor
+ OpMemberDecorate %type_Primitive 1 Offset 64
+ OpMemberDecorate %type_Primitive 2 Offset 80
+ OpMemberDecorate %type_Primitive 3 Offset 96
+ OpMemberDecorate %type_Primitive 3 MatrixStride 16
+ OpMemberDecorate %type_Primitive 3 ColMajor
+ OpMemberDecorate %type_Primitive 4 Offset 160
+ OpMemberDecorate %type_Primitive 4 MatrixStride 16
+ OpMemberDecorate %type_Primitive 4 ColMajor
+ OpMemberDecorate %type_Primitive 5 Offset 224
+ OpMemberDecorate %type_Primitive 5 MatrixStride 16
+ OpMemberDecorate %type_Primitive 5 ColMajor
+ OpMemberDecorate %type_Primitive 6 Offset 288
+ OpMemberDecorate %type_Primitive 7 Offset 300
+ OpMemberDecorate %type_Primitive 8 Offset 304
+ OpMemberDecorate %type_Primitive 9 Offset 316
+ OpMemberDecorate %type_Primitive 10 Offset 320
+ OpMemberDecorate %type_Primitive 11 Offset 324
+ OpMemberDecorate %type_Primitive 12 Offset 328
+ OpMemberDecorate %type_Primitive 13 Offset 332
+ OpMemberDecorate %type_Primitive 14 Offset 336
+ OpMemberDecorate %type_Primitive 15 Offset 352
+ OpMemberDecorate %type_Primitive 16 Offset 368
+ OpMemberDecorate %type_Primitive 17 Offset 380
+ OpMemberDecorate %type_Primitive 18 Offset 384
+ OpMemberDecorate %type_Primitive 19 Offset 396
+ OpMemberDecorate %type_Primitive 20 Offset 400
+ OpMemberDecorate %type_Primitive 21 Offset 412
+ OpMemberDecorate %type_Primitive 22 Offset 416
+ OpMemberDecorate %type_Primitive 23 Offset 420
+ OpMemberDecorate %type_Primitive 24 Offset 424
+ OpMemberDecorate %type_Primitive 25 Offset 428
+ OpMemberDecorate %type_Primitive 26 Offset 432
+ OpDecorate %type_Primitive Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+ %v2int = OpTypeVector %int 2
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %uint_3 = OpConstant %uint 3
+%_arr_float_uint_3 = OpTypeArray %float %uint_3
+ %int_1 = OpConstant %int 1
+ %int_0 = OpConstant %int 0
+ %int_2 = OpConstant %int 2
+ %float_2 = OpConstant %float 2
+ %54 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
+ %float_0_5 = OpConstant %float 0.5
+ %int_3 = OpConstant %int 3
+%float_0_333000004 = OpConstant %float 0.333000004
+ %float_1 = OpConstant %float 1
+ %59 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %float_15 = OpConstant %float 15
+ %61 = OpConstantComposite %v4float %float_15 %float_15 %float_15 %float_15
+%_arr_v2float_uint_2 = OpTypeArray %v2float %uint_2
+%FVertexFactoryInterpolantsVSToPS = OpTypeStruct %v4float %v4float %v4float %_arr_v2float_uint_2
+%FVertexFactoryInterpolantsVSToDS = OpTypeStruct %FVertexFactoryInterpolantsVSToPS
+%FHitProxyVSToDS = OpTypeStruct %FVertexFactoryInterpolantsVSToDS %v4float
+%_arr_v4float_uint_3 = OpTypeArray %v4float %uint_3
+%FPNTessellationHSToDS = OpTypeStruct %FHitProxyVSToDS %_arr_v4float_uint_3 %v3float %float %float
+ %v3int = OpTypeVector %int 3
+ %65 = OpConstantComposite %v3int %int_0 %int_0 %int_0
+ %66 = OpConstantComposite %v3int %int_3 %int_3 %int_3
+ %float_0 = OpConstant %float 0
+ %68 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+ %69 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
+ %int_78 = OpConstant %int 78
+ %int_15 = OpConstant %int 15
+ %int_7 = OpConstant %int 7
+ %int_28 = OpConstant %int 28
+ %74 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %75 = OpConstantComposite %v3int %int_2 %int_2 %int_2
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_arr_v4float_uint_7 = OpTypeArray %v4float %uint_7
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+ %type_View = OpTypeStruct %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %v3float %float %v3float %float %v4float %v4float %v3float %float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %v4float %v4float %v2float %v2float %v4float %v4float %v4float %v4float %int %float %float %float %v4float %v4float %v4float %v2float %float %float %float %float %float %float %v3float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %float %float %float %float %float %v4float %v3float %float %_arr_v4float_uint_2 %_arr_v4float_uint_2 %v4float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %v3float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %float %float %v4float %uint %uint %uint %uint %v4float %v3float %float %v4float %float %float %float %float %v4float %_arr_v4float_uint_7 %float %float %float %float %uint %float %float %float %v3float %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %float %float %float %float %v2int %float %float %v3float %float %v3float %float %v2float %float %float %v3float %float %v3float %float %v3float %float %v3float %float %float %float
+%_ptr_Uniform_type_View = OpTypePointer Uniform %type_View
+%type_Primitive = OpTypeStruct %mat4v4float %v4float %v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %float %float %float %float %v4float %v4float %v3float %uint %v3float %uint %v3float %int %uint %uint %uint %uint %_arr_v4float_uint_4
+%_ptr_Uniform_type_Primitive = OpTypePointer Uniform %type_Primitive
+ %uint_12 = OpConstant %uint 12
+%_arr_v4float_uint_12 = OpTypeArray %v4float %uint_12
+%_ptr_Input__arr_v4float_uint_12 = OpTypePointer Input %_arr_v4float_uint_12
+%_arr__arr_v2float_uint_2_uint_12 = OpTypeArray %_arr_v2float_uint_2 %uint_12
+%_ptr_Input__arr__arr_v2float_uint_2_uint_12 = OpTypePointer Input %_arr__arr_v2float_uint_2_uint_12
+%_ptr_Input_uint = OpTypePointer Input %uint
+%_ptr_Output__arr_v4float_uint_3 = OpTypePointer Output %_arr_v4float_uint_3
+%_arr__arr_v2float_uint_2_uint_3 = OpTypeArray %_arr_v2float_uint_2 %uint_3
+%_ptr_Output__arr__arr_v2float_uint_2_uint_3 = OpTypePointer Output %_arr__arr_v2float_uint_2_uint_3
+%_arr__arr_v4float_uint_3_uint_3 = OpTypeArray %_arr_v4float_uint_3 %uint_3
+%_ptr_Output__arr__arr_v4float_uint_3_uint_3 = OpTypePointer Output %_arr__arr_v4float_uint_3_uint_3
+%_arr_v3float_uint_3 = OpTypeArray %v3float %uint_3
+%_ptr_Output__arr_v3float_uint_3 = OpTypePointer Output %_arr_v3float_uint_3
+%_ptr_Output__arr_float_uint_3 = OpTypePointer Output %_arr_float_uint_3
+%_arr_float_uint_4 = OpTypeArray %float %uint_4
+%_ptr_Output__arr_float_uint_4 = OpTypePointer Output %_arr_float_uint_4
+%_arr_float_uint_2 = OpTypeArray %float %uint_2
+%_ptr_Output__arr_float_uint_2 = OpTypePointer Output %_arr_float_uint_2
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %98 = OpTypeFunction %void
+%_arr_FHitProxyVSToDS_uint_12 = OpTypeArray %FHitProxyVSToDS %uint_12
+%_ptr_Function__arr_FHitProxyVSToDS_uint_12 = OpTypePointer Function %_arr_FHitProxyVSToDS_uint_12
+%_arr_FPNTessellationHSToDS_uint_3 = OpTypeArray %FPNTessellationHSToDS %uint_3
+%_ptr_Function__arr_FPNTessellationHSToDS_uint_3 = OpTypePointer Function %_arr_FPNTessellationHSToDS_uint_3
+%_ptr_Workgroup__arr_FPNTessellationHSToDS_uint_3 = OpTypePointer Workgroup %_arr_FPNTessellationHSToDS_uint_3
+%_ptr_Output__arr_v2float_uint_2 = OpTypePointer Output %_arr_v2float_uint_2
+%_ptr_Output_v3float = OpTypePointer Output %v3float
+%_ptr_Output_float = OpTypePointer Output %float
+%_ptr_Function_FPNTessellationHSToDS = OpTypePointer Function %FPNTessellationHSToDS
+%_ptr_Workgroup_FPNTessellationHSToDS = OpTypePointer Workgroup %FPNTessellationHSToDS
+ %bool = OpTypeBool
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%_ptr_Function_float = OpTypePointer Function %float
+%_ptr_Workgroup_v4float = OpTypePointer Workgroup %v4float
+%_ptr_Workgroup_float = OpTypePointer Workgroup %float
+%mat3v3float = OpTypeMatrix %v3float 3
+%_ptr_Function_FVertexFactoryInterpolantsVSToDS = OpTypePointer Function %FVertexFactoryInterpolantsVSToDS
+%_ptr_Function_FHitProxyVSToDS = OpTypePointer Function %FHitProxyVSToDS
+ %v3bool = OpTypeVector %bool 3
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+ %View = OpVariable %_ptr_Uniform_type_View Uniform
+ %Primitive = OpVariable %_ptr_Uniform_type_Primitive Uniform
+%in_var_TEXCOORD10_centroid = OpVariable %_ptr_Input__arr_v4float_uint_12 Input
+%in_var_TEXCOORD11_centroid = OpVariable %_ptr_Input__arr_v4float_uint_12 Input
+%in_var_COLOR0 = OpVariable %_ptr_Input__arr_v4float_uint_12 Input
+%in_var_TEXCOORD0 = OpVariable %_ptr_Input__arr__arr_v2float_uint_2_uint_12 Input
+%in_var_VS_To_DS_Position = OpVariable %_ptr_Input__arr_v4float_uint_12 Input
+%gl_InvocationID = OpVariable %_ptr_Input_uint Input
+%out_var_TEXCOORD10_centroid = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_TEXCOORD11_centroid = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_COLOR0 = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_TEXCOORD0 = OpVariable %_ptr_Output__arr__arr_v2float_uint_2_uint_3 Output
+%out_var_VS_To_DS_Position = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
+%out_var_PN_POSITION = OpVariable %_ptr_Output__arr__arr_v4float_uint_3_uint_3 Output
+%out_var_PN_DisplacementScales = OpVariable %_ptr_Output__arr_v3float_uint_3 Output
+%out_var_PN_TessellationMultiplier = OpVariable %_ptr_Output__arr_float_uint_3 Output
+%out_var_PN_WorldDisplacementMultiplier = OpVariable %_ptr_Output__arr_float_uint_3 Output
+%gl_TessLevelOuter = OpVariable %_ptr_Output__arr_float_uint_4 Output
+%gl_TessLevelInner = OpVariable %_ptr_Output__arr_float_uint_2 Output
+%out_var_PN_POSITION9 = OpVariable %_ptr_Output_v4float Output
+%float_0_333333343 = OpConstant %float 0.333333343
+ %119 = OpConstantComposite %v4float %float_0_333333343 %float_0_333333343 %float_0_333333343 %float_0_333333343
+ %120 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
+%float_0_166666672 = OpConstant %float 0.166666672
+ %122 = OpConstantComposite %v4float %float_0_166666672 %float_0_166666672 %float_0_166666672 %float_0_166666672
+ %123 = OpUndef %v4float
+
+; XXX: Original asm used Function here, which is wrong.
+; This patches the SPIR-V to be correct.
+%temp_var_hullMainRetVal = OpVariable %_ptr_Workgroup__arr_FPNTessellationHSToDS_uint_3 Workgroup
+
+ %MainHull = OpFunction %void None %98
+ %124 = OpLabel
+%param_var_I = OpVariable %_ptr_Function__arr_FHitProxyVSToDS_uint_12 Function
+ %125 = OpLoad %_arr_v4float_uint_12 %in_var_TEXCOORD10_centroid
+ %126 = OpLoad %_arr_v4float_uint_12 %in_var_TEXCOORD11_centroid
+ %127 = OpLoad %_arr_v4float_uint_12 %in_var_COLOR0
+ %128 = OpLoad %_arr__arr_v2float_uint_2_uint_12 %in_var_TEXCOORD0
+ %129 = OpCompositeExtract %v4float %125 0
+ %130 = OpCompositeExtract %v4float %126 0
+ %131 = OpCompositeExtract %v4float %127 0
+ %132 = OpCompositeExtract %_arr_v2float_uint_2 %128 0
+ %133 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %129 %130 %131 %132
+ %134 = OpCompositeExtract %v4float %125 1
+ %135 = OpCompositeExtract %v4float %126 1
+ %136 = OpCompositeExtract %v4float %127 1
+ %137 = OpCompositeExtract %_arr_v2float_uint_2 %128 1
+ %138 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %134 %135 %136 %137
+ %139 = OpCompositeExtract %v4float %125 2
+ %140 = OpCompositeExtract %v4float %126 2
+ %141 = OpCompositeExtract %v4float %127 2
+ %142 = OpCompositeExtract %_arr_v2float_uint_2 %128 2
+ %143 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %139 %140 %141 %142
+ %144 = OpCompositeExtract %v4float %125 3
+ %145 = OpCompositeExtract %v4float %126 3
+ %146 = OpCompositeExtract %v4float %127 3
+ %147 = OpCompositeExtract %_arr_v2float_uint_2 %128 3
+ %148 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %144 %145 %146 %147
+ %149 = OpCompositeExtract %v4float %125 4
+ %150 = OpCompositeExtract %v4float %126 4
+ %151 = OpCompositeExtract %v4float %127 4
+ %152 = OpCompositeExtract %_arr_v2float_uint_2 %128 4
+ %153 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %149 %150 %151 %152
+ %154 = OpCompositeExtract %v4float %125 5
+ %155 = OpCompositeExtract %v4float %126 5
+ %156 = OpCompositeExtract %v4float %127 5
+ %157 = OpCompositeExtract %_arr_v2float_uint_2 %128 5
+ %158 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %154 %155 %156 %157
+ %159 = OpCompositeExtract %v4float %125 6
+ %160 = OpCompositeExtract %v4float %126 6
+ %161 = OpCompositeExtract %v4float %127 6
+ %162 = OpCompositeExtract %_arr_v2float_uint_2 %128 6
+ %163 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %159 %160 %161 %162
+ %164 = OpCompositeExtract %v4float %125 7
+ %165 = OpCompositeExtract %v4float %126 7
+ %166 = OpCompositeExtract %v4float %127 7
+ %167 = OpCompositeExtract %_arr_v2float_uint_2 %128 7
+ %168 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %164 %165 %166 %167
+ %169 = OpCompositeExtract %v4float %125 8
+ %170 = OpCompositeExtract %v4float %126 8
+ %171 = OpCompositeExtract %v4float %127 8
+ %172 = OpCompositeExtract %_arr_v2float_uint_2 %128 8
+ %173 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %169 %170 %171 %172
+ %174 = OpCompositeExtract %v4float %125 9
+ %175 = OpCompositeExtract %v4float %126 9
+ %176 = OpCompositeExtract %v4float %127 9
+ %177 = OpCompositeExtract %_arr_v2float_uint_2 %128 9
+ %178 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %174 %175 %176 %177
+ %179 = OpCompositeExtract %v4float %125 10
+ %180 = OpCompositeExtract %v4float %126 10
+ %181 = OpCompositeExtract %v4float %127 10
+ %182 = OpCompositeExtract %_arr_v2float_uint_2 %128 10
+ %183 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %179 %180 %181 %182
+ %184 = OpCompositeExtract %v4float %125 11
+ %185 = OpCompositeExtract %v4float %126 11
+ %186 = OpCompositeExtract %v4float %127 11
+ %187 = OpCompositeExtract %_arr_v2float_uint_2 %128 11
+ %188 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %184 %185 %186 %187
+ %189 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %133
+ %190 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %138
+ %191 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %143
+ %192 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %148
+ %193 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %153
+ %194 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %158
+ %195 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %163
+ %196 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %168
+ %197 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %173
+ %198 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %178
+ %199 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %183
+ %200 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %188
+ %201 = OpLoad %_arr_v4float_uint_12 %in_var_VS_To_DS_Position
+ %202 = OpCompositeExtract %v4float %201 0
+ %203 = OpCompositeConstruct %FHitProxyVSToDS %189 %202
+ %204 = OpCompositeExtract %v4float %201 1
+ %205 = OpCompositeConstruct %FHitProxyVSToDS %190 %204
+ %206 = OpCompositeExtract %v4float %201 2
+ %207 = OpCompositeConstruct %FHitProxyVSToDS %191 %206
+ %208 = OpCompositeExtract %v4float %201 3
+ %209 = OpCompositeConstruct %FHitProxyVSToDS %192 %208
+ %210 = OpCompositeExtract %v4float %201 4
+ %211 = OpCompositeConstruct %FHitProxyVSToDS %193 %210
+ %212 = OpCompositeExtract %v4float %201 5
+ %213 = OpCompositeConstruct %FHitProxyVSToDS %194 %212
+ %214 = OpCompositeExtract %v4float %201 6
+ %215 = OpCompositeConstruct %FHitProxyVSToDS %195 %214
+ %216 = OpCompositeExtract %v4float %201 7
+ %217 = OpCompositeConstruct %FHitProxyVSToDS %196 %216
+ %218 = OpCompositeExtract %v4float %201 8
+ %219 = OpCompositeConstruct %FHitProxyVSToDS %197 %218
+ %220 = OpCompositeExtract %v4float %201 9
+ %221 = OpCompositeConstruct %FHitProxyVSToDS %198 %220
+ %222 = OpCompositeExtract %v4float %201 10
+ %223 = OpCompositeConstruct %FHitProxyVSToDS %199 %222
+ %224 = OpCompositeExtract %v4float %201 11
+ %225 = OpCompositeConstruct %FHitProxyVSToDS %200 %224
+ %226 = OpCompositeConstruct %_arr_FHitProxyVSToDS_uint_12 %203 %205 %207 %209 %211 %213 %215 %217 %219 %221 %223 %225
+ OpStore %param_var_I %226
+ %227 = OpLoad %uint %gl_InvocationID
+ %228 = OpAccessChain %_ptr_Function_FVertexFactoryInterpolantsVSToDS %param_var_I %227 %int_0
+ %229 = OpLoad %FVertexFactoryInterpolantsVSToDS %228
+ %230 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %229 0
+ %231 = OpCompositeExtract %v4float %230 0
+ %232 = OpCompositeExtract %v4float %230 1
+ %233 = OpVectorShuffle %v3float %231 %231 0 1 2
+ %234 = OpVectorShuffle %v3float %232 %232 0 1 2
+ %235 = OpExtInst %v3float %1 Cross %234 %233
+ %236 = OpCompositeExtract %float %232 3
+ %237 = OpCompositeConstruct %v3float %236 %236 %236
+ %238 = OpFMul %v3float %235 %237
+ %239 = OpCompositeConstruct %mat3v3float %233 %238 %234
+ %240 = OpCompositeExtract %float %232 0
+ %241 = OpCompositeExtract %float %232 1
+ %242 = OpCompositeExtract %float %232 2
+ %243 = OpCompositeConstruct %v4float %240 %241 %242 %float_0
+ %244 = OpAccessChain %_ptr_Uniform_v4float %Primitive %int_15
+ %245 = OpLoad %v4float %244
+ %246 = OpVectorShuffle %v3float %245 %245 0 1 2
+ %247 = OpVectorTimesMatrix %v3float %246 %239
+ %248 = OpULessThan %bool %227 %uint_2
+ %249 = OpIAdd %uint %227 %uint_1
+ %250 = OpSelect %uint %248 %249 %uint_0
+ %251 = OpIMul %uint %uint_2 %227
+ %252 = OpIAdd %uint %uint_3 %251
+ %253 = OpIAdd %uint %251 %uint_4
+ %254 = OpAccessChain %_ptr_Function_FHitProxyVSToDS %param_var_I %227
+ %255 = OpLoad %FHitProxyVSToDS %254
+ %256 = OpAccessChain %_ptr_Function_v4float %param_var_I %227 %int_1
+ %257 = OpLoad %v4float %256
+ %258 = OpAccessChain %_ptr_Function_FVertexFactoryInterpolantsVSToDS %param_var_I %250 %int_0
+ %259 = OpLoad %FVertexFactoryInterpolantsVSToDS %258
+ %260 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %259 0
+ %261 = OpCompositeExtract %v4float %260 1
+ %262 = OpCompositeExtract %float %261 0
+ %263 = OpCompositeExtract %float %261 1
+ %264 = OpCompositeExtract %float %261 2
+ %265 = OpCompositeConstruct %v4float %262 %263 %264 %float_0
+ %266 = OpAccessChain %_ptr_Function_FVertexFactoryInterpolantsVSToDS %param_var_I %252 %int_0
+ %267 = OpLoad %FVertexFactoryInterpolantsVSToDS %266
+ %268 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %267 0
+ %269 = OpCompositeExtract %v4float %268 1
+ %270 = OpCompositeExtract %float %269 0
+ %271 = OpCompositeExtract %float %269 1
+ %272 = OpCompositeExtract %float %269 2
+ %273 = OpCompositeConstruct %v4float %270 %271 %272 %float_0
+ %274 = OpAccessChain %_ptr_Function_FVertexFactoryInterpolantsVSToDS %param_var_I %253 %int_0
+ %275 = OpLoad %FVertexFactoryInterpolantsVSToDS %274
+ %276 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %275 0
+ %277 = OpCompositeExtract %v4float %276 1
+ %278 = OpCompositeExtract %float %277 0
+ %279 = OpCompositeExtract %float %277 1
+ %280 = OpCompositeExtract %float %277 2
+ %281 = OpCompositeConstruct %v4float %278 %279 %280 %float_0
+ %282 = OpLoad %v4float %256
+ %283 = OpAccessChain %_ptr_Function_v4float %param_var_I %250 %int_1
+ %284 = OpLoad %v4float %283
+ %285 = OpFMul %v4float %54 %282
+ %286 = OpFAdd %v4float %285 %284
+ %287 = OpFSub %v4float %284 %282
+ %288 = OpDot %float %287 %243
+ %289 = OpCompositeConstruct %v4float %288 %288 %288 %288
+ %290 = OpFMul %v4float %289 %243
+ %291 = OpFSub %v4float %286 %290
+ %292 = OpFMul %v4float %291 %119
+ %293 = OpAccessChain %_ptr_Function_v4float %param_var_I %252 %int_1
+ %294 = OpLoad %v4float %293
+ %295 = OpAccessChain %_ptr_Function_v4float %param_var_I %253 %int_1
+ %296 = OpLoad %v4float %295
+ %297 = OpFMul %v4float %54 %294
+ %298 = OpFAdd %v4float %297 %296
+ %299 = OpFSub %v4float %296 %294
+ %300 = OpDot %float %299 %273
+ %301 = OpCompositeConstruct %v4float %300 %300 %300 %300
+ %302 = OpFMul %v4float %301 %273
+ %303 = OpFSub %v4float %298 %302
+ %304 = OpFMul %v4float %303 %119
+ %305 = OpFAdd %v4float %292 %304
+ %306 = OpFMul %v4float %305 %120
+ %307 = OpLoad %v4float %283
+ %308 = OpLoad %v4float %256
+ %309 = OpFMul %v4float %54 %307
+ %310 = OpFAdd %v4float %309 %308
+ %311 = OpFSub %v4float %308 %307
+ %312 = OpDot %float %311 %265
+ %313 = OpCompositeConstruct %v4float %312 %312 %312 %312
+ %314 = OpFMul %v4float %313 %265
+ %315 = OpFSub %v4float %310 %314
+ %316 = OpFMul %v4float %315 %119
+ %317 = OpLoad %v4float %295
+ %318 = OpLoad %v4float %293
+ %319 = OpFMul %v4float %54 %317
+ %320 = OpFAdd %v4float %319 %318
+ %321 = OpFSub %v4float %318 %317
+ %322 = OpDot %float %321 %281
+ %323 = OpCompositeConstruct %v4float %322 %322 %322 %322
+ %324 = OpFMul %v4float %323 %281
+ %325 = OpFSub %v4float %320 %324
+ %326 = OpFMul %v4float %325 %119
+ %327 = OpFAdd %v4float %316 %326
+ %328 = OpFMul %v4float %327 %120
+ %329 = OpCompositeConstruct %_arr_v4float_uint_3 %257 %306 %328
+ %330 = OpCompositeConstruct %FPNTessellationHSToDS %255 %329 %247 %float_1 %float_1
+ %331 = OpCompositeExtract %FVertexFactoryInterpolantsVSToDS %255 0
+ %332 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %331 0
+ %333 = OpCompositeExtract %v4float %332 0
+ %334 = OpAccessChain %_ptr_Output_v4float %out_var_TEXCOORD10_centroid %227
+ OpStore %334 %333
+ %335 = OpCompositeExtract %v4float %332 1
+ %336 = OpAccessChain %_ptr_Output_v4float %out_var_TEXCOORD11_centroid %227
+ OpStore %336 %335
+ %337 = OpCompositeExtract %v4float %332 2
+ %338 = OpAccessChain %_ptr_Output_v4float %out_var_COLOR0 %227
+ OpStore %338 %337
+ %339 = OpCompositeExtract %_arr_v2float_uint_2 %332 3
+ %340 = OpAccessChain %_ptr_Output__arr_v2float_uint_2 %out_var_TEXCOORD0 %227
+ OpStore %340 %339
+ %341 = OpCompositeExtract %v4float %255 1
+ %342 = OpAccessChain %_ptr_Output_v4float %out_var_VS_To_DS_Position %227
+ OpStore %342 %341
+ %343 = OpAccessChain %_ptr_Output__arr_v4float_uint_3 %out_var_PN_POSITION %227
+ OpStore %343 %329
+ %344 = OpAccessChain %_ptr_Output_v3float %out_var_PN_DisplacementScales %227
+ OpStore %344 %247
+ %345 = OpAccessChain %_ptr_Output_float %out_var_PN_TessellationMultiplier %227
+ OpStore %345 %float_1
+ %346 = OpAccessChain %_ptr_Output_float %out_var_PN_WorldDisplacementMultiplier %227
+ OpStore %346 %float_1
+ %347 = OpAccessChain %_ptr_Workgroup_FPNTessellationHSToDS %temp_var_hullMainRetVal %227
+ OpStore %347 %330
+ OpControlBarrier %uint_2 %uint_4 %uint_0
+ %348 = OpIEqual %bool %227 %uint_0
+ OpSelectionMerge %if_merge None
+ OpBranchConditional %348 %349 %if_merge
+ %349 = OpLabel
+ %350 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_0
+ %351 = OpLoad %mat4v4float %350
+ %352 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_7
+ %353 = OpLoad %mat4v4float %352
+ %354 = OpAccessChain %_ptr_Uniform_v3float %View %int_28
+ %355 = OpLoad %v3float %354
+ %356 = OpAccessChain %_ptr_Uniform_float %View %int_78
+ %357 = OpLoad %float %356
+ %358 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_0 %int_1 %int_0
+ %359 = OpLoad %v4float %358
+ %360 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_0 %int_1 %int_1
+ %361 = OpLoad %v4float %360
+ %362 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_0 %int_1 %int_2
+ %363 = OpLoad %v4float %362
+ %364 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_1 %int_1 %int_0
+ %365 = OpLoad %v4float %364
+ %366 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_1 %int_1 %int_1
+ %367 = OpLoad %v4float %366
+ %368 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_1 %int_1 %int_2
+ %369 = OpLoad %v4float %368
+ %370 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_2 %int_1 %int_0
+ %371 = OpLoad %v4float %370
+ %372 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_2 %int_1 %int_1
+ %373 = OpLoad %v4float %372
+ %374 = OpAccessChain %_ptr_Workgroup_v4float %temp_var_hullMainRetVal %uint_2 %int_1 %int_2
+ %375 = OpLoad %v4float %374
+ %376 = OpFAdd %v4float %361 %363
+ %377 = OpFAdd %v4float %376 %367
+ %378 = OpFAdd %v4float %377 %369
+ %379 = OpFAdd %v4float %378 %373
+ %380 = OpFAdd %v4float %379 %375
+ %381 = OpFMul %v4float %380 %122
+ %382 = OpFAdd %v4float %371 %365
+ %383 = OpFAdd %v4float %382 %359
+ %384 = OpFMul %v4float %383 %119
+ %385 = OpFSub %v4float %381 %384
+ %386 = OpFMul %v4float %385 %120
+ %387 = OpFAdd %v4float %381 %386
+ %388 = OpAccessChain %_ptr_Workgroup_float %temp_var_hullMainRetVal %uint_1 %int_3
+ %389 = OpLoad %float %388
+ %390 = OpAccessChain %_ptr_Workgroup_float %temp_var_hullMainRetVal %uint_2 %int_3
+ %391 = OpLoad %float %390
+ %392 = OpFAdd %float %389 %391
+ %393 = OpFMul %float %float_0_5 %392
+ %394 = OpCompositeInsert %v4float %393 %123 0
+ %395 = OpLoad %float %390
+ %396 = OpAccessChain %_ptr_Workgroup_float %temp_var_hullMainRetVal %uint_0 %int_3
+ %397 = OpLoad %float %396
+ %398 = OpFAdd %float %395 %397
+ %399 = OpFMul %float %float_0_5 %398
+ %400 = OpCompositeInsert %v4float %399 %394 1
+ %401 = OpLoad %float %396
+ %402 = OpLoad %float %388
+ %403 = OpFAdd %float %401 %402
+ %404 = OpFMul %float %float_0_5 %403
+ %405 = OpCompositeInsert %v4float %404 %400 2
+ %406 = OpLoad %float %396
+ %407 = OpLoad %float %388
+ %408 = OpFAdd %float %406 %407
+ %409 = OpLoad %float %390
+ %410 = OpFAdd %float %408 %409
+ %411 = OpFMul %float %float_0_333000004 %410
+ %412 = OpCompositeInsert %v4float %411 %405 3
+ %413 = OpVectorShuffle %v3float %359 %359 0 1 2
+ %414 = OpVectorShuffle %v3float %365 %365 0 1 2
+ %415 = OpVectorShuffle %v3float %371 %371 0 1 2
+ OpBranch %416
+ %416 = OpLabel
+ OpLoopMerge %417 %418 None
+ OpBranch %419
+ %419 = OpLabel
+ %420 = OpMatrixTimesVector %v4float %353 %68
+ %421 = OpCompositeExtract %float %359 0
+ %422 = OpCompositeExtract %float %359 1
+ %423 = OpCompositeExtract %float %359 2
+ %424 = OpCompositeConstruct %v4float %421 %422 %423 %float_1
+ %425 = OpMatrixTimesVector %v4float %351 %424
+ %426 = OpVectorShuffle %v3float %425 %425 0 1 2
+ %427 = OpVectorShuffle %v3float %420 %420 0 1 2
+ %428 = OpFSub %v3float %426 %427
+ %429 = OpCompositeExtract %float %425 3
+ %430 = OpCompositeExtract %float %420 3
+ %431 = OpFAdd %float %429 %430
+ %432 = OpCompositeConstruct %v3float %431 %431 %431
+ %433 = OpFOrdLessThan %v3bool %428 %432
+ %434 = OpSelect %v3int %433 %74 %65
+ %435 = OpFAdd %v3float %426 %427
+ %436 = OpFNegate %float %429
+ %437 = OpFSub %float %436 %430
+ %438 = OpCompositeConstruct %v3float %437 %437 %437
+ %439 = OpFOrdGreaterThan %v3bool %435 %438
+ %440 = OpSelect %v3int %439 %74 %65
+ %441 = OpIMul %v3int %75 %440
+ %442 = OpIAdd %v3int %434 %441
+ %443 = OpCompositeExtract %float %365 0
+ %444 = OpCompositeExtract %float %365 1
+ %445 = OpCompositeExtract %float %365 2
+ %446 = OpCompositeConstruct %v4float %443 %444 %445 %float_1
+ %447 = OpMatrixTimesVector %v4float %351 %446
+ %448 = OpVectorShuffle %v3float %447 %447 0 1 2
+ %449 = OpFSub %v3float %448 %427
+ %450 = OpCompositeExtract %float %447 3
+ %451 = OpFAdd %float %450 %430
+ %452 = OpCompositeConstruct %v3float %451 %451 %451
+ %453 = OpFOrdLessThan %v3bool %449 %452
+ %454 = OpSelect %v3int %453 %74 %65
+ %455 = OpFAdd %v3float %448 %427
+ %456 = OpFNegate %float %450
+ %457 = OpFSub %float %456 %430
+ %458 = OpCompositeConstruct %v3float %457 %457 %457
+ %459 = OpFOrdGreaterThan %v3bool %455 %458
+ %460 = OpSelect %v3int %459 %74 %65
+ %461 = OpIMul %v3int %75 %460
+ %462 = OpIAdd %v3int %454 %461
+ %463 = OpBitwiseOr %v3int %442 %462
+ %464 = OpCompositeExtract %float %371 0
+ %465 = OpCompositeExtract %float %371 1
+ %466 = OpCompositeExtract %float %371 2
+ %467 = OpCompositeConstruct %v4float %464 %465 %466 %float_1
+ %468 = OpMatrixTimesVector %v4float %351 %467
+ %469 = OpVectorShuffle %v3float %468 %468 0 1 2
+ %470 = OpFSub %v3float %469 %427
+ %471 = OpCompositeExtract %float %468 3
+ %472 = OpFAdd %float %471 %430
+ %473 = OpCompositeConstruct %v3float %472 %472 %472
+ %474 = OpFOrdLessThan %v3bool %470 %473
+ %475 = OpSelect %v3int %474 %74 %65
+ %476 = OpFAdd %v3float %469 %427
+ %477 = OpFNegate %float %471
+ %478 = OpFSub %float %477 %430
+ %479 = OpCompositeConstruct %v3float %478 %478 %478
+ %480 = OpFOrdGreaterThan %v3bool %476 %479
+ %481 = OpSelect %v3int %480 %74 %65
+ %482 = OpIMul %v3int %75 %481
+ %483 = OpIAdd %v3int %475 %482
+ %484 = OpBitwiseOr %v3int %463 %483
+ %485 = OpINotEqual %v3bool %484 %66
+ %486 = OpAny %bool %485
+ OpSelectionMerge %487 None
+ OpBranchConditional %486 %488 %487
+ %488 = OpLabel
+ OpBranch %417
+ %487 = OpLabel
+ %489 = OpFSub %v3float %413 %414
+ %490 = OpFSub %v3float %414 %415
+ %491 = OpFSub %v3float %415 %413
+ %492 = OpFAdd %v3float %413 %414
+ %493 = OpFMul %v3float %69 %492
+ %494 = OpFSub %v3float %493 %355
+ %495 = OpFAdd %v3float %414 %415
+ %496 = OpFMul %v3float %69 %495
+ %497 = OpFSub %v3float %496 %355
+ %498 = OpFAdd %v3float %415 %413
+ %499 = OpFMul %v3float %69 %498
+ %500 = OpFSub %v3float %499 %355
+ %501 = OpDot %float %490 %490
+ %502 = OpDot %float %497 %497
+ %503 = OpFDiv %float %501 %502
+ %504 = OpExtInst %float %1 Sqrt %503
+ %505 = OpDot %float %491 %491
+ %506 = OpDot %float %500 %500
+ %507 = OpFDiv %float %505 %506
+ %508 = OpExtInst %float %1 Sqrt %507
+ %509 = OpDot %float %489 %489
+ %510 = OpDot %float %494 %494
+ %511 = OpFDiv %float %509 %510
+ %512 = OpExtInst %float %1 Sqrt %511
+ %513 = OpCompositeConstruct %v4float %504 %508 %512 %float_1
+ %514 = OpFAdd %float %504 %508
+ %515 = OpFAdd %float %514 %512
+ %516 = OpFMul %float %float_0_333000004 %515
+ %517 = OpCompositeInsert %v4float %516 %513 3
+ %518 = OpCompositeConstruct %v4float %357 %357 %357 %357
+ %519 = OpFMul %v4float %518 %517
+ OpBranch %417
+ %418 = OpLabel
+ OpBranch %416
+ %417 = OpLabel
+ %520 = OpPhi %v4float %68 %488 %519 %487
+ %521 = OpFMul %v4float %412 %520
+ %522 = OpExtInst %v4float %1 FClamp %521 %59 %61
+ %523 = OpCompositeExtract %float %522 0
+ %524 = OpCompositeExtract %float %522 1
+ %525 = OpCompositeExtract %float %522 2
+ %526 = OpCompositeExtract %float %522 3
+ %527 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %uint_0
+ OpStore %527 %523
+ %528 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %uint_1
+ OpStore %528 %524
+ %529 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %uint_2
+ OpStore %529 %525
+ %530 = OpAccessChain %_ptr_Output_float %gl_TessLevelInner %uint_0
+ OpStore %530 %526
+ OpStore %out_var_PN_POSITION9 %387
+ OpBranch %if_merge
+ %if_merge = OpLabel
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.asm.tesc b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.asm.tesc
new file mode 100644
index 00000000000..98216e79243
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.asm.tesc
@@ -0,0 +1,352 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 179
+; Schema: 0
+ OpCapability Tessellation
+ OpCapability SampledBuffer
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint TessellationControl %MainHull "main" %in_var_TEXCOORD10_centroid %in_var_TEXCOORD11_centroid %in_var_VS_To_DS_Position %gl_InvocationID %out_var_TEXCOORD10_centroid %out_var_TEXCOORD11_centroid %out_var_VS_To_DS_Position %out_var_Flat_DisplacementScales %out_var_Flat_TessellationMultiplier %out_var_Flat_WorldDisplacementMultiplier %gl_TessLevelOuter %gl_TessLevelInner
+ OpExecutionMode %MainHull Triangles
+ OpExecutionMode %MainHull SpacingFractionalOdd
+ OpExecutionMode %MainHull VertexOrderCw
+ OpExecutionMode %MainHull OutputVertices 3
+ OpSource HLSL 600
+ OpName %FFlatTessellationHSToDS "FFlatTessellationHSToDS"
+ OpMemberName %FFlatTessellationHSToDS 0 "PassSpecificData"
+ OpMemberName %FFlatTessellationHSToDS 1 "DisplacementScale"
+ OpMemberName %FFlatTessellationHSToDS 2 "TessellationMultiplier"
+ OpMemberName %FFlatTessellationHSToDS 3 "WorldDisplacementMultiplier"
+ OpName %FBasePassVSToDS "FBasePassVSToDS"
+ OpMemberName %FBasePassVSToDS 0 "FactoryInterpolants"
+ OpMemberName %FBasePassVSToDS 1 "BasePassInterpolants"
+ OpMemberName %FBasePassVSToDS 2 "Position"
+ OpName %FVertexFactoryInterpolantsVSToDS "FVertexFactoryInterpolantsVSToDS"
+ OpMemberName %FVertexFactoryInterpolantsVSToDS 0 "InterpolantsVSToPS"
+ OpName %FVertexFactoryInterpolantsVSToPS "FVertexFactoryInterpolantsVSToPS"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 0 "TangentToWorld0"
+ OpMemberName %FVertexFactoryInterpolantsVSToPS 1 "TangentToWorld2"
+ OpName %FBasePassInterpolantsVSToDS "FBasePassInterpolantsVSToDS"
+ OpName %FSharedBasePassInterpolants "FSharedBasePassInterpolants"
+ OpName %type_Primitive "type.Primitive"
+ OpMemberName %type_Primitive 0 "Primitive_LocalToWorld"
+ OpMemberName %type_Primitive 1 "Primitive_InvNonUniformScaleAndDeterminantSign"
+ OpMemberName %type_Primitive 2 "Primitive_ObjectWorldPositionAndRadius"
+ OpMemberName %type_Primitive 3 "Primitive_WorldToLocal"
+ OpMemberName %type_Primitive 4 "Primitive_PreviousLocalToWorld"
+ OpMemberName %type_Primitive 5 "Primitive_PreviousWorldToLocal"
+ OpMemberName %type_Primitive 6 "Primitive_ActorWorldPosition"
+ OpMemberName %type_Primitive 7 "Primitive_UseSingleSampleShadowFromStationaryLights"
+ OpMemberName %type_Primitive 8 "Primitive_ObjectBounds"
+ OpMemberName %type_Primitive 9 "Primitive_LpvBiasMultiplier"
+ OpMemberName %type_Primitive 10 "Primitive_DecalReceiverMask"
+ OpMemberName %type_Primitive 11 "Primitive_PerObjectGBufferData"
+ OpMemberName %type_Primitive 12 "Primitive_UseVolumetricLightmapShadowFromStationaryLights"
+ OpMemberName %type_Primitive 13 "Primitive_DrawsVelocity"
+ OpMemberName %type_Primitive 14 "Primitive_ObjectOrientation"
+ OpMemberName %type_Primitive 15 "Primitive_NonUniformScale"
+ OpMemberName %type_Primitive 16 "Primitive_LocalObjectBoundsMin"
+ OpMemberName %type_Primitive 17 "Primitive_LightingChannelMask"
+ OpMemberName %type_Primitive 18 "Primitive_LocalObjectBoundsMax"
+ OpMemberName %type_Primitive 19 "Primitive_LightmapDataIndex"
+ OpMemberName %type_Primitive 20 "Primitive_PreSkinnedLocalBounds"
+ OpMemberName %type_Primitive 21 "Primitive_SingleCaptureIndex"
+ OpMemberName %type_Primitive 22 "Primitive_OutputVelocity"
+ OpMemberName %type_Primitive 23 "PrePadding_Primitive_420"
+ OpMemberName %type_Primitive 24 "PrePadding_Primitive_424"
+ OpMemberName %type_Primitive 25 "PrePadding_Primitive_428"
+ OpMemberName %type_Primitive 26 "Primitive_CustomPrimitiveData"
+ OpName %Primitive "Primitive"
+ OpName %type_Material "type.Material"
+ OpMemberName %type_Material 0 "Material_VectorExpressions"
+ OpMemberName %type_Material 1 "Material_ScalarExpressions"
+ OpName %Material "Material"
+ OpName %in_var_TEXCOORD10_centroid "in.var.TEXCOORD10_centroid"
+ OpName %in_var_TEXCOORD11_centroid "in.var.TEXCOORD11_centroid"
+ OpName %in_var_VS_To_DS_Position "in.var.VS_To_DS_Position"
+ OpName %out_var_TEXCOORD10_centroid "out.var.TEXCOORD10_centroid"
+ OpName %out_var_TEXCOORD11_centroid "out.var.TEXCOORD11_centroid"
+ OpName %out_var_VS_To_DS_Position "out.var.VS_To_DS_Position"
+ OpName %out_var_Flat_DisplacementScales "out.var.Flat_DisplacementScales"
+ OpName %out_var_Flat_TessellationMultiplier "out.var.Flat_TessellationMultiplier"
+ OpName %out_var_Flat_WorldDisplacementMultiplier "out.var.Flat_WorldDisplacementMultiplier"
+ OpName %MainHull "MainHull"
+ OpName %param_var_I "param.var.I"
+ OpName %temp_var_hullMainRetVal "temp.var.hullMainRetVal"
+ OpName %if_merge "if.merge"
+ OpDecorateString %in_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %in_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %in_var_VS_To_DS_Position UserSemantic "VS_To_DS_Position"
+ OpDecorate %gl_InvocationID BuiltIn InvocationId
+ OpDecorateString %gl_InvocationID UserSemantic "SV_OutputControlPointID"
+ OpDecorateString %out_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %out_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %out_var_VS_To_DS_Position UserSemantic "VS_To_DS_Position"
+ OpDecorateString %out_var_Flat_DisplacementScales UserSemantic "Flat_DisplacementScales"
+ OpDecorateString %out_var_Flat_TessellationMultiplier UserSemantic "Flat_TessellationMultiplier"
+ OpDecorateString %out_var_Flat_WorldDisplacementMultiplier UserSemantic "Flat_WorldDisplacementMultiplier"
+ OpDecorate %gl_TessLevelOuter BuiltIn TessLevelOuter
+ OpDecorateString %gl_TessLevelOuter UserSemantic "SV_TessFactor"
+ OpDecorate %gl_TessLevelOuter Patch
+ OpDecorate %gl_TessLevelInner BuiltIn TessLevelInner
+ OpDecorateString %gl_TessLevelInner UserSemantic "SV_InsideTessFactor"
+ OpDecorate %gl_TessLevelInner Patch
+ OpDecorate %in_var_TEXCOORD10_centroid Location 0
+ OpDecorate %in_var_TEXCOORD11_centroid Location 1
+ OpDecorate %in_var_VS_To_DS_Position Location 2
+ OpDecorate %out_var_Flat_DisplacementScales Location 0
+ OpDecorate %out_var_Flat_TessellationMultiplier Location 1
+ OpDecorate %out_var_Flat_WorldDisplacementMultiplier Location 2
+ OpDecorate %out_var_TEXCOORD10_centroid Location 3
+ OpDecorate %out_var_TEXCOORD11_centroid Location 4
+ OpDecorate %out_var_VS_To_DS_Position Location 5
+ OpDecorate %Primitive DescriptorSet 0
+ OpDecorate %Primitive Binding 0
+ OpDecorate %Material DescriptorSet 0
+ OpDecorate %Material Binding 1
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpMemberDecorate %type_Primitive 0 Offset 0
+ OpMemberDecorate %type_Primitive 0 MatrixStride 16
+ OpMemberDecorate %type_Primitive 0 ColMajor
+ OpMemberDecorate %type_Primitive 1 Offset 64
+ OpMemberDecorate %type_Primitive 2 Offset 80
+ OpMemberDecorate %type_Primitive 3 Offset 96
+ OpMemberDecorate %type_Primitive 3 MatrixStride 16
+ OpMemberDecorate %type_Primitive 3 ColMajor
+ OpMemberDecorate %type_Primitive 4 Offset 160
+ OpMemberDecorate %type_Primitive 4 MatrixStride 16
+ OpMemberDecorate %type_Primitive 4 ColMajor
+ OpMemberDecorate %type_Primitive 5 Offset 224
+ OpMemberDecorate %type_Primitive 5 MatrixStride 16
+ OpMemberDecorate %type_Primitive 5 ColMajor
+ OpMemberDecorate %type_Primitive 6 Offset 288
+ OpMemberDecorate %type_Primitive 7 Offset 300
+ OpMemberDecorate %type_Primitive 8 Offset 304
+ OpMemberDecorate %type_Primitive 9 Offset 316
+ OpMemberDecorate %type_Primitive 10 Offset 320
+ OpMemberDecorate %type_Primitive 11 Offset 324
+ OpMemberDecorate %type_Primitive 12 Offset 328
+ OpMemberDecorate %type_Primitive 13 Offset 332
+ OpMemberDecorate %type_Primitive 14 Offset 336
+ OpMemberDecorate %type_Primitive 15 Offset 352
+ OpMemberDecorate %type_Primitive 16 Offset 368
+ OpMemberDecorate %type_Primitive 17 Offset 380
+ OpMemberDecorate %type_Primitive 18 Offset 384
+ OpMemberDecorate %type_Primitive 19 Offset 396
+ OpMemberDecorate %type_Primitive 20 Offset 400
+ OpMemberDecorate %type_Primitive 21 Offset 412
+ OpMemberDecorate %type_Primitive 22 Offset 416
+ OpMemberDecorate %type_Primitive 23 Offset 420
+ OpMemberDecorate %type_Primitive 24 Offset 424
+ OpMemberDecorate %type_Primitive 25 Offset 428
+ OpMemberDecorate %type_Primitive 26 Offset 432
+ OpDecorate %type_Primitive Block
+ OpDecorate %_arr_v4float_uint_3 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_1 ArrayStride 16
+ OpMemberDecorate %type_Material 0 Offset 0
+ OpMemberDecorate %type_Material 1 Offset 48
+ OpDecorate %type_Material Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_4 = OpConstant %uint 4
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %uint_3 = OpConstant %uint 3
+%_arr_float_uint_3 = OpTypeArray %float %uint_3
+ %int_0 = OpConstant %int 0
+ %int_2 = OpConstant %int 2
+ %float_0_5 = OpConstant %float 0.5
+ %int_1 = OpConstant %int 1
+%float_0_333000004 = OpConstant %float 0.333000004
+ %float_1 = OpConstant %float 1
+ %49 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %float_15 = OpConstant %float 15
+ %51 = OpConstantComposite %v4float %float_15 %float_15 %float_15 %float_15
+%FVertexFactoryInterpolantsVSToPS = OpTypeStruct %v4float %v4float
+%FVertexFactoryInterpolantsVSToDS = OpTypeStruct %FVertexFactoryInterpolantsVSToPS
+%FSharedBasePassInterpolants = OpTypeStruct
+%FBasePassInterpolantsVSToDS = OpTypeStruct %FSharedBasePassInterpolants
+%FBasePassVSToDS = OpTypeStruct %FVertexFactoryInterpolantsVSToDS %FBasePassInterpolantsVSToDS %v4float
+%FFlatTessellationHSToDS = OpTypeStruct %FBasePassVSToDS %v3float %float %float
+ %int_15 = OpConstant %int 15
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+%type_Primitive = OpTypeStruct %mat4v4float %v4float %v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %float %float %float %float %v4float %v4float %v3float %uint %v3float %uint %v3float %int %uint %uint %uint %uint %_arr_v4float_uint_4
+%_ptr_Uniform_type_Primitive = OpTypePointer Uniform %type_Primitive
+%_arr_v4float_uint_3 = OpTypeArray %v4float %uint_3
+%_arr_v4float_uint_1 = OpTypeArray %v4float %uint_1
+%type_Material = OpTypeStruct %_arr_v4float_uint_3 %_arr_v4float_uint_1
+%_ptr_Uniform_type_Material = OpTypePointer Uniform %type_Material
+%_arr_v4float_uint_3_0 = OpTypeArray %v4float %uint_3
+%_ptr_Input__arr_v4float_uint_3_0 = OpTypePointer Input %_arr_v4float_uint_3_0
+%_ptr_Input_uint = OpTypePointer Input %uint
+%_ptr_Output__arr_v4float_uint_3_0 = OpTypePointer Output %_arr_v4float_uint_3_0
+%_arr_v3float_uint_3 = OpTypeArray %v3float %uint_3
+%_ptr_Output__arr_v3float_uint_3 = OpTypePointer Output %_arr_v3float_uint_3
+%_ptr_Output__arr_float_uint_3 = OpTypePointer Output %_arr_float_uint_3
+%_arr_float_uint_4 = OpTypeArray %float %uint_4
+%_ptr_Output__arr_float_uint_4 = OpTypePointer Output %_arr_float_uint_4
+%_arr_float_uint_2 = OpTypeArray %float %uint_2
+%_ptr_Output__arr_float_uint_2 = OpTypePointer Output %_arr_float_uint_2
+ %void = OpTypeVoid
+ %67 = OpTypeFunction %void
+%_arr_FBasePassVSToDS_uint_3 = OpTypeArray %FBasePassVSToDS %uint_3
+%_ptr_Function__arr_FBasePassVSToDS_uint_3 = OpTypePointer Function %_arr_FBasePassVSToDS_uint_3
+%_arr_FFlatTessellationHSToDS_uint_3 = OpTypeArray %FFlatTessellationHSToDS %uint_3
+%_ptr_Function__arr_FFlatTessellationHSToDS_uint_3 = OpTypePointer Function %_arr_FFlatTessellationHSToDS_uint_3
+%_ptr_Workgroup__arr_FFlatTessellationHSToDS_uint_3 = OpTypePointer Workgroup %_arr_FFlatTessellationHSToDS_uint_3
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%_ptr_Output_v3float = OpTypePointer Output %v3float
+%_ptr_Output_float = OpTypePointer Output %float
+%_ptr_Function_FFlatTessellationHSToDS = OpTypePointer Function %FFlatTessellationHSToDS
+%_ptr_Workgroup_FFlatTessellationHSToDS = OpTypePointer Workgroup %FFlatTessellationHSToDS
+ %bool = OpTypeBool
+%_ptr_Function_float = OpTypePointer Function %float
+%_ptr_Workgroup_float = OpTypePointer Workgroup %float
+%mat3v3float = OpTypeMatrix %v3float 3
+%_ptr_Function_FVertexFactoryInterpolantsVSToDS = OpTypePointer Function %FVertexFactoryInterpolantsVSToDS
+%_ptr_Function_FBasePassVSToDS = OpTypePointer Function %FBasePassVSToDS
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+ %Primitive = OpVariable %_ptr_Uniform_type_Primitive Uniform
+ %Material = OpVariable %_ptr_Uniform_type_Material Uniform
+%in_var_TEXCOORD10_centroid = OpVariable %_ptr_Input__arr_v4float_uint_3_0 Input
+%in_var_TEXCOORD11_centroid = OpVariable %_ptr_Input__arr_v4float_uint_3_0 Input
+%in_var_VS_To_DS_Position = OpVariable %_ptr_Input__arr_v4float_uint_3_0 Input
+%gl_InvocationID = OpVariable %_ptr_Input_uint Input
+%out_var_TEXCOORD10_centroid = OpVariable %_ptr_Output__arr_v4float_uint_3_0 Output
+%out_var_TEXCOORD11_centroid = OpVariable %_ptr_Output__arr_v4float_uint_3_0 Output
+%out_var_VS_To_DS_Position = OpVariable %_ptr_Output__arr_v4float_uint_3_0 Output
+%out_var_Flat_DisplacementScales = OpVariable %_ptr_Output__arr_v3float_uint_3 Output
+%out_var_Flat_TessellationMultiplier = OpVariable %_ptr_Output__arr_float_uint_3 Output
+%out_var_Flat_WorldDisplacementMultiplier = OpVariable %_ptr_Output__arr_float_uint_3 Output
+%gl_TessLevelOuter = OpVariable %_ptr_Output__arr_float_uint_4 Output
+%gl_TessLevelInner = OpVariable %_ptr_Output__arr_float_uint_2 Output
+ %83 = OpConstantNull %FSharedBasePassInterpolants
+ %84 = OpConstantComposite %FBasePassInterpolantsVSToDS %83
+ %85 = OpUndef %v4float
+
+; XXX: Original asm used Function here, which is wrong.
+; This patches the SPIR-V to be correct.
+%temp_var_hullMainRetVal = OpVariable %_ptr_Workgroup__arr_FFlatTessellationHSToDS_uint_3 Workgroup
+
+ %MainHull = OpFunction %void None %67
+ %86 = OpLabel
+%param_var_I = OpVariable %_ptr_Function__arr_FBasePassVSToDS_uint_3 Function
+ %87 = OpLoad %_arr_v4float_uint_3_0 %in_var_TEXCOORD10_centroid
+ %88 = OpLoad %_arr_v4float_uint_3_0 %in_var_TEXCOORD11_centroid
+ %89 = OpCompositeExtract %v4float %87 0
+ %90 = OpCompositeExtract %v4float %88 0
+ %91 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %89 %90
+ %92 = OpCompositeExtract %v4float %87 1
+ %93 = OpCompositeExtract %v4float %88 1
+ %94 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %92 %93
+ %95 = OpCompositeExtract %v4float %87 2
+ %96 = OpCompositeExtract %v4float %88 2
+ %97 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToPS %95 %96
+ %98 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %91
+ %99 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %94
+ %100 = OpCompositeConstruct %FVertexFactoryInterpolantsVSToDS %97
+ %101 = OpLoad %_arr_v4float_uint_3_0 %in_var_VS_To_DS_Position
+ %102 = OpCompositeExtract %v4float %101 0
+ %103 = OpCompositeConstruct %FBasePassVSToDS %98 %84 %102
+ %104 = OpCompositeExtract %v4float %101 1
+ %105 = OpCompositeConstruct %FBasePassVSToDS %99 %84 %104
+ %106 = OpCompositeExtract %v4float %101 2
+ %107 = OpCompositeConstruct %FBasePassVSToDS %100 %84 %106
+ %108 = OpCompositeConstruct %_arr_FBasePassVSToDS_uint_3 %103 %105 %107
+ OpStore %param_var_I %108
+ %109 = OpLoad %uint %gl_InvocationID
+ %110 = OpAccessChain %_ptr_Function_FVertexFactoryInterpolantsVSToDS %param_var_I %109 %int_0
+ %111 = OpLoad %FVertexFactoryInterpolantsVSToDS %110
+ %112 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %111 0
+ %113 = OpCompositeExtract %v4float %112 0
+ %114 = OpCompositeExtract %v4float %112 1
+ %115 = OpVectorShuffle %v3float %113 %113 0 1 2
+ %116 = OpVectorShuffle %v3float %114 %114 0 1 2
+ %117 = OpExtInst %v3float %1 Cross %116 %115
+ %118 = OpCompositeExtract %float %114 3
+ %119 = OpCompositeConstruct %v3float %118 %118 %118
+ %120 = OpFMul %v3float %117 %119
+ %121 = OpCompositeConstruct %mat3v3float %115 %120 %116
+ %122 = OpAccessChain %_ptr_Uniform_v4float %Primitive %int_15
+ %123 = OpLoad %v4float %122
+ %124 = OpVectorShuffle %v3float %123 %123 0 1 2
+ %125 = OpVectorTimesMatrix %v3float %124 %121
+ %126 = OpAccessChain %_ptr_Function_FBasePassVSToDS %param_var_I %109
+ %127 = OpLoad %FBasePassVSToDS %126
+ %128 = OpAccessChain %_ptr_Uniform_float %Material %int_1 %int_0 %int_0
+ %129 = OpLoad %float %128
+ %130 = OpCompositeConstruct %FFlatTessellationHSToDS %127 %125 %129 %float_1
+ %131 = OpCompositeExtract %FVertexFactoryInterpolantsVSToDS %127 0
+ %132 = OpCompositeExtract %FVertexFactoryInterpolantsVSToPS %131 0
+ %133 = OpCompositeExtract %v4float %132 0
+ %134 = OpAccessChain %_ptr_Output_v4float %out_var_TEXCOORD10_centroid %109
+ OpStore %134 %133
+ %135 = OpCompositeExtract %v4float %132 1
+ %136 = OpAccessChain %_ptr_Output_v4float %out_var_TEXCOORD11_centroid %109
+ OpStore %136 %135
+ %137 = OpCompositeExtract %v4float %127 2
+ %138 = OpAccessChain %_ptr_Output_v4float %out_var_VS_To_DS_Position %109
+ OpStore %138 %137
+ %139 = OpAccessChain %_ptr_Output_v3float %out_var_Flat_DisplacementScales %109
+ OpStore %139 %125
+ %140 = OpAccessChain %_ptr_Output_float %out_var_Flat_TessellationMultiplier %109
+ OpStore %140 %129
+ %141 = OpAccessChain %_ptr_Output_float %out_var_Flat_WorldDisplacementMultiplier %109
+ OpStore %141 %float_1
+ %142 = OpAccessChain %_ptr_Workgroup_FFlatTessellationHSToDS %temp_var_hullMainRetVal %109
+ OpStore %142 %130
+ OpControlBarrier %uint_2 %uint_4 %uint_0
+ %143 = OpIEqual %bool %109 %uint_0
+ OpSelectionMerge %if_merge None
+ OpBranchConditional %143 %144 %if_merge
+ %144 = OpLabel
+ %145 = OpAccessChain %_ptr_Workgroup_float %temp_var_hullMainRetVal %uint_1 %int_2
+ %146 = OpLoad %float %145
+ %147 = OpAccessChain %_ptr_Workgroup_float %temp_var_hullMainRetVal %uint_2 %int_2
+ %148 = OpLoad %float %147
+ %149 = OpFAdd %float %146 %148
+ %150 = OpFMul %float %float_0_5 %149
+ %151 = OpCompositeInsert %v4float %150 %85 0
+ %152 = OpLoad %float %147
+ %153 = OpAccessChain %_ptr_Workgroup_float %temp_var_hullMainRetVal %uint_0 %int_2
+ %154 = OpLoad %float %153
+ %155 = OpFAdd %float %152 %154
+ %156 = OpFMul %float %float_0_5 %155
+ %157 = OpCompositeInsert %v4float %156 %151 1
+ %158 = OpLoad %float %153
+ %159 = OpLoad %float %145
+ %160 = OpFAdd %float %158 %159
+ %161 = OpFMul %float %float_0_5 %160
+ %162 = OpCompositeInsert %v4float %161 %157 2
+ %163 = OpLoad %float %153
+ %164 = OpLoad %float %145
+ %165 = OpFAdd %float %163 %164
+ %166 = OpLoad %float %147
+ %167 = OpFAdd %float %165 %166
+ %168 = OpFMul %float %float_0_333000004 %167
+ %169 = OpCompositeInsert %v4float %168 %162 3
+ %170 = OpExtInst %v4float %1 FClamp %169 %49 %51
+ %171 = OpCompositeExtract %float %170 0
+ %172 = OpCompositeExtract %float %170 1
+ %173 = OpCompositeExtract %float %170 2
+ %174 = OpCompositeExtract %float %170 3
+ %175 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %uint_0
+ OpStore %175 %171
+ %176 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %uint_1
+ OpStore %176 %172
+ %177 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %uint_2
+ OpStore %177 %173
+ %178 = OpAccessChain %_ptr_Output_float %gl_TessLevelInner %uint_0
+ OpStore %178 %174
+ OpBranch %if_merge
+ %if_merge = OpLabel
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese
new file mode 100644
index 00000000000..dc543d1f861
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese
@@ -0,0 +1,1046 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 310
+; Schema: 0
+ OpCapability Tessellation
+ OpCapability SampledBuffer
+ OpCapability StorageImageExtendedFormats
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint TessellationEvaluation %MainDomain "main" %in_var_TEXCOORD10_centroid %in_var_TEXCOORD11_centroid %in_var_COLOR0 %in_var_TEXCOORD0 %in_var_PRIMITIVE_ID %in_var_VS_to_DS_Position %in_var_PN_POSITION %in_var_PN_DisplacementScales %in_var_PN_TessellationMultiplier %in_var_PN_WorldDisplacementMultiplier %gl_TessLevelOuter %gl_TessLevelInner %in_var_PN_POSITION9 %gl_TessCoord %out_var_TEXCOORD10_centroid %out_var_TEXCOORD11_centroid %out_var_COLOR0 %out_var_TEXCOORD0 %out_var_PRIMITIVE_ID %out_var_TEXCOORD6 %out_var_TEXCOORD8 %out_var_TEXCOORD7 %gl_Position
+ OpExecutionMode %MainDomain Triangles
+ OpSource HLSL 600
+ OpName %type_View "type.View"
+ OpMemberName %type_View 0 "View_TranslatedWorldToClip"
+ OpMemberName %type_View 1 "View_WorldToClip"
+ OpMemberName %type_View 2 "View_ClipToWorld"
+ OpMemberName %type_View 3 "View_TranslatedWorldToView"
+ OpMemberName %type_View 4 "View_ViewToTranslatedWorld"
+ OpMemberName %type_View 5 "View_TranslatedWorldToCameraView"
+ OpMemberName %type_View 6 "View_CameraViewToTranslatedWorld"
+ OpMemberName %type_View 7 "View_ViewToClip"
+ OpMemberName %type_View 8 "View_ViewToClipNoAA"
+ OpMemberName %type_View 9 "View_ClipToView"
+ OpMemberName %type_View 10 "View_ClipToTranslatedWorld"
+ OpMemberName %type_View 11 "View_SVPositionToTranslatedWorld"
+ OpMemberName %type_View 12 "View_ScreenToWorld"
+ OpMemberName %type_View 13 "View_ScreenToTranslatedWorld"
+ OpMemberName %type_View 14 "View_ViewForward"
+ OpMemberName %type_View 15 "PrePadding_View_908"
+ OpMemberName %type_View 16 "View_ViewUp"
+ OpMemberName %type_View 17 "PrePadding_View_924"
+ OpMemberName %type_View 18 "View_ViewRight"
+ OpMemberName %type_View 19 "PrePadding_View_940"
+ OpMemberName %type_View 20 "View_HMDViewNoRollUp"
+ OpMemberName %type_View 21 "PrePadding_View_956"
+ OpMemberName %type_View 22 "View_HMDViewNoRollRight"
+ OpMemberName %type_View 23 "PrePadding_View_972"
+ OpMemberName %type_View 24 "View_InvDeviceZToWorldZTransform"
+ OpMemberName %type_View 25 "View_ScreenPositionScaleBias"
+ OpMemberName %type_View 26 "View_WorldCameraOrigin"
+ OpMemberName %type_View 27 "PrePadding_View_1020"
+ OpMemberName %type_View 28 "View_TranslatedWorldCameraOrigin"
+ OpMemberName %type_View 29 "PrePadding_View_1036"
+ OpMemberName %type_View 30 "View_WorldViewOrigin"
+ OpMemberName %type_View 31 "PrePadding_View_1052"
+ OpMemberName %type_View 32 "View_PreViewTranslation"
+ OpMemberName %type_View 33 "PrePadding_View_1068"
+ OpMemberName %type_View 34 "View_PrevProjection"
+ OpMemberName %type_View 35 "View_PrevViewProj"
+ OpMemberName %type_View 36 "View_PrevViewRotationProj"
+ OpMemberName %type_View 37 "View_PrevViewToClip"
+ OpMemberName %type_View 38 "View_PrevClipToView"
+ OpMemberName %type_View 39 "View_PrevTranslatedWorldToClip"
+ OpMemberName %type_View 40 "View_PrevTranslatedWorldToView"
+ OpMemberName %type_View 41 "View_PrevViewToTranslatedWorld"
+ OpMemberName %type_View 42 "View_PrevTranslatedWorldToCameraView"
+ OpMemberName %type_View 43 "View_PrevCameraViewToTranslatedWorld"
+ OpMemberName %type_View 44 "View_PrevWorldCameraOrigin"
+ OpMemberName %type_View 45 "PrePadding_View_1724"
+ OpMemberName %type_View 46 "View_PrevWorldViewOrigin"
+ OpMemberName %type_View 47 "PrePadding_View_1740"
+ OpMemberName %type_View 48 "View_PrevPreViewTranslation"
+ OpMemberName %type_View 49 "PrePadding_View_1756"
+ OpMemberName %type_View 50 "View_PrevInvViewProj"
+ OpMemberName %type_View 51 "View_PrevScreenToTranslatedWorld"
+ OpMemberName %type_View 52 "View_ClipToPrevClip"
+ OpMemberName %type_View 53 "View_TemporalAAJitter"
+ OpMemberName %type_View 54 "View_GlobalClippingPlane"
+ OpMemberName %type_View 55 "View_FieldOfViewWideAngles"
+ OpMemberName %type_View 56 "View_PrevFieldOfViewWideAngles"
+ OpMemberName %type_View 57 "View_ViewRectMin"
+ OpMemberName %type_View 58 "View_ViewSizeAndInvSize"
+ OpMemberName %type_View 59 "View_BufferSizeAndInvSize"
+ OpMemberName %type_View 60 "View_BufferBilinearUVMinMax"
+ OpMemberName %type_View 61 "View_NumSceneColorMSAASamples"
+ OpMemberName %type_View 62 "View_PreExposure"
+ OpMemberName %type_View 63 "View_OneOverPreExposure"
+ OpMemberName %type_View 64 "PrePadding_View_2076"
+ OpMemberName %type_View 65 "View_DiffuseOverrideParameter"
+ OpMemberName %type_View 66 "View_SpecularOverrideParameter"
+ OpMemberName %type_View 67 "View_NormalOverrideParameter"
+ OpMemberName %type_View 68 "View_RoughnessOverrideParameter"
+ OpMemberName %type_View 69 "View_PrevFrameGameTime"
+ OpMemberName %type_View 70 "View_PrevFrameRealTime"
+ OpMemberName %type_View 71 "View_OutOfBoundsMask"
+ OpMemberName %type_View 72 "PrePadding_View_2148"
+ OpMemberName %type_View 73 "PrePadding_View_2152"
+ OpMemberName %type_View 74 "PrePadding_View_2156"
+ OpMemberName %type_View 75 "View_WorldCameraMovementSinceLastFrame"
+ OpMemberName %type_View 76 "View_CullingSign"
+ OpMemberName %type_View 77 "View_NearPlane"
+ OpMemberName %type_View 78 "View_AdaptiveTessellationFactor"
+ OpMemberName %type_View 79 "View_GameTime"
+ OpMemberName %type_View 80 "View_RealTime"
+ OpMemberName %type_View 81 "View_DeltaTime"
+ OpMemberName %type_View 82 "View_MaterialTextureMipBias"
+ OpMemberName %type_View 83 "View_MaterialTextureDerivativeMultiply"
+ OpMemberName %type_View 84 "View_Random"
+ OpMemberName %type_View 85 "View_FrameNumber"
+ OpMemberName %type_View 86 "View_StateFrameIndexMod8"
+ OpMemberName %type_View 87 "View_StateFrameIndex"
+ OpMemberName %type_View 88 "View_CameraCut"
+ OpMemberName %type_View 89 "View_UnlitViewmodeMask"
+ OpMemberName %type_View 90 "PrePadding_View_2228"
+ OpMemberName %type_View 91 "PrePadding_View_2232"
+ OpMemberName %type_View 92 "PrePadding_View_2236"
+ OpMemberName %type_View 93 "View_DirectionalLightColor"
+ OpMemberName %type_View 94 "View_DirectionalLightDirection"
+ OpMemberName %type_View 95 "PrePadding_View_2268"
+ OpMemberName %type_View 96 "View_TranslucencyLightingVolumeMin"
+ OpMemberName %type_View 97 "View_TranslucencyLightingVolumeInvSize"
+ OpMemberName %type_View 98 "View_TemporalAAParams"
+ OpMemberName %type_View 99 "View_CircleDOFParams"
+ OpMemberName %type_View 100 "View_DepthOfFieldSensorWidth"
+ OpMemberName %type_View 101 "View_DepthOfFieldFocalDistance"
+ OpMemberName %type_View 102 "View_DepthOfFieldScale"
+ OpMemberName %type_View 103 "View_DepthOfFieldFocalLength"
+ OpMemberName %type_View 104 "View_DepthOfFieldFocalRegion"
+ OpMemberName %type_View 105 "View_DepthOfFieldNearTransitionRegion"
+ OpMemberName %type_View 106 "View_DepthOfFieldFarTransitionRegion"
+ OpMemberName %type_View 107 "View_MotionBlurNormalizedToPixel"
+ OpMemberName %type_View 108 "View_bSubsurfacePostprocessEnabled"
+ OpMemberName %type_View 109 "View_GeneralPurposeTweak"
+ OpMemberName %type_View 110 "View_DemosaicVposOffset"
+ OpMemberName %type_View 111 "PrePadding_View_2412"
+ OpMemberName %type_View 112 "View_IndirectLightingColorScale"
+ OpMemberName %type_View 113 "View_HDR32bppEncodingMode"
+ OpMemberName %type_View 114 "View_AtmosphericFogSunDirection"
+ OpMemberName %type_View 115 "View_AtmosphericFogSunPower"
+ OpMemberName %type_View 116 "View_AtmosphericFogPower"
+ OpMemberName %type_View 117 "View_AtmosphericFogDensityScale"
+ OpMemberName %type_View 118 "View_AtmosphericFogDensityOffset"
+ OpMemberName %type_View 119 "View_AtmosphericFogGroundOffset"
+ OpMemberName %type_View 120 "View_AtmosphericFogDistanceScale"
+ OpMemberName %type_View 121 "View_AtmosphericFogAltitudeScale"
+ OpMemberName %type_View 122 "View_AtmosphericFogHeightScaleRayleigh"
+ OpMemberName %type_View 123 "View_AtmosphericFogStartDistance"
+ OpMemberName %type_View 124 "View_AtmosphericFogDistanceOffset"
+ OpMemberName %type_View 125 "View_AtmosphericFogSunDiscScale"
+ OpMemberName %type_View 126 "View_AtmosphericFogSunDiscHalfApexAngleRadian"
+ OpMemberName %type_View 127 "PrePadding_View_2492"
+ OpMemberName %type_View 128 "View_AtmosphericFogSunDiscLuminance"
+ OpMemberName %type_View 129 "View_AtmosphericFogRenderMask"
+ OpMemberName %type_View 130 "View_AtmosphericFogInscatterAltitudeSampleNum"
+ OpMemberName %type_View 131 "PrePadding_View_2520"
+ OpMemberName %type_View 132 "PrePadding_View_2524"
+ OpMemberName %type_View 133 "View_AtmosphericFogSunColor"
+ OpMemberName %type_View 134 "View_NormalCurvatureToRoughnessScaleBias"
+ OpMemberName %type_View 135 "View_RenderingReflectionCaptureMask"
+ OpMemberName %type_View 136 "View_AmbientCubemapTint"
+ OpMemberName %type_View 137 "View_AmbientCubemapIntensity"
+ OpMemberName %type_View 138 "View_SkyLightParameters"
+ OpMemberName %type_View 139 "PrePadding_View_2584"
+ OpMemberName %type_View 140 "PrePadding_View_2588"
+ OpMemberName %type_View 141 "View_SkyLightColor"
+ OpMemberName %type_View 142 "View_SkyIrradianceEnvironmentMap"
+ OpMemberName %type_View 143 "View_MobilePreviewMode"
+ OpMemberName %type_View 144 "View_HMDEyePaddingOffset"
+ OpMemberName %type_View 145 "View_ReflectionCubemapMaxMip"
+ OpMemberName %type_View 146 "View_ShowDecalsMask"
+ OpMemberName %type_View 147 "View_DistanceFieldAOSpecularOcclusionMode"
+ OpMemberName %type_View 148 "View_IndirectCapsuleSelfShadowingIntensity"
+ OpMemberName %type_View 149 "PrePadding_View_2744"
+ OpMemberName %type_View 150 "PrePadding_View_2748"
+ OpMemberName %type_View 151 "View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight"
+ OpMemberName %type_View 152 "View_StereoPassIndex"
+ OpMemberName %type_View 153 "View_GlobalVolumeCenterAndExtent"
+ OpMemberName %type_View 154 "View_GlobalVolumeWorldToUVAddAndMul"
+ OpMemberName %type_View 155 "View_GlobalVolumeDimension"
+ OpMemberName %type_View 156 "View_GlobalVolumeTexelSize"
+ OpMemberName %type_View 157 "View_MaxGlobalDistance"
+ OpMemberName %type_View 158 "PrePadding_View_2908"
+ OpMemberName %type_View 159 "View_CursorPosition"
+ OpMemberName %type_View 160 "View_bCheckerboardSubsurfaceProfileRendering"
+ OpMemberName %type_View 161 "PrePadding_View_2924"
+ OpMemberName %type_View 162 "View_VolumetricFogInvGridSize"
+ OpMemberName %type_View 163 "PrePadding_View_2940"
+ OpMemberName %type_View 164 "View_VolumetricFogGridZParams"
+ OpMemberName %type_View 165 "PrePadding_View_2956"
+ OpMemberName %type_View 166 "View_VolumetricFogSVPosToVolumeUV"
+ OpMemberName %type_View 167 "View_VolumetricFogMaxDistance"
+ OpMemberName %type_View 168 "PrePadding_View_2972"
+ OpMemberName %type_View 169 "View_VolumetricLightmapWorldToUVScale"
+ OpMemberName %type_View 170 "PrePadding_View_2988"
+ OpMemberName %type_View 171 "View_VolumetricLightmapWorldToUVAdd"
+ OpMemberName %type_View 172 "PrePadding_View_3004"
+ OpMemberName %type_View 173 "View_VolumetricLightmapIndirectionTextureSize"
+ OpMemberName %type_View 174 "View_VolumetricLightmapBrickSize"
+ OpMemberName %type_View 175 "View_VolumetricLightmapBrickTexelSize"
+ OpMemberName %type_View 176 "View_StereoIPD"
+ OpMemberName %type_View 177 "View_IndirectLightingCacheShowFlag"
+ OpMemberName %type_View 178 "View_EyeToPixelSpreadAngle"
+ OpName %View "View"
+ OpName %type_sampler "type.sampler"
+ OpName %type_2d_image "type.2d.image"
+ OpName %type_ShadowDepthPass "type.ShadowDepthPass"
+ OpMemberName %type_ShadowDepthPass 0 "PrePadding_ShadowDepthPass_LPV_0"
+ OpMemberName %type_ShadowDepthPass 1 "PrePadding_ShadowDepthPass_LPV_4"
+ OpMemberName %type_ShadowDepthPass 2 "PrePadding_ShadowDepthPass_LPV_8"
+ OpMemberName %type_ShadowDepthPass 3 "PrePadding_ShadowDepthPass_LPV_12"
+ OpMemberName %type_ShadowDepthPass 4 "PrePadding_ShadowDepthPass_LPV_16"
+ OpMemberName %type_ShadowDepthPass 5 "PrePadding_ShadowDepthPass_LPV_20"
+ OpMemberName %type_ShadowDepthPass 6 "PrePadding_ShadowDepthPass_LPV_24"
+ OpMemberName %type_ShadowDepthPass 7 "PrePadding_ShadowDepthPass_LPV_28"
+ OpMemberName %type_ShadowDepthPass 8 "PrePadding_ShadowDepthPass_LPV_32"
+ OpMemberName %type_ShadowDepthPass 9 "PrePadding_ShadowDepthPass_LPV_36"
+ OpMemberName %type_ShadowDepthPass 10 "PrePadding_ShadowDepthPass_LPV_40"
+ OpMemberName %type_ShadowDepthPass 11 "PrePadding_ShadowDepthPass_LPV_44"
+ OpMemberName %type_ShadowDepthPass 12 "PrePadding_ShadowDepthPass_LPV_48"
+ OpMemberName %type_ShadowDepthPass 13 "PrePadding_ShadowDepthPass_LPV_52"
+ OpMemberName %type_ShadowDepthPass 14 "PrePadding_ShadowDepthPass_LPV_56"
+ OpMemberName %type_ShadowDepthPass 15 "PrePadding_ShadowDepthPass_LPV_60"
+ OpMemberName %type_ShadowDepthPass 16 "PrePadding_ShadowDepthPass_LPV_64"
+ OpMemberName %type_ShadowDepthPass 17 "PrePadding_ShadowDepthPass_LPV_68"
+ OpMemberName %type_ShadowDepthPass 18 "PrePadding_ShadowDepthPass_LPV_72"
+ OpMemberName %type_ShadowDepthPass 19 "PrePadding_ShadowDepthPass_LPV_76"
+ OpMemberName %type_ShadowDepthPass 20 "PrePadding_ShadowDepthPass_LPV_80"
+ OpMemberName %type_ShadowDepthPass 21 "PrePadding_ShadowDepthPass_LPV_84"
+ OpMemberName %type_ShadowDepthPass 22 "PrePadding_ShadowDepthPass_LPV_88"
+ OpMemberName %type_ShadowDepthPass 23 "PrePadding_ShadowDepthPass_LPV_92"
+ OpMemberName %type_ShadowDepthPass 24 "PrePadding_ShadowDepthPass_LPV_96"
+ OpMemberName %type_ShadowDepthPass 25 "PrePadding_ShadowDepthPass_LPV_100"
+ OpMemberName %type_ShadowDepthPass 26 "PrePadding_ShadowDepthPass_LPV_104"
+ OpMemberName %type_ShadowDepthPass 27 "PrePadding_ShadowDepthPass_LPV_108"
+ OpMemberName %type_ShadowDepthPass 28 "PrePadding_ShadowDepthPass_LPV_112"
+ OpMemberName %type_ShadowDepthPass 29 "PrePadding_ShadowDepthPass_LPV_116"
+ OpMemberName %type_ShadowDepthPass 30 "PrePadding_ShadowDepthPass_LPV_120"
+ OpMemberName %type_ShadowDepthPass 31 "PrePadding_ShadowDepthPass_LPV_124"
+ OpMemberName %type_ShadowDepthPass 32 "PrePadding_ShadowDepthPass_LPV_128"
+ OpMemberName %type_ShadowDepthPass 33 "PrePadding_ShadowDepthPass_LPV_132"
+ OpMemberName %type_ShadowDepthPass 34 "PrePadding_ShadowDepthPass_LPV_136"
+ OpMemberName %type_ShadowDepthPass 35 "PrePadding_ShadowDepthPass_LPV_140"
+ OpMemberName %type_ShadowDepthPass 36 "PrePadding_ShadowDepthPass_LPV_144"
+ OpMemberName %type_ShadowDepthPass 37 "PrePadding_ShadowDepthPass_LPV_148"
+ OpMemberName %type_ShadowDepthPass 38 "PrePadding_ShadowDepthPass_LPV_152"
+ OpMemberName %type_ShadowDepthPass 39 "PrePadding_ShadowDepthPass_LPV_156"
+ OpMemberName %type_ShadowDepthPass 40 "PrePadding_ShadowDepthPass_LPV_160"
+ OpMemberName %type_ShadowDepthPass 41 "PrePadding_ShadowDepthPass_LPV_164"
+ OpMemberName %type_ShadowDepthPass 42 "PrePadding_ShadowDepthPass_LPV_168"
+ OpMemberName %type_ShadowDepthPass 43 "PrePadding_ShadowDepthPass_LPV_172"
+ OpMemberName %type_ShadowDepthPass 44 "PrePadding_ShadowDepthPass_LPV_176"
+ OpMemberName %type_ShadowDepthPass 45 "PrePadding_ShadowDepthPass_LPV_180"
+ OpMemberName %type_ShadowDepthPass 46 "PrePadding_ShadowDepthPass_LPV_184"
+ OpMemberName %type_ShadowDepthPass 47 "PrePadding_ShadowDepthPass_LPV_188"
+ OpMemberName %type_ShadowDepthPass 48 "PrePadding_ShadowDepthPass_LPV_192"
+ OpMemberName %type_ShadowDepthPass 49 "PrePadding_ShadowDepthPass_LPV_196"
+ OpMemberName %type_ShadowDepthPass 50 "PrePadding_ShadowDepthPass_LPV_200"
+ OpMemberName %type_ShadowDepthPass 51 "PrePadding_ShadowDepthPass_LPV_204"
+ OpMemberName %type_ShadowDepthPass 52 "PrePadding_ShadowDepthPass_LPV_208"
+ OpMemberName %type_ShadowDepthPass 53 "PrePadding_ShadowDepthPass_LPV_212"
+ OpMemberName %type_ShadowDepthPass 54 "PrePadding_ShadowDepthPass_LPV_216"
+ OpMemberName %type_ShadowDepthPass 55 "PrePadding_ShadowDepthPass_LPV_220"
+ OpMemberName %type_ShadowDepthPass 56 "PrePadding_ShadowDepthPass_LPV_224"
+ OpMemberName %type_ShadowDepthPass 57 "PrePadding_ShadowDepthPass_LPV_228"
+ OpMemberName %type_ShadowDepthPass 58 "PrePadding_ShadowDepthPass_LPV_232"
+ OpMemberName %type_ShadowDepthPass 59 "PrePadding_ShadowDepthPass_LPV_236"
+ OpMemberName %type_ShadowDepthPass 60 "PrePadding_ShadowDepthPass_LPV_240"
+ OpMemberName %type_ShadowDepthPass 61 "PrePadding_ShadowDepthPass_LPV_244"
+ OpMemberName %type_ShadowDepthPass 62 "PrePadding_ShadowDepthPass_LPV_248"
+ OpMemberName %type_ShadowDepthPass 63 "PrePadding_ShadowDepthPass_LPV_252"
+ OpMemberName %type_ShadowDepthPass 64 "PrePadding_ShadowDepthPass_LPV_256"
+ OpMemberName %type_ShadowDepthPass 65 "PrePadding_ShadowDepthPass_LPV_260"
+ OpMemberName %type_ShadowDepthPass 66 "PrePadding_ShadowDepthPass_LPV_264"
+ OpMemberName %type_ShadowDepthPass 67 "PrePadding_ShadowDepthPass_LPV_268"
+ OpMemberName %type_ShadowDepthPass 68 "ShadowDepthPass_LPV_mRsmToWorld"
+ OpMemberName %type_ShadowDepthPass 69 "ShadowDepthPass_LPV_mLightColour"
+ OpMemberName %type_ShadowDepthPass 70 "ShadowDepthPass_LPV_GeometryVolumeCaptureLightDirection"
+ OpMemberName %type_ShadowDepthPass 71 "ShadowDepthPass_LPV_mEyePos"
+ OpMemberName %type_ShadowDepthPass 72 "ShadowDepthPass_LPV_mOldGridOffset"
+ OpMemberName %type_ShadowDepthPass 73 "PrePadding_ShadowDepthPass_LPV_396"
+ OpMemberName %type_ShadowDepthPass 74 "ShadowDepthPass_LPV_mLpvGridOffset"
+ OpMemberName %type_ShadowDepthPass 75 "ShadowDepthPass_LPV_ClearMultiplier"
+ OpMemberName %type_ShadowDepthPass 76 "ShadowDepthPass_LPV_LpvScale"
+ OpMemberName %type_ShadowDepthPass 77 "ShadowDepthPass_LPV_OneOverLpvScale"
+ OpMemberName %type_ShadowDepthPass 78 "ShadowDepthPass_LPV_DirectionalOcclusionIntensity"
+ OpMemberName %type_ShadowDepthPass 79 "ShadowDepthPass_LPV_DirectionalOcclusionRadius"
+ OpMemberName %type_ShadowDepthPass 80 "ShadowDepthPass_LPV_RsmAreaIntensityMultiplier"
+ OpMemberName %type_ShadowDepthPass 81 "ShadowDepthPass_LPV_RsmPixelToTexcoordMultiplier"
+ OpMemberName %type_ShadowDepthPass 82 "ShadowDepthPass_LPV_SecondaryOcclusionStrength"
+ OpMemberName %type_ShadowDepthPass 83 "ShadowDepthPass_LPV_SecondaryBounceStrength"
+ OpMemberName %type_ShadowDepthPass 84 "ShadowDepthPass_LPV_VplInjectionBias"
+ OpMemberName %type_ShadowDepthPass 85 "ShadowDepthPass_LPV_GeometryVolumeInjectionBias"
+ OpMemberName %type_ShadowDepthPass 86 "ShadowDepthPass_LPV_EmissiveInjectionMultiplier"
+ OpMemberName %type_ShadowDepthPass 87 "ShadowDepthPass_LPV_PropagationIndex"
+ OpMemberName %type_ShadowDepthPass 88 "ShadowDepthPass_ProjectionMatrix"
+ OpMemberName %type_ShadowDepthPass 89 "ShadowDepthPass_ViewMatrix"
+ OpMemberName %type_ShadowDepthPass 90 "ShadowDepthPass_ShadowParams"
+ OpMemberName %type_ShadowDepthPass 91 "ShadowDepthPass_bClampToNearPlane"
+ OpMemberName %type_ShadowDepthPass 92 "PrePadding_ShadowDepthPass_612"
+ OpMemberName %type_ShadowDepthPass 93 "PrePadding_ShadowDepthPass_616"
+ OpMemberName %type_ShadowDepthPass 94 "PrePadding_ShadowDepthPass_620"
+ OpMemberName %type_ShadowDepthPass 95 "ShadowDepthPass_ShadowViewProjectionMatrices"
+ OpMemberName %type_ShadowDepthPass 96 "ShadowDepthPass_ShadowViewMatrices"
+ OpName %ShadowDepthPass "ShadowDepthPass"
+ OpName %Material_Texture2D_3 "Material_Texture2D_3"
+ OpName %Material_Texture2D_3Sampler "Material_Texture2D_3Sampler"
+ OpName %in_var_TEXCOORD10_centroid "in.var.TEXCOORD10_centroid"
+ OpName %in_var_TEXCOORD11_centroid "in.var.TEXCOORD11_centroid"
+ OpName %in_var_COLOR0 "in.var.COLOR0"
+ OpName %in_var_TEXCOORD0 "in.var.TEXCOORD0"
+ OpName %in_var_PRIMITIVE_ID "in.var.PRIMITIVE_ID"
+ OpName %in_var_VS_to_DS_Position "in.var.VS_to_DS_Position"
+ OpName %in_var_PN_POSITION "in.var.PN_POSITION"
+ OpName %in_var_PN_DisplacementScales "in.var.PN_DisplacementScales"
+ OpName %in_var_PN_TessellationMultiplier "in.var.PN_TessellationMultiplier"
+ OpName %in_var_PN_WorldDisplacementMultiplier "in.var.PN_WorldDisplacementMultiplier"
+ OpName %in_var_PN_POSITION9 "in.var.PN_POSITION9"
+ OpName %out_var_TEXCOORD10_centroid "out.var.TEXCOORD10_centroid"
+ OpName %out_var_TEXCOORD11_centroid "out.var.TEXCOORD11_centroid"
+ OpName %out_var_COLOR0 "out.var.COLOR0"
+ OpName %out_var_TEXCOORD0 "out.var.TEXCOORD0"
+ OpName %out_var_PRIMITIVE_ID "out.var.PRIMITIVE_ID"
+ OpName %out_var_TEXCOORD6 "out.var.TEXCOORD6"
+ OpName %out_var_TEXCOORD8 "out.var.TEXCOORD8"
+ OpName %out_var_TEXCOORD7 "out.var.TEXCOORD7"
+ OpName %MainDomain "MainDomain"
+ OpName %type_sampled_image "type.sampled.image"
+ OpDecorateString %in_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %in_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %in_var_COLOR0 UserSemantic "COLOR0"
+ OpDecorateString %in_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorateString %in_var_PRIMITIVE_ID UserSemantic "PRIMITIVE_ID"
+ OpDecorateString %in_var_VS_to_DS_Position UserSemantic "VS_to_DS_Position"
+ OpDecorateString %in_var_PN_POSITION UserSemantic "PN_POSITION"
+ OpDecorateString %in_var_PN_DisplacementScales UserSemantic "PN_DisplacementScales"
+ OpDecorateString %in_var_PN_TessellationMultiplier UserSemantic "PN_TessellationMultiplier"
+ OpDecorateString %in_var_PN_WorldDisplacementMultiplier UserSemantic "PN_WorldDisplacementMultiplier"
+ OpDecorate %gl_TessLevelOuter BuiltIn TessLevelOuter
+ OpDecorateString %gl_TessLevelOuter UserSemantic "SV_TessFactor"
+ OpDecorate %gl_TessLevelOuter Patch
+ OpDecorate %gl_TessLevelInner BuiltIn TessLevelInner
+ OpDecorateString %gl_TessLevelInner UserSemantic "SV_InsideTessFactor"
+ OpDecorate %gl_TessLevelInner Patch
+ OpDecorateString %in_var_PN_POSITION9 UserSemantic "PN_POSITION9"
+ OpDecorate %in_var_PN_POSITION9 Patch
+ OpDecorate %gl_TessCoord BuiltIn TessCoord
+ OpDecorateString %gl_TessCoord UserSemantic "SV_DomainLocation"
+ OpDecorate %gl_TessCoord Patch
+ OpDecorateString %out_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %out_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %out_var_COLOR0 UserSemantic "COLOR0"
+ OpDecorateString %out_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorateString %out_var_PRIMITIVE_ID UserSemantic "PRIMITIVE_ID"
+ OpDecorateString %out_var_TEXCOORD6 UserSemantic "TEXCOORD6"
+ OpDecorateString %out_var_TEXCOORD8 UserSemantic "TEXCOORD8"
+ OpDecorateString %out_var_TEXCOORD7 UserSemantic "TEXCOORD7"
+ OpDecorate %gl_Position BuiltIn Position
+ OpDecorateString %gl_Position UserSemantic "SV_POSITION"
+ OpDecorate %in_var_COLOR0 Location 0
+ OpDecorate %in_var_PN_DisplacementScales Location 1
+ OpDecorate %in_var_PN_POSITION Location 2
+ OpDecorate %in_var_PN_POSITION9 Location 5
+ OpDecorate %in_var_PN_TessellationMultiplier Location 6
+ OpDecorate %in_var_PN_WorldDisplacementMultiplier Location 7
+ OpDecorate %in_var_PRIMITIVE_ID Location 8
+ OpDecorate %in_var_TEXCOORD0 Location 9
+ OpDecorate %in_var_TEXCOORD10_centroid Location 10
+ OpDecorate %in_var_TEXCOORD11_centroid Location 11
+ OpDecorate %in_var_VS_to_DS_Position Location 12
+ OpDecorate %out_var_TEXCOORD10_centroid Location 0
+ OpDecorate %out_var_TEXCOORD11_centroid Location 1
+ OpDecorate %out_var_COLOR0 Location 2
+ OpDecorate %out_var_TEXCOORD0 Location 3
+ OpDecorate %out_var_PRIMITIVE_ID Location 4
+ OpDecorate %out_var_TEXCOORD6 Location 5
+ OpDecorate %out_var_TEXCOORD8 Location 6
+ OpDecorate %out_var_TEXCOORD7 Location 7
+ OpDecorate %View DescriptorSet 0
+ OpDecorate %View Binding 0
+ OpDecorate %ShadowDepthPass DescriptorSet 0
+ OpDecorate %ShadowDepthPass Binding 1
+ OpDecorate %Material_Texture2D_3 DescriptorSet 0
+ OpDecorate %Material_Texture2D_3 Binding 0
+ OpDecorate %Material_Texture2D_3Sampler DescriptorSet 0
+ OpDecorate %Material_Texture2D_3Sampler Binding 0
+ OpDecorate %_arr_v4float_uint_2 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_7 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpMemberDecorate %type_View 0 Offset 0
+ OpMemberDecorate %type_View 0 MatrixStride 16
+ OpMemberDecorate %type_View 0 ColMajor
+ OpMemberDecorate %type_View 1 Offset 64
+ OpMemberDecorate %type_View 1 MatrixStride 16
+ OpMemberDecorate %type_View 1 ColMajor
+ OpMemberDecorate %type_View 2 Offset 128
+ OpMemberDecorate %type_View 2 MatrixStride 16
+ OpMemberDecorate %type_View 2 ColMajor
+ OpMemberDecorate %type_View 3 Offset 192
+ OpMemberDecorate %type_View 3 MatrixStride 16
+ OpMemberDecorate %type_View 3 ColMajor
+ OpMemberDecorate %type_View 4 Offset 256
+ OpMemberDecorate %type_View 4 MatrixStride 16
+ OpMemberDecorate %type_View 4 ColMajor
+ OpMemberDecorate %type_View 5 Offset 320
+ OpMemberDecorate %type_View 5 MatrixStride 16
+ OpMemberDecorate %type_View 5 ColMajor
+ OpMemberDecorate %type_View 6 Offset 384
+ OpMemberDecorate %type_View 6 MatrixStride 16
+ OpMemberDecorate %type_View 6 ColMajor
+ OpMemberDecorate %type_View 7 Offset 448
+ OpMemberDecorate %type_View 7 MatrixStride 16
+ OpMemberDecorate %type_View 7 ColMajor
+ OpMemberDecorate %type_View 8 Offset 512
+ OpMemberDecorate %type_View 8 MatrixStride 16
+ OpMemberDecorate %type_View 8 ColMajor
+ OpMemberDecorate %type_View 9 Offset 576
+ OpMemberDecorate %type_View 9 MatrixStride 16
+ OpMemberDecorate %type_View 9 ColMajor
+ OpMemberDecorate %type_View 10 Offset 640
+ OpMemberDecorate %type_View 10 MatrixStride 16
+ OpMemberDecorate %type_View 10 ColMajor
+ OpMemberDecorate %type_View 11 Offset 704
+ OpMemberDecorate %type_View 11 MatrixStride 16
+ OpMemberDecorate %type_View 11 ColMajor
+ OpMemberDecorate %type_View 12 Offset 768
+ OpMemberDecorate %type_View 12 MatrixStride 16
+ OpMemberDecorate %type_View 12 ColMajor
+ OpMemberDecorate %type_View 13 Offset 832
+ OpMemberDecorate %type_View 13 MatrixStride 16
+ OpMemberDecorate %type_View 13 ColMajor
+ OpMemberDecorate %type_View 14 Offset 896
+ OpMemberDecorate %type_View 15 Offset 908
+ OpMemberDecorate %type_View 16 Offset 912
+ OpMemberDecorate %type_View 17 Offset 924
+ OpMemberDecorate %type_View 18 Offset 928
+ OpMemberDecorate %type_View 19 Offset 940
+ OpMemberDecorate %type_View 20 Offset 944
+ OpMemberDecorate %type_View 21 Offset 956
+ OpMemberDecorate %type_View 22 Offset 960
+ OpMemberDecorate %type_View 23 Offset 972
+ OpMemberDecorate %type_View 24 Offset 976
+ OpMemberDecorate %type_View 25 Offset 992
+ OpMemberDecorate %type_View 26 Offset 1008
+ OpMemberDecorate %type_View 27 Offset 1020
+ OpMemberDecorate %type_View 28 Offset 1024
+ OpMemberDecorate %type_View 29 Offset 1036
+ OpMemberDecorate %type_View 30 Offset 1040
+ OpMemberDecorate %type_View 31 Offset 1052
+ OpMemberDecorate %type_View 32 Offset 1056
+ OpMemberDecorate %type_View 33 Offset 1068
+ OpMemberDecorate %type_View 34 Offset 1072
+ OpMemberDecorate %type_View 34 MatrixStride 16
+ OpMemberDecorate %type_View 34 ColMajor
+ OpMemberDecorate %type_View 35 Offset 1136
+ OpMemberDecorate %type_View 35 MatrixStride 16
+ OpMemberDecorate %type_View 35 ColMajor
+ OpMemberDecorate %type_View 36 Offset 1200
+ OpMemberDecorate %type_View 36 MatrixStride 16
+ OpMemberDecorate %type_View 36 ColMajor
+ OpMemberDecorate %type_View 37 Offset 1264
+ OpMemberDecorate %type_View 37 MatrixStride 16
+ OpMemberDecorate %type_View 37 ColMajor
+ OpMemberDecorate %type_View 38 Offset 1328
+ OpMemberDecorate %type_View 38 MatrixStride 16
+ OpMemberDecorate %type_View 38 ColMajor
+ OpMemberDecorate %type_View 39 Offset 1392
+ OpMemberDecorate %type_View 39 MatrixStride 16
+ OpMemberDecorate %type_View 39 ColMajor
+ OpMemberDecorate %type_View 40 Offset 1456
+ OpMemberDecorate %type_View 40 MatrixStride 16
+ OpMemberDecorate %type_View 40 ColMajor
+ OpMemberDecorate %type_View 41 Offset 1520
+ OpMemberDecorate %type_View 41 MatrixStride 16
+ OpMemberDecorate %type_View 41 ColMajor
+ OpMemberDecorate %type_View 42 Offset 1584
+ OpMemberDecorate %type_View 42 MatrixStride 16
+ OpMemberDecorate %type_View 42 ColMajor
+ OpMemberDecorate %type_View 43 Offset 1648
+ OpMemberDecorate %type_View 43 MatrixStride 16
+ OpMemberDecorate %type_View 43 ColMajor
+ OpMemberDecorate %type_View 44 Offset 1712
+ OpMemberDecorate %type_View 45 Offset 1724
+ OpMemberDecorate %type_View 46 Offset 1728
+ OpMemberDecorate %type_View 47 Offset 1740
+ OpMemberDecorate %type_View 48 Offset 1744
+ OpMemberDecorate %type_View 49 Offset 1756
+ OpMemberDecorate %type_View 50 Offset 1760
+ OpMemberDecorate %type_View 50 MatrixStride 16
+ OpMemberDecorate %type_View 50 ColMajor
+ OpMemberDecorate %type_View 51 Offset 1824
+ OpMemberDecorate %type_View 51 MatrixStride 16
+ OpMemberDecorate %type_View 51 ColMajor
+ OpMemberDecorate %type_View 52 Offset 1888
+ OpMemberDecorate %type_View 52 MatrixStride 16
+ OpMemberDecorate %type_View 52 ColMajor
+ OpMemberDecorate %type_View 53 Offset 1952
+ OpMemberDecorate %type_View 54 Offset 1968
+ OpMemberDecorate %type_View 55 Offset 1984
+ OpMemberDecorate %type_View 56 Offset 1992
+ OpMemberDecorate %type_View 57 Offset 2000
+ OpMemberDecorate %type_View 58 Offset 2016
+ OpMemberDecorate %type_View 59 Offset 2032
+ OpMemberDecorate %type_View 60 Offset 2048
+ OpMemberDecorate %type_View 61 Offset 2064
+ OpMemberDecorate %type_View 62 Offset 2068
+ OpMemberDecorate %type_View 63 Offset 2072
+ OpMemberDecorate %type_View 64 Offset 2076
+ OpMemberDecorate %type_View 65 Offset 2080
+ OpMemberDecorate %type_View 66 Offset 2096
+ OpMemberDecorate %type_View 67 Offset 2112
+ OpMemberDecorate %type_View 68 Offset 2128
+ OpMemberDecorate %type_View 69 Offset 2136
+ OpMemberDecorate %type_View 70 Offset 2140
+ OpMemberDecorate %type_View 71 Offset 2144
+ OpMemberDecorate %type_View 72 Offset 2148
+ OpMemberDecorate %type_View 73 Offset 2152
+ OpMemberDecorate %type_View 74 Offset 2156
+ OpMemberDecorate %type_View 75 Offset 2160
+ OpMemberDecorate %type_View 76 Offset 2172
+ OpMemberDecorate %type_View 77 Offset 2176
+ OpMemberDecorate %type_View 78 Offset 2180
+ OpMemberDecorate %type_View 79 Offset 2184
+ OpMemberDecorate %type_View 80 Offset 2188
+ OpMemberDecorate %type_View 81 Offset 2192
+ OpMemberDecorate %type_View 82 Offset 2196
+ OpMemberDecorate %type_View 83 Offset 2200
+ OpMemberDecorate %type_View 84 Offset 2204
+ OpMemberDecorate %type_View 85 Offset 2208
+ OpMemberDecorate %type_View 86 Offset 2212
+ OpMemberDecorate %type_View 87 Offset 2216
+ OpMemberDecorate %type_View 88 Offset 2220
+ OpMemberDecorate %type_View 89 Offset 2224
+ OpMemberDecorate %type_View 90 Offset 2228
+ OpMemberDecorate %type_View 91 Offset 2232
+ OpMemberDecorate %type_View 92 Offset 2236
+ OpMemberDecorate %type_View 93 Offset 2240
+ OpMemberDecorate %type_View 94 Offset 2256
+ OpMemberDecorate %type_View 95 Offset 2268
+ OpMemberDecorate %type_View 96 Offset 2272
+ OpMemberDecorate %type_View 97 Offset 2304
+ OpMemberDecorate %type_View 98 Offset 2336
+ OpMemberDecorate %type_View 99 Offset 2352
+ OpMemberDecorate %type_View 100 Offset 2368
+ OpMemberDecorate %type_View 101 Offset 2372
+ OpMemberDecorate %type_View 102 Offset 2376
+ OpMemberDecorate %type_View 103 Offset 2380
+ OpMemberDecorate %type_View 104 Offset 2384
+ OpMemberDecorate %type_View 105 Offset 2388
+ OpMemberDecorate %type_View 106 Offset 2392
+ OpMemberDecorate %type_View 107 Offset 2396
+ OpMemberDecorate %type_View 108 Offset 2400
+ OpMemberDecorate %type_View 109 Offset 2404
+ OpMemberDecorate %type_View 110 Offset 2408
+ OpMemberDecorate %type_View 111 Offset 2412
+ OpMemberDecorate %type_View 112 Offset 2416
+ OpMemberDecorate %type_View 113 Offset 2428
+ OpMemberDecorate %type_View 114 Offset 2432
+ OpMemberDecorate %type_View 115 Offset 2444
+ OpMemberDecorate %type_View 116 Offset 2448
+ OpMemberDecorate %type_View 117 Offset 2452
+ OpMemberDecorate %type_View 118 Offset 2456
+ OpMemberDecorate %type_View 119 Offset 2460
+ OpMemberDecorate %type_View 120 Offset 2464
+ OpMemberDecorate %type_View 121 Offset 2468
+ OpMemberDecorate %type_View 122 Offset 2472
+ OpMemberDecorate %type_View 123 Offset 2476
+ OpMemberDecorate %type_View 124 Offset 2480
+ OpMemberDecorate %type_View 125 Offset 2484
+ OpMemberDecorate %type_View 126 Offset 2488
+ OpMemberDecorate %type_View 127 Offset 2492
+ OpMemberDecorate %type_View 128 Offset 2496
+ OpMemberDecorate %type_View 129 Offset 2512
+ OpMemberDecorate %type_View 130 Offset 2516
+ OpMemberDecorate %type_View 131 Offset 2520
+ OpMemberDecorate %type_View 132 Offset 2524
+ OpMemberDecorate %type_View 133 Offset 2528
+ OpMemberDecorate %type_View 134 Offset 2544
+ OpMemberDecorate %type_View 135 Offset 2556
+ OpMemberDecorate %type_View 136 Offset 2560
+ OpMemberDecorate %type_View 137 Offset 2576
+ OpMemberDecorate %type_View 138 Offset 2580
+ OpMemberDecorate %type_View 139 Offset 2584
+ OpMemberDecorate %type_View 140 Offset 2588
+ OpMemberDecorate %type_View 141 Offset 2592
+ OpMemberDecorate %type_View 142 Offset 2608
+ OpMemberDecorate %type_View 143 Offset 2720
+ OpMemberDecorate %type_View 144 Offset 2724
+ OpMemberDecorate %type_View 145 Offset 2728
+ OpMemberDecorate %type_View 146 Offset 2732
+ OpMemberDecorate %type_View 147 Offset 2736
+ OpMemberDecorate %type_View 148 Offset 2740
+ OpMemberDecorate %type_View 149 Offset 2744
+ OpMemberDecorate %type_View 150 Offset 2748
+ OpMemberDecorate %type_View 151 Offset 2752
+ OpMemberDecorate %type_View 152 Offset 2764
+ OpMemberDecorate %type_View 153 Offset 2768
+ OpMemberDecorate %type_View 154 Offset 2832
+ OpMemberDecorate %type_View 155 Offset 2896
+ OpMemberDecorate %type_View 156 Offset 2900
+ OpMemberDecorate %type_View 157 Offset 2904
+ OpMemberDecorate %type_View 158 Offset 2908
+ OpMemberDecorate %type_View 159 Offset 2912
+ OpMemberDecorate %type_View 160 Offset 2920
+ OpMemberDecorate %type_View 161 Offset 2924
+ OpMemberDecorate %type_View 162 Offset 2928
+ OpMemberDecorate %type_View 163 Offset 2940
+ OpMemberDecorate %type_View 164 Offset 2944
+ OpMemberDecorate %type_View 165 Offset 2956
+ OpMemberDecorate %type_View 166 Offset 2960
+ OpMemberDecorate %type_View 167 Offset 2968
+ OpMemberDecorate %type_View 168 Offset 2972
+ OpMemberDecorate %type_View 169 Offset 2976
+ OpMemberDecorate %type_View 170 Offset 2988
+ OpMemberDecorate %type_View 171 Offset 2992
+ OpMemberDecorate %type_View 172 Offset 3004
+ OpMemberDecorate %type_View 173 Offset 3008
+ OpMemberDecorate %type_View 174 Offset 3020
+ OpMemberDecorate %type_View 175 Offset 3024
+ OpMemberDecorate %type_View 176 Offset 3036
+ OpMemberDecorate %type_View 177 Offset 3040
+ OpMemberDecorate %type_View 178 Offset 3044
+ OpDecorate %type_View Block
+ OpDecorate %_arr_mat4v4float_uint_6 ArrayStride 64
+ OpMemberDecorate %type_ShadowDepthPass 0 Offset 0
+ OpMemberDecorate %type_ShadowDepthPass 1 Offset 4
+ OpMemberDecorate %type_ShadowDepthPass 2 Offset 8
+ OpMemberDecorate %type_ShadowDepthPass 3 Offset 12
+ OpMemberDecorate %type_ShadowDepthPass 4 Offset 16
+ OpMemberDecorate %type_ShadowDepthPass 5 Offset 20
+ OpMemberDecorate %type_ShadowDepthPass 6 Offset 24
+ OpMemberDecorate %type_ShadowDepthPass 7 Offset 28
+ OpMemberDecorate %type_ShadowDepthPass 8 Offset 32
+ OpMemberDecorate %type_ShadowDepthPass 9 Offset 36
+ OpMemberDecorate %type_ShadowDepthPass 10 Offset 40
+ OpMemberDecorate %type_ShadowDepthPass 11 Offset 44
+ OpMemberDecorate %type_ShadowDepthPass 12 Offset 48
+ OpMemberDecorate %type_ShadowDepthPass 13 Offset 52
+ OpMemberDecorate %type_ShadowDepthPass 14 Offset 56
+ OpMemberDecorate %type_ShadowDepthPass 15 Offset 60
+ OpMemberDecorate %type_ShadowDepthPass 16 Offset 64
+ OpMemberDecorate %type_ShadowDepthPass 17 Offset 68
+ OpMemberDecorate %type_ShadowDepthPass 18 Offset 72
+ OpMemberDecorate %type_ShadowDepthPass 19 Offset 76
+ OpMemberDecorate %type_ShadowDepthPass 20 Offset 80
+ OpMemberDecorate %type_ShadowDepthPass 21 Offset 84
+ OpMemberDecorate %type_ShadowDepthPass 22 Offset 88
+ OpMemberDecorate %type_ShadowDepthPass 23 Offset 92
+ OpMemberDecorate %type_ShadowDepthPass 24 Offset 96
+ OpMemberDecorate %type_ShadowDepthPass 25 Offset 100
+ OpMemberDecorate %type_ShadowDepthPass 26 Offset 104
+ OpMemberDecorate %type_ShadowDepthPass 27 Offset 108
+ OpMemberDecorate %type_ShadowDepthPass 28 Offset 112
+ OpMemberDecorate %type_ShadowDepthPass 29 Offset 116
+ OpMemberDecorate %type_ShadowDepthPass 30 Offset 120
+ OpMemberDecorate %type_ShadowDepthPass 31 Offset 124
+ OpMemberDecorate %type_ShadowDepthPass 32 Offset 128
+ OpMemberDecorate %type_ShadowDepthPass 33 Offset 132
+ OpMemberDecorate %type_ShadowDepthPass 34 Offset 136
+ OpMemberDecorate %type_ShadowDepthPass 35 Offset 140
+ OpMemberDecorate %type_ShadowDepthPass 36 Offset 144
+ OpMemberDecorate %type_ShadowDepthPass 37 Offset 148
+ OpMemberDecorate %type_ShadowDepthPass 38 Offset 152
+ OpMemberDecorate %type_ShadowDepthPass 39 Offset 156
+ OpMemberDecorate %type_ShadowDepthPass 40 Offset 160
+ OpMemberDecorate %type_ShadowDepthPass 41 Offset 164
+ OpMemberDecorate %type_ShadowDepthPass 42 Offset 168
+ OpMemberDecorate %type_ShadowDepthPass 43 Offset 172
+ OpMemberDecorate %type_ShadowDepthPass 44 Offset 176
+ OpMemberDecorate %type_ShadowDepthPass 45 Offset 180
+ OpMemberDecorate %type_ShadowDepthPass 46 Offset 184
+ OpMemberDecorate %type_ShadowDepthPass 47 Offset 188
+ OpMemberDecorate %type_ShadowDepthPass 48 Offset 192
+ OpMemberDecorate %type_ShadowDepthPass 49 Offset 196
+ OpMemberDecorate %type_ShadowDepthPass 50 Offset 200
+ OpMemberDecorate %type_ShadowDepthPass 51 Offset 204
+ OpMemberDecorate %type_ShadowDepthPass 52 Offset 208
+ OpMemberDecorate %type_ShadowDepthPass 53 Offset 212
+ OpMemberDecorate %type_ShadowDepthPass 54 Offset 216
+ OpMemberDecorate %type_ShadowDepthPass 55 Offset 220
+ OpMemberDecorate %type_ShadowDepthPass 56 Offset 224
+ OpMemberDecorate %type_ShadowDepthPass 57 Offset 228
+ OpMemberDecorate %type_ShadowDepthPass 58 Offset 232
+ OpMemberDecorate %type_ShadowDepthPass 59 Offset 236
+ OpMemberDecorate %type_ShadowDepthPass 60 Offset 240
+ OpMemberDecorate %type_ShadowDepthPass 61 Offset 244
+ OpMemberDecorate %type_ShadowDepthPass 62 Offset 248
+ OpMemberDecorate %type_ShadowDepthPass 63 Offset 252
+ OpMemberDecorate %type_ShadowDepthPass 64 Offset 256
+ OpMemberDecorate %type_ShadowDepthPass 65 Offset 260
+ OpMemberDecorate %type_ShadowDepthPass 66 Offset 264
+ OpMemberDecorate %type_ShadowDepthPass 67 Offset 268
+ OpMemberDecorate %type_ShadowDepthPass 68 Offset 272
+ OpMemberDecorate %type_ShadowDepthPass 68 MatrixStride 16
+ OpMemberDecorate %type_ShadowDepthPass 68 ColMajor
+ OpMemberDecorate %type_ShadowDepthPass 69 Offset 336
+ OpMemberDecorate %type_ShadowDepthPass 70 Offset 352
+ OpMemberDecorate %type_ShadowDepthPass 71 Offset 368
+ OpMemberDecorate %type_ShadowDepthPass 72 Offset 384
+ OpMemberDecorate %type_ShadowDepthPass 73 Offset 396
+ OpMemberDecorate %type_ShadowDepthPass 74 Offset 400
+ OpMemberDecorate %type_ShadowDepthPass 75 Offset 412
+ OpMemberDecorate %type_ShadowDepthPass 76 Offset 416
+ OpMemberDecorate %type_ShadowDepthPass 77 Offset 420
+ OpMemberDecorate %type_ShadowDepthPass 78 Offset 424
+ OpMemberDecorate %type_ShadowDepthPass 79 Offset 428
+ OpMemberDecorate %type_ShadowDepthPass 80 Offset 432
+ OpMemberDecorate %type_ShadowDepthPass 81 Offset 436
+ OpMemberDecorate %type_ShadowDepthPass 82 Offset 440
+ OpMemberDecorate %type_ShadowDepthPass 83 Offset 444
+ OpMemberDecorate %type_ShadowDepthPass 84 Offset 448
+ OpMemberDecorate %type_ShadowDepthPass 85 Offset 452
+ OpMemberDecorate %type_ShadowDepthPass 86 Offset 456
+ OpMemberDecorate %type_ShadowDepthPass 87 Offset 460
+ OpMemberDecorate %type_ShadowDepthPass 88 Offset 464
+ OpMemberDecorate %type_ShadowDepthPass 88 MatrixStride 16
+ OpMemberDecorate %type_ShadowDepthPass 88 ColMajor
+ OpMemberDecorate %type_ShadowDepthPass 89 Offset 528
+ OpMemberDecorate %type_ShadowDepthPass 89 MatrixStride 16
+ OpMemberDecorate %type_ShadowDepthPass 89 ColMajor
+ OpMemberDecorate %type_ShadowDepthPass 90 Offset 592
+ OpMemberDecorate %type_ShadowDepthPass 91 Offset 608
+ OpMemberDecorate %type_ShadowDepthPass 92 Offset 612
+ OpMemberDecorate %type_ShadowDepthPass 93 Offset 616
+ OpMemberDecorate %type_ShadowDepthPass 94 Offset 620
+ OpMemberDecorate %type_ShadowDepthPass 95 Offset 624
+ OpMemberDecorate %type_ShadowDepthPass 95 MatrixStride 16
+ OpMemberDecorate %type_ShadowDepthPass 95 ColMajor
+ OpMemberDecorate %type_ShadowDepthPass 96 Offset 1008
+ OpMemberDecorate %type_ShadowDepthPass 96 MatrixStride 16
+ OpMemberDecorate %type_ShadowDepthPass 96 ColMajor
+ OpDecorate %type_ShadowDepthPass Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+ %v2int = OpTypeVector %int 2
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %int_2 = OpConstant %int 2
+ %float_3 = OpConstant %float 3
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %float_6 = OpConstant %float 6
+ %57 = OpConstantComposite %v4float %float_6 %float_6 %float_6 %float_6
+ %float_1 = OpConstant %float 1
+ %int_79 = OpConstant %int 79
+%float_0_200000003 = OpConstant %float 0.200000003
+%float_n0_699999988 = OpConstant %float -0.699999988
+ %float_2 = OpConstant %float 2
+ %63 = OpConstantComposite %v2float %float_1 %float_2
+ %float_n1 = OpConstant %float -1
+ %float_10 = OpConstant %float 10
+ %float_0_5 = OpConstant %float 0.5
+ %67 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
+ %int_88 = OpConstant %int 88
+ %int_89 = OpConstant %int 89
+ %int_90 = OpConstant %int 90
+ %int_91 = OpConstant %int 91
+ %float_0 = OpConstant %float 0
+%float_9_99999997en07 = OpConstant %float 9.99999997e-07
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_arr_v4float_uint_7 = OpTypeArray %v4float %uint_7
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+ %type_View = OpTypeStruct %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %v3float %float %v3float %float %v4float %v4float %v3float %float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %v4float %v4float %v2float %v2float %v4float %v4float %v4float %v4float %int %float %float %float %v4float %v4float %v4float %v2float %float %float %float %float %float %float %v3float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %float %float %float %float %float %v4float %v3float %float %_arr_v4float_uint_2 %_arr_v4float_uint_2 %v4float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %v3float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %float %float %v4float %uint %uint %uint %uint %v4float %v3float %float %v4float %float %float %float %float %v4float %_arr_v4float_uint_7 %float %float %float %float %uint %float %float %float %v3float %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %float %float %float %float %v2int %float %float %v3float %float %v3float %float %v2float %float %float %v3float %float %v3float %float %v3float %float %v3float %float %float %float
+%_ptr_Uniform_type_View = OpTypePointer Uniform %type_View
+%type_sampler = OpTypeSampler
+%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler
+%type_2d_image = OpTypeImage %float 2D 2 0 0 1 Unknown
+%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image
+ %uint_6 = OpConstant %uint 6
+%_arr_mat4v4float_uint_6 = OpTypeArray %mat4v4float %uint_6
+ %v3int = OpTypeVector %int 3
+%type_ShadowDepthPass = OpTypeStruct %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %mat4v4float %v4float %v4float %v4float %v3int %int %v3int %float %float %float %float %float %float %float %float %float %float %float %float %int %mat4v4float %mat4v4float %v4float %float %float %float %float %_arr_mat4v4float_uint_6 %_arr_mat4v4float_uint_6
+%_ptr_Uniform_type_ShadowDepthPass = OpTypePointer Uniform %type_ShadowDepthPass
+ %uint_3 = OpConstant %uint 3
+%_arr_v4float_uint_3 = OpTypeArray %v4float %uint_3
+%_ptr_Input__arr_v4float_uint_3 = OpTypePointer Input %_arr_v4float_uint_3
+%_arr_v4float_uint_1 = OpTypeArray %v4float %uint_1
+%_arr__arr_v4float_uint_1_uint_3 = OpTypeArray %_arr_v4float_uint_1 %uint_3
+%_ptr_Input__arr__arr_v4float_uint_1_uint_3 = OpTypePointer Input %_arr__arr_v4float_uint_1_uint_3
+%_arr_uint_uint_3 = OpTypeArray %uint %uint_3
+%_ptr_Input__arr_uint_uint_3 = OpTypePointer Input %_arr_uint_uint_3
+%_arr__arr_v4float_uint_3_uint_3 = OpTypeArray %_arr_v4float_uint_3 %uint_3
+%_ptr_Input__arr__arr_v4float_uint_3_uint_3 = OpTypePointer Input %_arr__arr_v4float_uint_3_uint_3
+%_arr_v3float_uint_3 = OpTypeArray %v3float %uint_3
+%_ptr_Input__arr_v3float_uint_3 = OpTypePointer Input %_arr_v3float_uint_3
+%_arr_float_uint_3 = OpTypeArray %float %uint_3
+%_ptr_Input__arr_float_uint_3 = OpTypePointer Input %_arr_float_uint_3
+%_arr_float_uint_4 = OpTypeArray %float %uint_4
+%_ptr_Input__arr_float_uint_4 = OpTypePointer Input %_arr_float_uint_4
+%_arr_float_uint_2 = OpTypeArray %float %uint_2
+%_ptr_Input__arr_float_uint_2 = OpTypePointer Input %_arr_float_uint_2
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Input_v3float = OpTypePointer Input %v3float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%_ptr_Output__arr_v4float_uint_1 = OpTypePointer Output %_arr_v4float_uint_1
+%_ptr_Output_uint = OpTypePointer Output %uint
+%_ptr_Output_float = OpTypePointer Output %float
+%_ptr_Output_v3float = OpTypePointer Output %v3float
+ %void = OpTypeVoid
+ %106 = OpTypeFunction %void
+%_ptr_Function_float = OpTypePointer Function %float
+ %bool = OpTypeBool
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+%type_sampled_image = OpTypeSampledImage %type_2d_image
+ %View = OpVariable %_ptr_Uniform_type_View Uniform
+%ShadowDepthPass = OpVariable %_ptr_Uniform_type_ShadowDepthPass Uniform
+%Material_Texture2D_3 = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%Material_Texture2D_3Sampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%in_var_TEXCOORD10_centroid = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_TEXCOORD11_centroid = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_COLOR0 = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_TEXCOORD0 = OpVariable %_ptr_Input__arr__arr_v4float_uint_1_uint_3 Input
+%in_var_PRIMITIVE_ID = OpVariable %_ptr_Input__arr_uint_uint_3 Input
+%in_var_VS_to_DS_Position = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_PN_POSITION = OpVariable %_ptr_Input__arr__arr_v4float_uint_3_uint_3 Input
+%in_var_PN_DisplacementScales = OpVariable %_ptr_Input__arr_v3float_uint_3 Input
+%in_var_PN_TessellationMultiplier = OpVariable %_ptr_Input__arr_float_uint_3 Input
+%in_var_PN_WorldDisplacementMultiplier = OpVariable %_ptr_Input__arr_float_uint_3 Input
+%gl_TessLevelOuter = OpVariable %_ptr_Input__arr_float_uint_4 Input
+%gl_TessLevelInner = OpVariable %_ptr_Input__arr_float_uint_2 Input
+%in_var_PN_POSITION9 = OpVariable %_ptr_Input_v4float Input
+%gl_TessCoord = OpVariable %_ptr_Input_v3float Input
+%out_var_TEXCOORD10_centroid = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD11_centroid = OpVariable %_ptr_Output_v4float Output
+%out_var_COLOR0 = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD0 = OpVariable %_ptr_Output__arr_v4float_uint_1 Output
+%out_var_PRIMITIVE_ID = OpVariable %_ptr_Output_uint Output
+%out_var_TEXCOORD6 = OpVariable %_ptr_Output_float Output
+%out_var_TEXCOORD8 = OpVariable %_ptr_Output_float Output
+%out_var_TEXCOORD7 = OpVariable %_ptr_Output_v3float Output
+%gl_Position = OpVariable %_ptr_Output_v4float Output
+ %112 = OpConstantNull %v4float
+ %113 = OpUndef %v4float
+%_ptr_Input_uint = OpTypePointer Input %uint
+ %MainDomain = OpFunction %void None %106
+ %115 = OpLabel
+ %116 = OpVariable %_ptr_Function_mat4v4float Function
+ %117 = OpLoad %_arr_v4float_uint_3 %in_var_TEXCOORD10_centroid
+ %118 = OpLoad %_arr_v4float_uint_3 %in_var_TEXCOORD11_centroid
+ %119 = OpLoad %_arr_v4float_uint_3 %in_var_COLOR0
+ %120 = OpLoad %_arr__arr_v4float_uint_1_uint_3 %in_var_TEXCOORD0
+ %121 = OpAccessChain %_ptr_Input_uint %in_var_PRIMITIVE_ID %uint_0
+ %122 = OpLoad %uint %121
+ %123 = OpCompositeExtract %v4float %117 0
+ %124 = OpCompositeExtract %v4float %118 0
+ %125 = OpCompositeExtract %v4float %119 0
+ %126 = OpCompositeExtract %_arr_v4float_uint_1 %120 0
+ %127 = OpCompositeExtract %v4float %117 1
+ %128 = OpCompositeExtract %v4float %118 1
+ %129 = OpCompositeExtract %v4float %119 1
+ %130 = OpCompositeExtract %_arr_v4float_uint_1 %120 1
+ %131 = OpCompositeExtract %v4float %117 2
+ %132 = OpCompositeExtract %v4float %118 2
+ %133 = OpCompositeExtract %v4float %119 2
+ %134 = OpCompositeExtract %_arr_v4float_uint_1 %120 2
+ %135 = OpLoad %_arr__arr_v4float_uint_3_uint_3 %in_var_PN_POSITION
+ %136 = OpLoad %_arr_float_uint_3 %in_var_PN_WorldDisplacementMultiplier
+ %137 = OpCompositeExtract %_arr_v4float_uint_3 %135 0
+ %138 = OpCompositeExtract %float %136 0
+ %139 = OpCompositeExtract %_arr_v4float_uint_3 %135 1
+ %140 = OpCompositeExtract %float %136 1
+ %141 = OpCompositeExtract %_arr_v4float_uint_3 %135 2
+ %142 = OpCompositeExtract %float %136 2
+ %143 = OpCompositeExtract %v4float %137 0
+ %144 = OpCompositeExtract %v4float %137 1
+ %145 = OpCompositeExtract %v4float %137 2
+ %146 = OpCompositeExtract %v4float %139 0
+ %147 = OpCompositeExtract %v4float %139 1
+ %148 = OpCompositeExtract %v4float %139 2
+ %149 = OpCompositeExtract %v4float %141 0
+ %150 = OpCompositeExtract %v4float %141 1
+ %151 = OpCompositeExtract %v4float %141 2
+ %152 = OpLoad %v4float %in_var_PN_POSITION9
+ %153 = OpLoad %v3float %gl_TessCoord
+ %154 = OpCompositeExtract %float %153 0
+ %155 = OpCompositeExtract %float %153 1
+ %156 = OpCompositeExtract %float %153 2
+ %157 = OpFMul %float %154 %154
+ %158 = OpFMul %float %155 %155
+ %159 = OpFMul %float %156 %156
+ %160 = OpFMul %float %157 %float_3
+ %161 = OpFMul %float %158 %float_3
+ %162 = OpFMul %float %159 %float_3
+ %163 = OpCompositeConstruct %v4float %157 %157 %157 %157
+ %164 = OpFMul %v4float %143 %163
+ %165 = OpCompositeConstruct %v4float %154 %154 %154 %154
+ %166 = OpFMul %v4float %164 %165
+ %167 = OpCompositeConstruct %v4float %158 %158 %158 %158
+ %168 = OpFMul %v4float %146 %167
+ %169 = OpCompositeConstruct %v4float %155 %155 %155 %155
+ %170 = OpFMul %v4float %168 %169
+ %171 = OpFAdd %v4float %166 %170
+ %172 = OpCompositeConstruct %v4float %159 %159 %159 %159
+ %173 = OpFMul %v4float %149 %172
+ %174 = OpCompositeConstruct %v4float %156 %156 %156 %156
+ %175 = OpFMul %v4float %173 %174
+ %176 = OpFAdd %v4float %171 %175
+ %177 = OpCompositeConstruct %v4float %160 %160 %160 %160
+ %178 = OpFMul %v4float %144 %177
+ %179 = OpFMul %v4float %178 %169
+ %180 = OpFAdd %v4float %176 %179
+ %181 = OpCompositeConstruct %v4float %161 %161 %161 %161
+ %182 = OpFMul %v4float %145 %181
+ %183 = OpFMul %v4float %182 %165
+ %184 = OpFAdd %v4float %180 %183
+ %185 = OpFMul %v4float %147 %181
+ %186 = OpFMul %v4float %185 %174
+ %187 = OpFAdd %v4float %184 %186
+ %188 = OpCompositeConstruct %v4float %162 %162 %162 %162
+ %189 = OpFMul %v4float %148 %188
+ %190 = OpFMul %v4float %189 %169
+ %191 = OpFAdd %v4float %187 %190
+ %192 = OpFMul %v4float %150 %188
+ %193 = OpFMul %v4float %192 %165
+ %194 = OpFAdd %v4float %191 %193
+ %195 = OpFMul %v4float %151 %177
+ %196 = OpFMul %v4float %195 %174
+ %197 = OpFAdd %v4float %194 %196
+ %198 = OpFMul %v4float %152 %57
+ %199 = OpFMul %v4float %198 %174
+ %200 = OpFMul %v4float %199 %165
+ %201 = OpFMul %v4float %200 %169
+ %202 = OpFAdd %v4float %197 %201
+ %203 = OpCompositeExtract %v4float %126 0
+ %204 = OpCompositeExtract %v4float %130 0
+ %205 = OpVectorShuffle %v3float %123 %123 0 1 2
+ %206 = OpCompositeConstruct %v3float %154 %154 %154
+ %207 = OpFMul %v3float %205 %206
+ %208 = OpVectorShuffle %v3float %127 %127 0 1 2
+ %209 = OpCompositeConstruct %v3float %155 %155 %155
+ %210 = OpFMul %v3float %208 %209
+ %211 = OpFAdd %v3float %207 %210
+ %212 = OpFMul %v4float %124 %165
+ %213 = OpFMul %v4float %128 %169
+ %214 = OpFAdd %v4float %212 %213
+ %215 = OpFMul %v4float %125 %165
+ %216 = OpFMul %v4float %129 %169
+ %217 = OpFAdd %v4float %215 %216
+ %218 = OpFMul %v4float %203 %165
+ %219 = OpFMul %v4float %204 %169
+ %220 = OpFAdd %v4float %218 %219
+ %221 = OpCompositeExtract %v4float %134 0
+ %222 = OpVectorShuffle %v3float %211 %112 0 1 2
+ %223 = OpVectorShuffle %v3float %131 %131 0 1 2
+ %224 = OpCompositeConstruct %v3float %156 %156 %156
+ %225 = OpFMul %v3float %223 %224
+ %226 = OpFAdd %v3float %222 %225
+ %227 = OpVectorShuffle %v4float %113 %226 4 5 6 3
+ %228 = OpFMul %v4float %132 %174
+ %229 = OpFAdd %v4float %214 %228
+ %230 = OpFMul %v4float %133 %174
+ %231 = OpFAdd %v4float %217 %230
+ %232 = OpFMul %v4float %221 %174
+ %233 = OpFAdd %v4float %220 %232
+ %234 = OpCompositeConstruct %_arr_v4float_uint_1 %233
+ %235 = OpVectorShuffle %v2float %233 %233 2 3
+ %236 = OpVectorShuffle %v3float %229 %229 0 1 2
+ %237 = OpAccessChain %_ptr_Uniform_float %View %int_79
+ %238 = OpLoad %float %237
+ %239 = OpFMul %float %238 %float_0_200000003
+ %240 = OpFMul %float %238 %float_n0_699999988
+ %241 = OpFMul %v2float %235 %63
+ %242 = OpCompositeConstruct %v2float %239 %240
+ %243 = OpFAdd %v2float %242 %241
+ %244 = OpLoad %type_2d_image %Material_Texture2D_3
+ %245 = OpLoad %type_sampler %Material_Texture2D_3Sampler
+ %246 = OpSampledImage %type_sampled_image %244 %245
+ %247 = OpImageSampleExplicitLod %v4float %246 %243 Lod %float_n1
+ %248 = OpCompositeExtract %float %247 0
+ %249 = OpFMul %float %248 %float_10
+ %250 = OpCompositeExtract %float %231 0
+ %251 = OpFSub %float %float_1 %250
+ %252 = OpFMul %float %249 %251
+ %253 = OpCompositeConstruct %v3float %252 %252 %252
+ %254 = OpFMul %v3float %253 %236
+ %255 = OpFMul %v3float %254 %67
+ %256 = OpFMul %float %138 %154
+ %257 = OpFMul %float %140 %155
+ %258 = OpFAdd %float %256 %257
+ %259 = OpFMul %float %142 %156
+ %260 = OpFAdd %float %258 %259
+ %261 = OpCompositeConstruct %v3float %260 %260 %260
+ %262 = OpFMul %v3float %255 %261
+ %263 = OpVectorShuffle %v3float %202 %202 0 1 2
+ %264 = OpFAdd %v3float %263 %262
+ %265 = OpVectorShuffle %v4float %202 %264 4 5 6 3
+ %266 = OpAccessChain %_ptr_Uniform_mat4v4float %ShadowDepthPass %int_88
+ %267 = OpLoad %mat4v4float %266
+ %268 = OpAccessChain %_ptr_Uniform_mat4v4float %ShadowDepthPass %int_89
+ %269 = OpLoad %mat4v4float %268
+ OpStore %116 %269
+ %270 = OpMatrixTimesVector %v4float %267 %265
+ %271 = OpAccessChain %_ptr_Uniform_float %ShadowDepthPass %int_91
+ %272 = OpLoad %float %271
+ %273 = OpFOrdGreaterThan %bool %272 %float_0
+ %274 = OpCompositeExtract %float %270 2
+ %275 = OpFOrdLessThan %bool %274 %float_0
+ %276 = OpLogicalAnd %bool %273 %275
+ OpSelectionMerge %277 None
+ OpBranchConditional %276 %278 %277
+ %278 = OpLabel
+ %279 = OpCompositeInsert %v4float %float_9_99999997en07 %270 2
+ %280 = OpCompositeInsert %v4float %float_1 %279 3
+ OpBranch %277
+ %277 = OpLabel
+ %281 = OpPhi %v4float %270 %115 %280 %278
+ %282 = OpAccessChain %_ptr_Function_float %116 %uint_0 %int_2
+ %283 = OpLoad %float %282
+ %284 = OpAccessChain %_ptr_Function_float %116 %uint_1 %int_2
+ %285 = OpLoad %float %284
+ %286 = OpAccessChain %_ptr_Function_float %116 %uint_2 %int_2
+ %287 = OpLoad %float %286
+ %288 = OpCompositeConstruct %v3float %283 %285 %287
+ %289 = OpDot %float %288 %236
+ %290 = OpExtInst %float %1 FAbs %289
+ %291 = OpAccessChain %_ptr_Uniform_float %ShadowDepthPass %int_90 %int_2
+ %292 = OpLoad %float %291
+ %293 = OpExtInst %float %1 FAbs %290
+ %294 = OpFOrdGreaterThan %bool %293 %float_0
+ %295 = OpFMul %float %290 %290
+ %296 = OpFSub %float %float_1 %295
+ %297 = OpExtInst %float %1 FClamp %296 %float_0 %float_1
+ %298 = OpExtInst %float %1 Sqrt %297
+ %299 = OpFDiv %float %298 %290
+ %300 = OpSelect %float %294 %299 %292
+ %301 = OpExtInst %float %1 FClamp %300 %float_0 %292
+ %302 = OpAccessChain %_ptr_Uniform_float %ShadowDepthPass %int_90 %int_1
+ %303 = OpLoad %float %302
+ %304 = OpFMul %float %303 %301
+ %305 = OpAccessChain %_ptr_Uniform_float %ShadowDepthPass %int_90 %int_0
+ %306 = OpLoad %float %305
+ %307 = OpFAdd %float %304 %306
+ %308 = OpCompositeExtract %float %281 2
+ %309 = OpVectorShuffle %v3float %264 %112 0 1 2
+ OpStore %out_var_TEXCOORD10_centroid %227
+ OpStore %out_var_TEXCOORD11_centroid %229
+ OpStore %out_var_COLOR0 %231
+ OpStore %out_var_TEXCOORD0 %234
+ OpStore %out_var_PRIMITIVE_ID %122
+ OpStore %out_var_TEXCOORD6 %308
+ OpStore %out_var_TEXCOORD8 %307
+ OpStore %out_var_TEXCOORD7 %309
+ OpStore %gl_Position %281
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese
new file mode 100644
index 00000000000..cb55bb42503
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese
@@ -0,0 +1,1175 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 581
+; Schema: 0
+ OpCapability Tessellation
+ OpCapability ClipDistance
+ OpCapability SampledBuffer
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint TessellationEvaluation %MainDomain "main" %gl_ClipDistance %in_var_TEXCOORD6 %in_var_TEXCOORD8 %in_var_TEXCOORD10_centroid %in_var_TEXCOORD11_centroid %in_var_VS_To_DS_Position %in_var_VS_To_DS_VertexID %in_var_PN_POSITION %in_var_PN_DisplacementScales %in_var_PN_TessellationMultiplier %in_var_PN_WorldDisplacementMultiplier %in_var_PN_DominantVertex %in_var_PN_DominantVertex1 %in_var_PN_DominantVertex2 %in_var_PN_DominantEdge %in_var_PN_DominantEdge1 %in_var_PN_DominantEdge2 %in_var_PN_DominantEdge3 %in_var_PN_DominantEdge4 %in_var_PN_DominantEdge5 %gl_TessLevelOuter %gl_TessLevelInner %in_var_PN_POSITION9 %gl_TessCoord %gl_Position %out_var_TEXCOORD6 %out_var_TEXCOORD7 %out_var_TEXCOORD10_centroid %out_var_TEXCOORD11_centroid
+ OpExecutionMode %MainDomain Triangles
+ OpExecutionMode %MainDomain SpacingFractionalOdd
+ OpExecutionMode %MainDomain VertexOrderCw
+ OpSource HLSL 600
+ OpName %type_View "type.View"
+ OpMemberName %type_View 0 "View_TranslatedWorldToClip"
+ OpMemberName %type_View 1 "View_WorldToClip"
+ OpMemberName %type_View 2 "View_ClipToWorld"
+ OpMemberName %type_View 3 "View_TranslatedWorldToView"
+ OpMemberName %type_View 4 "View_ViewToTranslatedWorld"
+ OpMemberName %type_View 5 "View_TranslatedWorldToCameraView"
+ OpMemberName %type_View 6 "View_CameraViewToTranslatedWorld"
+ OpMemberName %type_View 7 "View_ViewToClip"
+ OpMemberName %type_View 8 "View_ViewToClipNoAA"
+ OpMemberName %type_View 9 "View_ClipToView"
+ OpMemberName %type_View 10 "View_ClipToTranslatedWorld"
+ OpMemberName %type_View 11 "View_SVPositionToTranslatedWorld"
+ OpMemberName %type_View 12 "View_ScreenToWorld"
+ OpMemberName %type_View 13 "View_ScreenToTranslatedWorld"
+ OpMemberName %type_View 14 "View_ViewForward"
+ OpMemberName %type_View 15 "PrePadding_View_908"
+ OpMemberName %type_View 16 "View_ViewUp"
+ OpMemberName %type_View 17 "PrePadding_View_924"
+ OpMemberName %type_View 18 "View_ViewRight"
+ OpMemberName %type_View 19 "PrePadding_View_940"
+ OpMemberName %type_View 20 "View_HMDViewNoRollUp"
+ OpMemberName %type_View 21 "PrePadding_View_956"
+ OpMemberName %type_View 22 "View_HMDViewNoRollRight"
+ OpMemberName %type_View 23 "PrePadding_View_972"
+ OpMemberName %type_View 24 "View_InvDeviceZToWorldZTransform"
+ OpMemberName %type_View 25 "View_ScreenPositionScaleBias"
+ OpMemberName %type_View 26 "View_WorldCameraOrigin"
+ OpMemberName %type_View 27 "PrePadding_View_1020"
+ OpMemberName %type_View 28 "View_TranslatedWorldCameraOrigin"
+ OpMemberName %type_View 29 "PrePadding_View_1036"
+ OpMemberName %type_View 30 "View_WorldViewOrigin"
+ OpMemberName %type_View 31 "PrePadding_View_1052"
+ OpMemberName %type_View 32 "View_PreViewTranslation"
+ OpMemberName %type_View 33 "PrePadding_View_1068"
+ OpMemberName %type_View 34 "View_PrevProjection"
+ OpMemberName %type_View 35 "View_PrevViewProj"
+ OpMemberName %type_View 36 "View_PrevViewRotationProj"
+ OpMemberName %type_View 37 "View_PrevViewToClip"
+ OpMemberName %type_View 38 "View_PrevClipToView"
+ OpMemberName %type_View 39 "View_PrevTranslatedWorldToClip"
+ OpMemberName %type_View 40 "View_PrevTranslatedWorldToView"
+ OpMemberName %type_View 41 "View_PrevViewToTranslatedWorld"
+ OpMemberName %type_View 42 "View_PrevTranslatedWorldToCameraView"
+ OpMemberName %type_View 43 "View_PrevCameraViewToTranslatedWorld"
+ OpMemberName %type_View 44 "View_PrevWorldCameraOrigin"
+ OpMemberName %type_View 45 "PrePadding_View_1724"
+ OpMemberName %type_View 46 "View_PrevWorldViewOrigin"
+ OpMemberName %type_View 47 "PrePadding_View_1740"
+ OpMemberName %type_View 48 "View_PrevPreViewTranslation"
+ OpMemberName %type_View 49 "PrePadding_View_1756"
+ OpMemberName %type_View 50 "View_PrevInvViewProj"
+ OpMemberName %type_View 51 "View_PrevScreenToTranslatedWorld"
+ OpMemberName %type_View 52 "View_ClipToPrevClip"
+ OpMemberName %type_View 53 "View_TemporalAAJitter"
+ OpMemberName %type_View 54 "View_GlobalClippingPlane"
+ OpMemberName %type_View 55 "View_FieldOfViewWideAngles"
+ OpMemberName %type_View 56 "View_PrevFieldOfViewWideAngles"
+ OpMemberName %type_View 57 "View_ViewRectMin"
+ OpMemberName %type_View 58 "View_ViewSizeAndInvSize"
+ OpMemberName %type_View 59 "View_BufferSizeAndInvSize"
+ OpMemberName %type_View 60 "View_BufferBilinearUVMinMax"
+ OpMemberName %type_View 61 "View_NumSceneColorMSAASamples"
+ OpMemberName %type_View 62 "View_PreExposure"
+ OpMemberName %type_View 63 "View_OneOverPreExposure"
+ OpMemberName %type_View 64 "PrePadding_View_2076"
+ OpMemberName %type_View 65 "View_DiffuseOverrideParameter"
+ OpMemberName %type_View 66 "View_SpecularOverrideParameter"
+ OpMemberName %type_View 67 "View_NormalOverrideParameter"
+ OpMemberName %type_View 68 "View_RoughnessOverrideParameter"
+ OpMemberName %type_View 69 "View_PrevFrameGameTime"
+ OpMemberName %type_View 70 "View_PrevFrameRealTime"
+ OpMemberName %type_View 71 "View_OutOfBoundsMask"
+ OpMemberName %type_View 72 "PrePadding_View_2148"
+ OpMemberName %type_View 73 "PrePadding_View_2152"
+ OpMemberName %type_View 74 "PrePadding_View_2156"
+ OpMemberName %type_View 75 "View_WorldCameraMovementSinceLastFrame"
+ OpMemberName %type_View 76 "View_CullingSign"
+ OpMemberName %type_View 77 "View_NearPlane"
+ OpMemberName %type_View 78 "View_AdaptiveTessellationFactor"
+ OpMemberName %type_View 79 "View_GameTime"
+ OpMemberName %type_View 80 "View_RealTime"
+ OpMemberName %type_View 81 "View_DeltaTime"
+ OpMemberName %type_View 82 "View_MaterialTextureMipBias"
+ OpMemberName %type_View 83 "View_MaterialTextureDerivativeMultiply"
+ OpMemberName %type_View 84 "View_Random"
+ OpMemberName %type_View 85 "View_FrameNumber"
+ OpMemberName %type_View 86 "View_StateFrameIndexMod8"
+ OpMemberName %type_View 87 "View_StateFrameIndex"
+ OpMemberName %type_View 88 "View_CameraCut"
+ OpMemberName %type_View 89 "View_UnlitViewmodeMask"
+ OpMemberName %type_View 90 "PrePadding_View_2228"
+ OpMemberName %type_View 91 "PrePadding_View_2232"
+ OpMemberName %type_View 92 "PrePadding_View_2236"
+ OpMemberName %type_View 93 "View_DirectionalLightColor"
+ OpMemberName %type_View 94 "View_DirectionalLightDirection"
+ OpMemberName %type_View 95 "PrePadding_View_2268"
+ OpMemberName %type_View 96 "View_TranslucencyLightingVolumeMin"
+ OpMemberName %type_View 97 "View_TranslucencyLightingVolumeInvSize"
+ OpMemberName %type_View 98 "View_TemporalAAParams"
+ OpMemberName %type_View 99 "View_CircleDOFParams"
+ OpMemberName %type_View 100 "View_DepthOfFieldSensorWidth"
+ OpMemberName %type_View 101 "View_DepthOfFieldFocalDistance"
+ OpMemberName %type_View 102 "View_DepthOfFieldScale"
+ OpMemberName %type_View 103 "View_DepthOfFieldFocalLength"
+ OpMemberName %type_View 104 "View_DepthOfFieldFocalRegion"
+ OpMemberName %type_View 105 "View_DepthOfFieldNearTransitionRegion"
+ OpMemberName %type_View 106 "View_DepthOfFieldFarTransitionRegion"
+ OpMemberName %type_View 107 "View_MotionBlurNormalizedToPixel"
+ OpMemberName %type_View 108 "View_bSubsurfacePostprocessEnabled"
+ OpMemberName %type_View 109 "View_GeneralPurposeTweak"
+ OpMemberName %type_View 110 "View_DemosaicVposOffset"
+ OpMemberName %type_View 111 "PrePadding_View_2412"
+ OpMemberName %type_View 112 "View_IndirectLightingColorScale"
+ OpMemberName %type_View 113 "View_HDR32bppEncodingMode"
+ OpMemberName %type_View 114 "View_AtmosphericFogSunDirection"
+ OpMemberName %type_View 115 "View_AtmosphericFogSunPower"
+ OpMemberName %type_View 116 "View_AtmosphericFogPower"
+ OpMemberName %type_View 117 "View_AtmosphericFogDensityScale"
+ OpMemberName %type_View 118 "View_AtmosphericFogDensityOffset"
+ OpMemberName %type_View 119 "View_AtmosphericFogGroundOffset"
+ OpMemberName %type_View 120 "View_AtmosphericFogDistanceScale"
+ OpMemberName %type_View 121 "View_AtmosphericFogAltitudeScale"
+ OpMemberName %type_View 122 "View_AtmosphericFogHeightScaleRayleigh"
+ OpMemberName %type_View 123 "View_AtmosphericFogStartDistance"
+ OpMemberName %type_View 124 "View_AtmosphericFogDistanceOffset"
+ OpMemberName %type_View 125 "View_AtmosphericFogSunDiscScale"
+ OpMemberName %type_View 126 "View_AtmosphericFogSunDiscHalfApexAngleRadian"
+ OpMemberName %type_View 127 "PrePadding_View_2492"
+ OpMemberName %type_View 128 "View_AtmosphericFogSunDiscLuminance"
+ OpMemberName %type_View 129 "View_AtmosphericFogRenderMask"
+ OpMemberName %type_View 130 "View_AtmosphericFogInscatterAltitudeSampleNum"
+ OpMemberName %type_View 131 "PrePadding_View_2520"
+ OpMemberName %type_View 132 "PrePadding_View_2524"
+ OpMemberName %type_View 133 "View_AtmosphericFogSunColor"
+ OpMemberName %type_View 134 "View_NormalCurvatureToRoughnessScaleBias"
+ OpMemberName %type_View 135 "View_RenderingReflectionCaptureMask"
+ OpMemberName %type_View 136 "View_AmbientCubemapTint"
+ OpMemberName %type_View 137 "View_AmbientCubemapIntensity"
+ OpMemberName %type_View 138 "View_SkyLightParameters"
+ OpMemberName %type_View 139 "PrePadding_View_2584"
+ OpMemberName %type_View 140 "PrePadding_View_2588"
+ OpMemberName %type_View 141 "View_SkyLightColor"
+ OpMemberName %type_View 142 "View_SkyIrradianceEnvironmentMap"
+ OpMemberName %type_View 143 "View_MobilePreviewMode"
+ OpMemberName %type_View 144 "View_HMDEyePaddingOffset"
+ OpMemberName %type_View 145 "View_ReflectionCubemapMaxMip"
+ OpMemberName %type_View 146 "View_ShowDecalsMask"
+ OpMemberName %type_View 147 "View_DistanceFieldAOSpecularOcclusionMode"
+ OpMemberName %type_View 148 "View_IndirectCapsuleSelfShadowingIntensity"
+ OpMemberName %type_View 149 "PrePadding_View_2744"
+ OpMemberName %type_View 150 "PrePadding_View_2748"
+ OpMemberName %type_View 151 "View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight"
+ OpMemberName %type_View 152 "View_StereoPassIndex"
+ OpMemberName %type_View 153 "View_GlobalVolumeCenterAndExtent"
+ OpMemberName %type_View 154 "View_GlobalVolumeWorldToUVAddAndMul"
+ OpMemberName %type_View 155 "View_GlobalVolumeDimension"
+ OpMemberName %type_View 156 "View_GlobalVolumeTexelSize"
+ OpMemberName %type_View 157 "View_MaxGlobalDistance"
+ OpMemberName %type_View 158 "PrePadding_View_2908"
+ OpMemberName %type_View 159 "View_CursorPosition"
+ OpMemberName %type_View 160 "View_bCheckerboardSubsurfaceProfileRendering"
+ OpMemberName %type_View 161 "PrePadding_View_2924"
+ OpMemberName %type_View 162 "View_VolumetricFogInvGridSize"
+ OpMemberName %type_View 163 "PrePadding_View_2940"
+ OpMemberName %type_View 164 "View_VolumetricFogGridZParams"
+ OpMemberName %type_View 165 "PrePadding_View_2956"
+ OpMemberName %type_View 166 "View_VolumetricFogSVPosToVolumeUV"
+ OpMemberName %type_View 167 "View_VolumetricFogMaxDistance"
+ OpMemberName %type_View 168 "PrePadding_View_2972"
+ OpMemberName %type_View 169 "View_VolumetricLightmapWorldToUVScale"
+ OpMemberName %type_View 170 "PrePadding_View_2988"
+ OpMemberName %type_View 171 "View_VolumetricLightmapWorldToUVAdd"
+ OpMemberName %type_View 172 "PrePadding_View_3004"
+ OpMemberName %type_View 173 "View_VolumetricLightmapIndirectionTextureSize"
+ OpMemberName %type_View 174 "View_VolumetricLightmapBrickSize"
+ OpMemberName %type_View 175 "View_VolumetricLightmapBrickTexelSize"
+ OpMemberName %type_View 176 "View_StereoIPD"
+ OpMemberName %type_View 177 "View_IndirectLightingCacheShowFlag"
+ OpMemberName %type_View 178 "View_EyeToPixelSpreadAngle"
+ OpMemberName %type_View 179 "PrePadding_View_3048"
+ OpMemberName %type_View 180 "PrePadding_View_3052"
+ OpMemberName %type_View 181 "View_WorldToVirtualTexture"
+ OpMemberName %type_View 182 "View_VirtualTextureParams"
+ OpMemberName %type_View 183 "View_XRPassthroughCameraUVs"
+ OpName %View "View"
+ OpName %type_sampler "type.sampler"
+ OpName %type_3d_image "type.3d.image"
+ OpName %View_GlobalDistanceFieldTexture0 "View_GlobalDistanceFieldTexture0"
+ OpName %View_GlobalDistanceFieldSampler0 "View_GlobalDistanceFieldSampler0"
+ OpName %View_GlobalDistanceFieldTexture1 "View_GlobalDistanceFieldTexture1"
+ OpName %View_GlobalDistanceFieldTexture2 "View_GlobalDistanceFieldTexture2"
+ OpName %View_GlobalDistanceFieldTexture3 "View_GlobalDistanceFieldTexture3"
+ OpName %type_Material "type.Material"
+ OpMemberName %type_Material 0 "Material_VectorExpressions"
+ OpMemberName %type_Material 1 "Material_ScalarExpressions"
+ OpName %Material "Material"
+ OpName %in_var_TEXCOORD6 "in.var.TEXCOORD6"
+ OpName %in_var_TEXCOORD8 "in.var.TEXCOORD8"
+ OpName %in_var_TEXCOORD10_centroid "in.var.TEXCOORD10_centroid"
+ OpName %in_var_TEXCOORD11_centroid "in.var.TEXCOORD11_centroid"
+ OpName %in_var_VS_To_DS_Position "in.var.VS_To_DS_Position"
+ OpName %in_var_VS_To_DS_VertexID "in.var.VS_To_DS_VertexID"
+ OpName %in_var_PN_POSITION "in.var.PN_POSITION"
+ OpName %in_var_PN_DisplacementScales "in.var.PN_DisplacementScales"
+ OpName %in_var_PN_TessellationMultiplier "in.var.PN_TessellationMultiplier"
+ OpName %in_var_PN_WorldDisplacementMultiplier "in.var.PN_WorldDisplacementMultiplier"
+ OpName %in_var_PN_DominantVertex "in.var.PN_DominantVertex"
+ OpName %in_var_PN_DominantVertex1 "in.var.PN_DominantVertex1"
+ OpName %in_var_PN_DominantVertex2 "in.var.PN_DominantVertex2"
+ OpName %in_var_PN_DominantEdge "in.var.PN_DominantEdge"
+ OpName %in_var_PN_DominantEdge1 "in.var.PN_DominantEdge1"
+ OpName %in_var_PN_DominantEdge2 "in.var.PN_DominantEdge2"
+ OpName %in_var_PN_DominantEdge3 "in.var.PN_DominantEdge3"
+ OpName %in_var_PN_DominantEdge4 "in.var.PN_DominantEdge4"
+ OpName %in_var_PN_DominantEdge5 "in.var.PN_DominantEdge5"
+ OpName %in_var_PN_POSITION9 "in.var.PN_POSITION9"
+ OpName %out_var_TEXCOORD6 "out.var.TEXCOORD6"
+ OpName %out_var_TEXCOORD7 "out.var.TEXCOORD7"
+ OpName %out_var_TEXCOORD10_centroid "out.var.TEXCOORD10_centroid"
+ OpName %out_var_TEXCOORD11_centroid "out.var.TEXCOORD11_centroid"
+ OpName %MainDomain "MainDomain"
+ OpName %type_sampled_image "type.sampled.image"
+ OpDecorate %gl_ClipDistance BuiltIn ClipDistance
+ OpDecorateString %gl_ClipDistance UserSemantic "SV_ClipDistance"
+ OpDecorateString %in_var_TEXCOORD6 UserSemantic "TEXCOORD6"
+ OpDecorateString %in_var_TEXCOORD8 UserSemantic "TEXCOORD8"
+ OpDecorateString %in_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %in_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %in_var_VS_To_DS_Position UserSemantic "VS_To_DS_Position"
+ OpDecorateString %in_var_VS_To_DS_VertexID UserSemantic "VS_To_DS_VertexID"
+ OpDecorateString %in_var_PN_POSITION UserSemantic "PN_POSITION"
+ OpDecorateString %in_var_PN_DisplacementScales UserSemantic "PN_DisplacementScales"
+ OpDecorateString %in_var_PN_TessellationMultiplier UserSemantic "PN_TessellationMultiplier"
+ OpDecorateString %in_var_PN_WorldDisplacementMultiplier UserSemantic "PN_WorldDisplacementMultiplier"
+ OpDecorateString %in_var_PN_DominantVertex UserSemantic "PN_DominantVertex"
+ OpDecorateString %in_var_PN_DominantVertex1 UserSemantic "PN_DominantVertex"
+ OpDecorateString %in_var_PN_DominantVertex2 UserSemantic "PN_DominantVertex"
+ OpDecorateString %in_var_PN_DominantEdge UserSemantic "PN_DominantEdge"
+ OpDecorateString %in_var_PN_DominantEdge1 UserSemantic "PN_DominantEdge"
+ OpDecorateString %in_var_PN_DominantEdge2 UserSemantic "PN_DominantEdge"
+ OpDecorateString %in_var_PN_DominantEdge3 UserSemantic "PN_DominantEdge"
+ OpDecorateString %in_var_PN_DominantEdge4 UserSemantic "PN_DominantEdge"
+ OpDecorateString %in_var_PN_DominantEdge5 UserSemantic "PN_DominantEdge"
+ OpDecorate %gl_TessLevelOuter BuiltIn TessLevelOuter
+ OpDecorateString %gl_TessLevelOuter UserSemantic "SV_TessFactor"
+ OpDecorate %gl_TessLevelOuter Patch
+ OpDecorate %gl_TessLevelInner BuiltIn TessLevelInner
+ OpDecorateString %gl_TessLevelInner UserSemantic "SV_InsideTessFactor"
+ OpDecorate %gl_TessLevelInner Patch
+ OpDecorateString %in_var_PN_POSITION9 UserSemantic "PN_POSITION9"
+ OpDecorate %in_var_PN_POSITION9 Patch
+ OpDecorate %gl_TessCoord BuiltIn TessCoord
+ OpDecorateString %gl_TessCoord UserSemantic "SV_DomainLocation"
+ OpDecorate %gl_TessCoord Patch
+ OpDecorate %gl_Position BuiltIn Position
+ OpDecorateString %gl_Position UserSemantic "SV_POSITION"
+ OpDecorateString %out_var_TEXCOORD6 UserSemantic "TEXCOORD6"
+ OpDecorateString %out_var_TEXCOORD7 UserSemantic "TEXCOORD7"
+ OpDecorateString %out_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %out_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorate %in_var_PN_DisplacementScales Location 0
+ OpDecorate %in_var_PN_DominantEdge Location 1
+ OpDecorate %in_var_PN_DominantEdge1 Location 2
+ OpDecorate %in_var_PN_DominantEdge2 Location 3
+ OpDecorate %in_var_PN_DominantEdge3 Location 4
+ OpDecorate %in_var_PN_DominantEdge4 Location 5
+ OpDecorate %in_var_PN_DominantEdge5 Location 6
+ OpDecorate %in_var_PN_DominantVertex Location 7
+ OpDecorate %in_var_PN_DominantVertex1 Location 8
+ OpDecorate %in_var_PN_DominantVertex2 Location 9
+ OpDecorate %in_var_PN_POSITION Location 10
+ OpDecorate %in_var_PN_POSITION9 Location 13
+ OpDecorate %in_var_PN_TessellationMultiplier Location 14
+ OpDecorate %in_var_PN_WorldDisplacementMultiplier Location 15
+ OpDecorate %in_var_TEXCOORD10_centroid Location 16
+ OpDecorate %in_var_TEXCOORD11_centroid Location 17
+ OpDecorate %in_var_TEXCOORD6 Location 18
+ OpDecorate %in_var_TEXCOORD8 Location 19
+ OpDecorate %in_var_VS_To_DS_Position Location 20
+ OpDecorate %in_var_VS_To_DS_VertexID Location 21
+ OpDecorate %out_var_TEXCOORD6 Location 0
+ OpDecorate %out_var_TEXCOORD7 Location 1
+ OpDecorate %out_var_TEXCOORD10_centroid Location 2
+ OpDecorate %out_var_TEXCOORD11_centroid Location 3
+ OpDecorate %View DescriptorSet 0
+ OpDecorate %View Binding 0
+ OpDecorate %View_GlobalDistanceFieldTexture0 DescriptorSet 0
+ OpDecorate %View_GlobalDistanceFieldTexture0 Binding 0
+ OpDecorate %View_GlobalDistanceFieldSampler0 DescriptorSet 0
+ OpDecorate %View_GlobalDistanceFieldSampler0 Binding 0
+ OpDecorate %View_GlobalDistanceFieldTexture1 DescriptorSet 0
+ OpDecorate %View_GlobalDistanceFieldTexture1 Binding 1
+ OpDecorate %View_GlobalDistanceFieldTexture2 DescriptorSet 0
+ OpDecorate %View_GlobalDistanceFieldTexture2 Binding 2
+ OpDecorate %View_GlobalDistanceFieldTexture3 DescriptorSet 0
+ OpDecorate %View_GlobalDistanceFieldTexture3 Binding 3
+ OpDecorate %Material DescriptorSet 0
+ OpDecorate %Material Binding 1
+ OpDecorate %_arr_v4float_uint_2 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_7 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpMemberDecorate %type_View 0 Offset 0
+ OpMemberDecorate %type_View 0 MatrixStride 16
+ OpMemberDecorate %type_View 0 ColMajor
+ OpMemberDecorate %type_View 1 Offset 64
+ OpMemberDecorate %type_View 1 MatrixStride 16
+ OpMemberDecorate %type_View 1 ColMajor
+ OpMemberDecorate %type_View 2 Offset 128
+ OpMemberDecorate %type_View 2 MatrixStride 16
+ OpMemberDecorate %type_View 2 ColMajor
+ OpMemberDecorate %type_View 3 Offset 192
+ OpMemberDecorate %type_View 3 MatrixStride 16
+ OpMemberDecorate %type_View 3 ColMajor
+ OpMemberDecorate %type_View 4 Offset 256
+ OpMemberDecorate %type_View 4 MatrixStride 16
+ OpMemberDecorate %type_View 4 ColMajor
+ OpMemberDecorate %type_View 5 Offset 320
+ OpMemberDecorate %type_View 5 MatrixStride 16
+ OpMemberDecorate %type_View 5 ColMajor
+ OpMemberDecorate %type_View 6 Offset 384
+ OpMemberDecorate %type_View 6 MatrixStride 16
+ OpMemberDecorate %type_View 6 ColMajor
+ OpMemberDecorate %type_View 7 Offset 448
+ OpMemberDecorate %type_View 7 MatrixStride 16
+ OpMemberDecorate %type_View 7 ColMajor
+ OpMemberDecorate %type_View 8 Offset 512
+ OpMemberDecorate %type_View 8 MatrixStride 16
+ OpMemberDecorate %type_View 8 ColMajor
+ OpMemberDecorate %type_View 9 Offset 576
+ OpMemberDecorate %type_View 9 MatrixStride 16
+ OpMemberDecorate %type_View 9 ColMajor
+ OpMemberDecorate %type_View 10 Offset 640
+ OpMemberDecorate %type_View 10 MatrixStride 16
+ OpMemberDecorate %type_View 10 ColMajor
+ OpMemberDecorate %type_View 11 Offset 704
+ OpMemberDecorate %type_View 11 MatrixStride 16
+ OpMemberDecorate %type_View 11 ColMajor
+ OpMemberDecorate %type_View 12 Offset 768
+ OpMemberDecorate %type_View 12 MatrixStride 16
+ OpMemberDecorate %type_View 12 ColMajor
+ OpMemberDecorate %type_View 13 Offset 832
+ OpMemberDecorate %type_View 13 MatrixStride 16
+ OpMemberDecorate %type_View 13 ColMajor
+ OpMemberDecorate %type_View 14 Offset 896
+ OpMemberDecorate %type_View 15 Offset 908
+ OpMemberDecorate %type_View 16 Offset 912
+ OpMemberDecorate %type_View 17 Offset 924
+ OpMemberDecorate %type_View 18 Offset 928
+ OpMemberDecorate %type_View 19 Offset 940
+ OpMemberDecorate %type_View 20 Offset 944
+ OpMemberDecorate %type_View 21 Offset 956
+ OpMemberDecorate %type_View 22 Offset 960
+ OpMemberDecorate %type_View 23 Offset 972
+ OpMemberDecorate %type_View 24 Offset 976
+ OpMemberDecorate %type_View 25 Offset 992
+ OpMemberDecorate %type_View 26 Offset 1008
+ OpMemberDecorate %type_View 27 Offset 1020
+ OpMemberDecorate %type_View 28 Offset 1024
+ OpMemberDecorate %type_View 29 Offset 1036
+ OpMemberDecorate %type_View 30 Offset 1040
+ OpMemberDecorate %type_View 31 Offset 1052
+ OpMemberDecorate %type_View 32 Offset 1056
+ OpMemberDecorate %type_View 33 Offset 1068
+ OpMemberDecorate %type_View 34 Offset 1072
+ OpMemberDecorate %type_View 34 MatrixStride 16
+ OpMemberDecorate %type_View 34 ColMajor
+ OpMemberDecorate %type_View 35 Offset 1136
+ OpMemberDecorate %type_View 35 MatrixStride 16
+ OpMemberDecorate %type_View 35 ColMajor
+ OpMemberDecorate %type_View 36 Offset 1200
+ OpMemberDecorate %type_View 36 MatrixStride 16
+ OpMemberDecorate %type_View 36 ColMajor
+ OpMemberDecorate %type_View 37 Offset 1264
+ OpMemberDecorate %type_View 37 MatrixStride 16
+ OpMemberDecorate %type_View 37 ColMajor
+ OpMemberDecorate %type_View 38 Offset 1328
+ OpMemberDecorate %type_View 38 MatrixStride 16
+ OpMemberDecorate %type_View 38 ColMajor
+ OpMemberDecorate %type_View 39 Offset 1392
+ OpMemberDecorate %type_View 39 MatrixStride 16
+ OpMemberDecorate %type_View 39 ColMajor
+ OpMemberDecorate %type_View 40 Offset 1456
+ OpMemberDecorate %type_View 40 MatrixStride 16
+ OpMemberDecorate %type_View 40 ColMajor
+ OpMemberDecorate %type_View 41 Offset 1520
+ OpMemberDecorate %type_View 41 MatrixStride 16
+ OpMemberDecorate %type_View 41 ColMajor
+ OpMemberDecorate %type_View 42 Offset 1584
+ OpMemberDecorate %type_View 42 MatrixStride 16
+ OpMemberDecorate %type_View 42 ColMajor
+ OpMemberDecorate %type_View 43 Offset 1648
+ OpMemberDecorate %type_View 43 MatrixStride 16
+ OpMemberDecorate %type_View 43 ColMajor
+ OpMemberDecorate %type_View 44 Offset 1712
+ OpMemberDecorate %type_View 45 Offset 1724
+ OpMemberDecorate %type_View 46 Offset 1728
+ OpMemberDecorate %type_View 47 Offset 1740
+ OpMemberDecorate %type_View 48 Offset 1744
+ OpMemberDecorate %type_View 49 Offset 1756
+ OpMemberDecorate %type_View 50 Offset 1760
+ OpMemberDecorate %type_View 50 MatrixStride 16
+ OpMemberDecorate %type_View 50 ColMajor
+ OpMemberDecorate %type_View 51 Offset 1824
+ OpMemberDecorate %type_View 51 MatrixStride 16
+ OpMemberDecorate %type_View 51 ColMajor
+ OpMemberDecorate %type_View 52 Offset 1888
+ OpMemberDecorate %type_View 52 MatrixStride 16
+ OpMemberDecorate %type_View 52 ColMajor
+ OpMemberDecorate %type_View 53 Offset 1952
+ OpMemberDecorate %type_View 54 Offset 1968
+ OpMemberDecorate %type_View 55 Offset 1984
+ OpMemberDecorate %type_View 56 Offset 1992
+ OpMemberDecorate %type_View 57 Offset 2000
+ OpMemberDecorate %type_View 58 Offset 2016
+ OpMemberDecorate %type_View 59 Offset 2032
+ OpMemberDecorate %type_View 60 Offset 2048
+ OpMemberDecorate %type_View 61 Offset 2064
+ OpMemberDecorate %type_View 62 Offset 2068
+ OpMemberDecorate %type_View 63 Offset 2072
+ OpMemberDecorate %type_View 64 Offset 2076
+ OpMemberDecorate %type_View 65 Offset 2080
+ OpMemberDecorate %type_View 66 Offset 2096
+ OpMemberDecorate %type_View 67 Offset 2112
+ OpMemberDecorate %type_View 68 Offset 2128
+ OpMemberDecorate %type_View 69 Offset 2136
+ OpMemberDecorate %type_View 70 Offset 2140
+ OpMemberDecorate %type_View 71 Offset 2144
+ OpMemberDecorate %type_View 72 Offset 2148
+ OpMemberDecorate %type_View 73 Offset 2152
+ OpMemberDecorate %type_View 74 Offset 2156
+ OpMemberDecorate %type_View 75 Offset 2160
+ OpMemberDecorate %type_View 76 Offset 2172
+ OpMemberDecorate %type_View 77 Offset 2176
+ OpMemberDecorate %type_View 78 Offset 2180
+ OpMemberDecorate %type_View 79 Offset 2184
+ OpMemberDecorate %type_View 80 Offset 2188
+ OpMemberDecorate %type_View 81 Offset 2192
+ OpMemberDecorate %type_View 82 Offset 2196
+ OpMemberDecorate %type_View 83 Offset 2200
+ OpMemberDecorate %type_View 84 Offset 2204
+ OpMemberDecorate %type_View 85 Offset 2208
+ OpMemberDecorate %type_View 86 Offset 2212
+ OpMemberDecorate %type_View 87 Offset 2216
+ OpMemberDecorate %type_View 88 Offset 2220
+ OpMemberDecorate %type_View 89 Offset 2224
+ OpMemberDecorate %type_View 90 Offset 2228
+ OpMemberDecorate %type_View 91 Offset 2232
+ OpMemberDecorate %type_View 92 Offset 2236
+ OpMemberDecorate %type_View 93 Offset 2240
+ OpMemberDecorate %type_View 94 Offset 2256
+ OpMemberDecorate %type_View 95 Offset 2268
+ OpMemberDecorate %type_View 96 Offset 2272
+ OpMemberDecorate %type_View 97 Offset 2304
+ OpMemberDecorate %type_View 98 Offset 2336
+ OpMemberDecorate %type_View 99 Offset 2352
+ OpMemberDecorate %type_View 100 Offset 2368
+ OpMemberDecorate %type_View 101 Offset 2372
+ OpMemberDecorate %type_View 102 Offset 2376
+ OpMemberDecorate %type_View 103 Offset 2380
+ OpMemberDecorate %type_View 104 Offset 2384
+ OpMemberDecorate %type_View 105 Offset 2388
+ OpMemberDecorate %type_View 106 Offset 2392
+ OpMemberDecorate %type_View 107 Offset 2396
+ OpMemberDecorate %type_View 108 Offset 2400
+ OpMemberDecorate %type_View 109 Offset 2404
+ OpMemberDecorate %type_View 110 Offset 2408
+ OpMemberDecorate %type_View 111 Offset 2412
+ OpMemberDecorate %type_View 112 Offset 2416
+ OpMemberDecorate %type_View 113 Offset 2428
+ OpMemberDecorate %type_View 114 Offset 2432
+ OpMemberDecorate %type_View 115 Offset 2444
+ OpMemberDecorate %type_View 116 Offset 2448
+ OpMemberDecorate %type_View 117 Offset 2452
+ OpMemberDecorate %type_View 118 Offset 2456
+ OpMemberDecorate %type_View 119 Offset 2460
+ OpMemberDecorate %type_View 120 Offset 2464
+ OpMemberDecorate %type_View 121 Offset 2468
+ OpMemberDecorate %type_View 122 Offset 2472
+ OpMemberDecorate %type_View 123 Offset 2476
+ OpMemberDecorate %type_View 124 Offset 2480
+ OpMemberDecorate %type_View 125 Offset 2484
+ OpMemberDecorate %type_View 126 Offset 2488
+ OpMemberDecorate %type_View 127 Offset 2492
+ OpMemberDecorate %type_View 128 Offset 2496
+ OpMemberDecorate %type_View 129 Offset 2512
+ OpMemberDecorate %type_View 130 Offset 2516
+ OpMemberDecorate %type_View 131 Offset 2520
+ OpMemberDecorate %type_View 132 Offset 2524
+ OpMemberDecorate %type_View 133 Offset 2528
+ OpMemberDecorate %type_View 134 Offset 2544
+ OpMemberDecorate %type_View 135 Offset 2556
+ OpMemberDecorate %type_View 136 Offset 2560
+ OpMemberDecorate %type_View 137 Offset 2576
+ OpMemberDecorate %type_View 138 Offset 2580
+ OpMemberDecorate %type_View 139 Offset 2584
+ OpMemberDecorate %type_View 140 Offset 2588
+ OpMemberDecorate %type_View 141 Offset 2592
+ OpMemberDecorate %type_View 142 Offset 2608
+ OpMemberDecorate %type_View 143 Offset 2720
+ OpMemberDecorate %type_View 144 Offset 2724
+ OpMemberDecorate %type_View 145 Offset 2728
+ OpMemberDecorate %type_View 146 Offset 2732
+ OpMemberDecorate %type_View 147 Offset 2736
+ OpMemberDecorate %type_View 148 Offset 2740
+ OpMemberDecorate %type_View 149 Offset 2744
+ OpMemberDecorate %type_View 150 Offset 2748
+ OpMemberDecorate %type_View 151 Offset 2752
+ OpMemberDecorate %type_View 152 Offset 2764
+ OpMemberDecorate %type_View 153 Offset 2768
+ OpMemberDecorate %type_View 154 Offset 2832
+ OpMemberDecorate %type_View 155 Offset 2896
+ OpMemberDecorate %type_View 156 Offset 2900
+ OpMemberDecorate %type_View 157 Offset 2904
+ OpMemberDecorate %type_View 158 Offset 2908
+ OpMemberDecorate %type_View 159 Offset 2912
+ OpMemberDecorate %type_View 160 Offset 2920
+ OpMemberDecorate %type_View 161 Offset 2924
+ OpMemberDecorate %type_View 162 Offset 2928
+ OpMemberDecorate %type_View 163 Offset 2940
+ OpMemberDecorate %type_View 164 Offset 2944
+ OpMemberDecorate %type_View 165 Offset 2956
+ OpMemberDecorate %type_View 166 Offset 2960
+ OpMemberDecorate %type_View 167 Offset 2968
+ OpMemberDecorate %type_View 168 Offset 2972
+ OpMemberDecorate %type_View 169 Offset 2976
+ OpMemberDecorate %type_View 170 Offset 2988
+ OpMemberDecorate %type_View 171 Offset 2992
+ OpMemberDecorate %type_View 172 Offset 3004
+ OpMemberDecorate %type_View 173 Offset 3008
+ OpMemberDecorate %type_View 174 Offset 3020
+ OpMemberDecorate %type_View 175 Offset 3024
+ OpMemberDecorate %type_View 176 Offset 3036
+ OpMemberDecorate %type_View 177 Offset 3040
+ OpMemberDecorate %type_View 178 Offset 3044
+ OpMemberDecorate %type_View 179 Offset 3048
+ OpMemberDecorate %type_View 180 Offset 3052
+ OpMemberDecorate %type_View 181 Offset 3056
+ OpMemberDecorate %type_View 181 MatrixStride 16
+ OpMemberDecorate %type_View 181 ColMajor
+ OpMemberDecorate %type_View 182 Offset 3120
+ OpMemberDecorate %type_View 183 Offset 3136
+ OpDecorate %type_View Block
+ OpDecorate %_arr_v4float_uint_5 ArrayStride 16
+ OpMemberDecorate %type_Material 0 Offset 0
+ OpMemberDecorate %type_Material 1 Offset 80
+ OpDecorate %type_Material Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+ %v2int = OpTypeVector %int 2
+%float_0_00100000005 = OpConstant %float 0.00100000005
+ %uint_0 = OpConstant %uint 0
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %int_2 = OpConstant %int 2
+ %float_3 = OpConstant %float 3
+ %uint_1 = OpConstant %uint 1
+ %float_6 = OpConstant %float 6
+ %67 = OpConstantComposite %v4float %float_6 %float_6 %float_6 %float_6
+ %float_1 = OpConstant %float 1
+ %float_0 = OpConstant %float 0
+ %int_3 = OpConstant %int 3
+ %float_2 = OpConstant %float 2
+ %int_26 = OpConstant %int 26
+ %int_32 = OpConstant %int 32
+ %int_54 = OpConstant %int 54
+ %int_153 = OpConstant %int 153
+ %int_154 = OpConstant %int 154
+ %int_156 = OpConstant %int 156
+ %int_157 = OpConstant %int 157
+ %float_10 = OpConstant %float 10
+ %uint_3 = OpConstant %uint 3
+ %81 = OpConstantComposite %v3float %float_0 %float_0 %float_0
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_arr_v4float_uint_7 = OpTypeArray %v4float %uint_7
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+ %type_View = OpTypeStruct %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %v3float %float %v3float %float %v4float %v4float %v3float %float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %v4float %v4float %v2float %v2float %v4float %v4float %v4float %v4float %int %float %float %float %v4float %v4float %v4float %v2float %float %float %float %float %float %float %v3float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %float %float %float %float %float %v4float %v3float %float %_arr_v4float_uint_2 %_arr_v4float_uint_2 %v4float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %v3float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %float %float %v4float %uint %uint %uint %uint %v4float %v3float %float %v4float %float %float %float %float %v4float %_arr_v4float_uint_7 %float %float %float %float %uint %float %float %float %v3float %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %float %float %float %float %v2int %float %float %v3float %float %v3float %float %v2float %float %float %v3float %float %v3float %float %v3float %float %v3float %float %float %float %float %float %mat4v4float %v4float %_arr_v4float_uint_2
+%_ptr_Uniform_type_View = OpTypePointer Uniform %type_View
+%type_sampler = OpTypeSampler
+%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler
+%type_3d_image = OpTypeImage %float 3D 2 0 0 1 Unknown
+%_ptr_UniformConstant_type_3d_image = OpTypePointer UniformConstant %type_3d_image
+ %uint_5 = OpConstant %uint 5
+%_arr_v4float_uint_5 = OpTypeArray %v4float %uint_5
+%type_Material = OpTypeStruct %_arr_v4float_uint_5 %_arr_v4float_uint_2
+%_ptr_Uniform_type_Material = OpTypePointer Uniform %type_Material
+%_arr_float_uint_1 = OpTypeArray %float %uint_1
+%_ptr_Output__arr_float_uint_1 = OpTypePointer Output %_arr_float_uint_1
+%_arr_v4float_uint_3 = OpTypeArray %v4float %uint_3
+%_ptr_Input__arr_v4float_uint_3 = OpTypePointer Input %_arr_v4float_uint_3
+%_arr_uint_uint_3 = OpTypeArray %uint %uint_3
+%_ptr_Input__arr_uint_uint_3 = OpTypePointer Input %_arr_uint_uint_3
+%_arr__arr_v4float_uint_3_uint_3 = OpTypeArray %_arr_v4float_uint_3 %uint_3
+%_ptr_Input__arr__arr_v4float_uint_3_uint_3 = OpTypePointer Input %_arr__arr_v4float_uint_3_uint_3
+%_arr_v3float_uint_3 = OpTypeArray %v3float %uint_3
+%_ptr_Input__arr_v3float_uint_3 = OpTypePointer Input %_arr_v3float_uint_3
+%_arr_float_uint_3 = OpTypeArray %float %uint_3
+%_ptr_Input__arr_float_uint_3 = OpTypePointer Input %_arr_float_uint_3
+%_arr_v2float_uint_3 = OpTypeArray %v2float %uint_3
+%_ptr_Input__arr_v2float_uint_3 = OpTypePointer Input %_arr_v2float_uint_3
+%_arr_float_uint_4 = OpTypeArray %float %uint_4
+%_ptr_Input__arr_float_uint_4 = OpTypePointer Input %_arr_float_uint_4
+%_arr_float_uint_2 = OpTypeArray %float %uint_2
+%_ptr_Input__arr_float_uint_2 = OpTypePointer Input %_arr_float_uint_2
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Input_v3float = OpTypePointer Input %v3float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %109 = OpTypeFunction %void
+%_ptr_Output_float = OpTypePointer Output %float
+%mat3v3float = OpTypeMatrix %v3float 3
+ %bool = OpTypeBool
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+%type_sampled_image = OpTypeSampledImage %type_3d_image
+ %View = OpVariable %_ptr_Uniform_type_View Uniform
+%View_GlobalDistanceFieldTexture0 = OpVariable %_ptr_UniformConstant_type_3d_image UniformConstant
+%View_GlobalDistanceFieldSampler0 = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%View_GlobalDistanceFieldTexture1 = OpVariable %_ptr_UniformConstant_type_3d_image UniformConstant
+%View_GlobalDistanceFieldTexture2 = OpVariable %_ptr_UniformConstant_type_3d_image UniformConstant
+%View_GlobalDistanceFieldTexture3 = OpVariable %_ptr_UniformConstant_type_3d_image UniformConstant
+ %Material = OpVariable %_ptr_Uniform_type_Material Uniform
+%gl_ClipDistance = OpVariable %_ptr_Output__arr_float_uint_1 Output
+%in_var_TEXCOORD6 = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_TEXCOORD8 = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_TEXCOORD10_centroid = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_TEXCOORD11_centroid = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_VS_To_DS_Position = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_VS_To_DS_VertexID = OpVariable %_ptr_Input__arr_uint_uint_3 Input
+%in_var_PN_POSITION = OpVariable %_ptr_Input__arr__arr_v4float_uint_3_uint_3 Input
+%in_var_PN_DisplacementScales = OpVariable %_ptr_Input__arr_v3float_uint_3 Input
+%in_var_PN_TessellationMultiplier = OpVariable %_ptr_Input__arr_float_uint_3 Input
+%in_var_PN_WorldDisplacementMultiplier = OpVariable %_ptr_Input__arr_float_uint_3 Input
+%in_var_PN_DominantVertex = OpVariable %_ptr_Input__arr_v2float_uint_3 Input
+%in_var_PN_DominantVertex1 = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_PN_DominantVertex2 = OpVariable %_ptr_Input__arr_v3float_uint_3 Input
+%in_var_PN_DominantEdge = OpVariable %_ptr_Input__arr_v2float_uint_3 Input
+%in_var_PN_DominantEdge1 = OpVariable %_ptr_Input__arr_v2float_uint_3 Input
+%in_var_PN_DominantEdge2 = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_PN_DominantEdge3 = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_PN_DominantEdge4 = OpVariable %_ptr_Input__arr_v3float_uint_3 Input
+%in_var_PN_DominantEdge5 = OpVariable %_ptr_Input__arr_v3float_uint_3 Input
+%gl_TessLevelOuter = OpVariable %_ptr_Input__arr_float_uint_4 Input
+%gl_TessLevelInner = OpVariable %_ptr_Input__arr_float_uint_2 Input
+%in_var_PN_POSITION9 = OpVariable %_ptr_Input_v4float Input
+%gl_TessCoord = OpVariable %_ptr_Input_v3float Input
+%gl_Position = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD6 = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD7 = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD10_centroid = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD11_centroid = OpVariable %_ptr_Output_v4float Output
+ %117 = OpConstantNull %v4float
+ %118 = OpUndef %v4float
+ %MainDomain = OpFunction %void None %109
+ %119 = OpLabel
+ %120 = OpLoad %_arr_v4float_uint_3 %in_var_TEXCOORD6
+ %121 = OpLoad %_arr_v4float_uint_3 %in_var_TEXCOORD8
+ %122 = OpCompositeExtract %v4float %120 0
+ %123 = OpCompositeExtract %v4float %121 0
+ %124 = OpCompositeExtract %v4float %120 1
+ %125 = OpCompositeExtract %v4float %121 1
+ %126 = OpCompositeExtract %v4float %120 2
+ %127 = OpCompositeExtract %v4float %121 2
+ %128 = OpLoad %_arr_v4float_uint_3 %in_var_TEXCOORD10_centroid
+ %129 = OpLoad %_arr_v4float_uint_3 %in_var_TEXCOORD11_centroid
+ %130 = OpCompositeExtract %v4float %128 0
+ %131 = OpCompositeExtract %v4float %129 0
+ %132 = OpCompositeExtract %v4float %128 1
+ %133 = OpCompositeExtract %v4float %129 1
+ %134 = OpCompositeExtract %v4float %128 2
+ %135 = OpCompositeExtract %v4float %129 2
+ %136 = OpLoad %_arr__arr_v4float_uint_3_uint_3 %in_var_PN_POSITION
+ %137 = OpLoad %_arr_float_uint_3 %in_var_PN_WorldDisplacementMultiplier
+ %138 = OpLoad %_arr_v4float_uint_3 %in_var_PN_DominantVertex1
+ %139 = OpLoad %_arr_v3float_uint_3 %in_var_PN_DominantVertex2
+ %140 = OpCompositeExtract %v4float %138 0
+ %141 = OpCompositeExtract %v3float %139 0
+ %142 = OpCompositeExtract %v4float %138 1
+ %143 = OpCompositeExtract %v3float %139 1
+ %144 = OpCompositeExtract %v4float %138 2
+ %145 = OpCompositeExtract %v3float %139 2
+ %146 = OpLoad %_arr_v4float_uint_3 %in_var_PN_DominantEdge2
+ %147 = OpLoad %_arr_v4float_uint_3 %in_var_PN_DominantEdge3
+ %148 = OpLoad %_arr_v3float_uint_3 %in_var_PN_DominantEdge4
+ %149 = OpLoad %_arr_v3float_uint_3 %in_var_PN_DominantEdge5
+ %150 = OpCompositeExtract %v4float %146 0
+ %151 = OpCompositeExtract %v4float %147 0
+ %152 = OpCompositeExtract %v3float %148 0
+ %153 = OpCompositeExtract %v3float %149 0
+ %154 = OpCompositeExtract %v4float %146 1
+ %155 = OpCompositeExtract %v4float %147 1
+ %156 = OpCompositeExtract %v3float %148 1
+ %157 = OpCompositeExtract %v3float %149 1
+ %158 = OpCompositeExtract %v4float %146 2
+ %159 = OpCompositeExtract %v4float %147 2
+ %160 = OpCompositeExtract %v3float %148 2
+ %161 = OpCompositeExtract %v3float %149 2
+ %162 = OpCompositeExtract %_arr_v4float_uint_3 %136 0
+ %163 = OpCompositeExtract %float %137 0
+ %164 = OpCompositeExtract %_arr_v4float_uint_3 %136 1
+ %165 = OpCompositeExtract %float %137 1
+ %166 = OpCompositeExtract %_arr_v4float_uint_3 %136 2
+ %167 = OpCompositeExtract %float %137 2
+ %168 = OpCompositeExtract %v4float %162 0
+ %169 = OpCompositeExtract %v4float %162 1
+ %170 = OpCompositeExtract %v4float %162 2
+ %171 = OpCompositeExtract %v4float %164 0
+ %172 = OpCompositeExtract %v4float %164 1
+ %173 = OpCompositeExtract %v4float %164 2
+ %174 = OpCompositeExtract %v4float %166 0
+ %175 = OpCompositeExtract %v4float %166 1
+ %176 = OpCompositeExtract %v4float %166 2
+ %177 = OpLoad %v4float %in_var_PN_POSITION9
+ %178 = OpLoad %v3float %gl_TessCoord
+ %179 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_0
+ %180 = OpLoad %mat4v4float %179
+ %181 = OpAccessChain %_ptr_Uniform_v3float %View %int_26
+ %182 = OpLoad %v3float %181
+ %183 = OpAccessChain %_ptr_Uniform_v3float %View %int_32
+ %184 = OpLoad %v3float %183
+ %185 = OpAccessChain %_ptr_Uniform_v4float %View %int_54
+ %186 = OpLoad %v4float %185
+ %187 = OpCompositeExtract %float %178 0
+ %188 = OpCompositeExtract %float %178 1
+ %189 = OpCompositeExtract %float %178 2
+ %190 = OpFMul %float %187 %187
+ %191 = OpFMul %float %188 %188
+ %192 = OpFMul %float %189 %189
+ %193 = OpFMul %float %190 %float_3
+ %194 = OpFMul %float %191 %float_3
+ %195 = OpFMul %float %192 %float_3
+ %196 = OpCompositeConstruct %v4float %190 %190 %190 %190
+ %197 = OpFMul %v4float %168 %196
+ %198 = OpCompositeConstruct %v4float %187 %187 %187 %187
+ %199 = OpFMul %v4float %197 %198
+ %200 = OpCompositeConstruct %v4float %191 %191 %191 %191
+ %201 = OpFMul %v4float %171 %200
+ %202 = OpCompositeConstruct %v4float %188 %188 %188 %188
+ %203 = OpFMul %v4float %201 %202
+ %204 = OpFAdd %v4float %199 %203
+ %205 = OpCompositeConstruct %v4float %192 %192 %192 %192
+ %206 = OpFMul %v4float %174 %205
+ %207 = OpCompositeConstruct %v4float %189 %189 %189 %189
+ %208 = OpFMul %v4float %206 %207
+ %209 = OpFAdd %v4float %204 %208
+ %210 = OpCompositeConstruct %v4float %193 %193 %193 %193
+ %211 = OpFMul %v4float %169 %210
+ %212 = OpFMul %v4float %211 %202
+ %213 = OpFAdd %v4float %209 %212
+ %214 = OpCompositeConstruct %v4float %194 %194 %194 %194
+ %215 = OpFMul %v4float %170 %214
+ %216 = OpFMul %v4float %215 %198
+ %217 = OpFAdd %v4float %213 %216
+ %218 = OpFMul %v4float %172 %214
+ %219 = OpFMul %v4float %218 %207
+ %220 = OpFAdd %v4float %217 %219
+ %221 = OpCompositeConstruct %v4float %195 %195 %195 %195
+ %222 = OpFMul %v4float %173 %221
+ %223 = OpFMul %v4float %222 %202
+ %224 = OpFAdd %v4float %220 %223
+ %225 = OpFMul %v4float %175 %221
+ %226 = OpFMul %v4float %225 %198
+ %227 = OpFAdd %v4float %224 %226
+ %228 = OpFMul %v4float %176 %210
+ %229 = OpFMul %v4float %228 %207
+ %230 = OpFAdd %v4float %227 %229
+ %231 = OpFMul %v4float %177 %67
+ %232 = OpFMul %v4float %231 %207
+ %233 = OpFMul %v4float %232 %198
+ %234 = OpFMul %v4float %233 %202
+ %235 = OpFAdd %v4float %230 %234
+ %236 = OpVectorShuffle %v3float %130 %130 0 1 2
+ %237 = OpCompositeConstruct %v3float %187 %187 %187
+ %238 = OpFMul %v3float %236 %237
+ %239 = OpVectorShuffle %v3float %132 %132 0 1 2
+ %240 = OpCompositeConstruct %v3float %188 %188 %188
+ %241 = OpFMul %v3float %239 %240
+ %242 = OpFAdd %v3float %238 %241
+ %243 = OpFMul %v4float %131 %198
+ %244 = OpFMul %v4float %133 %202
+ %245 = OpFAdd %v4float %243 %244
+ %246 = OpFMul %v4float %122 %198
+ %247 = OpFMul %v4float %124 %202
+ %248 = OpFAdd %v4float %246 %247
+ %249 = OpFMul %v4float %123 %198
+ %250 = OpFMul %v4float %125 %202
+ %251 = OpFAdd %v4float %249 %250
+ %252 = OpVectorShuffle %v3float %242 %117 0 1 2
+ %253 = OpVectorShuffle %v3float %134 %134 0 1 2
+ %254 = OpCompositeConstruct %v3float %189 %189 %189
+ %255 = OpFMul %v3float %253 %254
+ %256 = OpFAdd %v3float %252 %255
+ %257 = OpVectorShuffle %v4float %118 %256 4 5 6 3
+ %258 = OpFMul %v4float %135 %207
+ %259 = OpFAdd %v4float %245 %258
+ %260 = OpFMul %v4float %126 %207
+ %261 = OpFAdd %v4float %248 %260
+ %262 = OpFMul %v4float %127 %207
+ %263 = OpFAdd %v4float %251 %262
+ %264 = OpVectorShuffle %v3float %235 %235 0 1 2
+ %265 = OpVectorShuffle %v3float %256 %117 0 1 2
+ %266 = OpVectorShuffle %v3float %259 %259 0 1 2
+ %267 = OpExtInst %v3float %1 Cross %266 %265
+ %268 = OpCompositeExtract %float %259 3
+ %269 = OpCompositeConstruct %v3float %268 %268 %268
+ %270 = OpFMul %v3float %267 %269
+ %271 = OpCompositeConstruct %mat3v3float %265 %270 %266
+ %272 = OpFAdd %v3float %264 %182
+ %273 = OpCompositeExtract %float %259 0
+ %274 = OpCompositeExtract %float %259 1
+ %275 = OpCompositeExtract %float %259 2
+ %276 = OpCompositeConstruct %v4float %273 %274 %275 %float_0
+ %277 = OpFOrdEqual %bool %187 %float_0
+ %278 = OpSelect %int %277 %int_1 %int_0
+ %279 = OpConvertSToF %float %278
+ %280 = OpFOrdEqual %bool %188 %float_0
+ %281 = OpSelect %int %280 %int_1 %int_0
+ %282 = OpConvertSToF %float %281
+ %283 = OpFOrdEqual %bool %189 %float_0
+ %284 = OpSelect %int %283 %int_1 %int_0
+ %285 = OpConvertSToF %float %284
+ %286 = OpFAdd %float %279 %282
+ %287 = OpFAdd %float %286 %285
+ %288 = OpFOrdEqual %bool %287 %float_2
+ %289 = OpSelect %int %288 %int_1 %int_0
+ %290 = OpConvertSToF %float %289
+ %291 = OpFOrdEqual %bool %287 %float_1
+ %292 = OpSelect %int %291 %int_1 %int_0
+ %293 = OpConvertSToF %float %292
+ %294 = OpFOrdEqual %bool %287 %float_0
+ %295 = OpSelect %int %294 %int_1 %int_0
+ %296 = OpConvertSToF %float %295
+ %297 = OpFOrdEqual %bool %290 %float_1
+ OpSelectionMerge %298 None
+ OpBranchConditional %297 %299 %300
+ %300 = OpLabel
+ %301 = OpFOrdNotEqual %bool %293 %float_0
+ OpSelectionMerge %302 None
+ OpBranchConditional %301 %303 %302
+ %303 = OpLabel
+ %304 = OpCompositeConstruct %v4float %279 %279 %279 %279
+ %305 = OpFMul %v4float %304 %150
+ %306 = OpCompositeConstruct %v4float %282 %282 %282 %282
+ %307 = OpFMul %v4float %306 %154
+ %308 = OpFAdd %v4float %305 %307
+ %309 = OpCompositeConstruct %v4float %285 %285 %285 %285
+ %310 = OpFMul %v4float %309 %158
+ %311 = OpFAdd %v4float %308 %310
+ %312 = OpFMul %v4float %304 %151
+ %313 = OpFMul %v4float %306 %155
+ %314 = OpFAdd %v4float %312 %313
+ %315 = OpFMul %v4float %309 %159
+ %316 = OpFAdd %v4float %314 %315
+ %317 = OpFMul %v4float %202 %311
+ %318 = OpFMul %v4float %207 %316
+ %319 = OpFAdd %v4float %317 %318
+ %320 = OpFMul %v4float %304 %319
+ %321 = OpFMul %v4float %207 %311
+ %322 = OpFMul %v4float %198 %316
+ %323 = OpFAdd %v4float %321 %322
+ %324 = OpFMul %v4float %306 %323
+ %325 = OpFAdd %v4float %320 %324
+ %326 = OpFMul %v4float %198 %311
+ %327 = OpFMul %v4float %202 %316
+ %328 = OpFAdd %v4float %326 %327
+ %329 = OpFMul %v4float %309 %328
+ %330 = OpFAdd %v4float %325 %329
+ %331 = OpCompositeConstruct %v3float %279 %279 %279
+ %332 = OpFMul %v3float %331 %152
+ %333 = OpCompositeConstruct %v3float %282 %282 %282
+ %334 = OpFMul %v3float %333 %156
+ %335 = OpFAdd %v3float %332 %334
+ %336 = OpCompositeConstruct %v3float %285 %285 %285
+ %337 = OpFMul %v3float %336 %160
+ %338 = OpFAdd %v3float %335 %337
+ %339 = OpFMul %v3float %331 %153
+ %340 = OpFMul %v3float %333 %157
+ %341 = OpFAdd %v3float %339 %340
+ %342 = OpFMul %v3float %336 %161
+ %343 = OpFAdd %v3float %341 %342
+ %344 = OpFMul %v3float %240 %338
+ %345 = OpFMul %v3float %254 %343
+ %346 = OpFAdd %v3float %344 %345
+ %347 = OpFMul %v3float %331 %346
+ %348 = OpFMul %v3float %254 %338
+ %349 = OpFMul %v3float %237 %343
+ %350 = OpFAdd %v3float %348 %349
+ %351 = OpFMul %v3float %333 %350
+ %352 = OpFAdd %v3float %347 %351
+ %353 = OpFMul %v3float %237 %338
+ %354 = OpFMul %v3float %240 %343
+ %355 = OpFAdd %v3float %353 %354
+ %356 = OpFMul %v3float %336 %355
+ %357 = OpFAdd %v3float %352 %356
+ OpBranch %302
+ %302 = OpLabel
+ %358 = OpPhi %v4float %276 %300 %330 %303
+ %359 = OpPhi %v3float %265 %300 %357 %303
+ OpBranch %298
+ %299 = OpLabel
+ %360 = OpFAdd %float %282 %285
+ %361 = OpFOrdEqual %bool %360 %float_2
+ %362 = OpSelect %int %361 %int_1 %int_0
+ %363 = OpConvertSToF %float %362
+ %364 = OpFAdd %float %285 %279
+ %365 = OpFOrdEqual %bool %364 %float_2
+ %366 = OpSelect %int %365 %int_1 %int_0
+ %367 = OpConvertSToF %float %366
+ %368 = OpFOrdEqual %bool %286 %float_2
+ %369 = OpSelect %int %368 %int_1 %int_0
+ %370 = OpConvertSToF %float %369
+ %371 = OpCompositeConstruct %v4float %363 %363 %363 %363
+ %372 = OpFMul %v4float %371 %140
+ %373 = OpCompositeConstruct %v4float %367 %367 %367 %367
+ %374 = OpFMul %v4float %373 %142
+ %375 = OpFAdd %v4float %372 %374
+ %376 = OpCompositeConstruct %v4float %370 %370 %370 %370
+ %377 = OpFMul %v4float %376 %144
+ %378 = OpFAdd %v4float %375 %377
+ %379 = OpCompositeConstruct %v3float %363 %363 %363
+ %380 = OpFMul %v3float %379 %141
+ %381 = OpCompositeConstruct %v3float %367 %367 %367
+ %382 = OpFMul %v3float %381 %143
+ %383 = OpFAdd %v3float %380 %382
+ %384 = OpCompositeConstruct %v3float %370 %370 %370
+ %385 = OpFMul %v3float %384 %145
+ %386 = OpFAdd %v3float %383 %385
+ OpBranch %298
+ %298 = OpLabel
+ %387 = OpPhi %v4float %378 %299 %358 %302
+ %388 = OpPhi %v3float %386 %299 %359 %302
+ %389 = OpFOrdEqual %bool %296 %float_0
+ OpSelectionMerge %390 None
+ OpBranchConditional %389 %391 %390
+ %391 = OpLabel
+ %392 = OpVectorShuffle %v3float %387 %387 0 1 2
+ %393 = OpExtInst %v3float %1 Cross %392 %388
+ %394 = OpCompositeExtract %float %387 3
+ %395 = OpCompositeConstruct %v3float %394 %394 %394
+ %396 = OpFMul %v3float %393 %395
+ %397 = OpCompositeConstruct %mat3v3float %388 %396 %392
+ OpBranch %390
+ %390 = OpLabel
+ %398 = OpPhi %mat3v3float %271 %298 %397 %391
+ %399 = OpAccessChain %_ptr_Uniform_float %View %int_157
+ %400 = OpLoad %float %399
+ %401 = OpAccessChain %_ptr_Uniform_v4float %View %int_153 %int_0
+ %402 = OpLoad %v4float %401
+ %403 = OpVectorShuffle %v3float %402 %402 0 1 2
+ %404 = OpVectorShuffle %v3float %402 %402 3 3 3
+ %405 = OpFSub %v3float %272 %403
+ %406 = OpFAdd %v3float %405 %404
+ %407 = OpExtInst %v3float %1 FMax %406 %81
+ %408 = OpFAdd %v3float %403 %404
+ %409 = OpFSub %v3float %408 %272
+ %410 = OpExtInst %v3float %1 FMax %409 %81
+ %411 = OpExtInst %v3float %1 FMin %407 %410
+ %412 = OpCompositeExtract %float %411 0
+ %413 = OpCompositeExtract %float %411 1
+ %414 = OpCompositeExtract %float %411 2
+ %415 = OpExtInst %float %1 FMin %413 %414
+ %416 = OpExtInst %float %1 FMin %412 %415
+ %417 = OpAccessChain %_ptr_Uniform_float %View %int_153 %int_0 %int_3
+ %418 = OpLoad %float %417
+ %419 = OpAccessChain %_ptr_Uniform_float %View %int_156
+ %420 = OpLoad %float %419
+ %421 = OpFMul %float %418 %420
+ %422 = OpFOrdGreaterThan %bool %416 %421
+ OpSelectionMerge %423 DontFlatten
+ OpBranchConditional %422 %424 %425
+ %425 = OpLabel
+ %426 = OpAccessChain %_ptr_Uniform_v4float %View %int_153 %int_1
+ %427 = OpLoad %v4float %426
+ %428 = OpVectorShuffle %v3float %427 %427 0 1 2
+ %429 = OpVectorShuffle %v3float %427 %427 3 3 3
+ %430 = OpFSub %v3float %272 %428
+ %431 = OpFAdd %v3float %430 %429
+ %432 = OpExtInst %v3float %1 FMax %431 %81
+ %433 = OpFAdd %v3float %428 %429
+ %434 = OpFSub %v3float %433 %272
+ %435 = OpExtInst %v3float %1 FMax %434 %81
+ %436 = OpExtInst %v3float %1 FMin %432 %435
+ %437 = OpCompositeExtract %float %436 0
+ %438 = OpCompositeExtract %float %436 1
+ %439 = OpCompositeExtract %float %436 2
+ %440 = OpExtInst %float %1 FMin %438 %439
+ %441 = OpExtInst %float %1 FMin %437 %440
+ %442 = OpAccessChain %_ptr_Uniform_float %View %int_153 %int_1 %int_3
+ %443 = OpLoad %float %442
+ %444 = OpFMul %float %443 %420
+ %445 = OpFOrdGreaterThan %bool %441 %444
+ OpSelectionMerge %446 DontFlatten
+ OpBranchConditional %445 %447 %448
+ %448 = OpLabel
+ %449 = OpAccessChain %_ptr_Uniform_v4float %View %int_153 %int_2
+ %450 = OpLoad %v4float %449
+ %451 = OpVectorShuffle %v3float %450 %450 0 1 2
+ %452 = OpVectorShuffle %v3float %450 %450 3 3 3
+ %453 = OpFSub %v3float %272 %451
+ %454 = OpFAdd %v3float %453 %452
+ %455 = OpExtInst %v3float %1 FMax %454 %81
+ %456 = OpFAdd %v3float %451 %452
+ %457 = OpFSub %v3float %456 %272
+ %458 = OpExtInst %v3float %1 FMax %457 %81
+ %459 = OpExtInst %v3float %1 FMin %455 %458
+ %460 = OpCompositeExtract %float %459 0
+ %461 = OpCompositeExtract %float %459 1
+ %462 = OpCompositeExtract %float %459 2
+ %463 = OpExtInst %float %1 FMin %461 %462
+ %464 = OpExtInst %float %1 FMin %460 %463
+ %465 = OpAccessChain %_ptr_Uniform_v4float %View %int_153 %int_3
+ %466 = OpLoad %v4float %465
+ %467 = OpVectorShuffle %v3float %466 %466 0 1 2
+ %468 = OpVectorShuffle %v3float %466 %466 3 3 3
+ %469 = OpFSub %v3float %272 %467
+ %470 = OpFAdd %v3float %469 %468
+ %471 = OpExtInst %v3float %1 FMax %470 %81
+ %472 = OpFAdd %v3float %467 %468
+ %473 = OpFSub %v3float %472 %272
+ %474 = OpExtInst %v3float %1 FMax %473 %81
+ %475 = OpExtInst %v3float %1 FMin %471 %474
+ %476 = OpCompositeExtract %float %475 0
+ %477 = OpCompositeExtract %float %475 1
+ %478 = OpCompositeExtract %float %475 2
+ %479 = OpExtInst %float %1 FMin %477 %478
+ %480 = OpExtInst %float %1 FMin %476 %479
+ %481 = OpAccessChain %_ptr_Uniform_float %View %int_153 %int_2 %int_3
+ %482 = OpLoad %float %481
+ %483 = OpFMul %float %482 %420
+ %484 = OpFOrdGreaterThan %bool %464 %483
+ OpSelectionMerge %485 DontFlatten
+ OpBranchConditional %484 %486 %487
+ %487 = OpLabel
+ %488 = OpAccessChain %_ptr_Uniform_float %View %int_153 %int_3 %int_3
+ %489 = OpLoad %float %488
+ %490 = OpFMul %float %489 %420
+ %491 = OpFOrdGreaterThan %bool %480 %490
+ OpSelectionMerge %492 None
+ OpBranchConditional %491 %493 %492
+ %493 = OpLabel
+ %494 = OpFMul %float %480 %float_10
+ %495 = OpAccessChain %_ptr_Uniform_float %View %int_154 %int_3 %int_3
+ %496 = OpLoad %float %495
+ %497 = OpFMul %float %494 %496
+ %498 = OpExtInst %float %1 FClamp %497 %float_0 %float_1
+ %499 = OpAccessChain %_ptr_Uniform_v4float %View %int_154 %uint_3
+ %500 = OpLoad %v4float %499
+ %501 = OpVectorShuffle %v3float %500 %500 3 3 3
+ %502 = OpFMul %v3float %272 %501
+ %503 = OpVectorShuffle %v3float %500 %500 0 1 2
+ %504 = OpFAdd %v3float %502 %503
+ %505 = OpLoad %type_3d_image %View_GlobalDistanceFieldTexture3
+ %506 = OpLoad %type_sampler %View_GlobalDistanceFieldSampler0
+ %507 = OpSampledImage %type_sampled_image %505 %506
+ %508 = OpImageSampleExplicitLod %v4float %507 %504 Lod %float_0
+ %509 = OpCompositeExtract %float %508 0
+ %510 = OpExtInst %float %1 FMix %400 %509 %498
+ OpBranch %492
+ %492 = OpLabel
+ %511 = OpPhi %float %400 %487 %510 %493
+ OpBranch %485
+ %486 = OpLabel
+ %512 = OpAccessChain %_ptr_Uniform_v4float %View %int_154 %uint_2
+ %513 = OpLoad %v4float %512
+ %514 = OpVectorShuffle %v3float %513 %513 3 3 3
+ %515 = OpFMul %v3float %272 %514
+ %516 = OpVectorShuffle %v3float %513 %513 0 1 2
+ %517 = OpFAdd %v3float %515 %516
+ %518 = OpLoad %type_3d_image %View_GlobalDistanceFieldTexture2
+ %519 = OpLoad %type_sampler %View_GlobalDistanceFieldSampler0
+ %520 = OpSampledImage %type_sampled_image %518 %519
+ %521 = OpImageSampleExplicitLod %v4float %520 %517 Lod %float_0
+ %522 = OpCompositeExtract %float %521 0
+ OpBranch %485
+ %485 = OpLabel
+ %523 = OpPhi %float %522 %486 %511 %492
+ OpBranch %446
+ %447 = OpLabel
+ %524 = OpAccessChain %_ptr_Uniform_v4float %View %int_154 %uint_1
+ %525 = OpLoad %v4float %524
+ %526 = OpVectorShuffle %v3float %525 %525 3 3 3
+ %527 = OpFMul %v3float %272 %526
+ %528 = OpVectorShuffle %v3float %525 %525 0 1 2
+ %529 = OpFAdd %v3float %527 %528
+ %530 = OpLoad %type_3d_image %View_GlobalDistanceFieldTexture1
+ %531 = OpLoad %type_sampler %View_GlobalDistanceFieldSampler0
+ %532 = OpSampledImage %type_sampled_image %530 %531
+ %533 = OpImageSampleExplicitLod %v4float %532 %529 Lod %float_0
+ %534 = OpCompositeExtract %float %533 0
+ OpBranch %446
+ %446 = OpLabel
+ %535 = OpPhi %float %534 %447 %523 %485
+ OpBranch %423
+ %424 = OpLabel
+ %536 = OpAccessChain %_ptr_Uniform_v4float %View %int_154 %uint_0
+ %537 = OpLoad %v4float %536
+ %538 = OpVectorShuffle %v3float %537 %537 3 3 3
+ %539 = OpFMul %v3float %272 %538
+ %540 = OpVectorShuffle %v3float %537 %537 0 1 2
+ %541 = OpFAdd %v3float %539 %540
+ %542 = OpLoad %type_3d_image %View_GlobalDistanceFieldTexture0
+ %543 = OpLoad %type_sampler %View_GlobalDistanceFieldSampler0
+ %544 = OpSampledImage %type_sampled_image %542 %543
+ %545 = OpImageSampleExplicitLod %v4float %544 %541 Lod %float_0
+ %546 = OpCompositeExtract %float %545 0
+ OpBranch %423
+ %423 = OpLabel
+ %547 = OpPhi %float %546 %424 %535 %446
+ %548 = OpAccessChain %_ptr_Uniform_float %Material %int_1 %int_0 %int_2
+ %549 = OpLoad %float %548
+ %550 = OpFAdd %float %547 %549
+ %551 = OpExtInst %float %1 FMin %550 %float_0
+ %552 = OpAccessChain %_ptr_Uniform_float %Material %int_1 %int_0 %int_3
+ %553 = OpLoad %float %552
+ %554 = OpFMul %float %551 %553
+ %555 = OpCompositeExtract %v3float %398 2
+ %556 = OpCompositeConstruct %v3float %554 %554 %554
+ %557 = OpFMul %v3float %555 %556
+ %558 = OpFMul %float %163 %187
+ %559 = OpFMul %float %165 %188
+ %560 = OpFAdd %float %558 %559
+ %561 = OpFMul %float %167 %189
+ %562 = OpFAdd %float %560 %561
+ %563 = OpCompositeConstruct %v3float %562 %562 %562
+ %564 = OpFMul %v3float %557 %563
+ %565 = OpFAdd %v3float %264 %564
+ %566 = OpVectorShuffle %v4float %235 %565 4 5 6 3
+ %567 = OpVectorShuffle %v3float %565 %117 0 1 2
+ %568 = OpFSub %v3float %567 %184
+ %569 = OpCompositeExtract %float %568 0
+ %570 = OpCompositeExtract %float %568 1
+ %571 = OpCompositeExtract %float %568 2
+ %572 = OpCompositeConstruct %v4float %569 %570 %571 %float_1
+ %573 = OpDot %float %186 %572
+ %574 = OpMatrixTimesVector %v4float %180 %566
+ %575 = OpCompositeExtract %float %574 3
+ %576 = OpFMul %float %float_0_00100000005 %575
+ %577 = OpCompositeExtract %float %574 2
+ %578 = OpFAdd %float %577 %576
+ %579 = OpCompositeInsert %v4float %578 %574 2
+ OpStore %gl_Position %579
+ OpStore %out_var_TEXCOORD6 %261
+ OpStore %out_var_TEXCOORD7 %263
+ OpStore %out_var_TEXCOORD10_centroid %257
+ OpStore %out_var_TEXCOORD11_centroid %259
+ %580 = OpAccessChain %_ptr_Output_float %gl_ClipDistance %uint_0
+ OpStore %580 %573
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese
new file mode 100644
index 00000000000..e792c7e1160
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese
@@ -0,0 +1,547 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 236
+; Schema: 0
+ OpCapability Tessellation
+ OpCapability SampledBuffer
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint TessellationEvaluation %MainDomain "main" %in_var_TEXCOORD10_centroid %in_var_TEXCOORD11_centroid %in_var_VS_to_DS_Position %in_var_VS_To_DS_VertexID %in_var_PN_POSITION %in_var_PN_DisplacementScales %in_var_PN_TessellationMultiplier %in_var_PN_WorldDisplacementMultiplier %in_var_PN_DominantVertex %in_var_PN_DominantVertex1 %in_var_PN_DominantVertex2 %in_var_PN_DominantEdge %in_var_PN_DominantEdge1 %in_var_PN_DominantEdge2 %in_var_PN_DominantEdge3 %in_var_PN_DominantEdge4 %in_var_PN_DominantEdge5 %gl_TessLevelOuter %gl_TessLevelInner %in_var_PN_POSITION9 %gl_TessCoord %out_var_TEXCOORD10_centroid %out_var_TEXCOORD11_centroid %out_var_TEXCOORD6 %out_var_TEXCOORD7 %gl_Position
+ OpExecutionMode %MainDomain Triangles
+ OpSource HLSL 600
+ OpName %type_ShadowDepthPass "type.ShadowDepthPass"
+ OpMemberName %type_ShadowDepthPass 0 "PrePadding_ShadowDepthPass_LPV_0"
+ OpMemberName %type_ShadowDepthPass 1 "PrePadding_ShadowDepthPass_LPV_4"
+ OpMemberName %type_ShadowDepthPass 2 "PrePadding_ShadowDepthPass_LPV_8"
+ OpMemberName %type_ShadowDepthPass 3 "PrePadding_ShadowDepthPass_LPV_12"
+ OpMemberName %type_ShadowDepthPass 4 "PrePadding_ShadowDepthPass_LPV_16"
+ OpMemberName %type_ShadowDepthPass 5 "PrePadding_ShadowDepthPass_LPV_20"
+ OpMemberName %type_ShadowDepthPass 6 "PrePadding_ShadowDepthPass_LPV_24"
+ OpMemberName %type_ShadowDepthPass 7 "PrePadding_ShadowDepthPass_LPV_28"
+ OpMemberName %type_ShadowDepthPass 8 "PrePadding_ShadowDepthPass_LPV_32"
+ OpMemberName %type_ShadowDepthPass 9 "PrePadding_ShadowDepthPass_LPV_36"
+ OpMemberName %type_ShadowDepthPass 10 "PrePadding_ShadowDepthPass_LPV_40"
+ OpMemberName %type_ShadowDepthPass 11 "PrePadding_ShadowDepthPass_LPV_44"
+ OpMemberName %type_ShadowDepthPass 12 "PrePadding_ShadowDepthPass_LPV_48"
+ OpMemberName %type_ShadowDepthPass 13 "PrePadding_ShadowDepthPass_LPV_52"
+ OpMemberName %type_ShadowDepthPass 14 "PrePadding_ShadowDepthPass_LPV_56"
+ OpMemberName %type_ShadowDepthPass 15 "PrePadding_ShadowDepthPass_LPV_60"
+ OpMemberName %type_ShadowDepthPass 16 "PrePadding_ShadowDepthPass_LPV_64"
+ OpMemberName %type_ShadowDepthPass 17 "PrePadding_ShadowDepthPass_LPV_68"
+ OpMemberName %type_ShadowDepthPass 18 "PrePadding_ShadowDepthPass_LPV_72"
+ OpMemberName %type_ShadowDepthPass 19 "PrePadding_ShadowDepthPass_LPV_76"
+ OpMemberName %type_ShadowDepthPass 20 "PrePadding_ShadowDepthPass_LPV_80"
+ OpMemberName %type_ShadowDepthPass 21 "PrePadding_ShadowDepthPass_LPV_84"
+ OpMemberName %type_ShadowDepthPass 22 "PrePadding_ShadowDepthPass_LPV_88"
+ OpMemberName %type_ShadowDepthPass 23 "PrePadding_ShadowDepthPass_LPV_92"
+ OpMemberName %type_ShadowDepthPass 24 "PrePadding_ShadowDepthPass_LPV_96"
+ OpMemberName %type_ShadowDepthPass 25 "PrePadding_ShadowDepthPass_LPV_100"
+ OpMemberName %type_ShadowDepthPass 26 "PrePadding_ShadowDepthPass_LPV_104"
+ OpMemberName %type_ShadowDepthPass 27 "PrePadding_ShadowDepthPass_LPV_108"
+ OpMemberName %type_ShadowDepthPass 28 "PrePadding_ShadowDepthPass_LPV_112"
+ OpMemberName %type_ShadowDepthPass 29 "PrePadding_ShadowDepthPass_LPV_116"
+ OpMemberName %type_ShadowDepthPass 30 "PrePadding_ShadowDepthPass_LPV_120"
+ OpMemberName %type_ShadowDepthPass 31 "PrePadding_ShadowDepthPass_LPV_124"
+ OpMemberName %type_ShadowDepthPass 32 "PrePadding_ShadowDepthPass_LPV_128"
+ OpMemberName %type_ShadowDepthPass 33 "PrePadding_ShadowDepthPass_LPV_132"
+ OpMemberName %type_ShadowDepthPass 34 "PrePadding_ShadowDepthPass_LPV_136"
+ OpMemberName %type_ShadowDepthPass 35 "PrePadding_ShadowDepthPass_LPV_140"
+ OpMemberName %type_ShadowDepthPass 36 "PrePadding_ShadowDepthPass_LPV_144"
+ OpMemberName %type_ShadowDepthPass 37 "PrePadding_ShadowDepthPass_LPV_148"
+ OpMemberName %type_ShadowDepthPass 38 "PrePadding_ShadowDepthPass_LPV_152"
+ OpMemberName %type_ShadowDepthPass 39 "PrePadding_ShadowDepthPass_LPV_156"
+ OpMemberName %type_ShadowDepthPass 40 "PrePadding_ShadowDepthPass_LPV_160"
+ OpMemberName %type_ShadowDepthPass 41 "PrePadding_ShadowDepthPass_LPV_164"
+ OpMemberName %type_ShadowDepthPass 42 "PrePadding_ShadowDepthPass_LPV_168"
+ OpMemberName %type_ShadowDepthPass 43 "PrePadding_ShadowDepthPass_LPV_172"
+ OpMemberName %type_ShadowDepthPass 44 "PrePadding_ShadowDepthPass_LPV_176"
+ OpMemberName %type_ShadowDepthPass 45 "PrePadding_ShadowDepthPass_LPV_180"
+ OpMemberName %type_ShadowDepthPass 46 "PrePadding_ShadowDepthPass_LPV_184"
+ OpMemberName %type_ShadowDepthPass 47 "PrePadding_ShadowDepthPass_LPV_188"
+ OpMemberName %type_ShadowDepthPass 48 "PrePadding_ShadowDepthPass_LPV_192"
+ OpMemberName %type_ShadowDepthPass 49 "PrePadding_ShadowDepthPass_LPV_196"
+ OpMemberName %type_ShadowDepthPass 50 "PrePadding_ShadowDepthPass_LPV_200"
+ OpMemberName %type_ShadowDepthPass 51 "PrePadding_ShadowDepthPass_LPV_204"
+ OpMemberName %type_ShadowDepthPass 52 "PrePadding_ShadowDepthPass_LPV_208"
+ OpMemberName %type_ShadowDepthPass 53 "PrePadding_ShadowDepthPass_LPV_212"
+ OpMemberName %type_ShadowDepthPass 54 "PrePadding_ShadowDepthPass_LPV_216"
+ OpMemberName %type_ShadowDepthPass 55 "PrePadding_ShadowDepthPass_LPV_220"
+ OpMemberName %type_ShadowDepthPass 56 "PrePadding_ShadowDepthPass_LPV_224"
+ OpMemberName %type_ShadowDepthPass 57 "PrePadding_ShadowDepthPass_LPV_228"
+ OpMemberName %type_ShadowDepthPass 58 "PrePadding_ShadowDepthPass_LPV_232"
+ OpMemberName %type_ShadowDepthPass 59 "PrePadding_ShadowDepthPass_LPV_236"
+ OpMemberName %type_ShadowDepthPass 60 "PrePadding_ShadowDepthPass_LPV_240"
+ OpMemberName %type_ShadowDepthPass 61 "PrePadding_ShadowDepthPass_LPV_244"
+ OpMemberName %type_ShadowDepthPass 62 "PrePadding_ShadowDepthPass_LPV_248"
+ OpMemberName %type_ShadowDepthPass 63 "PrePadding_ShadowDepthPass_LPV_252"
+ OpMemberName %type_ShadowDepthPass 64 "PrePadding_ShadowDepthPass_LPV_256"
+ OpMemberName %type_ShadowDepthPass 65 "PrePadding_ShadowDepthPass_LPV_260"
+ OpMemberName %type_ShadowDepthPass 66 "PrePadding_ShadowDepthPass_LPV_264"
+ OpMemberName %type_ShadowDepthPass 67 "PrePadding_ShadowDepthPass_LPV_268"
+ OpMemberName %type_ShadowDepthPass 68 "ShadowDepthPass_LPV_mRsmToWorld"
+ OpMemberName %type_ShadowDepthPass 69 "ShadowDepthPass_LPV_mLightColour"
+ OpMemberName %type_ShadowDepthPass 70 "ShadowDepthPass_LPV_GeometryVolumeCaptureLightDirection"
+ OpMemberName %type_ShadowDepthPass 71 "ShadowDepthPass_LPV_mEyePos"
+ OpMemberName %type_ShadowDepthPass 72 "ShadowDepthPass_LPV_mOldGridOffset"
+ OpMemberName %type_ShadowDepthPass 73 "PrePadding_ShadowDepthPass_LPV_396"
+ OpMemberName %type_ShadowDepthPass 74 "ShadowDepthPass_LPV_mLpvGridOffset"
+ OpMemberName %type_ShadowDepthPass 75 "ShadowDepthPass_LPV_ClearMultiplier"
+ OpMemberName %type_ShadowDepthPass 76 "ShadowDepthPass_LPV_LpvScale"
+ OpMemberName %type_ShadowDepthPass 77 "ShadowDepthPass_LPV_OneOverLpvScale"
+ OpMemberName %type_ShadowDepthPass 78 "ShadowDepthPass_LPV_DirectionalOcclusionIntensity"
+ OpMemberName %type_ShadowDepthPass 79 "ShadowDepthPass_LPV_DirectionalOcclusionRadius"
+ OpMemberName %type_ShadowDepthPass 80 "ShadowDepthPass_LPV_RsmAreaIntensityMultiplier"
+ OpMemberName %type_ShadowDepthPass 81 "ShadowDepthPass_LPV_RsmPixelToTexcoordMultiplier"
+ OpMemberName %type_ShadowDepthPass 82 "ShadowDepthPass_LPV_SecondaryOcclusionStrength"
+ OpMemberName %type_ShadowDepthPass 83 "ShadowDepthPass_LPV_SecondaryBounceStrength"
+ OpMemberName %type_ShadowDepthPass 84 "ShadowDepthPass_LPV_VplInjectionBias"
+ OpMemberName %type_ShadowDepthPass 85 "ShadowDepthPass_LPV_GeometryVolumeInjectionBias"
+ OpMemberName %type_ShadowDepthPass 86 "ShadowDepthPass_LPV_EmissiveInjectionMultiplier"
+ OpMemberName %type_ShadowDepthPass 87 "ShadowDepthPass_LPV_PropagationIndex"
+ OpMemberName %type_ShadowDepthPass 88 "ShadowDepthPass_ProjectionMatrix"
+ OpMemberName %type_ShadowDepthPass 89 "ShadowDepthPass_ViewMatrix"
+ OpMemberName %type_ShadowDepthPass 90 "ShadowDepthPass_ShadowParams"
+ OpMemberName %type_ShadowDepthPass 91 "ShadowDepthPass_bClampToNearPlane"
+ OpMemberName %type_ShadowDepthPass 92 "PrePadding_ShadowDepthPass_612"
+ OpMemberName %type_ShadowDepthPass 93 "PrePadding_ShadowDepthPass_616"
+ OpMemberName %type_ShadowDepthPass 94 "PrePadding_ShadowDepthPass_620"
+ OpMemberName %type_ShadowDepthPass 95 "ShadowDepthPass_ShadowViewProjectionMatrices"
+ OpMemberName %type_ShadowDepthPass 96 "ShadowDepthPass_ShadowViewMatrices"
+ OpName %ShadowDepthPass "ShadowDepthPass"
+ OpName %in_var_TEXCOORD10_centroid "in.var.TEXCOORD10_centroid"
+ OpName %in_var_TEXCOORD11_centroid "in.var.TEXCOORD11_centroid"
+ OpName %in_var_VS_to_DS_Position "in.var.VS_to_DS_Position"
+ OpName %in_var_VS_To_DS_VertexID "in.var.VS_To_DS_VertexID"
+ OpName %in_var_PN_POSITION "in.var.PN_POSITION"
+ OpName %in_var_PN_DisplacementScales "in.var.PN_DisplacementScales"
+ OpName %in_var_PN_TessellationMultiplier "in.var.PN_TessellationMultiplier"
+ OpName %in_var_PN_WorldDisplacementMultiplier "in.var.PN_WorldDisplacementMultiplier"
+ OpName %in_var_PN_DominantVertex "in.var.PN_DominantVertex"
+ OpName %in_var_PN_DominantVertex1 "in.var.PN_DominantVertex1"
+ OpName %in_var_PN_DominantVertex2 "in.var.PN_DominantVertex2"
+ OpName %in_var_PN_DominantEdge "in.var.PN_DominantEdge"
+ OpName %in_var_PN_DominantEdge1 "in.var.PN_DominantEdge1"
+ OpName %in_var_PN_DominantEdge2 "in.var.PN_DominantEdge2"
+ OpName %in_var_PN_DominantEdge3 "in.var.PN_DominantEdge3"
+ OpName %in_var_PN_DominantEdge4 "in.var.PN_DominantEdge4"
+ OpName %in_var_PN_DominantEdge5 "in.var.PN_DominantEdge5"
+ OpName %in_var_PN_POSITION9 "in.var.PN_POSITION9"
+ OpName %out_var_TEXCOORD10_centroid "out.var.TEXCOORD10_centroid"
+ OpName %out_var_TEXCOORD11_centroid "out.var.TEXCOORD11_centroid"
+ OpName %out_var_TEXCOORD6 "out.var.TEXCOORD6"
+ OpName %out_var_TEXCOORD7 "out.var.TEXCOORD7"
+ OpName %MainDomain "MainDomain"
+ OpDecorateString %in_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %in_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %in_var_VS_to_DS_Position UserSemantic "VS_to_DS_Position"
+ OpDecorateString %in_var_VS_To_DS_VertexID UserSemantic "VS_To_DS_VertexID"
+ OpDecorateString %in_var_PN_POSITION UserSemantic "PN_POSITION"
+ OpDecorateString %in_var_PN_DisplacementScales UserSemantic "PN_DisplacementScales"
+ OpDecorateString %in_var_PN_TessellationMultiplier UserSemantic "PN_TessellationMultiplier"
+ OpDecorateString %in_var_PN_WorldDisplacementMultiplier UserSemantic "PN_WorldDisplacementMultiplier"
+ OpDecorateString %in_var_PN_DominantVertex UserSemantic "PN_DominantVertex"
+ OpDecorateString %in_var_PN_DominantVertex1 UserSemantic "PN_DominantVertex"
+ OpDecorateString %in_var_PN_DominantVertex2 UserSemantic "PN_DominantVertex"
+ OpDecorateString %in_var_PN_DominantEdge UserSemantic "PN_DominantEdge"
+ OpDecorateString %in_var_PN_DominantEdge1 UserSemantic "PN_DominantEdge"
+ OpDecorateString %in_var_PN_DominantEdge2 UserSemantic "PN_DominantEdge"
+ OpDecorateString %in_var_PN_DominantEdge3 UserSemantic "PN_DominantEdge"
+ OpDecorateString %in_var_PN_DominantEdge4 UserSemantic "PN_DominantEdge"
+ OpDecorateString %in_var_PN_DominantEdge5 UserSemantic "PN_DominantEdge"
+ OpDecorate %gl_TessLevelOuter BuiltIn TessLevelOuter
+ OpDecorateString %gl_TessLevelOuter UserSemantic "SV_TessFactor"
+ OpDecorate %gl_TessLevelOuter Patch
+ OpDecorate %gl_TessLevelInner BuiltIn TessLevelInner
+ OpDecorateString %gl_TessLevelInner UserSemantic "SV_InsideTessFactor"
+ OpDecorate %gl_TessLevelInner Patch
+ OpDecorateString %in_var_PN_POSITION9 UserSemantic "PN_POSITION9"
+ OpDecorate %in_var_PN_POSITION9 Patch
+ OpDecorate %gl_TessCoord BuiltIn TessCoord
+ OpDecorateString %gl_TessCoord UserSemantic "SV_DomainLocation"
+ OpDecorate %gl_TessCoord Patch
+ OpDecorateString %out_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %out_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %out_var_TEXCOORD6 UserSemantic "TEXCOORD6"
+ OpDecorateString %out_var_TEXCOORD7 UserSemantic "TEXCOORD7"
+ OpDecorate %gl_Position BuiltIn Position
+ OpDecorateString %gl_Position UserSemantic "SV_POSITION"
+ OpDecorate %in_var_PN_DisplacementScales Location 0
+ OpDecorate %in_var_PN_DominantEdge Location 1
+ OpDecorate %in_var_PN_DominantEdge1 Location 2
+ OpDecorate %in_var_PN_DominantEdge2 Location 3
+ OpDecorate %in_var_PN_DominantEdge3 Location 4
+ OpDecorate %in_var_PN_DominantEdge4 Location 5
+ OpDecorate %in_var_PN_DominantEdge5 Location 6
+ OpDecorate %in_var_PN_DominantVertex Location 7
+ OpDecorate %in_var_PN_DominantVertex1 Location 8
+ OpDecorate %in_var_PN_DominantVertex2 Location 9
+ OpDecorate %in_var_PN_POSITION Location 10
+ OpDecorate %in_var_PN_POSITION9 Location 13
+ OpDecorate %in_var_PN_TessellationMultiplier Location 14
+ OpDecorate %in_var_PN_WorldDisplacementMultiplier Location 15
+ OpDecorate %in_var_TEXCOORD10_centroid Location 16
+ OpDecorate %in_var_TEXCOORD11_centroid Location 17
+ OpDecorate %in_var_VS_To_DS_VertexID Location 18
+ OpDecorate %in_var_VS_to_DS_Position Location 19
+ OpDecorate %out_var_TEXCOORD10_centroid Location 0
+ OpDecorate %out_var_TEXCOORD11_centroid Location 1
+ OpDecorate %out_var_TEXCOORD6 Location 2
+ OpDecorate %out_var_TEXCOORD7 Location 3
+ OpDecorate %ShadowDepthPass DescriptorSet 0
+ OpDecorate %ShadowDepthPass Binding 0
+ OpDecorate %_arr_mat4v4float_uint_6 ArrayStride 64
+ OpMemberDecorate %type_ShadowDepthPass 0 Offset 0
+ OpMemberDecorate %type_ShadowDepthPass 1 Offset 4
+ OpMemberDecorate %type_ShadowDepthPass 2 Offset 8
+ OpMemberDecorate %type_ShadowDepthPass 3 Offset 12
+ OpMemberDecorate %type_ShadowDepthPass 4 Offset 16
+ OpMemberDecorate %type_ShadowDepthPass 5 Offset 20
+ OpMemberDecorate %type_ShadowDepthPass 6 Offset 24
+ OpMemberDecorate %type_ShadowDepthPass 7 Offset 28
+ OpMemberDecorate %type_ShadowDepthPass 8 Offset 32
+ OpMemberDecorate %type_ShadowDepthPass 9 Offset 36
+ OpMemberDecorate %type_ShadowDepthPass 10 Offset 40
+ OpMemberDecorate %type_ShadowDepthPass 11 Offset 44
+ OpMemberDecorate %type_ShadowDepthPass 12 Offset 48
+ OpMemberDecorate %type_ShadowDepthPass 13 Offset 52
+ OpMemberDecorate %type_ShadowDepthPass 14 Offset 56
+ OpMemberDecorate %type_ShadowDepthPass 15 Offset 60
+ OpMemberDecorate %type_ShadowDepthPass 16 Offset 64
+ OpMemberDecorate %type_ShadowDepthPass 17 Offset 68
+ OpMemberDecorate %type_ShadowDepthPass 18 Offset 72
+ OpMemberDecorate %type_ShadowDepthPass 19 Offset 76
+ OpMemberDecorate %type_ShadowDepthPass 20 Offset 80
+ OpMemberDecorate %type_ShadowDepthPass 21 Offset 84
+ OpMemberDecorate %type_ShadowDepthPass 22 Offset 88
+ OpMemberDecorate %type_ShadowDepthPass 23 Offset 92
+ OpMemberDecorate %type_ShadowDepthPass 24 Offset 96
+ OpMemberDecorate %type_ShadowDepthPass 25 Offset 100
+ OpMemberDecorate %type_ShadowDepthPass 26 Offset 104
+ OpMemberDecorate %type_ShadowDepthPass 27 Offset 108
+ OpMemberDecorate %type_ShadowDepthPass 28 Offset 112
+ OpMemberDecorate %type_ShadowDepthPass 29 Offset 116
+ OpMemberDecorate %type_ShadowDepthPass 30 Offset 120
+ OpMemberDecorate %type_ShadowDepthPass 31 Offset 124
+ OpMemberDecorate %type_ShadowDepthPass 32 Offset 128
+ OpMemberDecorate %type_ShadowDepthPass 33 Offset 132
+ OpMemberDecorate %type_ShadowDepthPass 34 Offset 136
+ OpMemberDecorate %type_ShadowDepthPass 35 Offset 140
+ OpMemberDecorate %type_ShadowDepthPass 36 Offset 144
+ OpMemberDecorate %type_ShadowDepthPass 37 Offset 148
+ OpMemberDecorate %type_ShadowDepthPass 38 Offset 152
+ OpMemberDecorate %type_ShadowDepthPass 39 Offset 156
+ OpMemberDecorate %type_ShadowDepthPass 40 Offset 160
+ OpMemberDecorate %type_ShadowDepthPass 41 Offset 164
+ OpMemberDecorate %type_ShadowDepthPass 42 Offset 168
+ OpMemberDecorate %type_ShadowDepthPass 43 Offset 172
+ OpMemberDecorate %type_ShadowDepthPass 44 Offset 176
+ OpMemberDecorate %type_ShadowDepthPass 45 Offset 180
+ OpMemberDecorate %type_ShadowDepthPass 46 Offset 184
+ OpMemberDecorate %type_ShadowDepthPass 47 Offset 188
+ OpMemberDecorate %type_ShadowDepthPass 48 Offset 192
+ OpMemberDecorate %type_ShadowDepthPass 49 Offset 196
+ OpMemberDecorate %type_ShadowDepthPass 50 Offset 200
+ OpMemberDecorate %type_ShadowDepthPass 51 Offset 204
+ OpMemberDecorate %type_ShadowDepthPass 52 Offset 208
+ OpMemberDecorate %type_ShadowDepthPass 53 Offset 212
+ OpMemberDecorate %type_ShadowDepthPass 54 Offset 216
+ OpMemberDecorate %type_ShadowDepthPass 55 Offset 220
+ OpMemberDecorate %type_ShadowDepthPass 56 Offset 224
+ OpMemberDecorate %type_ShadowDepthPass 57 Offset 228
+ OpMemberDecorate %type_ShadowDepthPass 58 Offset 232
+ OpMemberDecorate %type_ShadowDepthPass 59 Offset 236
+ OpMemberDecorate %type_ShadowDepthPass 60 Offset 240
+ OpMemberDecorate %type_ShadowDepthPass 61 Offset 244
+ OpMemberDecorate %type_ShadowDepthPass 62 Offset 248
+ OpMemberDecorate %type_ShadowDepthPass 63 Offset 252
+ OpMemberDecorate %type_ShadowDepthPass 64 Offset 256
+ OpMemberDecorate %type_ShadowDepthPass 65 Offset 260
+ OpMemberDecorate %type_ShadowDepthPass 66 Offset 264
+ OpMemberDecorate %type_ShadowDepthPass 67 Offset 268
+ OpMemberDecorate %type_ShadowDepthPass 68 Offset 272
+ OpMemberDecorate %type_ShadowDepthPass 68 MatrixStride 16
+ OpMemberDecorate %type_ShadowDepthPass 68 ColMajor
+ OpMemberDecorate %type_ShadowDepthPass 69 Offset 336
+ OpMemberDecorate %type_ShadowDepthPass 70 Offset 352
+ OpMemberDecorate %type_ShadowDepthPass 71 Offset 368
+ OpMemberDecorate %type_ShadowDepthPass 72 Offset 384
+ OpMemberDecorate %type_ShadowDepthPass 73 Offset 396
+ OpMemberDecorate %type_ShadowDepthPass 74 Offset 400
+ OpMemberDecorate %type_ShadowDepthPass 75 Offset 412
+ OpMemberDecorate %type_ShadowDepthPass 76 Offset 416
+ OpMemberDecorate %type_ShadowDepthPass 77 Offset 420
+ OpMemberDecorate %type_ShadowDepthPass 78 Offset 424
+ OpMemberDecorate %type_ShadowDepthPass 79 Offset 428
+ OpMemberDecorate %type_ShadowDepthPass 80 Offset 432
+ OpMemberDecorate %type_ShadowDepthPass 81 Offset 436
+ OpMemberDecorate %type_ShadowDepthPass 82 Offset 440
+ OpMemberDecorate %type_ShadowDepthPass 83 Offset 444
+ OpMemberDecorate %type_ShadowDepthPass 84 Offset 448
+ OpMemberDecorate %type_ShadowDepthPass 85 Offset 452
+ OpMemberDecorate %type_ShadowDepthPass 86 Offset 456
+ OpMemberDecorate %type_ShadowDepthPass 87 Offset 460
+ OpMemberDecorate %type_ShadowDepthPass 88 Offset 464
+ OpMemberDecorate %type_ShadowDepthPass 88 MatrixStride 16
+ OpMemberDecorate %type_ShadowDepthPass 88 ColMajor
+ OpMemberDecorate %type_ShadowDepthPass 89 Offset 528
+ OpMemberDecorate %type_ShadowDepthPass 89 MatrixStride 16
+ OpMemberDecorate %type_ShadowDepthPass 89 ColMajor
+ OpMemberDecorate %type_ShadowDepthPass 90 Offset 592
+ OpMemberDecorate %type_ShadowDepthPass 91 Offset 608
+ OpMemberDecorate %type_ShadowDepthPass 92 Offset 612
+ OpMemberDecorate %type_ShadowDepthPass 93 Offset 616
+ OpMemberDecorate %type_ShadowDepthPass 94 Offset 620
+ OpMemberDecorate %type_ShadowDepthPass 95 Offset 624
+ OpMemberDecorate %type_ShadowDepthPass 95 MatrixStride 16
+ OpMemberDecorate %type_ShadowDepthPass 95 ColMajor
+ OpMemberDecorate %type_ShadowDepthPass 96 Offset 1008
+ OpMemberDecorate %type_ShadowDepthPass 96 MatrixStride 16
+ OpMemberDecorate %type_ShadowDepthPass 96 ColMajor
+ OpDecorate %type_ShadowDepthPass Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_4 = OpConstant %uint 4
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %int_2 = OpConstant %int 2
+ %float_3 = OpConstant %float 3
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %float_6 = OpConstant %float 6
+ %48 = OpConstantComposite %v4float %float_6 %float_6 %float_6 %float_6
+ %float_1 = OpConstant %float 1
+ %float_0 = OpConstant %float 0
+ %int_3 = OpConstant %int 3
+ %int_88 = OpConstant %int 88
+ %int_89 = OpConstant %int 89
+ %int_90 = OpConstant %int 90
+ %int_91 = OpConstant %int 91
+%float_9_99999997en07 = OpConstant %float 9.99999997e-07
+ %uint_6 = OpConstant %uint 6
+%_arr_mat4v4float_uint_6 = OpTypeArray %mat4v4float %uint_6
+ %v3int = OpTypeVector %int 3
+%type_ShadowDepthPass = OpTypeStruct %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %mat4v4float %v4float %v4float %v4float %v3int %int %v3int %float %float %float %float %float %float %float %float %float %float %float %float %int %mat4v4float %mat4v4float %v4float %float %float %float %float %_arr_mat4v4float_uint_6 %_arr_mat4v4float_uint_6
+%_ptr_Uniform_type_ShadowDepthPass = OpTypePointer Uniform %type_ShadowDepthPass
+ %uint_3 = OpConstant %uint 3
+%_arr_v4float_uint_3 = OpTypeArray %v4float %uint_3
+%_ptr_Input__arr_v4float_uint_3 = OpTypePointer Input %_arr_v4float_uint_3
+%_arr_uint_uint_3 = OpTypeArray %uint %uint_3
+%_ptr_Input__arr_uint_uint_3 = OpTypePointer Input %_arr_uint_uint_3
+%_arr__arr_v4float_uint_3_uint_3 = OpTypeArray %_arr_v4float_uint_3 %uint_3
+%_ptr_Input__arr__arr_v4float_uint_3_uint_3 = OpTypePointer Input %_arr__arr_v4float_uint_3_uint_3
+%_arr_v3float_uint_3 = OpTypeArray %v3float %uint_3
+%_ptr_Input__arr_v3float_uint_3 = OpTypePointer Input %_arr_v3float_uint_3
+%_arr_float_uint_3 = OpTypeArray %float %uint_3
+%_ptr_Input__arr_float_uint_3 = OpTypePointer Input %_arr_float_uint_3
+%_arr_v2float_uint_3 = OpTypeArray %v2float %uint_3
+%_ptr_Input__arr_v2float_uint_3 = OpTypePointer Input %_arr_v2float_uint_3
+%_arr_float_uint_4 = OpTypeArray %float %uint_4
+%_ptr_Input__arr_float_uint_4 = OpTypePointer Input %_arr_float_uint_4
+%_arr_float_uint_2 = OpTypeArray %float %uint_2
+%_ptr_Input__arr_float_uint_2 = OpTypePointer Input %_arr_float_uint_2
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Input_v3float = OpTypePointer Input %v3float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%_ptr_Output_float = OpTypePointer Output %float
+%_ptr_Output_v3float = OpTypePointer Output %v3float
+ %void = OpTypeVoid
+ %83 = OpTypeFunction %void
+%_ptr_Function_float = OpTypePointer Function %float
+ %bool = OpTypeBool
+%_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%ShadowDepthPass = OpVariable %_ptr_Uniform_type_ShadowDepthPass Uniform
+%in_var_TEXCOORD10_centroid = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_TEXCOORD11_centroid = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_VS_to_DS_Position = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_VS_To_DS_VertexID = OpVariable %_ptr_Input__arr_uint_uint_3 Input
+%in_var_PN_POSITION = OpVariable %_ptr_Input__arr__arr_v4float_uint_3_uint_3 Input
+%in_var_PN_DisplacementScales = OpVariable %_ptr_Input__arr_v3float_uint_3 Input
+%in_var_PN_TessellationMultiplier = OpVariable %_ptr_Input__arr_float_uint_3 Input
+%in_var_PN_WorldDisplacementMultiplier = OpVariable %_ptr_Input__arr_float_uint_3 Input
+%in_var_PN_DominantVertex = OpVariable %_ptr_Input__arr_v2float_uint_3 Input
+%in_var_PN_DominantVertex1 = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_PN_DominantVertex2 = OpVariable %_ptr_Input__arr_v3float_uint_3 Input
+%in_var_PN_DominantEdge = OpVariable %_ptr_Input__arr_v2float_uint_3 Input
+%in_var_PN_DominantEdge1 = OpVariable %_ptr_Input__arr_v2float_uint_3 Input
+%in_var_PN_DominantEdge2 = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_PN_DominantEdge3 = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_PN_DominantEdge4 = OpVariable %_ptr_Input__arr_v3float_uint_3 Input
+%in_var_PN_DominantEdge5 = OpVariable %_ptr_Input__arr_v3float_uint_3 Input
+%gl_TessLevelOuter = OpVariable %_ptr_Input__arr_float_uint_4 Input
+%gl_TessLevelInner = OpVariable %_ptr_Input__arr_float_uint_2 Input
+%in_var_PN_POSITION9 = OpVariable %_ptr_Input_v4float Input
+%gl_TessCoord = OpVariable %_ptr_Input_v3float Input
+%out_var_TEXCOORD10_centroid = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD11_centroid = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD6 = OpVariable %_ptr_Output_float Output
+%out_var_TEXCOORD7 = OpVariable %_ptr_Output_v3float Output
+%gl_Position = OpVariable %_ptr_Output_v4float Output
+ %89 = OpConstantNull %v4float
+ %90 = OpUndef %v4float
+ %MainDomain = OpFunction %void None %83
+ %91 = OpLabel
+ %92 = OpVariable %_ptr_Function_mat4v4float Function
+ %93 = OpLoad %_arr_v4float_uint_3 %in_var_TEXCOORD10_centroid
+ %94 = OpLoad %_arr_v4float_uint_3 %in_var_TEXCOORD11_centroid
+ %95 = OpCompositeExtract %v4float %93 0
+ %96 = OpCompositeExtract %v4float %94 0
+ %97 = OpCompositeExtract %v4float %93 1
+ %98 = OpCompositeExtract %v4float %94 1
+ %99 = OpCompositeExtract %v4float %93 2
+ %100 = OpCompositeExtract %v4float %94 2
+ %101 = OpLoad %_arr__arr_v4float_uint_3_uint_3 %in_var_PN_POSITION
+ %102 = OpCompositeExtract %_arr_v4float_uint_3 %101 0
+ %103 = OpCompositeExtract %_arr_v4float_uint_3 %101 1
+ %104 = OpCompositeExtract %_arr_v4float_uint_3 %101 2
+ %105 = OpCompositeExtract %v4float %102 0
+ %106 = OpCompositeExtract %v4float %102 1
+ %107 = OpCompositeExtract %v4float %102 2
+ %108 = OpCompositeExtract %v4float %103 0
+ %109 = OpCompositeExtract %v4float %103 1
+ %110 = OpCompositeExtract %v4float %103 2
+ %111 = OpCompositeExtract %v4float %104 0
+ %112 = OpCompositeExtract %v4float %104 1
+ %113 = OpCompositeExtract %v4float %104 2
+ %114 = OpLoad %v4float %in_var_PN_POSITION9
+ %115 = OpLoad %v3float %gl_TessCoord
+ %116 = OpCompositeExtract %float %115 0
+ %117 = OpCompositeExtract %float %115 1
+ %118 = OpCompositeExtract %float %115 2
+ %119 = OpFMul %float %116 %116
+ %120 = OpFMul %float %117 %117
+ %121 = OpFMul %float %118 %118
+ %122 = OpFMul %float %119 %float_3
+ %123 = OpFMul %float %120 %float_3
+ %124 = OpFMul %float %121 %float_3
+ %125 = OpCompositeConstruct %v4float %119 %119 %119 %119
+ %126 = OpFMul %v4float %105 %125
+ %127 = OpCompositeConstruct %v4float %116 %116 %116 %116
+ %128 = OpFMul %v4float %126 %127
+ %129 = OpCompositeConstruct %v4float %120 %120 %120 %120
+ %130 = OpFMul %v4float %108 %129
+ %131 = OpCompositeConstruct %v4float %117 %117 %117 %117
+ %132 = OpFMul %v4float %130 %131
+ %133 = OpFAdd %v4float %128 %132
+ %134 = OpCompositeConstruct %v4float %121 %121 %121 %121
+ %135 = OpFMul %v4float %111 %134
+ %136 = OpCompositeConstruct %v4float %118 %118 %118 %118
+ %137 = OpFMul %v4float %135 %136
+ %138 = OpFAdd %v4float %133 %137
+ %139 = OpCompositeConstruct %v4float %122 %122 %122 %122
+ %140 = OpFMul %v4float %106 %139
+ %141 = OpFMul %v4float %140 %131
+ %142 = OpFAdd %v4float %138 %141
+ %143 = OpCompositeConstruct %v4float %123 %123 %123 %123
+ %144 = OpFMul %v4float %107 %143
+ %145 = OpFMul %v4float %144 %127
+ %146 = OpFAdd %v4float %142 %145
+ %147 = OpFMul %v4float %109 %143
+ %148 = OpFMul %v4float %147 %136
+ %149 = OpFAdd %v4float %146 %148
+ %150 = OpCompositeConstruct %v4float %124 %124 %124 %124
+ %151 = OpFMul %v4float %110 %150
+ %152 = OpFMul %v4float %151 %131
+ %153 = OpFAdd %v4float %149 %152
+ %154 = OpFMul %v4float %112 %150
+ %155 = OpFMul %v4float %154 %127
+ %156 = OpFAdd %v4float %153 %155
+ %157 = OpFMul %v4float %113 %139
+ %158 = OpFMul %v4float %157 %136
+ %159 = OpFAdd %v4float %156 %158
+ %160 = OpFMul %v4float %114 %48
+ %161 = OpFMul %v4float %160 %136
+ %162 = OpFMul %v4float %161 %127
+ %163 = OpFMul %v4float %162 %131
+ %164 = OpFAdd %v4float %159 %163
+ %165 = OpVectorShuffle %v3float %95 %95 0 1 2
+ %166 = OpCompositeConstruct %v3float %116 %116 %116
+ %167 = OpFMul %v3float %165 %166
+ %168 = OpVectorShuffle %v3float %97 %97 0 1 2
+ %169 = OpCompositeConstruct %v3float %117 %117 %117
+ %170 = OpFMul %v3float %168 %169
+ %171 = OpFAdd %v3float %167 %170
+ %172 = OpFMul %v4float %96 %127
+ %173 = OpFMul %v4float %98 %131
+ %174 = OpFAdd %v4float %172 %173
+ %175 = OpVectorShuffle %v3float %171 %89 0 1 2
+ %176 = OpVectorShuffle %v3float %99 %99 0 1 2
+ %177 = OpCompositeConstruct %v3float %118 %118 %118
+ %178 = OpFMul %v3float %176 %177
+ %179 = OpFAdd %v3float %175 %178
+ %180 = OpVectorShuffle %v4float %90 %179 4 5 6 3
+ %181 = OpFMul %v4float %100 %136
+ %182 = OpFAdd %v4float %174 %181
+ %183 = OpVectorShuffle %v3float %182 %182 0 1 2
+ %184 = OpVectorShuffle %v4float %164 %164 4 5 6 3
+ %185 = OpAccessChain %_ptr_Uniform_mat4v4float %ShadowDepthPass %int_88
+ %186 = OpLoad %mat4v4float %185
+ %187 = OpAccessChain %_ptr_Uniform_mat4v4float %ShadowDepthPass %int_89
+ %188 = OpLoad %mat4v4float %187
+ OpStore %92 %188
+ %189 = OpMatrixTimesVector %v4float %186 %184
+ %190 = OpAccessChain %_ptr_Uniform_float %ShadowDepthPass %int_91
+ %191 = OpLoad %float %190
+ %192 = OpFOrdGreaterThan %bool %191 %float_0
+ %193 = OpCompositeExtract %float %189 2
+ %194 = OpFOrdLessThan %bool %193 %float_0
+ %195 = OpLogicalAnd %bool %192 %194
+ OpSelectionMerge %196 None
+ OpBranchConditional %195 %197 %196
+ %197 = OpLabel
+ %198 = OpCompositeInsert %v4float %float_9_99999997en07 %189 2
+ %199 = OpCompositeInsert %v4float %float_1 %198 3
+ OpBranch %196
+ %196 = OpLabel
+ %200 = OpPhi %v4float %189 %91 %199 %197
+ %201 = OpAccessChain %_ptr_Function_float %92 %uint_0 %int_2
+ %202 = OpLoad %float %201
+ %203 = OpAccessChain %_ptr_Function_float %92 %uint_1 %int_2
+ %204 = OpLoad %float %203
+ %205 = OpAccessChain %_ptr_Function_float %92 %uint_2 %int_2
+ %206 = OpLoad %float %205
+ %207 = OpCompositeConstruct %v3float %202 %204 %206
+ %208 = OpDot %float %207 %183
+ %209 = OpExtInst %float %1 FAbs %208
+ %210 = OpAccessChain %_ptr_Uniform_float %ShadowDepthPass %int_90 %int_2
+ %211 = OpLoad %float %210
+ %212 = OpExtInst %float %1 FAbs %209
+ %213 = OpFOrdGreaterThan %bool %212 %float_0
+ %214 = OpFMul %float %209 %209
+ %215 = OpFSub %float %float_1 %214
+ %216 = OpExtInst %float %1 FClamp %215 %float_0 %float_1
+ %217 = OpExtInst %float %1 Sqrt %216
+ %218 = OpFDiv %float %217 %209
+ %219 = OpSelect %float %213 %218 %211
+ %220 = OpExtInst %float %1 FClamp %219 %float_0 %211
+ %221 = OpAccessChain %_ptr_Uniform_float %ShadowDepthPass %int_90 %int_1
+ %222 = OpLoad %float %221
+ %223 = OpFMul %float %222 %220
+ %224 = OpAccessChain %_ptr_Uniform_float %ShadowDepthPass %int_90 %int_0
+ %225 = OpLoad %float %224
+ %226 = OpFAdd %float %223 %225
+ %227 = OpAccessChain %_ptr_Uniform_float %ShadowDepthPass %int_90 %int_3
+ %228 = OpLoad %float %227
+ %229 = OpCompositeExtract %float %200 2
+ %230 = OpFMul %float %229 %228
+ %231 = OpFAdd %float %230 %226
+ %232 = OpCompositeExtract %float %200 3
+ %233 = OpFMul %float %231 %232
+ %234 = OpCompositeInsert %v4float %233 %200 2
+ %235 = OpVectorShuffle %v3float %164 %89 0 1 2
+ OpStore %out_var_TEXCOORD10_centroid %180
+ OpStore %out_var_TEXCOORD11_centroid %182
+ OpStore %out_var_TEXCOORD6 %float_0
+ OpStore %out_var_TEXCOORD7 %235
+ OpStore %gl_Position %234
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-texcoord-array.asm.tese b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-texcoord-array.asm.tese
new file mode 100644
index 00000000000..778e93d39a3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/tese/ds-texcoord-array.asm.tese
@@ -0,0 +1,715 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 183
+; Schema: 0
+ OpCapability Tessellation
+ OpCapability SampledBuffer
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint TessellationEvaluation %MainDomain "main" %gl_TessLevelOuter %gl_TessLevelInner %in_var_TEXCOORD10_centroid %in_var_TEXCOORD11_centroid %in_var_TEXCOORD0 %in_var_COLOR1 %in_var_COLOR2 %in_var_VS_To_DS_Position %in_var_TEXCOORD7 %in_var_Flat_DisplacementScales %in_var_Flat_TessellationMultiplier %in_var_Flat_WorldDisplacementMultiplier %gl_TessCoord %out_var_TEXCOORD10_centroid %out_var_TEXCOORD11_centroid %out_var_TEXCOORD0 %out_var_COLOR1 %out_var_COLOR2 %out_var_TEXCOORD6 %out_var_TEXCOORD7 %gl_Position
+ OpExecutionMode %MainDomain Triangles
+ OpExecutionMode %MainDomain SpacingFractionalOdd
+ OpExecutionMode %MainDomain VertexOrderCw
+ OpSource HLSL 600
+ OpName %type_View "type.View"
+ OpMemberName %type_View 0 "View_TranslatedWorldToClip"
+ OpMemberName %type_View 1 "View_WorldToClip"
+ OpMemberName %type_View 2 "View_ClipToWorld"
+ OpMemberName %type_View 3 "View_TranslatedWorldToView"
+ OpMemberName %type_View 4 "View_ViewToTranslatedWorld"
+ OpMemberName %type_View 5 "View_TranslatedWorldToCameraView"
+ OpMemberName %type_View 6 "View_CameraViewToTranslatedWorld"
+ OpMemberName %type_View 7 "View_ViewToClip"
+ OpMemberName %type_View 8 "View_ViewToClipNoAA"
+ OpMemberName %type_View 9 "View_ClipToView"
+ OpMemberName %type_View 10 "View_ClipToTranslatedWorld"
+ OpMemberName %type_View 11 "View_SVPositionToTranslatedWorld"
+ OpMemberName %type_View 12 "View_ScreenToWorld"
+ OpMemberName %type_View 13 "View_ScreenToTranslatedWorld"
+ OpMemberName %type_View 14 "View_ViewForward"
+ OpMemberName %type_View 15 "PrePadding_View_908"
+ OpMemberName %type_View 16 "View_ViewUp"
+ OpMemberName %type_View 17 "PrePadding_View_924"
+ OpMemberName %type_View 18 "View_ViewRight"
+ OpMemberName %type_View 19 "PrePadding_View_940"
+ OpMemberName %type_View 20 "View_HMDViewNoRollUp"
+ OpMemberName %type_View 21 "PrePadding_View_956"
+ OpMemberName %type_View 22 "View_HMDViewNoRollRight"
+ OpMemberName %type_View 23 "PrePadding_View_972"
+ OpMemberName %type_View 24 "View_InvDeviceZToWorldZTransform"
+ OpMemberName %type_View 25 "View_ScreenPositionScaleBias"
+ OpMemberName %type_View 26 "View_WorldCameraOrigin"
+ OpMemberName %type_View 27 "PrePadding_View_1020"
+ OpMemberName %type_View 28 "View_TranslatedWorldCameraOrigin"
+ OpMemberName %type_View 29 "PrePadding_View_1036"
+ OpMemberName %type_View 30 "View_WorldViewOrigin"
+ OpMemberName %type_View 31 "PrePadding_View_1052"
+ OpMemberName %type_View 32 "View_PreViewTranslation"
+ OpMemberName %type_View 33 "PrePadding_View_1068"
+ OpMemberName %type_View 34 "View_PrevProjection"
+ OpMemberName %type_View 35 "View_PrevViewProj"
+ OpMemberName %type_View 36 "View_PrevViewRotationProj"
+ OpMemberName %type_View 37 "View_PrevViewToClip"
+ OpMemberName %type_View 38 "View_PrevClipToView"
+ OpMemberName %type_View 39 "View_PrevTranslatedWorldToClip"
+ OpMemberName %type_View 40 "View_PrevTranslatedWorldToView"
+ OpMemberName %type_View 41 "View_PrevViewToTranslatedWorld"
+ OpMemberName %type_View 42 "View_PrevTranslatedWorldToCameraView"
+ OpMemberName %type_View 43 "View_PrevCameraViewToTranslatedWorld"
+ OpMemberName %type_View 44 "View_PrevWorldCameraOrigin"
+ OpMemberName %type_View 45 "PrePadding_View_1724"
+ OpMemberName %type_View 46 "View_PrevWorldViewOrigin"
+ OpMemberName %type_View 47 "PrePadding_View_1740"
+ OpMemberName %type_View 48 "View_PrevPreViewTranslation"
+ OpMemberName %type_View 49 "PrePadding_View_1756"
+ OpMemberName %type_View 50 "View_PrevInvViewProj"
+ OpMemberName %type_View 51 "View_PrevScreenToTranslatedWorld"
+ OpMemberName %type_View 52 "View_ClipToPrevClip"
+ OpMemberName %type_View 53 "View_TemporalAAJitter"
+ OpMemberName %type_View 54 "View_GlobalClippingPlane"
+ OpMemberName %type_View 55 "View_FieldOfViewWideAngles"
+ OpMemberName %type_View 56 "View_PrevFieldOfViewWideAngles"
+ OpMemberName %type_View 57 "View_ViewRectMin"
+ OpMemberName %type_View 58 "View_ViewSizeAndInvSize"
+ OpMemberName %type_View 59 "View_BufferSizeAndInvSize"
+ OpMemberName %type_View 60 "View_BufferBilinearUVMinMax"
+ OpMemberName %type_View 61 "View_NumSceneColorMSAASamples"
+ OpMemberName %type_View 62 "View_PreExposure"
+ OpMemberName %type_View 63 "View_OneOverPreExposure"
+ OpMemberName %type_View 64 "PrePadding_View_2076"
+ OpMemberName %type_View 65 "View_DiffuseOverrideParameter"
+ OpMemberName %type_View 66 "View_SpecularOverrideParameter"
+ OpMemberName %type_View 67 "View_NormalOverrideParameter"
+ OpMemberName %type_View 68 "View_RoughnessOverrideParameter"
+ OpMemberName %type_View 69 "View_PrevFrameGameTime"
+ OpMemberName %type_View 70 "View_PrevFrameRealTime"
+ OpMemberName %type_View 71 "View_OutOfBoundsMask"
+ OpMemberName %type_View 72 "PrePadding_View_2148"
+ OpMemberName %type_View 73 "PrePadding_View_2152"
+ OpMemberName %type_View 74 "PrePadding_View_2156"
+ OpMemberName %type_View 75 "View_WorldCameraMovementSinceLastFrame"
+ OpMemberName %type_View 76 "View_CullingSign"
+ OpMemberName %type_View 77 "View_NearPlane"
+ OpMemberName %type_View 78 "View_AdaptiveTessellationFactor"
+ OpMemberName %type_View 79 "View_GameTime"
+ OpMemberName %type_View 80 "View_RealTime"
+ OpMemberName %type_View 81 "View_DeltaTime"
+ OpMemberName %type_View 82 "View_MaterialTextureMipBias"
+ OpMemberName %type_View 83 "View_MaterialTextureDerivativeMultiply"
+ OpMemberName %type_View 84 "View_Random"
+ OpMemberName %type_View 85 "View_FrameNumber"
+ OpMemberName %type_View 86 "View_StateFrameIndexMod8"
+ OpMemberName %type_View 87 "View_StateFrameIndex"
+ OpMemberName %type_View 88 "View_CameraCut"
+ OpMemberName %type_View 89 "View_UnlitViewmodeMask"
+ OpMemberName %type_View 90 "PrePadding_View_2228"
+ OpMemberName %type_View 91 "PrePadding_View_2232"
+ OpMemberName %type_View 92 "PrePadding_View_2236"
+ OpMemberName %type_View 93 "View_DirectionalLightColor"
+ OpMemberName %type_View 94 "View_DirectionalLightDirection"
+ OpMemberName %type_View 95 "PrePadding_View_2268"
+ OpMemberName %type_View 96 "View_TranslucencyLightingVolumeMin"
+ OpMemberName %type_View 97 "View_TranslucencyLightingVolumeInvSize"
+ OpMemberName %type_View 98 "View_TemporalAAParams"
+ OpMemberName %type_View 99 "View_CircleDOFParams"
+ OpMemberName %type_View 100 "View_DepthOfFieldSensorWidth"
+ OpMemberName %type_View 101 "View_DepthOfFieldFocalDistance"
+ OpMemberName %type_View 102 "View_DepthOfFieldScale"
+ OpMemberName %type_View 103 "View_DepthOfFieldFocalLength"
+ OpMemberName %type_View 104 "View_DepthOfFieldFocalRegion"
+ OpMemberName %type_View 105 "View_DepthOfFieldNearTransitionRegion"
+ OpMemberName %type_View 106 "View_DepthOfFieldFarTransitionRegion"
+ OpMemberName %type_View 107 "View_MotionBlurNormalizedToPixel"
+ OpMemberName %type_View 108 "View_bSubsurfacePostprocessEnabled"
+ OpMemberName %type_View 109 "View_GeneralPurposeTweak"
+ OpMemberName %type_View 110 "View_DemosaicVposOffset"
+ OpMemberName %type_View 111 "PrePadding_View_2412"
+ OpMemberName %type_View 112 "View_IndirectLightingColorScale"
+ OpMemberName %type_View 113 "View_HDR32bppEncodingMode"
+ OpMemberName %type_View 114 "View_AtmosphericFogSunDirection"
+ OpMemberName %type_View 115 "View_AtmosphericFogSunPower"
+ OpMemberName %type_View 116 "View_AtmosphericFogPower"
+ OpMemberName %type_View 117 "View_AtmosphericFogDensityScale"
+ OpMemberName %type_View 118 "View_AtmosphericFogDensityOffset"
+ OpMemberName %type_View 119 "View_AtmosphericFogGroundOffset"
+ OpMemberName %type_View 120 "View_AtmosphericFogDistanceScale"
+ OpMemberName %type_View 121 "View_AtmosphericFogAltitudeScale"
+ OpMemberName %type_View 122 "View_AtmosphericFogHeightScaleRayleigh"
+ OpMemberName %type_View 123 "View_AtmosphericFogStartDistance"
+ OpMemberName %type_View 124 "View_AtmosphericFogDistanceOffset"
+ OpMemberName %type_View 125 "View_AtmosphericFogSunDiscScale"
+ OpMemberName %type_View 126 "View_AtmosphericFogSunDiscHalfApexAngleRadian"
+ OpMemberName %type_View 127 "PrePadding_View_2492"
+ OpMemberName %type_View 128 "View_AtmosphericFogSunDiscLuminance"
+ OpMemberName %type_View 129 "View_AtmosphericFogRenderMask"
+ OpMemberName %type_View 130 "View_AtmosphericFogInscatterAltitudeSampleNum"
+ OpMemberName %type_View 131 "PrePadding_View_2520"
+ OpMemberName %type_View 132 "PrePadding_View_2524"
+ OpMemberName %type_View 133 "View_AtmosphericFogSunColor"
+ OpMemberName %type_View 134 "View_NormalCurvatureToRoughnessScaleBias"
+ OpMemberName %type_View 135 "View_RenderingReflectionCaptureMask"
+ OpMemberName %type_View 136 "View_AmbientCubemapTint"
+ OpMemberName %type_View 137 "View_AmbientCubemapIntensity"
+ OpMemberName %type_View 138 "View_SkyLightParameters"
+ OpMemberName %type_View 139 "PrePadding_View_2584"
+ OpMemberName %type_View 140 "PrePadding_View_2588"
+ OpMemberName %type_View 141 "View_SkyLightColor"
+ OpMemberName %type_View 142 "View_SkyIrradianceEnvironmentMap"
+ OpMemberName %type_View 143 "View_MobilePreviewMode"
+ OpMemberName %type_View 144 "View_HMDEyePaddingOffset"
+ OpMemberName %type_View 145 "View_ReflectionCubemapMaxMip"
+ OpMemberName %type_View 146 "View_ShowDecalsMask"
+ OpMemberName %type_View 147 "View_DistanceFieldAOSpecularOcclusionMode"
+ OpMemberName %type_View 148 "View_IndirectCapsuleSelfShadowingIntensity"
+ OpMemberName %type_View 149 "PrePadding_View_2744"
+ OpMemberName %type_View 150 "PrePadding_View_2748"
+ OpMemberName %type_View 151 "View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight"
+ OpMemberName %type_View 152 "View_StereoPassIndex"
+ OpMemberName %type_View 153 "View_GlobalVolumeCenterAndExtent"
+ OpMemberName %type_View 154 "View_GlobalVolumeWorldToUVAddAndMul"
+ OpMemberName %type_View 155 "View_GlobalVolumeDimension"
+ OpMemberName %type_View 156 "View_GlobalVolumeTexelSize"
+ OpMemberName %type_View 157 "View_MaxGlobalDistance"
+ OpMemberName %type_View 158 "PrePadding_View_2908"
+ OpMemberName %type_View 159 "View_CursorPosition"
+ OpMemberName %type_View 160 "View_bCheckerboardSubsurfaceProfileRendering"
+ OpMemberName %type_View 161 "PrePadding_View_2924"
+ OpMemberName %type_View 162 "View_VolumetricFogInvGridSize"
+ OpMemberName %type_View 163 "PrePadding_View_2940"
+ OpMemberName %type_View 164 "View_VolumetricFogGridZParams"
+ OpMemberName %type_View 165 "PrePadding_View_2956"
+ OpMemberName %type_View 166 "View_VolumetricFogSVPosToVolumeUV"
+ OpMemberName %type_View 167 "View_VolumetricFogMaxDistance"
+ OpMemberName %type_View 168 "PrePadding_View_2972"
+ OpMemberName %type_View 169 "View_VolumetricLightmapWorldToUVScale"
+ OpMemberName %type_View 170 "PrePadding_View_2988"
+ OpMemberName %type_View 171 "View_VolumetricLightmapWorldToUVAdd"
+ OpMemberName %type_View 172 "PrePadding_View_3004"
+ OpMemberName %type_View 173 "View_VolumetricLightmapIndirectionTextureSize"
+ OpMemberName %type_View 174 "View_VolumetricLightmapBrickSize"
+ OpMemberName %type_View 175 "View_VolumetricLightmapBrickTexelSize"
+ OpMemberName %type_View 176 "View_StereoIPD"
+ OpMemberName %type_View 177 "View_IndirectLightingCacheShowFlag"
+ OpMemberName %type_View 178 "View_EyeToPixelSpreadAngle"
+ OpMemberName %type_View 179 "PrePadding_View_3048"
+ OpMemberName %type_View 180 "PrePadding_View_3052"
+ OpMemberName %type_View 181 "View_WorldToVirtualTexture"
+ OpMemberName %type_View 182 "View_VirtualTextureParams"
+ OpMemberName %type_View 183 "View_XRPassthroughCameraUVs"
+ OpName %View "View"
+ OpName %in_var_TEXCOORD10_centroid "in.var.TEXCOORD10_centroid"
+ OpName %in_var_TEXCOORD11_centroid "in.var.TEXCOORD11_centroid"
+ OpName %in_var_TEXCOORD0 "in.var.TEXCOORD0"
+ OpName %in_var_COLOR1 "in.var.COLOR1"
+ OpName %in_var_COLOR2 "in.var.COLOR2"
+ OpName %in_var_VS_To_DS_Position "in.var.VS_To_DS_Position"
+ OpName %in_var_TEXCOORD7 "in.var.TEXCOORD7"
+ OpName %in_var_Flat_DisplacementScales "in.var.Flat_DisplacementScales"
+ OpName %in_var_Flat_TessellationMultiplier "in.var.Flat_TessellationMultiplier"
+ OpName %in_var_Flat_WorldDisplacementMultiplier "in.var.Flat_WorldDisplacementMultiplier"
+ OpName %out_var_TEXCOORD10_centroid "out.var.TEXCOORD10_centroid"
+ OpName %out_var_TEXCOORD11_centroid "out.var.TEXCOORD11_centroid"
+ OpName %out_var_TEXCOORD0 "out.var.TEXCOORD0"
+ OpName %out_var_COLOR1 "out.var.COLOR1"
+ OpName %out_var_COLOR2 "out.var.COLOR2"
+ OpName %out_var_TEXCOORD6 "out.var.TEXCOORD6"
+ OpName %out_var_TEXCOORD7 "out.var.TEXCOORD7"
+ OpName %MainDomain "MainDomain"
+ OpDecorate %gl_TessLevelOuter BuiltIn TessLevelOuter
+ OpDecorateString %gl_TessLevelOuter UserSemantic "SV_TessFactor"
+ OpDecorate %gl_TessLevelOuter Patch
+ OpDecorate %gl_TessLevelInner BuiltIn TessLevelInner
+ OpDecorateString %gl_TessLevelInner UserSemantic "SV_InsideTessFactor"
+ OpDecorate %gl_TessLevelInner Patch
+ OpDecorateString %in_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %in_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %in_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorateString %in_var_COLOR1 UserSemantic "COLOR1"
+ OpDecorateString %in_var_COLOR2 UserSemantic "COLOR2"
+ OpDecorateString %in_var_VS_To_DS_Position UserSemantic "VS_To_DS_Position"
+ OpDecorateString %in_var_TEXCOORD7 UserSemantic "TEXCOORD7"
+ OpDecorateString %in_var_Flat_DisplacementScales UserSemantic "Flat_DisplacementScales"
+ OpDecorateString %in_var_Flat_TessellationMultiplier UserSemantic "Flat_TessellationMultiplier"
+ OpDecorateString %in_var_Flat_WorldDisplacementMultiplier UserSemantic "Flat_WorldDisplacementMultiplier"
+ OpDecorate %gl_TessCoord BuiltIn TessCoord
+ OpDecorateString %gl_TessCoord UserSemantic "SV_DomainLocation"
+ OpDecorate %gl_TessCoord Patch
+ OpDecorateString %out_var_TEXCOORD10_centroid UserSemantic "TEXCOORD10_centroid"
+ OpDecorateString %out_var_TEXCOORD11_centroid UserSemantic "TEXCOORD11_centroid"
+ OpDecorateString %out_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorateString %out_var_COLOR1 UserSemantic "COLOR1"
+ OpDecorateString %out_var_COLOR2 UserSemantic "COLOR2"
+ OpDecorateString %out_var_TEXCOORD6 UserSemantic "TEXCOORD6"
+ OpDecorateString %out_var_TEXCOORD7 UserSemantic "TEXCOORD7"
+ OpDecorate %gl_Position BuiltIn Position
+ OpDecorateString %gl_Position UserSemantic "SV_POSITION"
+ OpDecorate %in_var_COLOR1 Location 0
+ OpDecorate %in_var_COLOR2 Location 1
+ OpDecorate %in_var_Flat_DisplacementScales Location 2
+ OpDecorate %in_var_Flat_TessellationMultiplier Location 3
+ OpDecorate %in_var_Flat_WorldDisplacementMultiplier Location 4
+ OpDecorate %in_var_TEXCOORD0 Location 5
+ OpDecorate %in_var_TEXCOORD10_centroid Location 6
+ OpDecorate %in_var_TEXCOORD11_centroid Location 7
+ OpDecorate %in_var_TEXCOORD7 Location 8
+ OpDecorate %in_var_VS_To_DS_Position Location 9
+ OpDecorate %out_var_TEXCOORD10_centroid Location 0
+ OpDecorate %out_var_TEXCOORD11_centroid Location 1
+ OpDecorate %out_var_TEXCOORD0 Location 2
+ OpDecorate %out_var_COLOR1 Location 3
+ OpDecorate %out_var_COLOR2 Location 4
+ OpDecorate %out_var_TEXCOORD6 Location 5
+ OpDecorate %out_var_TEXCOORD7 Location 6
+ OpDecorate %View DescriptorSet 0
+ OpDecorate %View Binding 0
+ OpDecorate %_arr_v4float_uint_2 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_7 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpMemberDecorate %type_View 0 Offset 0
+ OpMemberDecorate %type_View 0 MatrixStride 16
+ OpMemberDecorate %type_View 0 ColMajor
+ OpMemberDecorate %type_View 1 Offset 64
+ OpMemberDecorate %type_View 1 MatrixStride 16
+ OpMemberDecorate %type_View 1 ColMajor
+ OpMemberDecorate %type_View 2 Offset 128
+ OpMemberDecorate %type_View 2 MatrixStride 16
+ OpMemberDecorate %type_View 2 ColMajor
+ OpMemberDecorate %type_View 3 Offset 192
+ OpMemberDecorate %type_View 3 MatrixStride 16
+ OpMemberDecorate %type_View 3 ColMajor
+ OpMemberDecorate %type_View 4 Offset 256
+ OpMemberDecorate %type_View 4 MatrixStride 16
+ OpMemberDecorate %type_View 4 ColMajor
+ OpMemberDecorate %type_View 5 Offset 320
+ OpMemberDecorate %type_View 5 MatrixStride 16
+ OpMemberDecorate %type_View 5 ColMajor
+ OpMemberDecorate %type_View 6 Offset 384
+ OpMemberDecorate %type_View 6 MatrixStride 16
+ OpMemberDecorate %type_View 6 ColMajor
+ OpMemberDecorate %type_View 7 Offset 448
+ OpMemberDecorate %type_View 7 MatrixStride 16
+ OpMemberDecorate %type_View 7 ColMajor
+ OpMemberDecorate %type_View 8 Offset 512
+ OpMemberDecorate %type_View 8 MatrixStride 16
+ OpMemberDecorate %type_View 8 ColMajor
+ OpMemberDecorate %type_View 9 Offset 576
+ OpMemberDecorate %type_View 9 MatrixStride 16
+ OpMemberDecorate %type_View 9 ColMajor
+ OpMemberDecorate %type_View 10 Offset 640
+ OpMemberDecorate %type_View 10 MatrixStride 16
+ OpMemberDecorate %type_View 10 ColMajor
+ OpMemberDecorate %type_View 11 Offset 704
+ OpMemberDecorate %type_View 11 MatrixStride 16
+ OpMemberDecorate %type_View 11 ColMajor
+ OpMemberDecorate %type_View 12 Offset 768
+ OpMemberDecorate %type_View 12 MatrixStride 16
+ OpMemberDecorate %type_View 12 ColMajor
+ OpMemberDecorate %type_View 13 Offset 832
+ OpMemberDecorate %type_View 13 MatrixStride 16
+ OpMemberDecorate %type_View 13 ColMajor
+ OpMemberDecorate %type_View 14 Offset 896
+ OpMemberDecorate %type_View 15 Offset 908
+ OpMemberDecorate %type_View 16 Offset 912
+ OpMemberDecorate %type_View 17 Offset 924
+ OpMemberDecorate %type_View 18 Offset 928
+ OpMemberDecorate %type_View 19 Offset 940
+ OpMemberDecorate %type_View 20 Offset 944
+ OpMemberDecorate %type_View 21 Offset 956
+ OpMemberDecorate %type_View 22 Offset 960
+ OpMemberDecorate %type_View 23 Offset 972
+ OpMemberDecorate %type_View 24 Offset 976
+ OpMemberDecorate %type_View 25 Offset 992
+ OpMemberDecorate %type_View 26 Offset 1008
+ OpMemberDecorate %type_View 27 Offset 1020
+ OpMemberDecorate %type_View 28 Offset 1024
+ OpMemberDecorate %type_View 29 Offset 1036
+ OpMemberDecorate %type_View 30 Offset 1040
+ OpMemberDecorate %type_View 31 Offset 1052
+ OpMemberDecorate %type_View 32 Offset 1056
+ OpMemberDecorate %type_View 33 Offset 1068
+ OpMemberDecorate %type_View 34 Offset 1072
+ OpMemberDecorate %type_View 34 MatrixStride 16
+ OpMemberDecorate %type_View 34 ColMajor
+ OpMemberDecorate %type_View 35 Offset 1136
+ OpMemberDecorate %type_View 35 MatrixStride 16
+ OpMemberDecorate %type_View 35 ColMajor
+ OpMemberDecorate %type_View 36 Offset 1200
+ OpMemberDecorate %type_View 36 MatrixStride 16
+ OpMemberDecorate %type_View 36 ColMajor
+ OpMemberDecorate %type_View 37 Offset 1264
+ OpMemberDecorate %type_View 37 MatrixStride 16
+ OpMemberDecorate %type_View 37 ColMajor
+ OpMemberDecorate %type_View 38 Offset 1328
+ OpMemberDecorate %type_View 38 MatrixStride 16
+ OpMemberDecorate %type_View 38 ColMajor
+ OpMemberDecorate %type_View 39 Offset 1392
+ OpMemberDecorate %type_View 39 MatrixStride 16
+ OpMemberDecorate %type_View 39 ColMajor
+ OpMemberDecorate %type_View 40 Offset 1456
+ OpMemberDecorate %type_View 40 MatrixStride 16
+ OpMemberDecorate %type_View 40 ColMajor
+ OpMemberDecorate %type_View 41 Offset 1520
+ OpMemberDecorate %type_View 41 MatrixStride 16
+ OpMemberDecorate %type_View 41 ColMajor
+ OpMemberDecorate %type_View 42 Offset 1584
+ OpMemberDecorate %type_View 42 MatrixStride 16
+ OpMemberDecorate %type_View 42 ColMajor
+ OpMemberDecorate %type_View 43 Offset 1648
+ OpMemberDecorate %type_View 43 MatrixStride 16
+ OpMemberDecorate %type_View 43 ColMajor
+ OpMemberDecorate %type_View 44 Offset 1712
+ OpMemberDecorate %type_View 45 Offset 1724
+ OpMemberDecorate %type_View 46 Offset 1728
+ OpMemberDecorate %type_View 47 Offset 1740
+ OpMemberDecorate %type_View 48 Offset 1744
+ OpMemberDecorate %type_View 49 Offset 1756
+ OpMemberDecorate %type_View 50 Offset 1760
+ OpMemberDecorate %type_View 50 MatrixStride 16
+ OpMemberDecorate %type_View 50 ColMajor
+ OpMemberDecorate %type_View 51 Offset 1824
+ OpMemberDecorate %type_View 51 MatrixStride 16
+ OpMemberDecorate %type_View 51 ColMajor
+ OpMemberDecorate %type_View 52 Offset 1888
+ OpMemberDecorate %type_View 52 MatrixStride 16
+ OpMemberDecorate %type_View 52 ColMajor
+ OpMemberDecorate %type_View 53 Offset 1952
+ OpMemberDecorate %type_View 54 Offset 1968
+ OpMemberDecorate %type_View 55 Offset 1984
+ OpMemberDecorate %type_View 56 Offset 1992
+ OpMemberDecorate %type_View 57 Offset 2000
+ OpMemberDecorate %type_View 58 Offset 2016
+ OpMemberDecorate %type_View 59 Offset 2032
+ OpMemberDecorate %type_View 60 Offset 2048
+ OpMemberDecorate %type_View 61 Offset 2064
+ OpMemberDecorate %type_View 62 Offset 2068
+ OpMemberDecorate %type_View 63 Offset 2072
+ OpMemberDecorate %type_View 64 Offset 2076
+ OpMemberDecorate %type_View 65 Offset 2080
+ OpMemberDecorate %type_View 66 Offset 2096
+ OpMemberDecorate %type_View 67 Offset 2112
+ OpMemberDecorate %type_View 68 Offset 2128
+ OpMemberDecorate %type_View 69 Offset 2136
+ OpMemberDecorate %type_View 70 Offset 2140
+ OpMemberDecorate %type_View 71 Offset 2144
+ OpMemberDecorate %type_View 72 Offset 2148
+ OpMemberDecorate %type_View 73 Offset 2152
+ OpMemberDecorate %type_View 74 Offset 2156
+ OpMemberDecorate %type_View 75 Offset 2160
+ OpMemberDecorate %type_View 76 Offset 2172
+ OpMemberDecorate %type_View 77 Offset 2176
+ OpMemberDecorate %type_View 78 Offset 2180
+ OpMemberDecorate %type_View 79 Offset 2184
+ OpMemberDecorate %type_View 80 Offset 2188
+ OpMemberDecorate %type_View 81 Offset 2192
+ OpMemberDecorate %type_View 82 Offset 2196
+ OpMemberDecorate %type_View 83 Offset 2200
+ OpMemberDecorate %type_View 84 Offset 2204
+ OpMemberDecorate %type_View 85 Offset 2208
+ OpMemberDecorate %type_View 86 Offset 2212
+ OpMemberDecorate %type_View 87 Offset 2216
+ OpMemberDecorate %type_View 88 Offset 2220
+ OpMemberDecorate %type_View 89 Offset 2224
+ OpMemberDecorate %type_View 90 Offset 2228
+ OpMemberDecorate %type_View 91 Offset 2232
+ OpMemberDecorate %type_View 92 Offset 2236
+ OpMemberDecorate %type_View 93 Offset 2240
+ OpMemberDecorate %type_View 94 Offset 2256
+ OpMemberDecorate %type_View 95 Offset 2268
+ OpMemberDecorate %type_View 96 Offset 2272
+ OpMemberDecorate %type_View 97 Offset 2304
+ OpMemberDecorate %type_View 98 Offset 2336
+ OpMemberDecorate %type_View 99 Offset 2352
+ OpMemberDecorate %type_View 100 Offset 2368
+ OpMemberDecorate %type_View 101 Offset 2372
+ OpMemberDecorate %type_View 102 Offset 2376
+ OpMemberDecorate %type_View 103 Offset 2380
+ OpMemberDecorate %type_View 104 Offset 2384
+ OpMemberDecorate %type_View 105 Offset 2388
+ OpMemberDecorate %type_View 106 Offset 2392
+ OpMemberDecorate %type_View 107 Offset 2396
+ OpMemberDecorate %type_View 108 Offset 2400
+ OpMemberDecorate %type_View 109 Offset 2404
+ OpMemberDecorate %type_View 110 Offset 2408
+ OpMemberDecorate %type_View 111 Offset 2412
+ OpMemberDecorate %type_View 112 Offset 2416
+ OpMemberDecorate %type_View 113 Offset 2428
+ OpMemberDecorate %type_View 114 Offset 2432
+ OpMemberDecorate %type_View 115 Offset 2444
+ OpMemberDecorate %type_View 116 Offset 2448
+ OpMemberDecorate %type_View 117 Offset 2452
+ OpMemberDecorate %type_View 118 Offset 2456
+ OpMemberDecorate %type_View 119 Offset 2460
+ OpMemberDecorate %type_View 120 Offset 2464
+ OpMemberDecorate %type_View 121 Offset 2468
+ OpMemberDecorate %type_View 122 Offset 2472
+ OpMemberDecorate %type_View 123 Offset 2476
+ OpMemberDecorate %type_View 124 Offset 2480
+ OpMemberDecorate %type_View 125 Offset 2484
+ OpMemberDecorate %type_View 126 Offset 2488
+ OpMemberDecorate %type_View 127 Offset 2492
+ OpMemberDecorate %type_View 128 Offset 2496
+ OpMemberDecorate %type_View 129 Offset 2512
+ OpMemberDecorate %type_View 130 Offset 2516
+ OpMemberDecorate %type_View 131 Offset 2520
+ OpMemberDecorate %type_View 132 Offset 2524
+ OpMemberDecorate %type_View 133 Offset 2528
+ OpMemberDecorate %type_View 134 Offset 2544
+ OpMemberDecorate %type_View 135 Offset 2556
+ OpMemberDecorate %type_View 136 Offset 2560
+ OpMemberDecorate %type_View 137 Offset 2576
+ OpMemberDecorate %type_View 138 Offset 2580
+ OpMemberDecorate %type_View 139 Offset 2584
+ OpMemberDecorate %type_View 140 Offset 2588
+ OpMemberDecorate %type_View 141 Offset 2592
+ OpMemberDecorate %type_View 142 Offset 2608
+ OpMemberDecorate %type_View 143 Offset 2720
+ OpMemberDecorate %type_View 144 Offset 2724
+ OpMemberDecorate %type_View 145 Offset 2728
+ OpMemberDecorate %type_View 146 Offset 2732
+ OpMemberDecorate %type_View 147 Offset 2736
+ OpMemberDecorate %type_View 148 Offset 2740
+ OpMemberDecorate %type_View 149 Offset 2744
+ OpMemberDecorate %type_View 150 Offset 2748
+ OpMemberDecorate %type_View 151 Offset 2752
+ OpMemberDecorate %type_View 152 Offset 2764
+ OpMemberDecorate %type_View 153 Offset 2768
+ OpMemberDecorate %type_View 154 Offset 2832
+ OpMemberDecorate %type_View 155 Offset 2896
+ OpMemberDecorate %type_View 156 Offset 2900
+ OpMemberDecorate %type_View 157 Offset 2904
+ OpMemberDecorate %type_View 158 Offset 2908
+ OpMemberDecorate %type_View 159 Offset 2912
+ OpMemberDecorate %type_View 160 Offset 2920
+ OpMemberDecorate %type_View 161 Offset 2924
+ OpMemberDecorate %type_View 162 Offset 2928
+ OpMemberDecorate %type_View 163 Offset 2940
+ OpMemberDecorate %type_View 164 Offset 2944
+ OpMemberDecorate %type_View 165 Offset 2956
+ OpMemberDecorate %type_View 166 Offset 2960
+ OpMemberDecorate %type_View 167 Offset 2968
+ OpMemberDecorate %type_View 168 Offset 2972
+ OpMemberDecorate %type_View 169 Offset 2976
+ OpMemberDecorate %type_View 170 Offset 2988
+ OpMemberDecorate %type_View 171 Offset 2992
+ OpMemberDecorate %type_View 172 Offset 3004
+ OpMemberDecorate %type_View 173 Offset 3008
+ OpMemberDecorate %type_View 174 Offset 3020
+ OpMemberDecorate %type_View 175 Offset 3024
+ OpMemberDecorate %type_View 176 Offset 3036
+ OpMemberDecorate %type_View 177 Offset 3040
+ OpMemberDecorate %type_View 178 Offset 3044
+ OpMemberDecorate %type_View 179 Offset 3048
+ OpMemberDecorate %type_View 180 Offset 3052
+ OpMemberDecorate %type_View 181 Offset 3056
+ OpMemberDecorate %type_View 181 MatrixStride 16
+ OpMemberDecorate %type_View 181 ColMajor
+ OpMemberDecorate %type_View 182 Offset 3120
+ OpMemberDecorate %type_View 183 Offset 3136
+ OpDecorate %type_View Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+ %v2int = OpTypeVector %int 2
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %uint_1 = OpConstant %uint 1
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_arr_v4float_uint_7 = OpTypeArray %v4float %uint_7
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+ %type_View = OpTypeStruct %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %v3float %float %v3float %float %v4float %v4float %v3float %float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %v4float %v4float %v2float %v2float %v4float %v4float %v4float %v4float %int %float %float %float %v4float %v4float %v4float %v2float %float %float %float %float %float %float %v3float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %float %float %float %float %float %v4float %v3float %float %_arr_v4float_uint_2 %_arr_v4float_uint_2 %v4float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %v3float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %float %float %v4float %uint %uint %uint %uint %v4float %v3float %float %v4float %float %float %float %float %v4float %_arr_v4float_uint_7 %float %float %float %float %uint %float %float %float %v3float %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %float %float %float %float %v2int %float %float %v3float %float %v3float %float %v2float %float %float %v3float %float %v3float %float %v3float %float %v3float %float %float %float %float %float %mat4v4float %v4float %_arr_v4float_uint_2
+%_ptr_Uniform_type_View = OpTypePointer Uniform %type_View
+%_arr_float_uint_4 = OpTypeArray %float %uint_4
+%_ptr_Input__arr_float_uint_4 = OpTypePointer Input %_arr_float_uint_4
+%_arr_float_uint_2 = OpTypeArray %float %uint_2
+%_ptr_Input__arr_float_uint_2 = OpTypePointer Input %_arr_float_uint_2
+ %uint_3 = OpConstant %uint 3
+%_arr_v4float_uint_3 = OpTypeArray %v4float %uint_3
+%_ptr_Input__arr_v4float_uint_3 = OpTypePointer Input %_arr_v4float_uint_3
+%_arr_v4float_uint_1 = OpTypeArray %v4float %uint_1
+%_arr__arr_v4float_uint_1_uint_3 = OpTypeArray %_arr_v4float_uint_1 %uint_3
+%_ptr_Input__arr__arr_v4float_uint_1_uint_3 = OpTypePointer Input %_arr__arr_v4float_uint_1_uint_3
+%_arr_v3float_uint_3 = OpTypeArray %v3float %uint_3
+%_ptr_Input__arr_v3float_uint_3 = OpTypePointer Input %_arr_v3float_uint_3
+%_arr_float_uint_3 = OpTypeArray %float %uint_3
+%_ptr_Input__arr_float_uint_3 = OpTypePointer Input %_arr_float_uint_3
+%_ptr_Input_v3float = OpTypePointer Input %v3float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%_ptr_Output__arr_v4float_uint_1 = OpTypePointer Output %_arr_v4float_uint_1
+%_ptr_Output_v3float = OpTypePointer Output %v3float
+ %void = OpTypeVoid
+ %63 = OpTypeFunction %void
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %bool = OpTypeBool
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+ %View = OpVariable %_ptr_Uniform_type_View Uniform
+%gl_TessLevelOuter = OpVariable %_ptr_Input__arr_float_uint_4 Input
+%gl_TessLevelInner = OpVariable %_ptr_Input__arr_float_uint_2 Input
+%in_var_TEXCOORD10_centroid = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_TEXCOORD11_centroid = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_TEXCOORD0 = OpVariable %_ptr_Input__arr__arr_v4float_uint_1_uint_3 Input
+%in_var_COLOR1 = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_COLOR2 = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_VS_To_DS_Position = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
+%in_var_TEXCOORD7 = OpVariable %_ptr_Input__arr_v3float_uint_3 Input
+%in_var_Flat_DisplacementScales = OpVariable %_ptr_Input__arr_v3float_uint_3 Input
+%in_var_Flat_TessellationMultiplier = OpVariable %_ptr_Input__arr_float_uint_3 Input
+%in_var_Flat_WorldDisplacementMultiplier = OpVariable %_ptr_Input__arr_float_uint_3 Input
+%gl_TessCoord = OpVariable %_ptr_Input_v3float Input
+%out_var_TEXCOORD10_centroid = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD11_centroid = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD0 = OpVariable %_ptr_Output__arr_v4float_uint_1 Output
+%out_var_COLOR1 = OpVariable %_ptr_Output_v4float Output
+%out_var_COLOR2 = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD6 = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD7 = OpVariable %_ptr_Output_v3float Output
+%gl_Position = OpVariable %_ptr_Output_v4float Output
+%_ptr_Function__arr_v4float_uint_1 = OpTypePointer Function %_arr_v4float_uint_1
+ %68 = OpUndef %v4float
+ %69 = OpConstantNull %v4float
+ %MainDomain = OpFunction %void None %63
+ %70 = OpLabel
+ %71 = OpVariable %_ptr_Function__arr_v4float_uint_1 Function
+ %72 = OpVariable %_ptr_Function__arr_v4float_uint_1 Function
+ %73 = OpVariable %_ptr_Function__arr_v4float_uint_1 Function
+ %74 = OpVariable %_ptr_Function__arr_v4float_uint_1 Function
+ %75 = OpVariable %_ptr_Function__arr_v4float_uint_1 Function
+ %76 = OpVariable %_ptr_Function__arr_v4float_uint_1 Function
+ %77 = OpLoad %_arr_v4float_uint_3 %in_var_TEXCOORD10_centroid
+ %78 = OpLoad %_arr_v4float_uint_3 %in_var_TEXCOORD11_centroid
+ %79 = OpLoad %_arr__arr_v4float_uint_1_uint_3 %in_var_TEXCOORD0
+ %80 = OpLoad %_arr_v4float_uint_3 %in_var_COLOR1
+ %81 = OpLoad %_arr_v4float_uint_3 %in_var_COLOR2
+ %82 = OpCompositeExtract %v4float %77 0
+ %83 = OpCompositeExtract %v4float %78 0
+ %84 = OpCompositeExtract %_arr_v4float_uint_1 %79 0
+ %85 = OpCompositeExtract %v4float %80 0
+ %86 = OpCompositeExtract %v4float %81 0
+ %87 = OpCompositeExtract %v4float %77 1
+ %88 = OpCompositeExtract %v4float %78 1
+ %89 = OpCompositeExtract %_arr_v4float_uint_1 %79 1
+ %90 = OpCompositeExtract %v4float %80 1
+ %91 = OpCompositeExtract %v4float %81 1
+ %92 = OpCompositeExtract %v4float %77 2
+ %93 = OpCompositeExtract %v4float %78 2
+ %94 = OpCompositeExtract %_arr_v4float_uint_1 %79 2
+ %95 = OpCompositeExtract %v4float %80 2
+ %96 = OpCompositeExtract %v4float %81 2
+ %97 = OpLoad %_arr_v4float_uint_3 %in_var_VS_To_DS_Position
+ %98 = OpLoad %_arr_v3float_uint_3 %in_var_TEXCOORD7
+ %99 = OpCompositeExtract %v4float %97 0
+ %100 = OpCompositeExtract %v3float %98 0
+ %101 = OpCompositeExtract %v4float %97 1
+ %102 = OpCompositeExtract %v3float %98 1
+ %103 = OpCompositeExtract %v4float %97 2
+ %104 = OpCompositeExtract %v3float %98 2
+ %105 = OpLoad %v3float %gl_TessCoord
+ %106 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_0
+ %107 = OpLoad %mat4v4float %106
+ %108 = OpCompositeExtract %float %105 0
+ %109 = OpCompositeExtract %float %105 1
+ %110 = OpCompositeExtract %float %105 2
+ %111 = OpCompositeConstruct %v4float %108 %108 %108 %108
+ %112 = OpFMul %v4float %99 %111
+ %113 = OpCompositeConstruct %v4float %109 %109 %109 %109
+ %114 = OpFMul %v4float %101 %113
+ %115 = OpFAdd %v4float %112 %114
+ %116 = OpCompositeConstruct %v4float %110 %110 %110 %110
+ %117 = OpFMul %v4float %103 %116
+ %118 = OpFAdd %v4float %115 %117
+ OpStore %72 %84
+ OpStore %71 %89
+ %119 = OpVectorShuffle %v3float %82 %82 0 1 2
+ %120 = OpCompositeConstruct %v3float %108 %108 %108
+ %121 = OpFMul %v3float %119 %120
+ %122 = OpVectorShuffle %v3float %87 %87 0 1 2
+ %123 = OpCompositeConstruct %v3float %109 %109 %109
+ %124 = OpFMul %v3float %122 %123
+ %125 = OpFAdd %v3float %121 %124
+ %126 = OpFMul %v4float %83 %111
+ %127 = OpFMul %v4float %88 %113
+ %128 = OpFAdd %v4float %126 %127
+ %129 = OpFMul %v4float %85 %111
+ %130 = OpFMul %v4float %90 %113
+ %131 = OpFAdd %v4float %129 %130
+ OpBranch %132
+ %132 = OpLabel
+ %133 = OpPhi %int %int_0 %70 %134 %135
+ %136 = OpSLessThan %bool %133 %int_1
+ OpLoopMerge %137 %135 None
+ OpBranchConditional %136 %135 %137
+ %135 = OpLabel
+ %138 = OpAccessChain %_ptr_Function_v4float %72 %133
+ %139 = OpLoad %v4float %138
+ %140 = OpFMul %v4float %139 %111
+ %141 = OpAccessChain %_ptr_Function_v4float %71 %133
+ %142 = OpLoad %v4float %141
+ %143 = OpFMul %v4float %142 %113
+ %144 = OpFAdd %v4float %140 %143
+ %145 = OpAccessChain %_ptr_Function_v4float %73 %133
+ OpStore %145 %144
+ %134 = OpIAdd %int %133 %int_1
+ OpBranch %132
+ %137 = OpLabel
+ %146 = OpFMul %v4float %86 %111
+ %147 = OpFMul %v4float %91 %113
+ %148 = OpFAdd %v4float %146 %147
+ %149 = OpLoad %_arr_v4float_uint_1 %73
+ %150 = OpFMul %v3float %100 %120
+ %151 = OpFMul %v3float %102 %123
+ %152 = OpFAdd %v3float %150 %151
+ OpStore %75 %149
+ OpStore %74 %94
+ %153 = OpVectorShuffle %v3float %125 %69 0 1 2
+ %154 = OpVectorShuffle %v3float %92 %92 0 1 2
+ %155 = OpCompositeConstruct %v3float %110 %110 %110
+ %156 = OpFMul %v3float %154 %155
+ %157 = OpFAdd %v3float %153 %156
+ %158 = OpVectorShuffle %v4float %68 %157 4 5 6 3
+ %159 = OpFMul %v4float %93 %116
+ %160 = OpFAdd %v4float %128 %159
+ %161 = OpFMul %v4float %95 %116
+ %162 = OpFAdd %v4float %131 %161
+ OpBranch %163
+ %163 = OpLabel
+ %164 = OpPhi %int %int_0 %137 %165 %166
+ %167 = OpSLessThan %bool %164 %int_1
+ OpLoopMerge %168 %166 None
+ OpBranchConditional %167 %166 %168
+ %166 = OpLabel
+ %169 = OpAccessChain %_ptr_Function_v4float %75 %164
+ %170 = OpLoad %v4float %169
+ %171 = OpAccessChain %_ptr_Function_v4float %74 %164
+ %172 = OpLoad %v4float %171
+ %173 = OpFMul %v4float %172 %116
+ %174 = OpFAdd %v4float %170 %173
+ %175 = OpAccessChain %_ptr_Function_v4float %76 %164
+ OpStore %175 %174
+ %165 = OpIAdd %int %164 %int_1
+ OpBranch %163
+ %168 = OpLabel
+ %176 = OpFMul %v4float %96 %116
+ %177 = OpFAdd %v4float %148 %176
+ %178 = OpLoad %_arr_v4float_uint_1 %76
+ %179 = OpFMul %v3float %104 %155
+ %180 = OpFAdd %v3float %152 %179
+ %181 = OpVectorShuffle %v4float %118 %118 4 5 6 3
+ %182 = OpMatrixTimesVector %v4float %107 %181
+ OpStore %out_var_TEXCOORD10_centroid %158
+ OpStore %out_var_TEXCOORD11_centroid %160
+ OpStore %out_var_TEXCOORD0 %178
+ OpStore %out_var_COLOR1 %162
+ OpStore %out_var_COLOR2 %177
+ OpStore %out_var_TEXCOORD6 %181
+ OpStore %out_var_TEXCOORD7 %180
+ OpStore %gl_Position %182
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/vert/array-missing-copies.asm.vert b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/vert/array-missing-copies.asm.vert
new file mode 100644
index 00000000000..23dc7275601
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/vert/array-missing-copies.asm.vert
@@ -0,0 +1,1131 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 487
+; Schema: 0
+ OpCapability Shader
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %Main "main" %in_var_ATTRIBUTE0 %in_var_ATTRIBUTE1 %out_var_TEXCOORD0 %out_var_TEXCOORD1 %out_var_TEXCOORD2 %out_var_TEXCOORD3 %out_var_TEXCOORD8 %gl_Position
+ OpSource HLSL 600
+ OpName %type_View "type.View"
+ OpMemberName %type_View 0 "View_TranslatedWorldToClip"
+ OpMemberName %type_View 1 "View_WorldToClip"
+ OpMemberName %type_View 2 "View_TranslatedWorldToView"
+ OpMemberName %type_View 3 "View_ViewToTranslatedWorld"
+ OpMemberName %type_View 4 "View_TranslatedWorldToCameraView"
+ OpMemberName %type_View 5 "View_CameraViewToTranslatedWorld"
+ OpMemberName %type_View 6 "View_ViewToClip"
+ OpMemberName %type_View 7 "View_ViewToClipNoAA"
+ OpMemberName %type_View 8 "View_ClipToView"
+ OpMemberName %type_View 9 "View_ClipToTranslatedWorld"
+ OpMemberName %type_View 10 "View_SVPositionToTranslatedWorld"
+ OpMemberName %type_View 11 "View_ScreenToWorld"
+ OpMemberName %type_View 12 "View_ScreenToTranslatedWorld"
+ OpMemberName %type_View 13 "View_ViewForward"
+ OpMemberName %type_View 14 "PrePadding_View_844"
+ OpMemberName %type_View 15 "View_ViewUp"
+ OpMemberName %type_View 16 "PrePadding_View_860"
+ OpMemberName %type_View 17 "View_ViewRight"
+ OpMemberName %type_View 18 "PrePadding_View_876"
+ OpMemberName %type_View 19 "View_HMDViewNoRollUp"
+ OpMemberName %type_View 20 "PrePadding_View_892"
+ OpMemberName %type_View 21 "View_HMDViewNoRollRight"
+ OpMemberName %type_View 22 "PrePadding_View_908"
+ OpMemberName %type_View 23 "View_InvDeviceZToWorldZTransform"
+ OpMemberName %type_View 24 "View_ScreenPositionScaleBias"
+ OpMemberName %type_View 25 "View_WorldCameraOrigin"
+ OpMemberName %type_View 26 "PrePadding_View_956"
+ OpMemberName %type_View 27 "View_TranslatedWorldCameraOrigin"
+ OpMemberName %type_View 28 "PrePadding_View_972"
+ OpMemberName %type_View 29 "View_WorldViewOrigin"
+ OpMemberName %type_View 30 "PrePadding_View_988"
+ OpMemberName %type_View 31 "View_PreViewTranslation"
+ OpMemberName %type_View 32 "PrePadding_View_1004"
+ OpMemberName %type_View 33 "View_PrevProjection"
+ OpMemberName %type_View 34 "View_PrevViewProj"
+ OpMemberName %type_View 35 "View_PrevViewRotationProj"
+ OpMemberName %type_View 36 "View_PrevViewToClip"
+ OpMemberName %type_View 37 "View_PrevClipToView"
+ OpMemberName %type_View 38 "View_PrevTranslatedWorldToClip"
+ OpMemberName %type_View 39 "View_PrevTranslatedWorldToView"
+ OpMemberName %type_View 40 "View_PrevViewToTranslatedWorld"
+ OpMemberName %type_View 41 "View_PrevTranslatedWorldToCameraView"
+ OpMemberName %type_View 42 "View_PrevCameraViewToTranslatedWorld"
+ OpMemberName %type_View 43 "View_PrevWorldCameraOrigin"
+ OpMemberName %type_View 44 "PrePadding_View_1660"
+ OpMemberName %type_View 45 "View_PrevWorldViewOrigin"
+ OpMemberName %type_View 46 "PrePadding_View_1676"
+ OpMemberName %type_View 47 "View_PrevPreViewTranslation"
+ OpMemberName %type_View 48 "PrePadding_View_1692"
+ OpMemberName %type_View 49 "View_PrevInvViewProj"
+ OpMemberName %type_View 50 "View_PrevScreenToTranslatedWorld"
+ OpMemberName %type_View 51 "View_ClipToPrevClip"
+ OpMemberName %type_View 52 "View_TemporalAAJitter"
+ OpMemberName %type_View 53 "View_GlobalClippingPlane"
+ OpMemberName %type_View 54 "View_FieldOfViewWideAngles"
+ OpMemberName %type_View 55 "View_PrevFieldOfViewWideAngles"
+ OpMemberName %type_View 56 "View_ViewRectMin"
+ OpMemberName %type_View 57 "View_ViewSizeAndInvSize"
+ OpMemberName %type_View 58 "View_BufferSizeAndInvSize"
+ OpMemberName %type_View 59 "View_BufferBilinearUVMinMax"
+ OpMemberName %type_View 60 "View_NumSceneColorMSAASamples"
+ OpMemberName %type_View 61 "View_PreExposure"
+ OpMemberName %type_View 62 "View_OneOverPreExposure"
+ OpMemberName %type_View 63 "PrePadding_View_2012"
+ OpMemberName %type_View 64 "View_DiffuseOverrideParameter"
+ OpMemberName %type_View 65 "View_SpecularOverrideParameter"
+ OpMemberName %type_View 66 "View_NormalOverrideParameter"
+ OpMemberName %type_View 67 "View_RoughnessOverrideParameter"
+ OpMemberName %type_View 68 "View_PrevFrameGameTime"
+ OpMemberName %type_View 69 "View_PrevFrameRealTime"
+ OpMemberName %type_View 70 "View_OutOfBoundsMask"
+ OpMemberName %type_View 71 "PrePadding_View_2084"
+ OpMemberName %type_View 72 "PrePadding_View_2088"
+ OpMemberName %type_View 73 "PrePadding_View_2092"
+ OpMemberName %type_View 74 "View_WorldCameraMovementSinceLastFrame"
+ OpMemberName %type_View 75 "View_CullingSign"
+ OpMemberName %type_View 76 "View_NearPlane"
+ OpMemberName %type_View 77 "View_AdaptiveTessellationFactor"
+ OpMemberName %type_View 78 "View_GameTime"
+ OpMemberName %type_View 79 "View_RealTime"
+ OpMemberName %type_View 80 "View_DeltaTime"
+ OpMemberName %type_View 81 "View_MaterialTextureMipBias"
+ OpMemberName %type_View 82 "View_MaterialTextureDerivativeMultiply"
+ OpMemberName %type_View 83 "View_Random"
+ OpMemberName %type_View 84 "View_FrameNumber"
+ OpMemberName %type_View 85 "View_StateFrameIndexMod8"
+ OpMemberName %type_View 86 "View_StateFrameIndex"
+ OpMemberName %type_View 87 "View_CameraCut"
+ OpMemberName %type_View 88 "View_UnlitViewmodeMask"
+ OpMemberName %type_View 89 "PrePadding_View_2164"
+ OpMemberName %type_View 90 "PrePadding_View_2168"
+ OpMemberName %type_View 91 "PrePadding_View_2172"
+ OpMemberName %type_View 92 "View_DirectionalLightColor"
+ OpMemberName %type_View 93 "View_DirectionalLightDirection"
+ OpMemberName %type_View 94 "PrePadding_View_2204"
+ OpMemberName %type_View 95 "View_TranslucencyLightingVolumeMin"
+ OpMemberName %type_View 96 "View_TranslucencyLightingVolumeInvSize"
+ OpMemberName %type_View 97 "View_TemporalAAParams"
+ OpMemberName %type_View 98 "View_CircleDOFParams"
+ OpMemberName %type_View 99 "View_DepthOfFieldSensorWidth"
+ OpMemberName %type_View 100 "View_DepthOfFieldFocalDistance"
+ OpMemberName %type_View 101 "View_DepthOfFieldScale"
+ OpMemberName %type_View 102 "View_DepthOfFieldFocalLength"
+ OpMemberName %type_View 103 "View_DepthOfFieldFocalRegion"
+ OpMemberName %type_View 104 "View_DepthOfFieldNearTransitionRegion"
+ OpMemberName %type_View 105 "View_DepthOfFieldFarTransitionRegion"
+ OpMemberName %type_View 106 "View_MotionBlurNormalizedToPixel"
+ OpMemberName %type_View 107 "View_bSubsurfacePostprocessEnabled"
+ OpMemberName %type_View 108 "View_GeneralPurposeTweak"
+ OpMemberName %type_View 109 "View_DemosaicVposOffset"
+ OpMemberName %type_View 110 "PrePadding_View_2348"
+ OpMemberName %type_View 111 "View_IndirectLightingColorScale"
+ OpMemberName %type_View 112 "View_HDR32bppEncodingMode"
+ OpMemberName %type_View 113 "View_AtmosphericFogSunDirection"
+ OpMemberName %type_View 114 "View_AtmosphericFogSunPower"
+ OpMemberName %type_View 115 "View_AtmosphericFogPower"
+ OpMemberName %type_View 116 "View_AtmosphericFogDensityScale"
+ OpMemberName %type_View 117 "View_AtmosphericFogDensityOffset"
+ OpMemberName %type_View 118 "View_AtmosphericFogGroundOffset"
+ OpMemberName %type_View 119 "View_AtmosphericFogDistanceScale"
+ OpMemberName %type_View 120 "View_AtmosphericFogAltitudeScale"
+ OpMemberName %type_View 121 "View_AtmosphericFogHeightScaleRayleigh"
+ OpMemberName %type_View 122 "View_AtmosphericFogStartDistance"
+ OpMemberName %type_View 123 "View_AtmosphericFogDistanceOffset"
+ OpMemberName %type_View 124 "View_AtmosphericFogSunDiscScale"
+ OpMemberName %type_View 125 "View_AtmosphericFogRenderMask"
+ OpMemberName %type_View 126 "View_AtmosphericFogInscatterAltitudeSampleNum"
+ OpMemberName %type_View 127 "View_AtmosphericFogSunColor"
+ OpMemberName %type_View 128 "View_NormalCurvatureToRoughnessScaleBias"
+ OpMemberName %type_View 129 "View_RenderingReflectionCaptureMask"
+ OpMemberName %type_View 130 "View_AmbientCubemapTint"
+ OpMemberName %type_View 131 "View_AmbientCubemapIntensity"
+ OpMemberName %type_View 132 "View_SkyLightParameters"
+ OpMemberName %type_View 133 "PrePadding_View_2488"
+ OpMemberName %type_View 134 "PrePadding_View_2492"
+ OpMemberName %type_View 135 "View_SkyLightColor"
+ OpMemberName %type_View 136 "View_SkyIrradianceEnvironmentMap"
+ OpMemberName %type_View 137 "View_MobilePreviewMode"
+ OpMemberName %type_View 138 "View_HMDEyePaddingOffset"
+ OpMemberName %type_View 139 "View_ReflectionCubemapMaxMip"
+ OpMemberName %type_View 140 "View_ShowDecalsMask"
+ OpMemberName %type_View 141 "View_DistanceFieldAOSpecularOcclusionMode"
+ OpMemberName %type_View 142 "View_IndirectCapsuleSelfShadowingIntensity"
+ OpMemberName %type_View 143 "PrePadding_View_2648"
+ OpMemberName %type_View 144 "PrePadding_View_2652"
+ OpMemberName %type_View 145 "View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight"
+ OpMemberName %type_View 146 "View_StereoPassIndex"
+ OpMemberName %type_View 147 "View_GlobalVolumeCenterAndExtent"
+ OpMemberName %type_View 148 "View_GlobalVolumeWorldToUVAddAndMul"
+ OpMemberName %type_View 149 "View_GlobalVolumeDimension"
+ OpMemberName %type_View 150 "View_GlobalVolumeTexelSize"
+ OpMemberName %type_View 151 "View_MaxGlobalDistance"
+ OpMemberName %type_View 152 "View_bCheckerboardSubsurfaceProfileRendering"
+ OpMemberName %type_View 153 "View_VolumetricFogInvGridSize"
+ OpMemberName %type_View 154 "PrePadding_View_2828"
+ OpMemberName %type_View 155 "View_VolumetricFogGridZParams"
+ OpMemberName %type_View 156 "PrePadding_View_2844"
+ OpMemberName %type_View 157 "View_VolumetricFogSVPosToVolumeUV"
+ OpMemberName %type_View 158 "View_VolumetricFogMaxDistance"
+ OpMemberName %type_View 159 "PrePadding_View_2860"
+ OpMemberName %type_View 160 "View_VolumetricLightmapWorldToUVScale"
+ OpMemberName %type_View 161 "PrePadding_View_2876"
+ OpMemberName %type_View 162 "View_VolumetricLightmapWorldToUVAdd"
+ OpMemberName %type_View 163 "PrePadding_View_2892"
+ OpMemberName %type_View 164 "View_VolumetricLightmapIndirectionTextureSize"
+ OpMemberName %type_View 165 "View_VolumetricLightmapBrickSize"
+ OpMemberName %type_View 166 "View_VolumetricLightmapBrickTexelSize"
+ OpMemberName %type_View 167 "View_StereoIPD"
+ OpMemberName %type_View 168 "View_IndirectLightingCacheShowFlag"
+ OpMemberName %type_View 169 "View_EyeToPixelSpreadAngle"
+ OpName %View "View"
+ OpName %type_MobileBasePass "type.MobileBasePass"
+ OpMemberName %type_MobileBasePass 0 "MobileBasePass_Fog_ExponentialFogParameters"
+ OpMemberName %type_MobileBasePass 1 "MobileBasePass_Fog_ExponentialFogParameters2"
+ OpMemberName %type_MobileBasePass 2 "MobileBasePass_Fog_ExponentialFogColorParameter"
+ OpMemberName %type_MobileBasePass 3 "MobileBasePass_Fog_ExponentialFogParameters3"
+ OpMemberName %type_MobileBasePass 4 "MobileBasePass_Fog_InscatteringLightDirection"
+ OpMemberName %type_MobileBasePass 5 "MobileBasePass_Fog_DirectionalInscatteringColor"
+ OpMemberName %type_MobileBasePass 6 "MobileBasePass_Fog_SinCosInscatteringColorCubemapRotation"
+ OpMemberName %type_MobileBasePass 7 "PrePadding_MobileBasePass_Fog_104"
+ OpMemberName %type_MobileBasePass 8 "PrePadding_MobileBasePass_Fog_108"
+ OpMemberName %type_MobileBasePass 9 "MobileBasePass_Fog_FogInscatteringTextureParameters"
+ OpMemberName %type_MobileBasePass 10 "MobileBasePass_Fog_ApplyVolumetricFog"
+ OpMemberName %type_MobileBasePass 11 "PrePadding_MobileBasePass_PlanarReflection_128"
+ OpMemberName %type_MobileBasePass 12 "PrePadding_MobileBasePass_PlanarReflection_132"
+ OpMemberName %type_MobileBasePass 13 "PrePadding_MobileBasePass_PlanarReflection_136"
+ OpMemberName %type_MobileBasePass 14 "PrePadding_MobileBasePass_PlanarReflection_140"
+ OpMemberName %type_MobileBasePass 15 "PrePadding_MobileBasePass_PlanarReflection_144"
+ OpMemberName %type_MobileBasePass 16 "PrePadding_MobileBasePass_PlanarReflection_148"
+ OpMemberName %type_MobileBasePass 17 "PrePadding_MobileBasePass_PlanarReflection_152"
+ OpMemberName %type_MobileBasePass 18 "PrePadding_MobileBasePass_PlanarReflection_156"
+ OpMemberName %type_MobileBasePass 19 "MobileBasePass_PlanarReflection_ReflectionPlane"
+ OpMemberName %type_MobileBasePass 20 "MobileBasePass_PlanarReflection_PlanarReflectionOrigin"
+ OpMemberName %type_MobileBasePass 21 "MobileBasePass_PlanarReflection_PlanarReflectionXAxis"
+ OpMemberName %type_MobileBasePass 22 "MobileBasePass_PlanarReflection_PlanarReflectionYAxis"
+ OpMemberName %type_MobileBasePass 23 "MobileBasePass_PlanarReflection_InverseTransposeMirrorMatrix"
+ OpMemberName %type_MobileBasePass 24 "MobileBasePass_PlanarReflection_PlanarReflectionParameters"
+ OpMemberName %type_MobileBasePass 25 "PrePadding_MobileBasePass_PlanarReflection_284"
+ OpMemberName %type_MobileBasePass 26 "MobileBasePass_PlanarReflection_PlanarReflectionParameters2"
+ OpMemberName %type_MobileBasePass 27 "PrePadding_MobileBasePass_PlanarReflection_296"
+ OpMemberName %type_MobileBasePass 28 "PrePadding_MobileBasePass_PlanarReflection_300"
+ OpMemberName %type_MobileBasePass 29 "MobileBasePass_PlanarReflection_ProjectionWithExtraFOV"
+ OpMemberName %type_MobileBasePass 30 "MobileBasePass_PlanarReflection_PlanarReflectionScreenScaleBias"
+ OpMemberName %type_MobileBasePass 31 "MobileBasePass_PlanarReflection_PlanarReflectionScreenBound"
+ OpMemberName %type_MobileBasePass 32 "MobileBasePass_PlanarReflection_bIsStereo"
+ OpName %MobileBasePass "MobileBasePass"
+ OpName %type_Primitive "type.Primitive"
+ OpMemberName %type_Primitive 0 "Primitive_LocalToWorld"
+ OpMemberName %type_Primitive 1 "Primitive_InvNonUniformScaleAndDeterminantSign"
+ OpMemberName %type_Primitive 2 "Primitive_ObjectWorldPositionAndRadius"
+ OpMemberName %type_Primitive 3 "Primitive_WorldToLocal"
+ OpMemberName %type_Primitive 4 "Primitive_PreviousLocalToWorld"
+ OpMemberName %type_Primitive 5 "Primitive_PreviousWorldToLocal"
+ OpMemberName %type_Primitive 6 "Primitive_ActorWorldPosition"
+ OpMemberName %type_Primitive 7 "Primitive_UseSingleSampleShadowFromStationaryLights"
+ OpMemberName %type_Primitive 8 "Primitive_ObjectBounds"
+ OpMemberName %type_Primitive 9 "Primitive_LpvBiasMultiplier"
+ OpMemberName %type_Primitive 10 "Primitive_DecalReceiverMask"
+ OpMemberName %type_Primitive 11 "Primitive_PerObjectGBufferData"
+ OpMemberName %type_Primitive 12 "Primitive_UseVolumetricLightmapShadowFromStationaryLights"
+ OpMemberName %type_Primitive 13 "Primitive_UseEditorDepthTest"
+ OpMemberName %type_Primitive 14 "Primitive_ObjectOrientation"
+ OpMemberName %type_Primitive 15 "Primitive_NonUniformScale"
+ OpMemberName %type_Primitive 16 "Primitive_LocalObjectBoundsMin"
+ OpMemberName %type_Primitive 17 "PrePadding_Primitive_380"
+ OpMemberName %type_Primitive 18 "Primitive_LocalObjectBoundsMax"
+ OpMemberName %type_Primitive 19 "Primitive_LightingChannelMask"
+ OpMemberName %type_Primitive 20 "Primitive_LightmapDataIndex"
+ OpMemberName %type_Primitive 21 "Primitive_SingleCaptureIndex"
+ OpName %Primitive "Primitive"
+ OpName %type_LandscapeParameters "type.LandscapeParameters"
+ OpMemberName %type_LandscapeParameters 0 "LandscapeParameters_HeightmapUVScaleBias"
+ OpMemberName %type_LandscapeParameters 1 "LandscapeParameters_WeightmapUVScaleBias"
+ OpMemberName %type_LandscapeParameters 2 "LandscapeParameters_LandscapeLightmapScaleBias"
+ OpMemberName %type_LandscapeParameters 3 "LandscapeParameters_SubsectionSizeVertsLayerUVPan"
+ OpMemberName %type_LandscapeParameters 4 "LandscapeParameters_SubsectionOffsetParams"
+ OpMemberName %type_LandscapeParameters 5 "LandscapeParameters_LightmapSubsectionOffsetParams"
+ OpMemberName %type_LandscapeParameters 6 "LandscapeParameters_LocalToWorldNoScaling"
+ OpName %LandscapeParameters "LandscapeParameters"
+ OpName %type__Globals "type.$Globals"
+ OpMemberName %type__Globals 0 "LodBias"
+ OpMemberName %type__Globals 1 "LodValues"
+ OpMemberName %type__Globals 2 "SectionLods"
+ OpMemberName %type__Globals 3 "NeighborSectionLod"
+ OpName %_Globals "$Globals"
+ OpName %in_var_ATTRIBUTE0 "in.var.ATTRIBUTE0"
+ OpName %in_var_ATTRIBUTE1 "in.var.ATTRIBUTE1"
+ OpName %out_var_TEXCOORD0 "out.var.TEXCOORD0"
+ OpName %out_var_TEXCOORD1 "out.var.TEXCOORD1"
+ OpName %out_var_TEXCOORD2 "out.var.TEXCOORD2"
+ OpName %out_var_TEXCOORD3 "out.var.TEXCOORD3"
+ OpName %out_var_TEXCOORD8 "out.var.TEXCOORD8"
+ OpName %Main "Main"
+ OpDecorateString %in_var_ATTRIBUTE0 UserSemantic "ATTRIBUTE0"
+ OpDecorateString %in_var_ATTRIBUTE1 UserSemantic "ATTRIBUTE1"
+ OpDecorateString %out_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorateString %out_var_TEXCOORD1 UserSemantic "TEXCOORD1"
+ OpDecorateString %out_var_TEXCOORD2 UserSemantic "TEXCOORD2"
+ OpDecorateString %out_var_TEXCOORD3 UserSemantic "TEXCOORD3"
+ OpDecorateString %out_var_TEXCOORD8 UserSemantic "TEXCOORD8"
+ OpDecorate %gl_Position BuiltIn Position
+ OpDecorateString %gl_Position UserSemantic "SV_POSITION"
+ OpDecorate %in_var_ATTRIBUTE0 Location 0
+ OpDecorate %in_var_ATTRIBUTE1 Location 1
+ OpDecorate %out_var_TEXCOORD0 Location 0
+ OpDecorate %out_var_TEXCOORD1 Location 1
+ OpDecorate %out_var_TEXCOORD2 Location 2
+ OpDecorate %out_var_TEXCOORD3 Location 3
+ OpDecorate %out_var_TEXCOORD8 Location 4
+ OpDecorate %View DescriptorSet 0
+ OpDecorate %View Binding 0
+ OpDecorate %MobileBasePass DescriptorSet 0
+ OpDecorate %MobileBasePass Binding 1
+ OpDecorate %Primitive DescriptorSet 0
+ OpDecorate %Primitive Binding 2
+ OpDecorate %LandscapeParameters DescriptorSet 0
+ OpDecorate %LandscapeParameters Binding 3
+ OpDecorate %_Globals DescriptorSet 0
+ OpDecorate %_Globals Binding 4
+ OpDecorate %_arr_v4float_uint_2_0 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_7 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpMemberDecorate %type_View 0 Offset 0
+ OpMemberDecorate %type_View 0 MatrixStride 16
+ OpMemberDecorate %type_View 0 ColMajor
+ OpMemberDecorate %type_View 1 Offset 64
+ OpMemberDecorate %type_View 1 MatrixStride 16
+ OpMemberDecorate %type_View 1 ColMajor
+ OpMemberDecorate %type_View 2 Offset 128
+ OpMemberDecorate %type_View 2 MatrixStride 16
+ OpMemberDecorate %type_View 2 ColMajor
+ OpMemberDecorate %type_View 3 Offset 192
+ OpMemberDecorate %type_View 3 MatrixStride 16
+ OpMemberDecorate %type_View 3 ColMajor
+ OpMemberDecorate %type_View 4 Offset 256
+ OpMemberDecorate %type_View 4 MatrixStride 16
+ OpMemberDecorate %type_View 4 ColMajor
+ OpMemberDecorate %type_View 5 Offset 320
+ OpMemberDecorate %type_View 5 MatrixStride 16
+ OpMemberDecorate %type_View 5 ColMajor
+ OpMemberDecorate %type_View 6 Offset 384
+ OpMemberDecorate %type_View 6 MatrixStride 16
+ OpMemberDecorate %type_View 6 ColMajor
+ OpMemberDecorate %type_View 7 Offset 448
+ OpMemberDecorate %type_View 7 MatrixStride 16
+ OpMemberDecorate %type_View 7 ColMajor
+ OpMemberDecorate %type_View 8 Offset 512
+ OpMemberDecorate %type_View 8 MatrixStride 16
+ OpMemberDecorate %type_View 8 ColMajor
+ OpMemberDecorate %type_View 9 Offset 576
+ OpMemberDecorate %type_View 9 MatrixStride 16
+ OpMemberDecorate %type_View 9 ColMajor
+ OpMemberDecorate %type_View 10 Offset 640
+ OpMemberDecorate %type_View 10 MatrixStride 16
+ OpMemberDecorate %type_View 10 ColMajor
+ OpMemberDecorate %type_View 11 Offset 704
+ OpMemberDecorate %type_View 11 MatrixStride 16
+ OpMemberDecorate %type_View 11 ColMajor
+ OpMemberDecorate %type_View 12 Offset 768
+ OpMemberDecorate %type_View 12 MatrixStride 16
+ OpMemberDecorate %type_View 12 ColMajor
+ OpMemberDecorate %type_View 13 Offset 832
+ OpMemberDecorate %type_View 14 Offset 844
+ OpMemberDecorate %type_View 15 Offset 848
+ OpMemberDecorate %type_View 16 Offset 860
+ OpMemberDecorate %type_View 17 Offset 864
+ OpMemberDecorate %type_View 18 Offset 876
+ OpMemberDecorate %type_View 19 Offset 880
+ OpMemberDecorate %type_View 20 Offset 892
+ OpMemberDecorate %type_View 21 Offset 896
+ OpMemberDecorate %type_View 22 Offset 908
+ OpMemberDecorate %type_View 23 Offset 912
+ OpMemberDecorate %type_View 24 Offset 928
+ OpMemberDecorate %type_View 25 Offset 944
+ OpMemberDecorate %type_View 26 Offset 956
+ OpMemberDecorate %type_View 27 Offset 960
+ OpMemberDecorate %type_View 28 Offset 972
+ OpMemberDecorate %type_View 29 Offset 976
+ OpMemberDecorate %type_View 30 Offset 988
+ OpMemberDecorate %type_View 31 Offset 992
+ OpMemberDecorate %type_View 32 Offset 1004
+ OpMemberDecorate %type_View 33 Offset 1008
+ OpMemberDecorate %type_View 33 MatrixStride 16
+ OpMemberDecorate %type_View 33 ColMajor
+ OpMemberDecorate %type_View 34 Offset 1072
+ OpMemberDecorate %type_View 34 MatrixStride 16
+ OpMemberDecorate %type_View 34 ColMajor
+ OpMemberDecorate %type_View 35 Offset 1136
+ OpMemberDecorate %type_View 35 MatrixStride 16
+ OpMemberDecorate %type_View 35 ColMajor
+ OpMemberDecorate %type_View 36 Offset 1200
+ OpMemberDecorate %type_View 36 MatrixStride 16
+ OpMemberDecorate %type_View 36 ColMajor
+ OpMemberDecorate %type_View 37 Offset 1264
+ OpMemberDecorate %type_View 37 MatrixStride 16
+ OpMemberDecorate %type_View 37 ColMajor
+ OpMemberDecorate %type_View 38 Offset 1328
+ OpMemberDecorate %type_View 38 MatrixStride 16
+ OpMemberDecorate %type_View 38 ColMajor
+ OpMemberDecorate %type_View 39 Offset 1392
+ OpMemberDecorate %type_View 39 MatrixStride 16
+ OpMemberDecorate %type_View 39 ColMajor
+ OpMemberDecorate %type_View 40 Offset 1456
+ OpMemberDecorate %type_View 40 MatrixStride 16
+ OpMemberDecorate %type_View 40 ColMajor
+ OpMemberDecorate %type_View 41 Offset 1520
+ OpMemberDecorate %type_View 41 MatrixStride 16
+ OpMemberDecorate %type_View 41 ColMajor
+ OpMemberDecorate %type_View 42 Offset 1584
+ OpMemberDecorate %type_View 42 MatrixStride 16
+ OpMemberDecorate %type_View 42 ColMajor
+ OpMemberDecorate %type_View 43 Offset 1648
+ OpMemberDecorate %type_View 44 Offset 1660
+ OpMemberDecorate %type_View 45 Offset 1664
+ OpMemberDecorate %type_View 46 Offset 1676
+ OpMemberDecorate %type_View 47 Offset 1680
+ OpMemberDecorate %type_View 48 Offset 1692
+ OpMemberDecorate %type_View 49 Offset 1696
+ OpMemberDecorate %type_View 49 MatrixStride 16
+ OpMemberDecorate %type_View 49 ColMajor
+ OpMemberDecorate %type_View 50 Offset 1760
+ OpMemberDecorate %type_View 50 MatrixStride 16
+ OpMemberDecorate %type_View 50 ColMajor
+ OpMemberDecorate %type_View 51 Offset 1824
+ OpMemberDecorate %type_View 51 MatrixStride 16
+ OpMemberDecorate %type_View 51 ColMajor
+ OpMemberDecorate %type_View 52 Offset 1888
+ OpMemberDecorate %type_View 53 Offset 1904
+ OpMemberDecorate %type_View 54 Offset 1920
+ OpMemberDecorate %type_View 55 Offset 1928
+ OpMemberDecorate %type_View 56 Offset 1936
+ OpMemberDecorate %type_View 57 Offset 1952
+ OpMemberDecorate %type_View 58 Offset 1968
+ OpMemberDecorate %type_View 59 Offset 1984
+ OpMemberDecorate %type_View 60 Offset 2000
+ OpMemberDecorate %type_View 61 Offset 2004
+ OpMemberDecorate %type_View 62 Offset 2008
+ OpMemberDecorate %type_View 63 Offset 2012
+ OpMemberDecorate %type_View 64 Offset 2016
+ OpMemberDecorate %type_View 65 Offset 2032
+ OpMemberDecorate %type_View 66 Offset 2048
+ OpMemberDecorate %type_View 67 Offset 2064
+ OpMemberDecorate %type_View 68 Offset 2072
+ OpMemberDecorate %type_View 69 Offset 2076
+ OpMemberDecorate %type_View 70 Offset 2080
+ OpMemberDecorate %type_View 71 Offset 2084
+ OpMemberDecorate %type_View 72 Offset 2088
+ OpMemberDecorate %type_View 73 Offset 2092
+ OpMemberDecorate %type_View 74 Offset 2096
+ OpMemberDecorate %type_View 75 Offset 2108
+ OpMemberDecorate %type_View 76 Offset 2112
+ OpMemberDecorate %type_View 77 Offset 2116
+ OpMemberDecorate %type_View 78 Offset 2120
+ OpMemberDecorate %type_View 79 Offset 2124
+ OpMemberDecorate %type_View 80 Offset 2128
+ OpMemberDecorate %type_View 81 Offset 2132
+ OpMemberDecorate %type_View 82 Offset 2136
+ OpMemberDecorate %type_View 83 Offset 2140
+ OpMemberDecorate %type_View 84 Offset 2144
+ OpMemberDecorate %type_View 85 Offset 2148
+ OpMemberDecorate %type_View 86 Offset 2152
+ OpMemberDecorate %type_View 87 Offset 2156
+ OpMemberDecorate %type_View 88 Offset 2160
+ OpMemberDecorate %type_View 89 Offset 2164
+ OpMemberDecorate %type_View 90 Offset 2168
+ OpMemberDecorate %type_View 91 Offset 2172
+ OpMemberDecorate %type_View 92 Offset 2176
+ OpMemberDecorate %type_View 93 Offset 2192
+ OpMemberDecorate %type_View 94 Offset 2204
+ OpMemberDecorate %type_View 95 Offset 2208
+ OpMemberDecorate %type_View 96 Offset 2240
+ OpMemberDecorate %type_View 97 Offset 2272
+ OpMemberDecorate %type_View 98 Offset 2288
+ OpMemberDecorate %type_View 99 Offset 2304
+ OpMemberDecorate %type_View 100 Offset 2308
+ OpMemberDecorate %type_View 101 Offset 2312
+ OpMemberDecorate %type_View 102 Offset 2316
+ OpMemberDecorate %type_View 103 Offset 2320
+ OpMemberDecorate %type_View 104 Offset 2324
+ OpMemberDecorate %type_View 105 Offset 2328
+ OpMemberDecorate %type_View 106 Offset 2332
+ OpMemberDecorate %type_View 107 Offset 2336
+ OpMemberDecorate %type_View 108 Offset 2340
+ OpMemberDecorate %type_View 109 Offset 2344
+ OpMemberDecorate %type_View 110 Offset 2348
+ OpMemberDecorate %type_View 111 Offset 2352
+ OpMemberDecorate %type_View 112 Offset 2364
+ OpMemberDecorate %type_View 113 Offset 2368
+ OpMemberDecorate %type_View 114 Offset 2380
+ OpMemberDecorate %type_View 115 Offset 2384
+ OpMemberDecorate %type_View 116 Offset 2388
+ OpMemberDecorate %type_View 117 Offset 2392
+ OpMemberDecorate %type_View 118 Offset 2396
+ OpMemberDecorate %type_View 119 Offset 2400
+ OpMemberDecorate %type_View 120 Offset 2404
+ OpMemberDecorate %type_View 121 Offset 2408
+ OpMemberDecorate %type_View 122 Offset 2412
+ OpMemberDecorate %type_View 123 Offset 2416
+ OpMemberDecorate %type_View 124 Offset 2420
+ OpMemberDecorate %type_View 125 Offset 2424
+ OpMemberDecorate %type_View 126 Offset 2428
+ OpMemberDecorate %type_View 127 Offset 2432
+ OpMemberDecorate %type_View 128 Offset 2448
+ OpMemberDecorate %type_View 129 Offset 2460
+ OpMemberDecorate %type_View 130 Offset 2464
+ OpMemberDecorate %type_View 131 Offset 2480
+ OpMemberDecorate %type_View 132 Offset 2484
+ OpMemberDecorate %type_View 133 Offset 2488
+ OpMemberDecorate %type_View 134 Offset 2492
+ OpMemberDecorate %type_View 135 Offset 2496
+ OpMemberDecorate %type_View 136 Offset 2512
+ OpMemberDecorate %type_View 137 Offset 2624
+ OpMemberDecorate %type_View 138 Offset 2628
+ OpMemberDecorate %type_View 139 Offset 2632
+ OpMemberDecorate %type_View 140 Offset 2636
+ OpMemberDecorate %type_View 141 Offset 2640
+ OpMemberDecorate %type_View 142 Offset 2644
+ OpMemberDecorate %type_View 143 Offset 2648
+ OpMemberDecorate %type_View 144 Offset 2652
+ OpMemberDecorate %type_View 145 Offset 2656
+ OpMemberDecorate %type_View 146 Offset 2668
+ OpMemberDecorate %type_View 147 Offset 2672
+ OpMemberDecorate %type_View 148 Offset 2736
+ OpMemberDecorate %type_View 149 Offset 2800
+ OpMemberDecorate %type_View 150 Offset 2804
+ OpMemberDecorate %type_View 151 Offset 2808
+ OpMemberDecorate %type_View 152 Offset 2812
+ OpMemberDecorate %type_View 153 Offset 2816
+ OpMemberDecorate %type_View 154 Offset 2828
+ OpMemberDecorate %type_View 155 Offset 2832
+ OpMemberDecorate %type_View 156 Offset 2844
+ OpMemberDecorate %type_View 157 Offset 2848
+ OpMemberDecorate %type_View 158 Offset 2856
+ OpMemberDecorate %type_View 159 Offset 2860
+ OpMemberDecorate %type_View 160 Offset 2864
+ OpMemberDecorate %type_View 161 Offset 2876
+ OpMemberDecorate %type_View 162 Offset 2880
+ OpMemberDecorate %type_View 163 Offset 2892
+ OpMemberDecorate %type_View 164 Offset 2896
+ OpMemberDecorate %type_View 165 Offset 2908
+ OpMemberDecorate %type_View 166 Offset 2912
+ OpMemberDecorate %type_View 167 Offset 2924
+ OpMemberDecorate %type_View 168 Offset 2928
+ OpMemberDecorate %type_View 169 Offset 2932
+ OpDecorate %type_View Block
+ OpDecorate %_arr_mat4v4float_uint_2 ArrayStride 64
+ OpMemberDecorate %type_MobileBasePass 0 Offset 0
+ OpMemberDecorate %type_MobileBasePass 1 Offset 16
+ OpMemberDecorate %type_MobileBasePass 2 Offset 32
+ OpMemberDecorate %type_MobileBasePass 3 Offset 48
+ OpMemberDecorate %type_MobileBasePass 4 Offset 64
+ OpMemberDecorate %type_MobileBasePass 5 Offset 80
+ OpMemberDecorate %type_MobileBasePass 6 Offset 96
+ OpMemberDecorate %type_MobileBasePass 7 Offset 104
+ OpMemberDecorate %type_MobileBasePass 8 Offset 108
+ OpMemberDecorate %type_MobileBasePass 9 Offset 112
+ OpMemberDecorate %type_MobileBasePass 10 Offset 124
+ OpMemberDecorate %type_MobileBasePass 11 Offset 128
+ OpMemberDecorate %type_MobileBasePass 12 Offset 132
+ OpMemberDecorate %type_MobileBasePass 13 Offset 136
+ OpMemberDecorate %type_MobileBasePass 14 Offset 140
+ OpMemberDecorate %type_MobileBasePass 15 Offset 144
+ OpMemberDecorate %type_MobileBasePass 16 Offset 148
+ OpMemberDecorate %type_MobileBasePass 17 Offset 152
+ OpMemberDecorate %type_MobileBasePass 18 Offset 156
+ OpMemberDecorate %type_MobileBasePass 19 Offset 160
+ OpMemberDecorate %type_MobileBasePass 20 Offset 176
+ OpMemberDecorate %type_MobileBasePass 21 Offset 192
+ OpMemberDecorate %type_MobileBasePass 22 Offset 208
+ OpMemberDecorate %type_MobileBasePass 23 Offset 224
+ OpMemberDecorate %type_MobileBasePass 23 MatrixStride 16
+ OpMemberDecorate %type_MobileBasePass 23 ColMajor
+ OpMemberDecorate %type_MobileBasePass 24 Offset 272
+ OpMemberDecorate %type_MobileBasePass 25 Offset 284
+ OpMemberDecorate %type_MobileBasePass 26 Offset 288
+ OpMemberDecorate %type_MobileBasePass 27 Offset 296
+ OpMemberDecorate %type_MobileBasePass 28 Offset 300
+ OpMemberDecorate %type_MobileBasePass 29 Offset 304
+ OpMemberDecorate %type_MobileBasePass 29 MatrixStride 16
+ OpMemberDecorate %type_MobileBasePass 29 ColMajor
+ OpMemberDecorate %type_MobileBasePass 30 Offset 432
+ OpMemberDecorate %type_MobileBasePass 31 Offset 464
+ OpMemberDecorate %type_MobileBasePass 32 Offset 472
+ OpDecorate %type_MobileBasePass Block
+ OpMemberDecorate %type_Primitive 0 Offset 0
+ OpMemberDecorate %type_Primitive 0 MatrixStride 16
+ OpMemberDecorate %type_Primitive 0 ColMajor
+ OpMemberDecorate %type_Primitive 1 Offset 64
+ OpMemberDecorate %type_Primitive 2 Offset 80
+ OpMemberDecorate %type_Primitive 3 Offset 96
+ OpMemberDecorate %type_Primitive 3 MatrixStride 16
+ OpMemberDecorate %type_Primitive 3 ColMajor
+ OpMemberDecorate %type_Primitive 4 Offset 160
+ OpMemberDecorate %type_Primitive 4 MatrixStride 16
+ OpMemberDecorate %type_Primitive 4 ColMajor
+ OpMemberDecorate %type_Primitive 5 Offset 224
+ OpMemberDecorate %type_Primitive 5 MatrixStride 16
+ OpMemberDecorate %type_Primitive 5 ColMajor
+ OpMemberDecorate %type_Primitive 6 Offset 288
+ OpMemberDecorate %type_Primitive 7 Offset 300
+ OpMemberDecorate %type_Primitive 8 Offset 304
+ OpMemberDecorate %type_Primitive 9 Offset 316
+ OpMemberDecorate %type_Primitive 10 Offset 320
+ OpMemberDecorate %type_Primitive 11 Offset 324
+ OpMemberDecorate %type_Primitive 12 Offset 328
+ OpMemberDecorate %type_Primitive 13 Offset 332
+ OpMemberDecorate %type_Primitive 14 Offset 336
+ OpMemberDecorate %type_Primitive 15 Offset 352
+ OpMemberDecorate %type_Primitive 16 Offset 368
+ OpMemberDecorate %type_Primitive 17 Offset 380
+ OpMemberDecorate %type_Primitive 18 Offset 384
+ OpMemberDecorate %type_Primitive 19 Offset 396
+ OpMemberDecorate %type_Primitive 20 Offset 400
+ OpMemberDecorate %type_Primitive 21 Offset 404
+ OpDecorate %type_Primitive Block
+ OpMemberDecorate %type_LandscapeParameters 0 Offset 0
+ OpMemberDecorate %type_LandscapeParameters 1 Offset 16
+ OpMemberDecorate %type_LandscapeParameters 2 Offset 32
+ OpMemberDecorate %type_LandscapeParameters 3 Offset 48
+ OpMemberDecorate %type_LandscapeParameters 4 Offset 64
+ OpMemberDecorate %type_LandscapeParameters 5 Offset 80
+ OpMemberDecorate %type_LandscapeParameters 6 Offset 96
+ OpMemberDecorate %type_LandscapeParameters 6 MatrixStride 16
+ OpMemberDecorate %type_LandscapeParameters 6 ColMajor
+ OpDecorate %type_LandscapeParameters Block
+ OpMemberDecorate %type__Globals 0 Offset 0
+ OpMemberDecorate %type__Globals 1 Offset 16
+ OpMemberDecorate %type__Globals 2 Offset 32
+ OpMemberDecorate %type__Globals 3 Offset 48
+ OpDecorate %type__Globals Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+%float_0_00999999978 = OpConstant %float 0.00999999978
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %float_0 = OpConstant %float 0
+ %40 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+ %int_2 = OpConstant %int 2
+ %int_3 = OpConstant %int 3
+ %float_255 = OpConstant %float 255
+ %44 = OpConstantComposite %v4float %float_255 %float_255 %float_255 %float_255
+ %float_0_5 = OpConstant %float 0.5
+ %46 = OpConstantComposite %v2float %float_0_5 %float_0_5
+ %float_2 = OpConstant %float 2
+ %48 = OpConstantComposite %v2float %float_2 %float_2
+ %float_1 = OpConstant %float 1
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %float_3 = OpConstant %float 3
+ %float_0_25 = OpConstant %float 0.25
+ %uint_3 = OpConstant %uint 3
+ %float_4 = OpConstant %float 4
+%float_0_125 = OpConstant %float 0.125
+ %float_5 = OpConstant %float 5
+%float_0_0625 = OpConstant %float 0.0625
+%float_0_03125 = OpConstant %float 0.03125
+ %60 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %int_5 = OpConstant %int 5
+ %int_4 = OpConstant %int 4
+ %63 = OpConstantComposite %v3float %float_0 %float_0 %float_0
+ %int_25 = OpConstant %int 25
+ %int_27 = OpConstant %int 27
+ %int_31 = OpConstant %int 31
+ %67 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
+%float_32768 = OpConstant %float 32768
+%_arr_v4float_uint_2_0 = OpTypeArray %v4float %uint_2
+%_arr_v4float_uint_7 = OpTypeArray %v4float %uint_7
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+ %type_View = OpTypeStruct %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %v3float %float %v3float %float %v4float %v4float %v3float %float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %v4float %v4float %v2float %v2float %v4float %v4float %v4float %v4float %int %float %float %float %v4float %v4float %v4float %v2float %float %float %float %float %float %float %v3float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %float %float %float %float %float %v4float %v3float %float %_arr_v4float_uint_2_0 %_arr_v4float_uint_2_0 %v4float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %v3float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %uint %uint %v4float %v3float %float %v4float %float %float %float %float %v4float %_arr_v4float_uint_7 %float %float %float %float %uint %float %float %float %v3float %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %float %float %float %float %v3float %float %v3float %float %v2float %float %float %v3float %float %v3float %float %v3float %float %v3float %float %float %float
+%_ptr_Uniform_type_View = OpTypePointer Uniform %type_View
+%mat3v4float = OpTypeMatrix %v4float 3
+%_arr_mat4v4float_uint_2 = OpTypeArray %mat4v4float %uint_2
+%type_MobileBasePass = OpTypeStruct %v4float %v4float %v4float %v4float %v4float %v4float %v2float %float %float %v3float %float %float %float %float %float %float %float %float %float %v4float %v4float %v4float %v4float %mat3v4float %v3float %float %v2float %float %float %_arr_mat4v4float_uint_2 %_arr_v4float_uint_2_0 %v2float %uint
+%_ptr_Uniform_type_MobileBasePass = OpTypePointer Uniform %type_MobileBasePass
+%type_Primitive = OpTypeStruct %mat4v4float %v4float %v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %float %float %float %float %v4float %v4float %v3float %float %v3float %uint %uint %int
+%_ptr_Uniform_type_Primitive = OpTypePointer Uniform %type_Primitive
+%type_LandscapeParameters = OpTypeStruct %v4float %v4float %v4float %v4float %v4float %v4float %mat4v4float
+%_ptr_Uniform_type_LandscapeParameters = OpTypePointer Uniform %type_LandscapeParameters
+%type__Globals = OpTypeStruct %v4float %v4float %v4float %_arr_v4float_uint_4
+%_ptr_Uniform_type__Globals = OpTypePointer Uniform %type__Globals
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Input__arr_v4float_uint_2 = OpTypePointer Input %_arr_v4float_uint_2
+%_ptr_Output_v2float = OpTypePointer Output %v2float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %80 = OpTypeFunction %void
+%_arr_v4float_uint_1 = OpTypeArray %v4float %uint_1
+%_ptr_Function__arr_v4float_uint_1 = OpTypePointer Function %_arr_v4float_uint_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %bool = OpTypeBool
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+ %v3bool = OpTypeVector %bool 3
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+ %View = OpVariable %_ptr_Uniform_type_View Uniform
+%MobileBasePass = OpVariable %_ptr_Uniform_type_MobileBasePass Uniform
+ %Primitive = OpVariable %_ptr_Uniform_type_Primitive Uniform
+%LandscapeParameters = OpVariable %_ptr_Uniform_type_LandscapeParameters Uniform
+ %_Globals = OpVariable %_ptr_Uniform_type__Globals Uniform
+%in_var_ATTRIBUTE0 = OpVariable %_ptr_Input_v4float Input
+%in_var_ATTRIBUTE1 = OpVariable %_ptr_Input__arr_v4float_uint_2 Input
+%out_var_TEXCOORD0 = OpVariable %_ptr_Output_v2float Output
+%out_var_TEXCOORD1 = OpVariable %_ptr_Output_v2float Output
+%out_var_TEXCOORD2 = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD3 = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD8 = OpVariable %_ptr_Output_v4float Output
+%gl_Position = OpVariable %_ptr_Output_v4float Output
+%float_0_0078125 = OpConstant %float 0.0078125
+ %float_n127 = OpConstant %float -127
+ %92 = OpConstantNull %v4float
+%float_0_00392156886 = OpConstant %float 0.00392156886
+ %94 = OpConstantComposite %v2float %float_0_00392156886 %float_0_00392156886
+%float_65280 = OpConstant %float 65280
+ %Main = OpFunction %void None %80
+ %96 = OpLabel
+ %97 = OpVariable %_ptr_Function__arr_v4float_uint_1 Function
+ %98 = OpLoad %v4float %in_var_ATTRIBUTE0
+ %99 = OpLoad %_arr_v4float_uint_2 %in_var_ATTRIBUTE1
+ %100 = OpAccessChain %_ptr_Uniform_mat4v4float %View %int_0
+ %101 = OpLoad %mat4v4float %100
+ %102 = OpAccessChain %_ptr_Uniform_v3float %View %int_27
+ %103 = OpLoad %v3float %102
+ %104 = OpAccessChain %_ptr_Uniform_v3float %View %int_31
+ %105 = OpLoad %v3float %104
+ OpBranch %106
+ %106 = OpLabel
+ %107 = OpPhi %int %int_0 %96 %108 %109
+ %110 = OpSLessThan %bool %107 %int_1
+ OpLoopMerge %111 %109 Unroll
+ OpBranchConditional %110 %109 %111
+ %109 = OpLabel
+ %112 = OpAccessChain %_ptr_Function_v4float %97 %107
+ OpStore %112 %40
+ %108 = OpIAdd %int %107 %int_1
+ OpBranch %106
+ %111 = OpLabel
+ %113 = OpCompositeExtract %v4float %99 0
+ %114 = OpCompositeExtract %v4float %99 1
+ %115 = OpFMul %v4float %98 %44
+ %116 = OpVectorShuffle %v2float %115 %115 2 3
+ %117 = OpFMul %v2float %116 %46
+ %118 = OpExtInst %v2float %1 Fract %117
+ %119 = OpFMul %v2float %118 %48
+ %120 = OpFSub %v2float %116 %119
+ %121 = OpFMul %v2float %120 %94
+ %122 = OpVectorShuffle %v2float %115 %92 0 1
+ %123 = OpAccessChain %_ptr_Uniform_float %_Globals %int_1 %int_3
+ %124 = OpLoad %float %123
+ %125 = OpCompositeConstruct %v2float %124 %124
+ %126 = OpFMul %v2float %122 %125
+ %127 = OpCompositeExtract %float %126 1
+ %128 = OpCompositeExtract %float %126 0
+ %129 = OpFSub %float %float_1 %128
+ %130 = OpFSub %float %float_1 %127
+ %131 = OpCompositeConstruct %v4float %127 %128 %129 %130
+ %132 = OpFMul %v4float %131 %67
+ %133 = OpCompositeExtract %float %119 1
+ %134 = OpFOrdGreaterThan %bool %133 %float_0_5
+ OpSelectionMerge %135 None
+ OpBranchConditional %134 %136 %137
+ %136 = OpLabel
+ %138 = OpCompositeExtract %float %119 0
+ %139 = OpFOrdGreaterThan %bool %138 %float_0_5
+ OpSelectionMerge %140 None
+ OpBranchConditional %139 %141 %142
+ %141 = OpLabel
+ %143 = OpAccessChain %_ptr_Uniform_float %_Globals %int_2 %int_3
+ %144 = OpLoad %float %143
+ %145 = OpCompositeConstruct %v4float %144 %144 %144 %144
+ %146 = OpFMul %v4float %132 %145
+ %147 = OpFSub %v4float %60 %132
+ %148 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_3 %int_3
+ %149 = OpLoad %v4float %148
+ %150 = OpFMul %v4float %147 %149
+ %151 = OpFAdd %v4float %146 %150
+ OpBranch %140
+ %142 = OpLabel
+ %152 = OpAccessChain %_ptr_Uniform_float %_Globals %int_2 %int_2
+ %153 = OpLoad %float %152
+ %154 = OpCompositeConstruct %v4float %153 %153 %153 %153
+ %155 = OpFMul %v4float %132 %154
+ %156 = OpFSub %v4float %60 %132
+ %157 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_3 %int_2
+ %158 = OpLoad %v4float %157
+ %159 = OpFMul %v4float %156 %158
+ %160 = OpFAdd %v4float %155 %159
+ OpBranch %140
+ %140 = OpLabel
+ %161 = OpPhi %v4float %151 %141 %160 %142
+ OpBranch %135
+ %137 = OpLabel
+ %162 = OpCompositeExtract %float %119 0
+ %163 = OpFOrdGreaterThan %bool %162 %float_0_5
+ OpSelectionMerge %164 None
+ OpBranchConditional %163 %165 %166
+ %165 = OpLabel
+ %167 = OpAccessChain %_ptr_Uniform_float %_Globals %int_2 %int_1
+ %168 = OpLoad %float %167
+ %169 = OpCompositeConstruct %v4float %168 %168 %168 %168
+ %170 = OpFMul %v4float %132 %169
+ %171 = OpFSub %v4float %60 %132
+ %172 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_3 %int_1
+ %173 = OpLoad %v4float %172
+ %174 = OpFMul %v4float %171 %173
+ %175 = OpFAdd %v4float %170 %174
+ OpBranch %164
+ %166 = OpLabel
+ %176 = OpAccessChain %_ptr_Uniform_float %_Globals %int_2 %int_0
+ %177 = OpLoad %float %176
+ %178 = OpCompositeConstruct %v4float %177 %177 %177 %177
+ %179 = OpFMul %v4float %132 %178
+ %180 = OpFSub %v4float %60 %132
+ %181 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_3 %int_0
+ %182 = OpLoad %v4float %181
+ %183 = OpFMul %v4float %180 %182
+ %184 = OpFAdd %v4float %179 %183
+ OpBranch %164
+ %164 = OpLabel
+ %185 = OpPhi %v4float %175 %165 %184 %166
+ OpBranch %135
+ %135 = OpLabel
+ %186 = OpPhi %v4float %161 %140 %185 %164
+ %187 = OpFAdd %float %128 %127
+ %188 = OpFOrdGreaterThan %bool %187 %float_1
+ OpSelectionMerge %189 None
+ OpBranchConditional %188 %190 %191
+ %190 = OpLabel
+ %192 = OpFOrdLessThan %bool %128 %127
+ OpSelectionMerge %193 None
+ OpBranchConditional %192 %194 %195
+ %194 = OpLabel
+ %196 = OpCompositeExtract %float %186 3
+ OpBranch %193
+ %195 = OpLabel
+ %197 = OpCompositeExtract %float %186 2
+ OpBranch %193
+ %193 = OpLabel
+ %198 = OpPhi %float %196 %194 %197 %195
+ OpBranch %189
+ %191 = OpLabel
+ %199 = OpFOrdLessThan %bool %128 %127
+ OpSelectionMerge %200 None
+ OpBranchConditional %199 %201 %202
+ %201 = OpLabel
+ %203 = OpCompositeExtract %float %186 1
+ OpBranch %200
+ %202 = OpLabel
+ %204 = OpCompositeExtract %float %186 0
+ OpBranch %200
+ %200 = OpLabel
+ %205 = OpPhi %float %203 %201 %204 %202
+ OpBranch %189
+ %189 = OpLabel
+ %206 = OpPhi %float %198 %193 %205 %200
+ %207 = OpExtInst %float %1 Floor %206
+ %208 = OpFSub %float %206 %207
+ %209 = OpFOrdLessThan %bool %207 %float_1
+ %210 = OpCompositeExtract %float %114 0
+ %211 = OpCompositeExtract %float %114 1
+ %212 = OpCompositeConstruct %v3float %float_1 %210 %211
+ %213 = OpFOrdLessThan %bool %207 %float_2
+ %214 = OpCompositeExtract %float %114 2
+ %215 = OpCompositeConstruct %v3float %float_0_5 %211 %214
+ %216 = OpFOrdLessThan %bool %207 %float_3
+ %217 = OpCompositeExtract %float %114 3
+ %218 = OpCompositeConstruct %v3float %float_0_25 %214 %217
+ %219 = OpFOrdLessThan %bool %207 %float_4
+ %220 = OpCompositeExtract %float %121 0
+ %221 = OpCompositeConstruct %v3float %float_0_125 %217 %220
+ %222 = OpFOrdLessThan %bool %207 %float_5
+ %223 = OpCompositeExtract %float %121 1
+ %224 = OpCompositeConstruct %v3float %float_0_0625 %220 %223
+ %225 = OpCompositeConstruct %v3float %float_0_03125 %223 %223
+ %226 = OpCompositeConstruct %v3bool %222 %222 %222
+ %227 = OpSelect %v3float %226 %224 %225
+ %228 = OpCompositeConstruct %v3bool %219 %219 %219
+ %229 = OpSelect %v3float %228 %221 %227
+ %230 = OpCompositeConstruct %v3bool %216 %216 %216
+ %231 = OpSelect %v3float %230 %218 %229
+ %232 = OpCompositeConstruct %v3bool %213 %213 %213
+ %233 = OpSelect %v3float %232 %215 %231
+ %234 = OpCompositeConstruct %v3bool %209 %209 %209
+ %235 = OpSelect %v3float %234 %212 %233
+ %236 = OpCompositeExtract %float %235 0
+ %237 = OpCompositeExtract %float %235 1
+ %238 = OpCompositeExtract %float %235 2
+ %239 = OpCompositeExtract %float %113 0
+ %240 = OpFMul %float %239 %float_65280
+ %241 = OpCompositeExtract %float %113 1
+ %242 = OpFMul %float %241 %float_255
+ %243 = OpFAdd %float %240 %242
+ %244 = OpFSub %float %243 %float_32768
+ %245 = OpFMul %float %244 %float_0_0078125
+ %246 = OpCompositeExtract %float %113 2
+ %247 = OpFMul %float %246 %float_65280
+ %248 = OpCompositeExtract %float %113 3
+ %249 = OpFMul %float %248 %float_255
+ %250 = OpFAdd %float %247 %249
+ %251 = OpFSub %float %250 %float_32768
+ %252 = OpFMul %float %251 %float_0_0078125
+ %253 = OpExtInst %float %1 FMix %245 %252 %237
+ %254 = OpExtInst %float %1 FMix %245 %252 %238
+ %255 = OpCompositeConstruct %v2float %236 %236
+ %256 = OpFMul %v2float %122 %255
+ %257 = OpExtInst %v2float %1 Floor %256
+ %258 = OpAccessChain %_ptr_Uniform_v4float %LandscapeParameters %int_3
+ %259 = OpAccessChain %_ptr_Uniform_float %LandscapeParameters %int_3 %int_0
+ %260 = OpLoad %float %259
+ %261 = OpFMul %float %260 %236
+ %262 = OpFSub %float %261 %float_1
+ %263 = OpFMul %float %260 %float_0_5
+ %264 = OpFMul %float %263 %236
+ %265 = OpExtInst %float %1 FMax %264 %float_2
+ %266 = OpFSub %float %265 %float_1
+ %267 = OpCompositeConstruct %v2float %262 %266
+ %268 = OpAccessChain %_ptr_Uniform_float %LandscapeParameters %int_3 %int_1
+ %269 = OpLoad %float %268
+ %270 = OpCompositeConstruct %v2float %269 %269
+ %271 = OpFMul %v2float %267 %270
+ %272 = OpCompositeExtract %float %271 0
+ %273 = OpCompositeConstruct %v2float %272 %272
+ %274 = OpFDiv %v2float %257 %273
+ %275 = OpFMul %v2float %257 %46
+ %276 = OpExtInst %v2float %1 Floor %275
+ %277 = OpCompositeExtract %float %271 1
+ %278 = OpCompositeConstruct %v2float %277 %277
+ %279 = OpFDiv %v2float %276 %278
+ %280 = OpCompositeExtract %float %274 0
+ %281 = OpCompositeExtract %float %274 1
+ %282 = OpCompositeConstruct %v3float %280 %281 %253
+ %283 = OpCompositeExtract %float %279 0
+ %284 = OpCompositeExtract %float %279 1
+ %285 = OpCompositeConstruct %v3float %283 %284 %254
+ %286 = OpCompositeConstruct %v3float %208 %208 %208
+ %287 = OpExtInst %v3float %1 FMix %282 %285 %286
+ %288 = OpVectorShuffle %v2float %119 %92 0 1
+ %289 = OpAccessChain %_ptr_Uniform_v4float %LandscapeParameters %int_4
+ %290 = OpLoad %v4float %289
+ %291 = OpVectorShuffle %v2float %290 %290 3 3
+ %292 = OpFMul %v2float %288 %291
+ %293 = OpCompositeExtract %float %292 0
+ %294 = OpCompositeExtract %float %292 1
+ %295 = OpCompositeConstruct %v3float %293 %294 %float_0
+ %296 = OpFAdd %v3float %287 %295
+ %297 = OpAccessChain %_ptr_Uniform_v4float %Primitive %int_0 %uint_0
+ %298 = OpLoad %v4float %297
+ %299 = OpVectorShuffle %v3float %298 %298 0 1 2
+ %300 = OpVectorShuffle %v3float %296 %296 0 0 0
+ %301 = OpFMul %v3float %299 %300
+ %302 = OpAccessChain %_ptr_Uniform_v4float %Primitive %int_0 %uint_1
+ %303 = OpLoad %v4float %302
+ %304 = OpVectorShuffle %v3float %303 %303 0 1 2
+ %305 = OpVectorShuffle %v3float %296 %296 1 1 1
+ %306 = OpFMul %v3float %304 %305
+ %307 = OpFAdd %v3float %301 %306
+ %308 = OpAccessChain %_ptr_Uniform_v4float %Primitive %int_0 %uint_2
+ %309 = OpLoad %v4float %308
+ %310 = OpVectorShuffle %v3float %309 %309 0 1 2
+ %311 = OpVectorShuffle %v3float %296 %296 2 2 2
+ %312 = OpFMul %v3float %310 %311
+ %313 = OpFAdd %v3float %307 %312
+ %314 = OpAccessChain %_ptr_Uniform_v4float %Primitive %int_0 %uint_3
+ %315 = OpLoad %v4float %314
+ %316 = OpVectorShuffle %v3float %315 %315 0 1 2
+ %317 = OpFAdd %v3float %316 %105
+ %318 = OpFAdd %v3float %313 %317
+ %319 = OpCompositeExtract %float %318 0
+ %320 = OpCompositeExtract %float %318 1
+ %321 = OpCompositeExtract %float %318 2
+ %322 = OpCompositeConstruct %v4float %319 %320 %321 %float_1
+ %323 = OpVectorShuffle %v2float %287 %287 0 1
+ %324 = OpLoad %v4float %258
+ %325 = OpVectorShuffle %v2float %324 %324 2 3
+ %326 = OpFAdd %v2float %323 %325
+ %327 = OpFAdd %v2float %326 %292
+ %328 = OpAccessChain %_ptr_Uniform_v4float %LandscapeParameters %int_1
+ %329 = OpLoad %v4float %328
+ %330 = OpVectorShuffle %v2float %329 %329 0 1
+ %331 = OpFMul %v2float %323 %330
+ %332 = OpVectorShuffle %v2float %329 %329 2 3
+ %333 = OpFAdd %v2float %331 %332
+ %334 = OpVectorShuffle %v2float %290 %290 2 2
+ %335 = OpFMul %v2float %288 %334
+ %336 = OpFAdd %v2float %333 %335
+ %337 = OpVectorShuffle %v2float %327 %92 0 1
+ %338 = OpVectorShuffle %v4float %322 %322 4 5 6 3
+ %339 = OpMatrixTimesVector %v4float %101 %338
+ %340 = OpVectorShuffle %v3float %322 %92 0 1 2
+ %341 = OpFSub %v3float %340 %103
+ %342 = OpAccessChain %_ptr_Uniform_v4float %MobileBasePass %int_2
+ %343 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_2 %int_3
+ %344 = OpLoad %float %343
+ %345 = OpDot %float %341 %341
+ %346 = OpExtInst %float %1 InverseSqrt %345
+ %347 = OpFMul %float %345 %346
+ %348 = OpCompositeConstruct %v3float %346 %346 %346
+ %349 = OpFMul %v3float %341 %348
+ %350 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_0 %int_0
+ %351 = OpLoad %float %350
+ %352 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_1 %int_0
+ %353 = OpLoad %float %352
+ %354 = OpCompositeExtract %float %341 2
+ %355 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_0 %int_3
+ %356 = OpLoad %float %355
+ %357 = OpExtInst %float %1 FMax %float_0 %356
+ %358 = OpFOrdGreaterThan %bool %357 %float_0
+ OpSelectionMerge %359 None
+ OpBranchConditional %358 %360 %359
+ %360 = OpLabel
+ %361 = OpFMul %float %357 %346
+ %362 = OpFMul %float %361 %354
+ %363 = OpAccessChain %_ptr_Uniform_float %View %int_25 %int_2
+ %364 = OpLoad %float %363
+ %365 = OpFAdd %float %364 %362
+ %366 = OpFSub %float %354 %362
+ %367 = OpFSub %float %float_1 %361
+ %368 = OpFMul %float %367 %347
+ %369 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_0 %int_1
+ %370 = OpLoad %float %369
+ %371 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_3 %int_1
+ %372 = OpLoad %float %371
+ %373 = OpFSub %float %365 %372
+ %374 = OpFMul %float %370 %373
+ %375 = OpExtInst %float %1 FMax %float_n127 %374
+ %376 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_3 %int_0
+ %377 = OpLoad %float %376
+ %378 = OpFNegate %float %375
+ %379 = OpExtInst %float %1 Exp2 %378
+ %380 = OpFMul %float %377 %379
+ %381 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_1 %int_1
+ %382 = OpLoad %float %381
+ %383 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_1 %int_3
+ %384 = OpLoad %float %383
+ %385 = OpFSub %float %365 %384
+ %386 = OpFMul %float %382 %385
+ %387 = OpExtInst %float %1 FMax %float_n127 %386
+ %388 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_1 %int_2
+ %389 = OpLoad %float %388
+ %390 = OpFNegate %float %387
+ %391 = OpExtInst %float %1 Exp2 %390
+ %392 = OpFMul %float %389 %391
+ OpBranch %359
+ %359 = OpLabel
+ %393 = OpPhi %float %347 %189 %368 %360
+ %394 = OpPhi %float %353 %189 %392 %360
+ %395 = OpPhi %float %351 %189 %380 %360
+ %396 = OpPhi %float %354 %189 %366 %360
+ %397 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_0 %int_1
+ %398 = OpLoad %float %397
+ %399 = OpFMul %float %398 %396
+ %400 = OpExtInst %float %1 FMax %float_n127 %399
+ %401 = OpFNegate %float %400
+ %402 = OpExtInst %float %1 Exp2 %401
+ %403 = OpFSub %float %float_1 %402
+ %404 = OpFDiv %float %403 %400
+ %405 = OpExtInst %float %1 Log %float_2
+ %406 = OpFMul %float %405 %405
+ %407 = OpFMul %float %float_0_5 %406
+ %408 = OpFMul %float %407 %400
+ %409 = OpFSub %float %405 %408
+ %410 = OpExtInst %float %1 FAbs %400
+ %411 = OpFOrdGreaterThan %bool %410 %float_0_00999999978
+ %412 = OpSelect %float %411 %404 %409
+ %413 = OpFMul %float %395 %412
+ %414 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_1 %int_1
+ %415 = OpLoad %float %414
+ %416 = OpFMul %float %415 %396
+ %417 = OpExtInst %float %1 FMax %float_n127 %416
+ %418 = OpFNegate %float %417
+ %419 = OpExtInst %float %1 Exp2 %418
+ %420 = OpFSub %float %float_1 %419
+ %421 = OpFDiv %float %420 %417
+ %422 = OpFMul %float %407 %417
+ %423 = OpFSub %float %405 %422
+ %424 = OpExtInst %float %1 FAbs %417
+ %425 = OpFOrdGreaterThan %bool %424 %float_0_00999999978
+ %426 = OpSelect %float %425 %421 %423
+ %427 = OpFMul %float %394 %426
+ %428 = OpFAdd %float %413 %427
+ %429 = OpFMul %float %428 %393
+ %430 = OpLoad %v4float %342
+ %431 = OpVectorShuffle %v3float %430 %430 0 1 2
+ %432 = OpAccessChain %_ptr_Uniform_v4float %MobileBasePass %int_4
+ %433 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_4 %int_3
+ %434 = OpLoad %float %433
+ %435 = OpFOrdGreaterThanEqual %bool %434 %float_0
+ OpSelectionMerge %436 DontFlatten
+ OpBranchConditional %435 %437 %436
+ %437 = OpLabel
+ %438 = OpAccessChain %_ptr_Uniform_v4float %MobileBasePass %int_5
+ %439 = OpLoad %v4float %438
+ %440 = OpVectorShuffle %v3float %439 %439 0 1 2
+ %441 = OpLoad %v4float %432
+ %442 = OpVectorShuffle %v3float %441 %441 0 1 2
+ %443 = OpDot %float %349 %442
+ %444 = OpExtInst %float %1 FClamp %443 %float_0 %float_1
+ %445 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_5 %int_3
+ %446 = OpLoad %float %445
+ %447 = OpExtInst %float %1 Pow %444 %446
+ %448 = OpCompositeConstruct %v3float %447 %447 %447
+ %449 = OpFMul %v3float %440 %448
+ %450 = OpFSub %float %393 %434
+ %451 = OpExtInst %float %1 FMax %450 %float_0
+ %452 = OpFMul %float %428 %451
+ %453 = OpFNegate %float %452
+ %454 = OpExtInst %float %1 Exp2 %453
+ %455 = OpExtInst %float %1 FClamp %454 %float_0 %float_1
+ %456 = OpFSub %float %float_1 %455
+ %457 = OpCompositeConstruct %v3float %456 %456 %456
+ %458 = OpFMul %v3float %449 %457
+ OpBranch %436
+ %436 = OpLabel
+ %459 = OpPhi %v3float %63 %359 %458 %437
+ %460 = OpFNegate %float %429
+ %461 = OpExtInst %float %1 Exp2 %460
+ %462 = OpExtInst %float %1 FClamp %461 %float_0 %float_1
+ %463 = OpExtInst %float %1 FMax %462 %344
+ %464 = OpAccessChain %_ptr_Uniform_float %MobileBasePass %int_3 %int_3
+ %465 = OpLoad %float %464
+ %466 = OpFOrdGreaterThan %bool %465 %float_0
+ %467 = OpFOrdGreaterThan %bool %347 %465
+ %468 = OpLogicalAnd %bool %466 %467
+ %469 = OpCompositeConstruct %v3bool %468 %468 %468
+ %470 = OpSelect %v3float %469 %63 %459
+ %471 = OpSelect %float %468 %float_1 %463
+ %472 = OpFSub %float %float_1 %471
+ %473 = OpCompositeConstruct %v3float %472 %472 %472
+ %474 = OpFMul %v3float %431 %473
+ %475 = OpFAdd %v3float %474 %470
+ %476 = OpCompositeExtract %float %475 0
+ %477 = OpCompositeExtract %float %475 1
+ %478 = OpCompositeExtract %float %475 2
+ %479 = OpCompositeConstruct %v4float %476 %477 %478 %471
+ %480 = OpAccessChain %_ptr_Function_v4float %97 %int_0
+ OpStore %480 %479
+ %481 = OpCompositeExtract %float %339 3
+ %482 = OpCompositeInsert %v4float %481 %338 3
+ %483 = OpLoad %_arr_v4float_uint_1 %97
+ %484 = OpCompositeExtract %v4float %483 0
+ %485 = OpVectorShuffle %v4float %92 %484 0 1 4 5
+ %486 = OpVectorShuffle %v4float %92 %484 0 1 6 7
+ OpStore %out_var_TEXCOORD0 %337
+ OpStore %out_var_TEXCOORD1 %336
+ OpStore %out_var_TEXCOORD2 %485
+ OpStore %out_var_TEXCOORD3 %486
+ OpStore %out_var_TEXCOORD8 %482
+ OpStore %gl_Position %339
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert
new file mode 100644
index 00000000000..693f16c0099
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert
@@ -0,0 +1,259 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 181
+; Schema: 0
+ OpCapability Shader
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %ScatterMainVS "main" %gl_VertexIndex %gl_InstanceIndex %out_var_TEXCOORD0 %out_var_TEXCOORD1 %out_var_TEXCOORD2 %out_var_TEXCOORD3 %out_var_TEXCOORD4 %out_var_TEXCOORD5 %out_var_TEXCOORD6 %gl_Position
+ OpSource HLSL 600
+ OpName %type__Globals "type.$Globals"
+ OpMemberName %type__Globals 0 "ViewportSize"
+ OpMemberName %type__Globals 1 "ScatteringScaling"
+ OpMemberName %type__Globals 2 "CocRadiusToCircumscribedRadius"
+ OpName %_Globals "$Globals"
+ OpName %type_StructuredBuffer_v4float "type.StructuredBuffer.v4float"
+ OpName %ScatterDrawList "ScatterDrawList"
+ OpName %out_var_TEXCOORD0 "out.var.TEXCOORD0"
+ OpName %out_var_TEXCOORD1 "out.var.TEXCOORD1"
+ OpName %out_var_TEXCOORD2 "out.var.TEXCOORD2"
+ OpName %out_var_TEXCOORD3 "out.var.TEXCOORD3"
+ OpName %out_var_TEXCOORD4 "out.var.TEXCOORD4"
+ OpName %out_var_TEXCOORD5 "out.var.TEXCOORD5"
+ OpName %out_var_TEXCOORD6 "out.var.TEXCOORD6"
+ OpName %ScatterMainVS "ScatterMainVS"
+ OpDecorate %gl_VertexIndex BuiltIn VertexIndex
+ OpDecorateString %gl_VertexIndex UserSemantic "SV_VertexID"
+ OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex
+ OpDecorateString %gl_InstanceIndex UserSemantic "SV_InstanceID"
+ OpDecorateString %out_var_TEXCOORD0 UserSemantic "TEXCOORD0"
+ OpDecorateString %out_var_TEXCOORD1 UserSemantic "TEXCOORD1"
+ OpDecorateString %out_var_TEXCOORD2 UserSemantic "TEXCOORD2"
+ OpDecorateString %out_var_TEXCOORD3 UserSemantic "TEXCOORD3"
+ OpDecorateString %out_var_TEXCOORD4 UserSemantic "TEXCOORD4"
+ OpDecorateString %out_var_TEXCOORD5 UserSemantic "TEXCOORD5"
+ OpDecorateString %out_var_TEXCOORD6 UserSemantic "TEXCOORD6"
+ OpDecorate %gl_Position BuiltIn Position
+ OpDecorateString %gl_Position UserSemantic "SV_POSITION"
+ OpDecorate %out_var_TEXCOORD0 Location 0
+ OpDecorate %out_var_TEXCOORD1 Location 1
+ OpDecorate %out_var_TEXCOORD2 Location 2
+ OpDecorate %out_var_TEXCOORD3 Location 3
+ OpDecorate %out_var_TEXCOORD4 Location 4
+ OpDecorate %out_var_TEXCOORD5 Location 5
+ OpDecorate %out_var_TEXCOORD6 Location 6
+ OpDecorate %_Globals DescriptorSet 0
+ OpDecorate %_Globals Binding 1
+ OpDecorate %ScatterDrawList DescriptorSet 0
+ OpDecorate %ScatterDrawList Binding 0
+ OpMemberDecorate %type__Globals 0 Offset 0
+ OpMemberDecorate %type__Globals 1 Offset 16
+ OpMemberDecorate %type__Globals 2 Offset 20
+ OpDecorate %type__Globals Block
+ OpDecorate %_runtimearr_v4float ArrayStride 16
+ OpMemberDecorate %type_StructuredBuffer_v4float 0 Offset 0
+ OpMemberDecorate %type_StructuredBuffer_v4float 0 NonWritable
+ OpDecorate %type_StructuredBuffer_v4float BufferBlock
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_4 = OpConstant %uint 4
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+ %float_0_5 = OpConstant %float 0.5
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+ %uint_16 = OpConstant %uint 16
+ %float_0 = OpConstant %float 0
+ %uint_0 = OpConstant %uint 0
+ %uint_5 = OpConstant %uint 5
+ %uint_1 = OpConstant %uint 1
+ %int_3 = OpConstant %int 3
+ %float_n0_5 = OpConstant %float -0.5
+ %int_2 = OpConstant %int 2
+ %float_2 = OpConstant %float 2
+ %39 = OpConstantComposite %v2float %float_2 %float_2
+ %40 = OpConstantComposite %v2float %float_1 %float_1
+ %41 = OpConstantComposite %v2float %float_0_5 %float_0_5
+%type__Globals = OpTypeStruct %v4float %float %float
+%_ptr_Uniform_type__Globals = OpTypePointer Uniform %type__Globals
+%_runtimearr_v4float = OpTypeRuntimeArray %v4float
+%type_StructuredBuffer_v4float = OpTypeStruct %_runtimearr_v4float
+%_ptr_Uniform_type_StructuredBuffer_v4float = OpTypePointer Uniform %type_StructuredBuffer_v4float
+%_ptr_Input_uint = OpTypePointer Input %uint
+%_ptr_Output_v2float = OpTypePointer Output %v2float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %48 = OpTypeFunction %void
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%_ptr_Function__arr_v4float_uint_4 = OpTypePointer Function %_arr_v4float_uint_4
+%_arr_float_uint_4 = OpTypeArray %float %uint_4
+%_ptr_Function__arr_float_uint_4 = OpTypePointer Function %_arr_float_uint_4
+%_arr_v2float_uint_4 = OpTypeArray %v2float %uint_4
+%_ptr_Function__arr_v2float_uint_4 = OpTypePointer Function %_arr_v2float_uint_4
+%_ptr_Function_float = OpTypePointer Function %float
+ %bool = OpTypeBool
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+ %_Globals = OpVariable %_ptr_Uniform_type__Globals Uniform
+%ScatterDrawList = OpVariable %_ptr_Uniform_type_StructuredBuffer_v4float Uniform
+%gl_VertexIndex = OpVariable %_ptr_Input_uint Input
+%gl_InstanceIndex = OpVariable %_ptr_Input_uint Input
+%out_var_TEXCOORD0 = OpVariable %_ptr_Output_v2float Output
+%out_var_TEXCOORD1 = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD2 = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD3 = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD4 = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD5 = OpVariable %_ptr_Output_v4float Output
+%out_var_TEXCOORD6 = OpVariable %_ptr_Output_v4float Output
+%gl_Position = OpVariable %_ptr_Output_v4float Output
+%ScatterMainVS = OpFunction %void None %48
+ %60 = OpLabel
+ %61 = OpVariable %_ptr_Function__arr_v4float_uint_4 Function
+ %62 = OpVariable %_ptr_Function__arr_float_uint_4 Function
+ %63 = OpVariable %_ptr_Function__arr_v2float_uint_4 Function
+ %64 = OpLoad %uint %gl_VertexIndex
+ %65 = OpLoad %uint %gl_InstanceIndex
+ %66 = OpUDiv %uint %64 %uint_4
+ %67 = OpIMul %uint %66 %uint_4
+ %68 = OpISub %uint %64 %67
+ %69 = OpIMul %uint %uint_16 %65
+ %70 = OpIAdd %uint %69 %66
+ OpBranch %71
+ %71 = OpLabel
+ %72 = OpPhi %float %float_0 %60 %73 %74
+ %75 = OpPhi %uint %uint_0 %60 %76 %74
+ %77 = OpULessThan %bool %75 %uint_4
+ OpLoopMerge %78 %74 Unroll
+ OpBranchConditional %77 %79 %78
+ %79 = OpLabel
+ %80 = OpIMul %uint %uint_5 %70
+ %81 = OpIAdd %uint %80 %75
+ %82 = OpIAdd %uint %81 %uint_1
+ %83 = OpAccessChain %_ptr_Uniform_v4float %ScatterDrawList %int_0 %82
+ %84 = OpLoad %v4float %83
+ %85 = OpCompositeExtract %float %84 0
+ %86 = OpCompositeExtract %float %84 1
+ %87 = OpCompositeExtract %float %84 2
+ %88 = OpCompositeConstruct %v4float %85 %86 %87 %float_0
+ %89 = OpAccessChain %_ptr_Function_v4float %61 %75
+ OpStore %89 %88
+ %90 = OpCompositeExtract %float %84 3
+ %91 = OpAccessChain %_ptr_Function_float %62 %75
+ OpStore %91 %90
+ %92 = OpIEqual %bool %75 %uint_0
+ OpSelectionMerge %74 None
+ OpBranchConditional %92 %93 %94
+ %93 = OpLabel
+ %95 = OpLoad %float %91
+ OpBranch %74
+ %94 = OpLabel
+ %96 = OpLoad %float %91
+ %97 = OpExtInst %float %1 FMax %72 %96
+ OpBranch %74
+ %74 = OpLabel
+ %73 = OpPhi %float %95 %93 %97 %94
+ %98 = OpLoad %float %91
+ %99 = OpFDiv %float %float_n0_5 %98
+ %100 = OpAccessChain %_ptr_Function_float %63 %75 %int_0
+ OpStore %100 %99
+ %101 = OpLoad %float %91
+ %102 = OpFMul %float %float_0_5 %101
+ %103 = OpFAdd %float %102 %float_0_5
+ %104 = OpAccessChain %_ptr_Function_float %63 %75 %int_1
+ OpStore %104 %103
+ %76 = OpIAdd %uint %75 %uint_1
+ OpBranch %71
+ %78 = OpLabel
+ %105 = OpAccessChain %_ptr_Function_v4float %61 %int_0
+ %106 = OpLoad %v4float %105
+ %107 = OpCompositeExtract %float %106 0
+ %108 = OpCompositeExtract %float %106 1
+ %109 = OpCompositeExtract %float %106 2
+ %110 = OpAccessChain %_ptr_Function_float %62 %int_0
+ %111 = OpLoad %float %110
+ %112 = OpCompositeConstruct %v4float %107 %108 %109 %111
+ %113 = OpAccessChain %_ptr_Function_v4float %61 %int_1
+ %114 = OpLoad %v4float %113
+ %115 = OpCompositeExtract %float %114 0
+ %116 = OpCompositeExtract %float %114 1
+ %117 = OpCompositeExtract %float %114 2
+ %118 = OpAccessChain %_ptr_Function_float %62 %int_1
+ %119 = OpLoad %float %118
+ %120 = OpCompositeConstruct %v4float %115 %116 %117 %119
+ %121 = OpAccessChain %_ptr_Function_v4float %61 %int_2
+ %122 = OpLoad %v4float %121
+ %123 = OpCompositeExtract %float %122 0
+ %124 = OpCompositeExtract %float %122 1
+ %125 = OpCompositeExtract %float %122 2
+ %126 = OpAccessChain %_ptr_Function_float %62 %int_2
+ %127 = OpLoad %float %126
+ %128 = OpCompositeConstruct %v4float %123 %124 %125 %127
+ %129 = OpAccessChain %_ptr_Function_v4float %61 %int_3
+ %130 = OpLoad %v4float %129
+ %131 = OpCompositeExtract %float %130 0
+ %132 = OpCompositeExtract %float %130 1
+ %133 = OpCompositeExtract %float %130 2
+ %134 = OpAccessChain %_ptr_Function_float %62 %int_3
+ %135 = OpLoad %float %134
+ %136 = OpCompositeConstruct %v4float %131 %132 %133 %135
+ %137 = OpAccessChain %_ptr_Uniform_float %_Globals %int_1
+ %138 = OpLoad %float %137
+ %139 = OpCompositeConstruct %v2float %138 %138
+ %140 = OpIMul %uint %uint_5 %70
+ %141 = OpAccessChain %_ptr_Uniform_v4float %ScatterDrawList %int_0 %140
+ %142 = OpLoad %v4float %141
+ %143 = OpVectorShuffle %v2float %142 %142 0 1
+ %144 = OpFMul %v2float %139 %143
+ %145 = OpAccessChain %_ptr_Function_v2float %63 %int_0
+ %146 = OpLoad %v2float %145
+ %147 = OpAccessChain %_ptr_Function_v2float %63 %int_1
+ %148 = OpLoad %v2float %147
+ %149 = OpVectorShuffle %v4float %146 %148 0 1 2 3
+ %150 = OpAccessChain %_ptr_Function_v2float %63 %int_2
+ %151 = OpLoad %v2float %150
+ %152 = OpAccessChain %_ptr_Function_v2float %63 %int_3
+ %153 = OpLoad %v2float %152
+ %154 = OpVectorShuffle %v4float %151 %153 0 1 2 3
+ %155 = OpUMod %uint %68 %uint_2
+ %156 = OpConvertUToF %float %155
+ %157 = OpUDiv %uint %68 %uint_2
+ %158 = OpConvertUToF %float %157
+ %159 = OpCompositeConstruct %v2float %156 %158
+ %160 = OpFMul %v2float %159 %39
+ %161 = OpFSub %v2float %160 %40
+ %162 = OpAccessChain %_ptr_Uniform_float %_Globals %int_2
+ %163 = OpLoad %float %162
+ %164 = OpFMul %float %72 %163
+ %165 = OpFAdd %float %164 %float_1
+ %166 = OpCompositeConstruct %v2float %165 %165
+ %167 = OpFMul %v2float %166 %161
+ %168 = OpFAdd %v2float %167 %144
+ %169 = OpFAdd %v2float %168 %41
+ %170 = OpAccessChain %_ptr_Uniform_v4float %_Globals %int_0
+ %171 = OpLoad %v4float %170
+ %172 = OpVectorShuffle %v2float %171 %171 2 3
+ %173 = OpFMul %v2float %169 %172
+ %174 = OpCompositeExtract %float %173 0
+ %175 = OpFMul %float %174 %float_2
+ %176 = OpFSub %float %175 %float_1
+ %177 = OpCompositeExtract %float %173 1
+ %178 = OpFMul %float %177 %float_2
+ %179 = OpFSub %float %float_1 %178
+ %180 = OpCompositeConstruct %v4float %176 %179 %float_0 %float_1
+ OpStore %out_var_TEXCOORD0 %144
+ OpStore %out_var_TEXCOORD1 %112
+ OpStore %out_var_TEXCOORD2 %120
+ OpStore %out_var_TEXCOORD3 %128
+ OpStore %out_var_TEXCOORD4 %136
+ OpStore %out_var_TEXCOORD5 %149
+ OpStore %out_var_TEXCOORD6 %154
+ OpStore %gl_Position %180
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/vert/texture-buffer.asm.vert b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/vert/texture-buffer.asm.vert
new file mode 100644
index 00000000000..6d52623a145
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders-ue4/asm/vert/texture-buffer.asm.vert
@@ -0,0 +1,1054 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Google spiregg; 0
+; Bound: 397
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledBuffer
+ OpCapability StorageImageExtendedFormats
+ OpExtension "SPV_GOOGLE_hlsl_functionality1"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %Main "main" %gl_VertexIndex %gl_InstanceIndex %in_var_ATTRIBUTE0 %out_var_TEXCOORD6 %gl_Position
+ OpSource HLSL 600
+ OpName %type_View "type.View"
+ OpMemberName %type_View 0 "View_TranslatedWorldToClip"
+ OpMemberName %type_View 1 "View_WorldToClip"
+ OpMemberName %type_View 2 "View_TranslatedWorldToView"
+ OpMemberName %type_View 3 "View_ViewToTranslatedWorld"
+ OpMemberName %type_View 4 "View_TranslatedWorldToCameraView"
+ OpMemberName %type_View 5 "View_CameraViewToTranslatedWorld"
+ OpMemberName %type_View 6 "View_ViewToClip"
+ OpMemberName %type_View 7 "View_ViewToClipNoAA"
+ OpMemberName %type_View 8 "View_ClipToView"
+ OpMemberName %type_View 9 "View_ClipToTranslatedWorld"
+ OpMemberName %type_View 10 "View_SVPositionToTranslatedWorld"
+ OpMemberName %type_View 11 "View_ScreenToWorld"
+ OpMemberName %type_View 12 "View_ScreenToTranslatedWorld"
+ OpMemberName %type_View 13 "View_ViewForward"
+ OpMemberName %type_View 14 "PrePadding_View_844"
+ OpMemberName %type_View 15 "View_ViewUp"
+ OpMemberName %type_View 16 "PrePadding_View_860"
+ OpMemberName %type_View 17 "View_ViewRight"
+ OpMemberName %type_View 18 "PrePadding_View_876"
+ OpMemberName %type_View 19 "View_HMDViewNoRollUp"
+ OpMemberName %type_View 20 "PrePadding_View_892"
+ OpMemberName %type_View 21 "View_HMDViewNoRollRight"
+ OpMemberName %type_View 22 "PrePadding_View_908"
+ OpMemberName %type_View 23 "View_InvDeviceZToWorldZTransform"
+ OpMemberName %type_View 24 "View_ScreenPositionScaleBias"
+ OpMemberName %type_View 25 "View_WorldCameraOrigin"
+ OpMemberName %type_View 26 "PrePadding_View_956"
+ OpMemberName %type_View 27 "View_TranslatedWorldCameraOrigin"
+ OpMemberName %type_View 28 "PrePadding_View_972"
+ OpMemberName %type_View 29 "View_WorldViewOrigin"
+ OpMemberName %type_View 30 "PrePadding_View_988"
+ OpMemberName %type_View 31 "View_PreViewTranslation"
+ OpMemberName %type_View 32 "PrePadding_View_1004"
+ OpMemberName %type_View 33 "View_PrevProjection"
+ OpMemberName %type_View 34 "View_PrevViewProj"
+ OpMemberName %type_View 35 "View_PrevViewRotationProj"
+ OpMemberName %type_View 36 "View_PrevViewToClip"
+ OpMemberName %type_View 37 "View_PrevClipToView"
+ OpMemberName %type_View 38 "View_PrevTranslatedWorldToClip"
+ OpMemberName %type_View 39 "View_PrevTranslatedWorldToView"
+ OpMemberName %type_View 40 "View_PrevViewToTranslatedWorld"
+ OpMemberName %type_View 41 "View_PrevTranslatedWorldToCameraView"
+ OpMemberName %type_View 42 "View_PrevCameraViewToTranslatedWorld"
+ OpMemberName %type_View 43 "View_PrevWorldCameraOrigin"
+ OpMemberName %type_View 44 "PrePadding_View_1660"
+ OpMemberName %type_View 45 "View_PrevWorldViewOrigin"
+ OpMemberName %type_View 46 "PrePadding_View_1676"
+ OpMemberName %type_View 47 "View_PrevPreViewTranslation"
+ OpMemberName %type_View 48 "PrePadding_View_1692"
+ OpMemberName %type_View 49 "View_PrevInvViewProj"
+ OpMemberName %type_View 50 "View_PrevScreenToTranslatedWorld"
+ OpMemberName %type_View 51 "View_ClipToPrevClip"
+ OpMemberName %type_View 52 "View_TemporalAAJitter"
+ OpMemberName %type_View 53 "View_GlobalClippingPlane"
+ OpMemberName %type_View 54 "View_FieldOfViewWideAngles"
+ OpMemberName %type_View 55 "View_PrevFieldOfViewWideAngles"
+ OpMemberName %type_View 56 "View_ViewRectMin"
+ OpMemberName %type_View 57 "View_ViewSizeAndInvSize"
+ OpMemberName %type_View 58 "View_BufferSizeAndInvSize"
+ OpMemberName %type_View 59 "View_BufferBilinearUVMinMax"
+ OpMemberName %type_View 60 "View_NumSceneColorMSAASamples"
+ OpMemberName %type_View 61 "View_PreExposure"
+ OpMemberName %type_View 62 "View_OneOverPreExposure"
+ OpMemberName %type_View 63 "PrePadding_View_2012"
+ OpMemberName %type_View 64 "View_DiffuseOverrideParameter"
+ OpMemberName %type_View 65 "View_SpecularOverrideParameter"
+ OpMemberName %type_View 66 "View_NormalOverrideParameter"
+ OpMemberName %type_View 67 "View_RoughnessOverrideParameter"
+ OpMemberName %type_View 68 "View_PrevFrameGameTime"
+ OpMemberName %type_View 69 "View_PrevFrameRealTime"
+ OpMemberName %type_View 70 "View_OutOfBoundsMask"
+ OpMemberName %type_View 71 "PrePadding_View_2084"
+ OpMemberName %type_View 72 "PrePadding_View_2088"
+ OpMemberName %type_View 73 "PrePadding_View_2092"
+ OpMemberName %type_View 74 "View_WorldCameraMovementSinceLastFrame"
+ OpMemberName %type_View 75 "View_CullingSign"
+ OpMemberName %type_View 76 "View_NearPlane"
+ OpMemberName %type_View 77 "View_AdaptiveTessellationFactor"
+ OpMemberName %type_View 78 "View_GameTime"
+ OpMemberName %type_View 79 "View_RealTime"
+ OpMemberName %type_View 80 "View_DeltaTime"
+ OpMemberName %type_View 81 "View_MaterialTextureMipBias"
+ OpMemberName %type_View 82 "View_MaterialTextureDerivativeMultiply"
+ OpMemberName %type_View 83 "View_Random"
+ OpMemberName %type_View 84 "View_FrameNumber"
+ OpMemberName %type_View 85 "View_StateFrameIndexMod8"
+ OpMemberName %type_View 86 "View_StateFrameIndex"
+ OpMemberName %type_View 87 "View_CameraCut"
+ OpMemberName %type_View 88 "View_UnlitViewmodeMask"
+ OpMemberName %type_View 89 "PrePadding_View_2164"
+ OpMemberName %type_View 90 "PrePadding_View_2168"
+ OpMemberName %type_View 91 "PrePadding_View_2172"
+ OpMemberName %type_View 92 "View_DirectionalLightColor"
+ OpMemberName %type_View 93 "View_DirectionalLightDirection"
+ OpMemberName %type_View 94 "PrePadding_View_2204"
+ OpMemberName %type_View 95 "View_TranslucencyLightingVolumeMin"
+ OpMemberName %type_View 96 "View_TranslucencyLightingVolumeInvSize"
+ OpMemberName %type_View 97 "View_TemporalAAParams"
+ OpMemberName %type_View 98 "View_CircleDOFParams"
+ OpMemberName %type_View 99 "View_DepthOfFieldSensorWidth"
+ OpMemberName %type_View 100 "View_DepthOfFieldFocalDistance"
+ OpMemberName %type_View 101 "View_DepthOfFieldScale"
+ OpMemberName %type_View 102 "View_DepthOfFieldFocalLength"
+ OpMemberName %type_View 103 "View_DepthOfFieldFocalRegion"
+ OpMemberName %type_View 104 "View_DepthOfFieldNearTransitionRegion"
+ OpMemberName %type_View 105 "View_DepthOfFieldFarTransitionRegion"
+ OpMemberName %type_View 106 "View_MotionBlurNormalizedToPixel"
+ OpMemberName %type_View 107 "View_bSubsurfacePostprocessEnabled"
+ OpMemberName %type_View 108 "View_GeneralPurposeTweak"
+ OpMemberName %type_View 109 "View_DemosaicVposOffset"
+ OpMemberName %type_View 110 "PrePadding_View_2348"
+ OpMemberName %type_View 111 "View_IndirectLightingColorScale"
+ OpMemberName %type_View 112 "View_HDR32bppEncodingMode"
+ OpMemberName %type_View 113 "View_AtmosphericFogSunDirection"
+ OpMemberName %type_View 114 "View_AtmosphericFogSunPower"
+ OpMemberName %type_View 115 "View_AtmosphericFogPower"
+ OpMemberName %type_View 116 "View_AtmosphericFogDensityScale"
+ OpMemberName %type_View 117 "View_AtmosphericFogDensityOffset"
+ OpMemberName %type_View 118 "View_AtmosphericFogGroundOffset"
+ OpMemberName %type_View 119 "View_AtmosphericFogDistanceScale"
+ OpMemberName %type_View 120 "View_AtmosphericFogAltitudeScale"
+ OpMemberName %type_View 121 "View_AtmosphericFogHeightScaleRayleigh"
+ OpMemberName %type_View 122 "View_AtmosphericFogStartDistance"
+ OpMemberName %type_View 123 "View_AtmosphericFogDistanceOffset"
+ OpMemberName %type_View 124 "View_AtmosphericFogSunDiscScale"
+ OpMemberName %type_View 125 "View_AtmosphericFogRenderMask"
+ OpMemberName %type_View 126 "View_AtmosphericFogInscatterAltitudeSampleNum"
+ OpMemberName %type_View 127 "View_AtmosphericFogSunColor"
+ OpMemberName %type_View 128 "View_NormalCurvatureToRoughnessScaleBias"
+ OpMemberName %type_View 129 "View_RenderingReflectionCaptureMask"
+ OpMemberName %type_View 130 "View_AmbientCubemapTint"
+ OpMemberName %type_View 131 "View_AmbientCubemapIntensity"
+ OpMemberName %type_View 132 "View_SkyLightParameters"
+ OpMemberName %type_View 133 "PrePadding_View_2488"
+ OpMemberName %type_View 134 "PrePadding_View_2492"
+ OpMemberName %type_View 135 "View_SkyLightColor"
+ OpMemberName %type_View 136 "View_SkyIrradianceEnvironmentMap"
+ OpMemberName %type_View 137 "View_MobilePreviewMode"
+ OpMemberName %type_View 138 "View_HMDEyePaddingOffset"
+ OpMemberName %type_View 139 "View_ReflectionCubemapMaxMip"
+ OpMemberName %type_View 140 "View_ShowDecalsMask"
+ OpMemberName %type_View 141 "View_DistanceFieldAOSpecularOcclusionMode"
+ OpMemberName %type_View 142 "View_IndirectCapsuleSelfShadowingIntensity"
+ OpMemberName %type_View 143 "PrePadding_View_2648"
+ OpMemberName %type_View 144 "PrePadding_View_2652"
+ OpMemberName %type_View 145 "View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight"
+ OpMemberName %type_View 146 "View_StereoPassIndex"
+ OpMemberName %type_View 147 "View_GlobalVolumeCenterAndExtent"
+ OpMemberName %type_View 148 "View_GlobalVolumeWorldToUVAddAndMul"
+ OpMemberName %type_View 149 "View_GlobalVolumeDimension"
+ OpMemberName %type_View 150 "View_GlobalVolumeTexelSize"
+ OpMemberName %type_View 151 "View_MaxGlobalDistance"
+ OpMemberName %type_View 152 "View_bCheckerboardSubsurfaceProfileRendering"
+ OpMemberName %type_View 153 "View_VolumetricFogInvGridSize"
+ OpMemberName %type_View 154 "PrePadding_View_2828"
+ OpMemberName %type_View 155 "View_VolumetricFogGridZParams"
+ OpMemberName %type_View 156 "PrePadding_View_2844"
+ OpMemberName %type_View 157 "View_VolumetricFogSVPosToVolumeUV"
+ OpMemberName %type_View 158 "View_VolumetricFogMaxDistance"
+ OpMemberName %type_View 159 "PrePadding_View_2860"
+ OpMemberName %type_View 160 "View_VolumetricLightmapWorldToUVScale"
+ OpMemberName %type_View 161 "PrePadding_View_2876"
+ OpMemberName %type_View 162 "View_VolumetricLightmapWorldToUVAdd"
+ OpMemberName %type_View 163 "PrePadding_View_2892"
+ OpMemberName %type_View 164 "View_VolumetricLightmapIndirectionTextureSize"
+ OpMemberName %type_View 165 "View_VolumetricLightmapBrickSize"
+ OpMemberName %type_View 166 "View_VolumetricLightmapBrickTexelSize"
+ OpMemberName %type_View 167 "View_StereoIPD"
+ OpMemberName %type_View 168 "View_IndirectLightingCacheShowFlag"
+ OpMemberName %type_View 169 "View_EyeToPixelSpreadAngle"
+ OpName %View "View"
+ OpName %type_Primitive "type.Primitive"
+ OpMemberName %type_Primitive 0 "Primitive_LocalToWorld"
+ OpMemberName %type_Primitive 1 "Primitive_InvNonUniformScaleAndDeterminantSign"
+ OpMemberName %type_Primitive 2 "Primitive_ObjectWorldPositionAndRadius"
+ OpMemberName %type_Primitive 3 "Primitive_WorldToLocal"
+ OpMemberName %type_Primitive 4 "Primitive_PreviousLocalToWorld"
+ OpMemberName %type_Primitive 5 "Primitive_PreviousWorldToLocal"
+ OpMemberName %type_Primitive 6 "Primitive_ActorWorldPosition"
+ OpMemberName %type_Primitive 7 "Primitive_UseSingleSampleShadowFromStationaryLights"
+ OpMemberName %type_Primitive 8 "Primitive_ObjectBounds"
+ OpMemberName %type_Primitive 9 "Primitive_LpvBiasMultiplier"
+ OpMemberName %type_Primitive 10 "Primitive_DecalReceiverMask"
+ OpMemberName %type_Primitive 11 "Primitive_PerObjectGBufferData"
+ OpMemberName %type_Primitive 12 "Primitive_UseVolumetricLightmapShadowFromStationaryLights"
+ OpMemberName %type_Primitive 13 "Primitive_UseEditorDepthTest"
+ OpMemberName %type_Primitive 14 "Primitive_ObjectOrientation"
+ OpMemberName %type_Primitive 15 "Primitive_NonUniformScale"
+ OpMemberName %type_Primitive 16 "Primitive_LocalObjectBoundsMin"
+ OpMemberName %type_Primitive 17 "PrePadding_Primitive_380"
+ OpMemberName %type_Primitive 18 "Primitive_LocalObjectBoundsMax"
+ OpMemberName %type_Primitive 19 "Primitive_LightingChannelMask"
+ OpMemberName %type_Primitive 20 "Primitive_LightmapDataIndex"
+ OpMemberName %type_Primitive 21 "Primitive_SingleCaptureIndex"
+ OpName %Primitive "Primitive"
+ OpName %type_MobileShadowDepthPass "type.MobileShadowDepthPass"
+ OpMemberName %type_MobileShadowDepthPass 0 "PrePadding_MobileShadowDepthPass_0"
+ OpMemberName %type_MobileShadowDepthPass 1 "PrePadding_MobileShadowDepthPass_4"
+ OpMemberName %type_MobileShadowDepthPass 2 "PrePadding_MobileShadowDepthPass_8"
+ OpMemberName %type_MobileShadowDepthPass 3 "PrePadding_MobileShadowDepthPass_12"
+ OpMemberName %type_MobileShadowDepthPass 4 "PrePadding_MobileShadowDepthPass_16"
+ OpMemberName %type_MobileShadowDepthPass 5 "PrePadding_MobileShadowDepthPass_20"
+ OpMemberName %type_MobileShadowDepthPass 6 "PrePadding_MobileShadowDepthPass_24"
+ OpMemberName %type_MobileShadowDepthPass 7 "PrePadding_MobileShadowDepthPass_28"
+ OpMemberName %type_MobileShadowDepthPass 8 "PrePadding_MobileShadowDepthPass_32"
+ OpMemberName %type_MobileShadowDepthPass 9 "PrePadding_MobileShadowDepthPass_36"
+ OpMemberName %type_MobileShadowDepthPass 10 "PrePadding_MobileShadowDepthPass_40"
+ OpMemberName %type_MobileShadowDepthPass 11 "PrePadding_MobileShadowDepthPass_44"
+ OpMemberName %type_MobileShadowDepthPass 12 "PrePadding_MobileShadowDepthPass_48"
+ OpMemberName %type_MobileShadowDepthPass 13 "PrePadding_MobileShadowDepthPass_52"
+ OpMemberName %type_MobileShadowDepthPass 14 "PrePadding_MobileShadowDepthPass_56"
+ OpMemberName %type_MobileShadowDepthPass 15 "PrePadding_MobileShadowDepthPass_60"
+ OpMemberName %type_MobileShadowDepthPass 16 "PrePadding_MobileShadowDepthPass_64"
+ OpMemberName %type_MobileShadowDepthPass 17 "PrePadding_MobileShadowDepthPass_68"
+ OpMemberName %type_MobileShadowDepthPass 18 "PrePadding_MobileShadowDepthPass_72"
+ OpMemberName %type_MobileShadowDepthPass 19 "PrePadding_MobileShadowDepthPass_76"
+ OpMemberName %type_MobileShadowDepthPass 20 "MobileShadowDepthPass_ProjectionMatrix"
+ OpMemberName %type_MobileShadowDepthPass 21 "MobileShadowDepthPass_ShadowParams"
+ OpMemberName %type_MobileShadowDepthPass 22 "MobileShadowDepthPass_bClampToNearPlane"
+ OpMemberName %type_MobileShadowDepthPass 23 "PrePadding_MobileShadowDepthPass_156"
+ OpMemberName %type_MobileShadowDepthPass 24 "MobileShadowDepthPass_ShadowViewProjectionMatrices"
+ OpName %MobileShadowDepthPass "MobileShadowDepthPass"
+ OpName %type_EmitterDynamicUniforms "type.EmitterDynamicUniforms"
+ OpMemberName %type_EmitterDynamicUniforms 0 "EmitterDynamicUniforms_LocalToWorldScale"
+ OpMemberName %type_EmitterDynamicUniforms 1 "EmitterDynamicUniforms_EmitterInstRandom"
+ OpMemberName %type_EmitterDynamicUniforms 2 "PrePadding_EmitterDynamicUniforms_12"
+ OpMemberName %type_EmitterDynamicUniforms 3 "EmitterDynamicUniforms_AxisLockRight"
+ OpMemberName %type_EmitterDynamicUniforms 4 "EmitterDynamicUniforms_AxisLockUp"
+ OpMemberName %type_EmitterDynamicUniforms 5 "EmitterDynamicUniforms_DynamicColor"
+ OpMemberName %type_EmitterDynamicUniforms 6 "EmitterDynamicUniforms_MacroUVParameters"
+ OpName %EmitterDynamicUniforms "EmitterDynamicUniforms"
+ OpName %type_EmitterUniforms "type.EmitterUniforms"
+ OpMemberName %type_EmitterUniforms 0 "EmitterUniforms_ColorCurve"
+ OpMemberName %type_EmitterUniforms 1 "EmitterUniforms_ColorScale"
+ OpMemberName %type_EmitterUniforms 2 "EmitterUniforms_ColorBias"
+ OpMemberName %type_EmitterUniforms 3 "EmitterUniforms_MiscCurve"
+ OpMemberName %type_EmitterUniforms 4 "EmitterUniforms_MiscScale"
+ OpMemberName %type_EmitterUniforms 5 "EmitterUniforms_MiscBias"
+ OpMemberName %type_EmitterUniforms 6 "EmitterUniforms_SizeBySpeed"
+ OpMemberName %type_EmitterUniforms 7 "EmitterUniforms_SubImageSize"
+ OpMemberName %type_EmitterUniforms 8 "EmitterUniforms_TangentSelector"
+ OpMemberName %type_EmitterUniforms 9 "EmitterUniforms_CameraFacingBlend"
+ OpMemberName %type_EmitterUniforms 10 "EmitterUniforms_RemoveHMDRoll"
+ OpMemberName %type_EmitterUniforms 11 "EmitterUniforms_RotationRateScale"
+ OpMemberName %type_EmitterUniforms 12 "EmitterUniforms_RotationBias"
+ OpMemberName %type_EmitterUniforms 13 "EmitterUniforms_CameraMotionBlurAmount"
+ OpMemberName %type_EmitterUniforms 14 "PrePadding_EmitterUniforms_172"
+ OpMemberName %type_EmitterUniforms 15 "EmitterUniforms_PivotOffset"
+ OpName %EmitterUniforms "EmitterUniforms"
+ OpName %type_buffer_image "type.buffer.image"
+ OpName %ParticleIndices "ParticleIndices"
+ OpName %type__Globals "type.$Globals"
+ OpMemberName %type__Globals 0 "ParticleIndicesOffset"
+ OpName %_Globals "$Globals"
+ OpName %type_2d_image "type.2d.image"
+ OpName %PositionTexture "PositionTexture"
+ OpName %type_sampler "type.sampler"
+ OpName %PositionTextureSampler "PositionTextureSampler"
+ OpName %VelocityTexture "VelocityTexture"
+ OpName %VelocityTextureSampler "VelocityTextureSampler"
+ OpName %AttributesTexture "AttributesTexture"
+ OpName %AttributesTextureSampler "AttributesTextureSampler"
+ OpName %CurveTexture "CurveTexture"
+ OpName %CurveTextureSampler "CurveTextureSampler"
+ OpName %in_var_ATTRIBUTE0 "in.var.ATTRIBUTE0"
+ OpName %out_var_TEXCOORD6 "out.var.TEXCOORD6"
+ OpName %Main "Main"
+ OpName %type_sampled_image "type.sampled.image"
+ OpDecorate %gl_VertexIndex BuiltIn VertexIndex
+ OpDecorateString %gl_VertexIndex UserSemantic "SV_VertexID"
+ OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex
+ OpDecorateString %gl_InstanceIndex UserSemantic "SV_InstanceID"
+ OpDecorateString %in_var_ATTRIBUTE0 UserSemantic "ATTRIBUTE0"
+ OpDecorateString %out_var_TEXCOORD6 UserSemantic "TEXCOORD6"
+ OpDecorate %gl_Position BuiltIn Position
+ OpDecorateString %gl_Position UserSemantic "SV_POSITION"
+ OpDecorate %in_var_ATTRIBUTE0 Location 0
+ OpDecorate %out_var_TEXCOORD6 Location 0
+ OpDecorate %View DescriptorSet 0
+ OpDecorate %View Binding 1
+ OpDecorate %Primitive DescriptorSet 0
+ OpDecorate %Primitive Binding 2
+ OpDecorate %MobileShadowDepthPass DescriptorSet 0
+ OpDecorate %MobileShadowDepthPass Binding 3
+ OpDecorate %EmitterDynamicUniforms DescriptorSet 0
+ OpDecorate %EmitterDynamicUniforms Binding 4
+ OpDecorate %EmitterUniforms DescriptorSet 0
+ OpDecorate %EmitterUniforms Binding 5
+ OpDecorate %ParticleIndices DescriptorSet 0
+ OpDecorate %ParticleIndices Binding 0
+ OpDecorate %_Globals DescriptorSet 0
+ OpDecorate %_Globals Binding 6
+ OpDecorate %PositionTexture DescriptorSet 0
+ OpDecorate %PositionTexture Binding 1
+ OpDecorate %PositionTextureSampler DescriptorSet 0
+ OpDecorate %PositionTextureSampler Binding 0
+ OpDecorate %VelocityTexture DescriptorSet 0
+ OpDecorate %VelocityTexture Binding 2
+ OpDecorate %VelocityTextureSampler DescriptorSet 0
+ OpDecorate %VelocityTextureSampler Binding 1
+ OpDecorate %AttributesTexture DescriptorSet 0
+ OpDecorate %AttributesTexture Binding 3
+ OpDecorate %AttributesTextureSampler DescriptorSet 0
+ OpDecorate %AttributesTextureSampler Binding 2
+ OpDecorate %CurveTexture DescriptorSet 0
+ OpDecorate %CurveTexture Binding 4
+ OpDecorate %CurveTextureSampler DescriptorSet 0
+ OpDecorate %CurveTextureSampler Binding 3
+ OpDecorate %_arr_v4float_uint_2 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_7 ArrayStride 16
+ OpDecorate %_arr_v4float_uint_4 ArrayStride 16
+ OpMemberDecorate %type_View 0 Offset 0
+ OpMemberDecorate %type_View 0 MatrixStride 16
+ OpMemberDecorate %type_View 0 ColMajor
+ OpMemberDecorate %type_View 1 Offset 64
+ OpMemberDecorate %type_View 1 MatrixStride 16
+ OpMemberDecorate %type_View 1 ColMajor
+ OpMemberDecorate %type_View 2 Offset 128
+ OpMemberDecorate %type_View 2 MatrixStride 16
+ OpMemberDecorate %type_View 2 ColMajor
+ OpMemberDecorate %type_View 3 Offset 192
+ OpMemberDecorate %type_View 3 MatrixStride 16
+ OpMemberDecorate %type_View 3 ColMajor
+ OpMemberDecorate %type_View 4 Offset 256
+ OpMemberDecorate %type_View 4 MatrixStride 16
+ OpMemberDecorate %type_View 4 ColMajor
+ OpMemberDecorate %type_View 5 Offset 320
+ OpMemberDecorate %type_View 5 MatrixStride 16
+ OpMemberDecorate %type_View 5 ColMajor
+ OpMemberDecorate %type_View 6 Offset 384
+ OpMemberDecorate %type_View 6 MatrixStride 16
+ OpMemberDecorate %type_View 6 ColMajor
+ OpMemberDecorate %type_View 7 Offset 448
+ OpMemberDecorate %type_View 7 MatrixStride 16
+ OpMemberDecorate %type_View 7 ColMajor
+ OpMemberDecorate %type_View 8 Offset 512
+ OpMemberDecorate %type_View 8 MatrixStride 16
+ OpMemberDecorate %type_View 8 ColMajor
+ OpMemberDecorate %type_View 9 Offset 576
+ OpMemberDecorate %type_View 9 MatrixStride 16
+ OpMemberDecorate %type_View 9 ColMajor
+ OpMemberDecorate %type_View 10 Offset 640
+ OpMemberDecorate %type_View 10 MatrixStride 16
+ OpMemberDecorate %type_View 10 ColMajor
+ OpMemberDecorate %type_View 11 Offset 704
+ OpMemberDecorate %type_View 11 MatrixStride 16
+ OpMemberDecorate %type_View 11 ColMajor
+ OpMemberDecorate %type_View 12 Offset 768
+ OpMemberDecorate %type_View 12 MatrixStride 16
+ OpMemberDecorate %type_View 12 ColMajor
+ OpMemberDecorate %type_View 13 Offset 832
+ OpMemberDecorate %type_View 14 Offset 844
+ OpMemberDecorate %type_View 15 Offset 848
+ OpMemberDecorate %type_View 16 Offset 860
+ OpMemberDecorate %type_View 17 Offset 864
+ OpMemberDecorate %type_View 18 Offset 876
+ OpMemberDecorate %type_View 19 Offset 880
+ OpMemberDecorate %type_View 20 Offset 892
+ OpMemberDecorate %type_View 21 Offset 896
+ OpMemberDecorate %type_View 22 Offset 908
+ OpMemberDecorate %type_View 23 Offset 912
+ OpMemberDecorate %type_View 24 Offset 928
+ OpMemberDecorate %type_View 25 Offset 944
+ OpMemberDecorate %type_View 26 Offset 956
+ OpMemberDecorate %type_View 27 Offset 960
+ OpMemberDecorate %type_View 28 Offset 972
+ OpMemberDecorate %type_View 29 Offset 976
+ OpMemberDecorate %type_View 30 Offset 988
+ OpMemberDecorate %type_View 31 Offset 992
+ OpMemberDecorate %type_View 32 Offset 1004
+ OpMemberDecorate %type_View 33 Offset 1008
+ OpMemberDecorate %type_View 33 MatrixStride 16
+ OpMemberDecorate %type_View 33 ColMajor
+ OpMemberDecorate %type_View 34 Offset 1072
+ OpMemberDecorate %type_View 34 MatrixStride 16
+ OpMemberDecorate %type_View 34 ColMajor
+ OpMemberDecorate %type_View 35 Offset 1136
+ OpMemberDecorate %type_View 35 MatrixStride 16
+ OpMemberDecorate %type_View 35 ColMajor
+ OpMemberDecorate %type_View 36 Offset 1200
+ OpMemberDecorate %type_View 36 MatrixStride 16
+ OpMemberDecorate %type_View 36 ColMajor
+ OpMemberDecorate %type_View 37 Offset 1264
+ OpMemberDecorate %type_View 37 MatrixStride 16
+ OpMemberDecorate %type_View 37 ColMajor
+ OpMemberDecorate %type_View 38 Offset 1328
+ OpMemberDecorate %type_View 38 MatrixStride 16
+ OpMemberDecorate %type_View 38 ColMajor
+ OpMemberDecorate %type_View 39 Offset 1392
+ OpMemberDecorate %type_View 39 MatrixStride 16
+ OpMemberDecorate %type_View 39 ColMajor
+ OpMemberDecorate %type_View 40 Offset 1456
+ OpMemberDecorate %type_View 40 MatrixStride 16
+ OpMemberDecorate %type_View 40 ColMajor
+ OpMemberDecorate %type_View 41 Offset 1520
+ OpMemberDecorate %type_View 41 MatrixStride 16
+ OpMemberDecorate %type_View 41 ColMajor
+ OpMemberDecorate %type_View 42 Offset 1584
+ OpMemberDecorate %type_View 42 MatrixStride 16
+ OpMemberDecorate %type_View 42 ColMajor
+ OpMemberDecorate %type_View 43 Offset 1648
+ OpMemberDecorate %type_View 44 Offset 1660
+ OpMemberDecorate %type_View 45 Offset 1664
+ OpMemberDecorate %type_View 46 Offset 1676
+ OpMemberDecorate %type_View 47 Offset 1680
+ OpMemberDecorate %type_View 48 Offset 1692
+ OpMemberDecorate %type_View 49 Offset 1696
+ OpMemberDecorate %type_View 49 MatrixStride 16
+ OpMemberDecorate %type_View 49 ColMajor
+ OpMemberDecorate %type_View 50 Offset 1760
+ OpMemberDecorate %type_View 50 MatrixStride 16
+ OpMemberDecorate %type_View 50 ColMajor
+ OpMemberDecorate %type_View 51 Offset 1824
+ OpMemberDecorate %type_View 51 MatrixStride 16
+ OpMemberDecorate %type_View 51 ColMajor
+ OpMemberDecorate %type_View 52 Offset 1888
+ OpMemberDecorate %type_View 53 Offset 1904
+ OpMemberDecorate %type_View 54 Offset 1920
+ OpMemberDecorate %type_View 55 Offset 1928
+ OpMemberDecorate %type_View 56 Offset 1936
+ OpMemberDecorate %type_View 57 Offset 1952
+ OpMemberDecorate %type_View 58 Offset 1968
+ OpMemberDecorate %type_View 59 Offset 1984
+ OpMemberDecorate %type_View 60 Offset 2000
+ OpMemberDecorate %type_View 61 Offset 2004
+ OpMemberDecorate %type_View 62 Offset 2008
+ OpMemberDecorate %type_View 63 Offset 2012
+ OpMemberDecorate %type_View 64 Offset 2016
+ OpMemberDecorate %type_View 65 Offset 2032
+ OpMemberDecorate %type_View 66 Offset 2048
+ OpMemberDecorate %type_View 67 Offset 2064
+ OpMemberDecorate %type_View 68 Offset 2072
+ OpMemberDecorate %type_View 69 Offset 2076
+ OpMemberDecorate %type_View 70 Offset 2080
+ OpMemberDecorate %type_View 71 Offset 2084
+ OpMemberDecorate %type_View 72 Offset 2088
+ OpMemberDecorate %type_View 73 Offset 2092
+ OpMemberDecorate %type_View 74 Offset 2096
+ OpMemberDecorate %type_View 75 Offset 2108
+ OpMemberDecorate %type_View 76 Offset 2112
+ OpMemberDecorate %type_View 77 Offset 2116
+ OpMemberDecorate %type_View 78 Offset 2120
+ OpMemberDecorate %type_View 79 Offset 2124
+ OpMemberDecorate %type_View 80 Offset 2128
+ OpMemberDecorate %type_View 81 Offset 2132
+ OpMemberDecorate %type_View 82 Offset 2136
+ OpMemberDecorate %type_View 83 Offset 2140
+ OpMemberDecorate %type_View 84 Offset 2144
+ OpMemberDecorate %type_View 85 Offset 2148
+ OpMemberDecorate %type_View 86 Offset 2152
+ OpMemberDecorate %type_View 87 Offset 2156
+ OpMemberDecorate %type_View 88 Offset 2160
+ OpMemberDecorate %type_View 89 Offset 2164
+ OpMemberDecorate %type_View 90 Offset 2168
+ OpMemberDecorate %type_View 91 Offset 2172
+ OpMemberDecorate %type_View 92 Offset 2176
+ OpMemberDecorate %type_View 93 Offset 2192
+ OpMemberDecorate %type_View 94 Offset 2204
+ OpMemberDecorate %type_View 95 Offset 2208
+ OpMemberDecorate %type_View 96 Offset 2240
+ OpMemberDecorate %type_View 97 Offset 2272
+ OpMemberDecorate %type_View 98 Offset 2288
+ OpMemberDecorate %type_View 99 Offset 2304
+ OpMemberDecorate %type_View 100 Offset 2308
+ OpMemberDecorate %type_View 101 Offset 2312
+ OpMemberDecorate %type_View 102 Offset 2316
+ OpMemberDecorate %type_View 103 Offset 2320
+ OpMemberDecorate %type_View 104 Offset 2324
+ OpMemberDecorate %type_View 105 Offset 2328
+ OpMemberDecorate %type_View 106 Offset 2332
+ OpMemberDecorate %type_View 107 Offset 2336
+ OpMemberDecorate %type_View 108 Offset 2340
+ OpMemberDecorate %type_View 109 Offset 2344
+ OpMemberDecorate %type_View 110 Offset 2348
+ OpMemberDecorate %type_View 111 Offset 2352
+ OpMemberDecorate %type_View 112 Offset 2364
+ OpMemberDecorate %type_View 113 Offset 2368
+ OpMemberDecorate %type_View 114 Offset 2380
+ OpMemberDecorate %type_View 115 Offset 2384
+ OpMemberDecorate %type_View 116 Offset 2388
+ OpMemberDecorate %type_View 117 Offset 2392
+ OpMemberDecorate %type_View 118 Offset 2396
+ OpMemberDecorate %type_View 119 Offset 2400
+ OpMemberDecorate %type_View 120 Offset 2404
+ OpMemberDecorate %type_View 121 Offset 2408
+ OpMemberDecorate %type_View 122 Offset 2412
+ OpMemberDecorate %type_View 123 Offset 2416
+ OpMemberDecorate %type_View 124 Offset 2420
+ OpMemberDecorate %type_View 125 Offset 2424
+ OpMemberDecorate %type_View 126 Offset 2428
+ OpMemberDecorate %type_View 127 Offset 2432
+ OpMemberDecorate %type_View 128 Offset 2448
+ OpMemberDecorate %type_View 129 Offset 2460
+ OpMemberDecorate %type_View 130 Offset 2464
+ OpMemberDecorate %type_View 131 Offset 2480
+ OpMemberDecorate %type_View 132 Offset 2484
+ OpMemberDecorate %type_View 133 Offset 2488
+ OpMemberDecorate %type_View 134 Offset 2492
+ OpMemberDecorate %type_View 135 Offset 2496
+ OpMemberDecorate %type_View 136 Offset 2512
+ OpMemberDecorate %type_View 137 Offset 2624
+ OpMemberDecorate %type_View 138 Offset 2628
+ OpMemberDecorate %type_View 139 Offset 2632
+ OpMemberDecorate %type_View 140 Offset 2636
+ OpMemberDecorate %type_View 141 Offset 2640
+ OpMemberDecorate %type_View 142 Offset 2644
+ OpMemberDecorate %type_View 143 Offset 2648
+ OpMemberDecorate %type_View 144 Offset 2652
+ OpMemberDecorate %type_View 145 Offset 2656
+ OpMemberDecorate %type_View 146 Offset 2668
+ OpMemberDecorate %type_View 147 Offset 2672
+ OpMemberDecorate %type_View 148 Offset 2736
+ OpMemberDecorate %type_View 149 Offset 2800
+ OpMemberDecorate %type_View 150 Offset 2804
+ OpMemberDecorate %type_View 151 Offset 2808
+ OpMemberDecorate %type_View 152 Offset 2812
+ OpMemberDecorate %type_View 153 Offset 2816
+ OpMemberDecorate %type_View 154 Offset 2828
+ OpMemberDecorate %type_View 155 Offset 2832
+ OpMemberDecorate %type_View 156 Offset 2844
+ OpMemberDecorate %type_View 157 Offset 2848
+ OpMemberDecorate %type_View 158 Offset 2856
+ OpMemberDecorate %type_View 159 Offset 2860
+ OpMemberDecorate %type_View 160 Offset 2864
+ OpMemberDecorate %type_View 161 Offset 2876
+ OpMemberDecorate %type_View 162 Offset 2880
+ OpMemberDecorate %type_View 163 Offset 2892
+ OpMemberDecorate %type_View 164 Offset 2896
+ OpMemberDecorate %type_View 165 Offset 2908
+ OpMemberDecorate %type_View 166 Offset 2912
+ OpMemberDecorate %type_View 167 Offset 2924
+ OpMemberDecorate %type_View 168 Offset 2928
+ OpMemberDecorate %type_View 169 Offset 2932
+ OpDecorate %type_View Block
+ OpMemberDecorate %type_Primitive 0 Offset 0
+ OpMemberDecorate %type_Primitive 0 MatrixStride 16
+ OpMemberDecorate %type_Primitive 0 ColMajor
+ OpMemberDecorate %type_Primitive 1 Offset 64
+ OpMemberDecorate %type_Primitive 2 Offset 80
+ OpMemberDecorate %type_Primitive 3 Offset 96
+ OpMemberDecorate %type_Primitive 3 MatrixStride 16
+ OpMemberDecorate %type_Primitive 3 ColMajor
+ OpMemberDecorate %type_Primitive 4 Offset 160
+ OpMemberDecorate %type_Primitive 4 MatrixStride 16
+ OpMemberDecorate %type_Primitive 4 ColMajor
+ OpMemberDecorate %type_Primitive 5 Offset 224
+ OpMemberDecorate %type_Primitive 5 MatrixStride 16
+ OpMemberDecorate %type_Primitive 5 ColMajor
+ OpMemberDecorate %type_Primitive 6 Offset 288
+ OpMemberDecorate %type_Primitive 7 Offset 300
+ OpMemberDecorate %type_Primitive 8 Offset 304
+ OpMemberDecorate %type_Primitive 9 Offset 316
+ OpMemberDecorate %type_Primitive 10 Offset 320
+ OpMemberDecorate %type_Primitive 11 Offset 324
+ OpMemberDecorate %type_Primitive 12 Offset 328
+ OpMemberDecorate %type_Primitive 13 Offset 332
+ OpMemberDecorate %type_Primitive 14 Offset 336
+ OpMemberDecorate %type_Primitive 15 Offset 352
+ OpMemberDecorate %type_Primitive 16 Offset 368
+ OpMemberDecorate %type_Primitive 17 Offset 380
+ OpMemberDecorate %type_Primitive 18 Offset 384
+ OpMemberDecorate %type_Primitive 19 Offset 396
+ OpMemberDecorate %type_Primitive 20 Offset 400
+ OpMemberDecorate %type_Primitive 21 Offset 404
+ OpDecorate %type_Primitive Block
+ OpDecorate %_arr_mat4v4float_uint_6 ArrayStride 64
+ OpMemberDecorate %type_MobileShadowDepthPass 0 Offset 0
+ OpMemberDecorate %type_MobileShadowDepthPass 1 Offset 4
+ OpMemberDecorate %type_MobileShadowDepthPass 2 Offset 8
+ OpMemberDecorate %type_MobileShadowDepthPass 3 Offset 12
+ OpMemberDecorate %type_MobileShadowDepthPass 4 Offset 16
+ OpMemberDecorate %type_MobileShadowDepthPass 5 Offset 20
+ OpMemberDecorate %type_MobileShadowDepthPass 6 Offset 24
+ OpMemberDecorate %type_MobileShadowDepthPass 7 Offset 28
+ OpMemberDecorate %type_MobileShadowDepthPass 8 Offset 32
+ OpMemberDecorate %type_MobileShadowDepthPass 9 Offset 36
+ OpMemberDecorate %type_MobileShadowDepthPass 10 Offset 40
+ OpMemberDecorate %type_MobileShadowDepthPass 11 Offset 44
+ OpMemberDecorate %type_MobileShadowDepthPass 12 Offset 48
+ OpMemberDecorate %type_MobileShadowDepthPass 13 Offset 52
+ OpMemberDecorate %type_MobileShadowDepthPass 14 Offset 56
+ OpMemberDecorate %type_MobileShadowDepthPass 15 Offset 60
+ OpMemberDecorate %type_MobileShadowDepthPass 16 Offset 64
+ OpMemberDecorate %type_MobileShadowDepthPass 17 Offset 68
+ OpMemberDecorate %type_MobileShadowDepthPass 18 Offset 72
+ OpMemberDecorate %type_MobileShadowDepthPass 19 Offset 76
+ OpMemberDecorate %type_MobileShadowDepthPass 20 Offset 80
+ OpMemberDecorate %type_MobileShadowDepthPass 20 MatrixStride 16
+ OpMemberDecorate %type_MobileShadowDepthPass 20 ColMajor
+ OpMemberDecorate %type_MobileShadowDepthPass 21 Offset 144
+ OpMemberDecorate %type_MobileShadowDepthPass 22 Offset 152
+ OpMemberDecorate %type_MobileShadowDepthPass 23 Offset 156
+ OpMemberDecorate %type_MobileShadowDepthPass 24 Offset 160
+ OpMemberDecorate %type_MobileShadowDepthPass 24 MatrixStride 16
+ OpMemberDecorate %type_MobileShadowDepthPass 24 ColMajor
+ OpDecorate %type_MobileShadowDepthPass Block
+ OpMemberDecorate %type_EmitterDynamicUniforms 0 Offset 0
+ OpMemberDecorate %type_EmitterDynamicUniforms 1 Offset 8
+ OpMemberDecorate %type_EmitterDynamicUniforms 2 Offset 12
+ OpMemberDecorate %type_EmitterDynamicUniforms 3 Offset 16
+ OpMemberDecorate %type_EmitterDynamicUniforms 4 Offset 32
+ OpMemberDecorate %type_EmitterDynamicUniforms 5 Offset 48
+ OpMemberDecorate %type_EmitterDynamicUniforms 6 Offset 64
+ OpDecorate %type_EmitterDynamicUniforms Block
+ OpMemberDecorate %type_EmitterUniforms 0 Offset 0
+ OpMemberDecorate %type_EmitterUniforms 1 Offset 16
+ OpMemberDecorate %type_EmitterUniforms 2 Offset 32
+ OpMemberDecorate %type_EmitterUniforms 3 Offset 48
+ OpMemberDecorate %type_EmitterUniforms 4 Offset 64
+ OpMemberDecorate %type_EmitterUniforms 5 Offset 80
+ OpMemberDecorate %type_EmitterUniforms 6 Offset 96
+ OpMemberDecorate %type_EmitterUniforms 7 Offset 112
+ OpMemberDecorate %type_EmitterUniforms 8 Offset 128
+ OpMemberDecorate %type_EmitterUniforms 9 Offset 144
+ OpMemberDecorate %type_EmitterUniforms 10 Offset 156
+ OpMemberDecorate %type_EmitterUniforms 11 Offset 160
+ OpMemberDecorate %type_EmitterUniforms 12 Offset 164
+ OpMemberDecorate %type_EmitterUniforms 13 Offset 168
+ OpMemberDecorate %type_EmitterUniforms 14 Offset 172
+ OpMemberDecorate %type_EmitterUniforms 15 Offset 176
+ OpDecorate %type_EmitterUniforms Block
+ OpMemberDecorate %type__Globals 0 Offset 0
+ OpDecorate %type__Globals Block
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %v3float = OpTypeVector %float 3
+ %v2float = OpTypeVector %float 2
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_4 = OpConstant %uint 4
+ %float_0 = OpConstant %float 0
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %uint_16 = OpConstant %uint 16
+ %int_3 = OpConstant %int 3
+ %float_1 = OpConstant %float 1
+%float_9_99999975en05 = OpConstant %float 9.99999975e-05
+ %54 = OpConstantComposite %v3float %float_0 %float_0 %float_9_99999975en05
+ %int_2 = OpConstant %int 2
+ %int_5 = OpConstant %int 5
+ %int_4 = OpConstant %int 4
+ %float_0_5 = OpConstant %float 0.5
+ %float_n0_5 = OpConstant %float -0.5
+ %float_2 = OpConstant %float 2
+ %61 = OpConstantComposite %v2float %float_2 %float_2
+ %int_6 = OpConstant %int 6
+ %63 = OpConstantComposite %v2float %float_1 %float_1
+ %int_11 = OpConstant %int 11
+ %int_15 = OpConstant %int 15
+ %int_8 = OpConstant %int 8
+ %int_9 = OpConstant %int 9
+ %int_10 = OpConstant %int 10
+ %int_12 = OpConstant %int 12
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+%mat3v3float = OpTypeMatrix %v3float 3
+ %int_20 = OpConstant %int 20
+ %int_22 = OpConstant %int 22
+%float_9_99999997en07 = OpConstant %float 9.99999997e-07
+ %int_21 = OpConstant %int 21
+ %int_17 = OpConstant %int 17
+ %int_19 = OpConstant %int 19
+ %int_27 = OpConstant %int 27
+ %int_31 = OpConstant %int 31
+ %uint_3 = OpConstant %uint 3
+ %82 = OpConstantComposite %v3float %float_0 %float_0 %float_1
+%float_0_00999999978 = OpConstant %float 0.00999999978
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_arr_v4float_uint_7 = OpTypeArray %v4float %uint_7
+%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
+ %type_View = OpTypeStruct %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %v3float %float %v3float %float %v4float %v4float %v3float %float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %v3float %float %mat4v4float %mat4v4float %mat4v4float %v4float %v4float %v2float %v2float %v4float %v4float %v4float %v4float %int %float %float %float %v4float %v4float %v4float %v2float %float %float %float %float %float %float %v3float %float %float %float %float %float %float %float %float %uint %uint %uint %uint %float %float %float %float %float %v4float %v3float %float %_arr_v4float_uint_2 %_arr_v4float_uint_2 %v4float %v4float %float %float %float %float %float %float %float %float %float %float %float %float %v3float %float %v3float %float %float %float %float %float %float %float %float %float %float %float %uint %uint %v4float %v3float %float %v4float %float %float %float %float %v4float %_arr_v4float_uint_7 %float %float %float %float %uint %float %float %float %v3float %int %_arr_v4float_uint_4 %_arr_v4float_uint_4 %float %float %float %float %v3float %float %v3float %float %v2float %float %float %v3float %float %v3float %float %v3float %float %v3float %float %float %float
+%_ptr_Uniform_type_View = OpTypePointer Uniform %type_View
+%type_Primitive = OpTypeStruct %mat4v4float %v4float %v4float %mat4v4float %mat4v4float %mat4v4float %v3float %float %v3float %float %float %float %float %float %v4float %v4float %v3float %float %v3float %uint %uint %int
+%_ptr_Uniform_type_Primitive = OpTypePointer Uniform %type_Primitive
+ %uint_6 = OpConstant %uint 6
+%_arr_mat4v4float_uint_6 = OpTypeArray %mat4v4float %uint_6
+%type_MobileShadowDepthPass = OpTypeStruct %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %float %mat4v4float %v2float %float %float %_arr_mat4v4float_uint_6
+%_ptr_Uniform_type_MobileShadowDepthPass = OpTypePointer Uniform %type_MobileShadowDepthPass
+%type_EmitterDynamicUniforms = OpTypeStruct %v2float %float %float %v4float %v4float %v4float %v4float
+%_ptr_Uniform_type_EmitterDynamicUniforms = OpTypePointer Uniform %type_EmitterDynamicUniforms
+%type_EmitterUniforms = OpTypeStruct %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v4float %v3float %float %float %float %float %float %v2float
+%_ptr_Uniform_type_EmitterUniforms = OpTypePointer Uniform %type_EmitterUniforms
+%type_buffer_image = OpTypeImage %float Buffer 2 0 0 1 Rg32f
+%_ptr_UniformConstant_type_buffer_image = OpTypePointer UniformConstant %type_buffer_image
+%type__Globals = OpTypeStruct %uint
+%_ptr_Uniform_type__Globals = OpTypePointer Uniform %type__Globals
+%type_2d_image = OpTypeImage %float 2D 2 0 0 1 Unknown
+%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image
+%type_sampler = OpTypeSampler
+%_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler
+%_ptr_Input_uint = OpTypePointer Input %uint
+%_ptr_Input_v2float = OpTypePointer Input %v2float
+%_ptr_Output_float = OpTypePointer Output %float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %99 = OpTypeFunction %void
+%_ptr_Uniform_uint = OpTypePointer Uniform %uint
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+ %bool = OpTypeBool
+%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+%type_sampled_image = OpTypeSampledImage %type_2d_image
+ %View = OpVariable %_ptr_Uniform_type_View Uniform
+ %Primitive = OpVariable %_ptr_Uniform_type_Primitive Uniform
+%MobileShadowDepthPass = OpVariable %_ptr_Uniform_type_MobileShadowDepthPass Uniform
+%EmitterDynamicUniforms = OpVariable %_ptr_Uniform_type_EmitterDynamicUniforms Uniform
+%EmitterUniforms = OpVariable %_ptr_Uniform_type_EmitterUniforms Uniform
+%ParticleIndices = OpVariable %_ptr_UniformConstant_type_buffer_image UniformConstant
+ %_Globals = OpVariable %_ptr_Uniform_type__Globals Uniform
+%PositionTexture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%PositionTextureSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%VelocityTexture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%VelocityTextureSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%AttributesTexture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%AttributesTextureSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%CurveTexture = OpVariable %_ptr_UniformConstant_type_2d_image UniformConstant
+%CurveTextureSampler = OpVariable %_ptr_UniformConstant_type_sampler UniformConstant
+%gl_VertexIndex = OpVariable %_ptr_Input_uint Input
+%gl_InstanceIndex = OpVariable %_ptr_Input_uint Input
+%in_var_ATTRIBUTE0 = OpVariable %_ptr_Input_v2float Input
+%out_var_TEXCOORD6 = OpVariable %_ptr_Output_float Output
+%gl_Position = OpVariable %_ptr_Output_v4float Output
+%float_6_28318548 = OpConstant %float 6.28318548
+ %108 = OpConstantNull %v3float
+ %Main = OpFunction %void None %99
+ %109 = OpLabel
+ %110 = OpLoad %uint %gl_VertexIndex
+ %111 = OpLoad %uint %gl_InstanceIndex
+ %112 = OpLoad %v2float %in_var_ATTRIBUTE0
+ %113 = OpAccessChain %_ptr_Uniform_v3float %View %int_15
+ %114 = OpLoad %v3float %113
+ %115 = OpAccessChain %_ptr_Uniform_v3float %View %int_17
+ %116 = OpLoad %v3float %115
+ %117 = OpAccessChain %_ptr_Uniform_v3float %View %int_19
+ %118 = OpLoad %v3float %117
+ %119 = OpAccessChain %_ptr_Uniform_v3float %View %int_21
+ %120 = OpLoad %v3float %119
+ %121 = OpAccessChain %_ptr_Uniform_v3float %View %int_27
+ %122 = OpLoad %v3float %121
+ %123 = OpAccessChain %_ptr_Uniform_v3float %View %int_31
+ %124 = OpLoad %v3float %123
+ %125 = OpIMul %uint %111 %uint_16
+ %126 = OpUDiv %uint %110 %uint_4
+ %127 = OpIAdd %uint %125 %126
+ %128 = OpAccessChain %_ptr_Uniform_uint %_Globals %int_0
+ %129 = OpLoad %uint %128
+ %130 = OpIAdd %uint %129 %127
+ %131 = OpLoad %type_buffer_image %ParticleIndices
+ %132 = OpImageFetch %v4float %131 %130 None
+ %133 = OpVectorShuffle %v2float %132 %132 0 1
+ %134 = OpLoad %type_2d_image %PositionTexture
+ %135 = OpLoad %type_sampler %PositionTextureSampler
+ %136 = OpSampledImage %type_sampled_image %134 %135
+ %137 = OpImageSampleExplicitLod %v4float %136 %133 Lod %float_0
+ %138 = OpLoad %type_2d_image %VelocityTexture
+ %139 = OpLoad %type_sampler %VelocityTextureSampler
+ %140 = OpSampledImage %type_sampled_image %138 %139
+ %141 = OpImageSampleExplicitLod %v4float %140 %133 Lod %float_0
+ %142 = OpLoad %type_2d_image %AttributesTexture
+ %143 = OpLoad %type_sampler %AttributesTextureSampler
+ %144 = OpSampledImage %type_sampled_image %142 %143
+ %145 = OpImageSampleExplicitLod %v4float %144 %133 Lod %float_0
+ %146 = OpCompositeExtract %float %137 3
+ %147 = OpExtInst %float %1 Step %146 %float_1
+ %148 = OpVectorShuffle %v3float %141 %141 0 1 2
+ %149 = OpAccessChain %_ptr_Uniform_mat4v4float %Primitive %int_0
+ %150 = OpLoad %mat4v4float %149
+ %151 = OpCompositeExtract %v4float %150 0
+ %152 = OpVectorShuffle %v3float %151 %151 0 1 2
+ %153 = OpCompositeExtract %v4float %150 1
+ %154 = OpVectorShuffle %v3float %153 %153 0 1 2
+ %155 = OpCompositeExtract %v4float %150 2
+ %156 = OpVectorShuffle %v3float %155 %155 0 1 2
+ %157 = OpCompositeConstruct %mat3v3float %152 %154 %156
+ %158 = OpMatrixTimesVector %v3float %157 %148
+ %159 = OpFAdd %v3float %158 %54
+ %160 = OpExtInst %v3float %1 Normalize %159
+ %161 = OpExtInst %float %1 Length %158
+ %162 = OpAccessChain %_ptr_Uniform_v4float %EmitterUniforms %int_3
+ %163 = OpLoad %v4float %162
+ %164 = OpVectorShuffle %v2float %163 %163 0 1
+ %165 = OpVectorShuffle %v2float %163 %163 2 3
+ %166 = OpCompositeConstruct %v2float %146 %146
+ %167 = OpFMul %v2float %165 %166
+ %168 = OpFAdd %v2float %164 %167
+ %169 = OpLoad %type_2d_image %CurveTexture
+ %170 = OpLoad %type_sampler %CurveTextureSampler
+ %171 = OpSampledImage %type_sampled_image %169 %170
+ %172 = OpImageSampleExplicitLod %v4float %171 %168 Lod %float_0
+ %173 = OpAccessChain %_ptr_Uniform_v4float %EmitterUniforms %int_4
+ %174 = OpLoad %v4float %173
+ %175 = OpFMul %v4float %172 %174
+ %176 = OpAccessChain %_ptr_Uniform_v4float %EmitterUniforms %int_5
+ %177 = OpLoad %v4float %176
+ %178 = OpFAdd %v4float %175 %177
+ %179 = OpCompositeExtract %float %145 0
+ %180 = OpFOrdLessThan %bool %179 %float_0_5
+ %181 = OpSelect %float %180 %float_0 %float_n0_5
+ %182 = OpCompositeExtract %float %145 1
+ %183 = OpFOrdLessThan %bool %182 %float_0_5
+ %184 = OpSelect %float %183 %float_0 %float_n0_5
+ %185 = OpCompositeConstruct %v2float %181 %184
+ %186 = OpVectorShuffle %v2float %145 %145 0 1
+ %187 = OpFAdd %v2float %186 %185
+ %188 = OpFMul %v2float %187 %61
+ %189 = OpVectorShuffle %v2float %178 %178 0 1
+ %190 = OpAccessChain %_ptr_Uniform_v2float %EmitterDynamicUniforms %int_0
+ %191 = OpLoad %v2float %190
+ %192 = OpFMul %v2float %189 %191
+ %193 = OpAccessChain %_ptr_Uniform_v4float %EmitterUniforms %int_6
+ %194 = OpLoad %v4float %193
+ %195 = OpVectorShuffle %v2float %194 %194 0 1
+ %196 = OpCompositeConstruct %v2float %161 %161
+ %197 = OpFMul %v2float %195 %196
+ %198 = OpExtInst %v2float %1 FMax %197 %63
+ %199 = OpVectorShuffle %v2float %194 %194 2 3
+ %200 = OpExtInst %v2float %1 FMin %198 %199
+ %201 = OpFMul %v2float %188 %192
+ %202 = OpFMul %v2float %201 %200
+ %203 = OpCompositeConstruct %v2float %147 %147
+ %204 = OpFMul %v2float %202 %203
+ %205 = OpCompositeExtract %float %145 3
+ %206 = OpAccessChain %_ptr_Uniform_float %EmitterUniforms %int_11
+ %207 = OpLoad %float %206
+ %208 = OpFMul %float %205 %207
+ %209 = OpCompositeExtract %float %145 2
+ %210 = OpFMul %float %208 %146
+ %211 = OpFAdd %float %209 %210
+ %212 = OpFMul %float %211 %float_6_28318548
+ %213 = OpAccessChain %_ptr_Uniform_v4float %Primitive %int_0 %uint_0
+ %214 = OpLoad %v4float %213
+ %215 = OpVectorShuffle %v3float %214 %214 0 1 2
+ %216 = OpVectorShuffle %v3float %137 %108 0 0 0
+ %217 = OpFMul %v3float %215 %216
+ %218 = OpAccessChain %_ptr_Uniform_v4float %Primitive %int_0 %uint_1
+ %219 = OpLoad %v4float %218
+ %220 = OpVectorShuffle %v3float %219 %219 0 1 2
+ %221 = OpVectorShuffle %v3float %137 %108 1 1 1
+ %222 = OpFMul %v3float %220 %221
+ %223 = OpFAdd %v3float %217 %222
+ %224 = OpAccessChain %_ptr_Uniform_v4float %Primitive %int_0 %uint_2
+ %225 = OpLoad %v4float %224
+ %226 = OpVectorShuffle %v3float %225 %225 0 1 2
+ %227 = OpVectorShuffle %v3float %137 %108 2 2 2
+ %228 = OpFMul %v3float %226 %227
+ %229 = OpFAdd %v3float %223 %228
+ %230 = OpAccessChain %_ptr_Uniform_v4float %Primitive %int_0 %uint_3
+ %231 = OpLoad %v4float %230
+ %232 = OpVectorShuffle %v3float %231 %231 0 1 2
+ %233 = OpFAdd %v3float %232 %124
+ %234 = OpFAdd %v3float %229 %233
+ %235 = OpCompositeExtract %float %234 0
+ %236 = OpCompositeExtract %float %234 1
+ %237 = OpCompositeExtract %float %234 2
+ %238 = OpCompositeConstruct %v4float %235 %236 %237 %float_1
+ %239 = OpVectorShuffle %v3float %238 %238 0 1 2
+ %240 = OpAccessChain %_ptr_Uniform_float %EmitterUniforms %int_10
+ %241 = OpLoad %float %240
+ %242 = OpCompositeConstruct %v3float %241 %241 %241
+ %243 = OpExtInst %v3float %1 FMix %116 %120 %242
+ %244 = OpExtInst %v3float %1 FMix %114 %118 %242
+ %245 = OpAccessChain %_ptr_Uniform_v4float %EmitterDynamicUniforms %int_3
+ %246 = OpLoad %v4float %245
+ %247 = OpVectorShuffle %v3float %246 %246 0 1 2
+ %248 = OpAccessChain %_ptr_Uniform_float %EmitterDynamicUniforms %int_3 %int_3
+ %249 = OpLoad %float %248
+ %250 = OpCompositeConstruct %v3float %249 %249 %249
+ %251 = OpExtInst %v3float %1 FMix %243 %247 %250
+ %252 = OpFNegate %v3float %244
+ %253 = OpAccessChain %_ptr_Uniform_v4float %EmitterDynamicUniforms %int_4
+ %254 = OpLoad %v4float %253
+ %255 = OpVectorShuffle %v3float %254 %254 0 1 2
+ %256 = OpAccessChain %_ptr_Uniform_float %EmitterDynamicUniforms %int_4 %int_3
+ %257 = OpLoad %float %256
+ %258 = OpCompositeConstruct %v3float %257 %257 %257
+ %259 = OpExtInst %v3float %1 FMix %252 %255 %258
+ %260 = OpFSub %v3float %122 %239
+ %261 = OpDot %float %260 %260
+ %262 = OpExtInst %float %1 FMax %261 %float_0_00999999978
+ %263 = OpExtInst %float %1 Sqrt %262
+ %264 = OpCompositeConstruct %v3float %263 %263 %263
+ %265 = OpFDiv %v3float %260 %264
+ %266 = OpAccessChain %_ptr_Uniform_float %EmitterUniforms %int_9 %int_0
+ %267 = OpLoad %float %266
+ %268 = OpFOrdGreaterThan %bool %267 %float_0
+ OpSelectionMerge %269 DontFlatten
+ OpBranchConditional %268 %270 %271
+ %270 = OpLabel
+ %272 = OpAccessChain %_ptr_Uniform_float %EmitterUniforms %int_9 %int_1
+ %273 = OpLoad %float %272
+ %274 = OpFMul %float %261 %273
+ %275 = OpAccessChain %_ptr_Uniform_float %EmitterUniforms %int_9 %int_2
+ %276 = OpLoad %float %275
+ %277 = OpFSub %float %274 %276
+ %278 = OpExtInst %float %1 FClamp %277 %float_0 %float_1
+ %279 = OpExtInst %v3float %1 Cross %265 %82
+ %280 = OpDot %float %279 %279
+ %281 = OpExtInst %float %1 FMax %280 %float_0_00999999978
+ %282 = OpExtInst %float %1 Sqrt %281
+ %283 = OpCompositeConstruct %v3float %282 %282 %282
+ %284 = OpFDiv %v3float %279 %283
+ %285 = OpExtInst %v3float %1 Cross %265 %284
+ %286 = OpCompositeConstruct %v3float %278 %278 %278
+ %287 = OpExtInst %v3float %1 FMix %251 %284 %286
+ %288 = OpExtInst %v3float %1 Normalize %287
+ %289 = OpExtInst %v3float %1 FMix %259 %285 %286
+ %290 = OpExtInst %v3float %1 Normalize %289
+ OpBranch %269
+ %271 = OpLabel
+ %291 = OpAccessChain %_ptr_Uniform_float %EmitterUniforms %int_8 %int_1
+ %292 = OpLoad %float %291
+ %293 = OpFOrdGreaterThan %bool %292 %float_0
+ OpSelectionMerge %294 Flatten
+ OpBranchConditional %293 %295 %296
+ %295 = OpLabel
+ %297 = OpExtInst %v3float %1 Cross %265 %160
+ %298 = OpDot %float %297 %297
+ %299 = OpExtInst %float %1 FMax %298 %float_0_00999999978
+ %300 = OpExtInst %float %1 Sqrt %299
+ %301 = OpCompositeConstruct %v3float %300 %300 %300
+ %302 = OpFDiv %v3float %297 %301
+ %303 = OpFNegate %v3float %160
+ OpBranch %294
+ %296 = OpLabel
+ %304 = OpAccessChain %_ptr_Uniform_float %EmitterUniforms %int_8 %int_2
+ %305 = OpLoad %float %304
+ %306 = OpFOrdGreaterThan %bool %305 %float_0
+ OpSelectionMerge %307 None
+ OpBranchConditional %306 %308 %309
+ %308 = OpLabel
+ %310 = OpExtInst %v3float %1 Cross %247 %265
+ %311 = OpDot %float %310 %310
+ %312 = OpExtInst %float %1 FMax %311 %float_0_00999999978
+ %313 = OpExtInst %float %1 Sqrt %312
+ %314 = OpCompositeConstruct %v3float %313 %313 %313
+ %315 = OpFDiv %v3float %310 %314
+ %316 = OpFNegate %v3float %315
+ OpBranch %307
+ %309 = OpLabel
+ %317 = OpAccessChain %_ptr_Uniform_float %EmitterUniforms %int_8 %int_3
+ %318 = OpLoad %float %317
+ %319 = OpFOrdGreaterThan %bool %318 %float_0
+ OpSelectionMerge %320 None
+ OpBranchConditional %319 %321 %320
+ %321 = OpLabel
+ %322 = OpExtInst %v3float %1 Cross %265 %82
+ %323 = OpDot %float %322 %322
+ %324 = OpExtInst %float %1 FMax %323 %float_0_00999999978
+ %325 = OpExtInst %float %1 Sqrt %324
+ %326 = OpCompositeConstruct %v3float %325 %325 %325
+ %327 = OpFDiv %v3float %322 %326
+ %328 = OpExtInst %v3float %1 Cross %265 %327
+ OpBranch %320
+ %320 = OpLabel
+ %329 = OpPhi %v3float %251 %309 %327 %321
+ %330 = OpPhi %v3float %259 %309 %328 %321
+ OpBranch %307
+ %307 = OpLabel
+ %331 = OpPhi %v3float %247 %308 %329 %320
+ %332 = OpPhi %v3float %316 %308 %330 %320
+ OpBranch %294
+ %294 = OpLabel
+ %333 = OpPhi %v3float %302 %295 %331 %307
+ %334 = OpPhi %v3float %303 %295 %332 %307
+ OpBranch %269
+ %269 = OpLabel
+ %335 = OpPhi %v3float %288 %270 %333 %294
+ %336 = OpPhi %v3float %290 %270 %334 %294
+ %337 = OpAccessChain %_ptr_Uniform_float %EmitterUniforms %int_12
+ %338 = OpLoad %float %337
+ %339 = OpFAdd %float %212 %338
+ %340 = OpExtInst %float %1 Sin %339
+ %341 = OpExtInst %float %1 Cos %339
+ %342 = OpCompositeConstruct %v3float %340 %340 %340
+ %343 = OpFMul %v3float %342 %336
+ %344 = OpCompositeConstruct %v3float %341 %341 %341
+ %345 = OpFMul %v3float %344 %335
+ %346 = OpFAdd %v3float %343 %345
+ %347 = OpFMul %v3float %344 %336
+ %348 = OpFMul %v3float %342 %335
+ %349 = OpFSub %v3float %347 %348
+ %350 = OpCompositeExtract %float %204 0
+ %351 = OpCompositeExtract %float %112 0
+ %352 = OpAccessChain %_ptr_Uniform_float %EmitterUniforms %int_15 %int_0
+ %353 = OpLoad %float %352
+ %354 = OpFAdd %float %351 %353
+ %355 = OpFMul %float %350 %354
+ %356 = OpCompositeConstruct %v3float %355 %355 %355
+ %357 = OpFMul %v3float %356 %346
+ %358 = OpCompositeExtract %float %204 1
+ %359 = OpCompositeExtract %float %112 1
+ %360 = OpAccessChain %_ptr_Uniform_float %EmitterUniforms %int_15 %int_1
+ %361 = OpLoad %float %360
+ %362 = OpFAdd %float %359 %361
+ %363 = OpFMul %float %358 %362
+ %364 = OpCompositeConstruct %v3float %363 %363 %363
+ %365 = OpFMul %v3float %364 %349
+ %366 = OpFAdd %v3float %357 %365
+ %367 = OpFAdd %v3float %239 %366
+ %368 = OpCompositeExtract %float %367 0
+ %369 = OpCompositeExtract %float %367 1
+ %370 = OpCompositeExtract %float %367 2
+ %371 = OpCompositeConstruct %v4float %368 %369 %370 %float_1
+ %372 = OpVectorShuffle %v4float %371 %371 4 5 6 3
+ %373 = OpAccessChain %_ptr_Uniform_mat4v4float %MobileShadowDepthPass %int_20
+ %374 = OpLoad %mat4v4float %373
+ %375 = OpMatrixTimesVector %v4float %374 %372
+ %376 = OpAccessChain %_ptr_Uniform_float %MobileShadowDepthPass %int_22
+ %377 = OpLoad %float %376
+ %378 = OpFOrdGreaterThan %bool %377 %float_0
+ %379 = OpCompositeExtract %float %375 2
+ %380 = OpFOrdLessThan %bool %379 %float_0
+ %381 = OpLogicalAnd %bool %378 %380
+ OpSelectionMerge %382 None
+ OpBranchConditional %381 %383 %382
+ %383 = OpLabel
+ %384 = OpCompositeInsert %v4float %float_9_99999997en07 %375 2
+ %385 = OpCompositeInsert %v4float %float_1 %384 3
+ OpBranch %382
+ %382 = OpLabel
+ %386 = OpPhi %v4float %375 %269 %385 %383
+ %387 = OpAccessChain %_ptr_Uniform_float %MobileShadowDepthPass %int_21 %int_0
+ %388 = OpLoad %float %387
+ %389 = OpAccessChain %_ptr_Uniform_float %MobileShadowDepthPass %int_21 %int_1
+ %390 = OpLoad %float %389
+ %391 = OpCompositeExtract %float %386 2
+ %392 = OpFMul %float %391 %390
+ %393 = OpFAdd %float %392 %388
+ %394 = OpCompositeExtract %float %386 3
+ %395 = OpFMul %float %393 %394
+ %396 = OpCompositeInsert %v4float %395 %386 2
+ OpStore %out_var_TEXCOORD6 %float_0
+ OpStore %gl_Position %396
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders/asm/comp/bitcast_icmp.asm.comp b/3rdparty/bgfx/3rdparty/spirv-cross/shaders/asm/comp/bitcast_icmp.asm.comp
new file mode 100644
index 00000000000..b7b4e0b2e1e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders/asm/comp/bitcast_icmp.asm.comp
@@ -0,0 +1,101 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 1
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %func "main"
+ OpExecutionMode %func LocalSize 1 1 1
+ OpSource ESSL 310
+ OpSourceExtension "GL_GOOGLE_cpp_style_line_directive"
+ OpSourceExtension "GL_GOOGLE_include_directive"
+ OpMemberDecorate %input_struct 0 Offset 0
+ OpMemberDecorate %input_struct 1 Offset 16
+ OpMemberDecorate %output_struct 0 Offset 0
+ OpMemberDecorate %output_struct 1 Offset 16
+ OpDecorate %input_struct BufferBlock
+ OpDecorate %inputs DescriptorSet 0
+ OpDecorate %inputs Binding 0
+ OpDecorate %inputs Restrict
+ OpDecorate %output_struct BufferBlock
+ OpDecorate %outputs DescriptorSet 0
+ OpDecorate %outputs Binding 1
+ OpDecorate %outputs Restrict
+
+ %void = OpTypeVoid
+ %main_func = OpTypeFunction %void
+
+ %bool = OpTypeBool
+ %bvec4 = OpTypeVector %bool 4
+
+ %uint = OpTypeInt 32 0
+ %uvec4 = OpTypeVector %uint 4
+
+ %int = OpTypeInt 32 1
+ %ivec4 = OpTypeVector %int 4
+
+ %ivec4_ptr = OpTypePointer Uniform %ivec4
+ %uvec4_ptr = OpTypePointer Uniform %uvec4
+
+ %zero = OpConstant %int 0
+ %one = OpConstant %int 1
+ %uzero = OpConstant %uint 0
+ %uone = OpConstant %uint 1
+ %utrue = OpConstantComposite %uvec4 %uone %uone %uone %uone
+ %ufalse = OpConstantComposite %uvec4 %uzero %uzero %uzero %uzero
+
+ %input_struct = OpTypeStruct %ivec4 %uvec4
+ %input_struct_ptr = OpTypePointer Uniform %input_struct
+ %inputs = OpVariable %input_struct_ptr Uniform
+ %output_struct = OpTypeStruct %uvec4 %ivec4
+ %output_struct_ptr = OpTypePointer Uniform %output_struct
+ %outputs = OpVariable %output_struct_ptr Uniform
+
+ %func = OpFunction %void None %main_func
+ %block = OpLabel
+
+ %input1_ptr = OpAccessChain %ivec4_ptr %inputs %zero
+ %input0_ptr = OpAccessChain %uvec4_ptr %inputs %one
+ %input1 = OpLoad %ivec4 %input1_ptr
+ %input0 = OpLoad %uvec4 %input0_ptr
+
+ %output_ptr_uvec4 = OpAccessChain %uvec4_ptr %outputs %zero
+
+ %result_slt = OpSLessThan %bvec4 %input0 %input1
+ %result_sle = OpSLessThanEqual %bvec4 %input0 %input1
+ %result_ult = OpULessThan %bvec4 %input0 %input1
+ %result_ule = OpULessThanEqual %bvec4 %input0 %input1
+ %result_sgt = OpSGreaterThan %bvec4 %input0 %input1
+ %result_sge = OpSGreaterThanEqual %bvec4 %input0 %input1
+ %result_ugt = OpUGreaterThan %bvec4 %input0 %input1
+ %result_uge = OpUGreaterThanEqual %bvec4 %input0 %input1
+
+ %int_slt = OpSelect %uvec4 %result_slt %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_slt
+
+ %int_sle = OpSelect %uvec4 %result_sle %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_sle
+
+ %int_ult = OpSelect %uvec4 %result_ult %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_ult
+
+ %int_ule = OpSelect %uvec4 %result_ule %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_ule
+
+ %int_sgt = OpSelect %uvec4 %result_sgt %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_sgt
+
+ %int_sge = OpSelect %uvec4 %result_sge %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_sge
+
+ %int_ugt = OpSelect %uvec4 %result_ugt %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_ugt
+
+ %int_uge = OpSelect %uvec4 %result_uge %utrue %ufalse
+ OpStore %output_ptr_uvec4 %int_uge
+
+
+ OpReturn
+ OpFunctionEnd
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders/frag/struct-type-unrelated-alias.frag b/3rdparty/bgfx/3rdparty/spirv-cross/shaders/frag/struct-type-unrelated-alias.frag
new file mode 100644
index 00000000000..d1c7905225d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders/frag/struct-type-unrelated-alias.frag
@@ -0,0 +1,19 @@
+#version 450
+
+layout(location = 0) out float FragColor;
+
+struct T
+{
+ float a;
+};
+
+void main()
+{
+ T foo;
+ struct T { float b; };
+ T bar;
+
+ foo.a = 10.0;
+ bar.b = 20.0;
+ FragColor = foo.a + bar.b;
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/shaders/tese/load-array-of-array.tese b/3rdparty/bgfx/3rdparty/spirv-cross/shaders/tese/load-array-of-array.tese
new file mode 100644
index 00000000000..7383f7086eb
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/shaders/tese/load-array-of-array.tese
@@ -0,0 +1,10 @@
+#version 450
+layout(ccw, quads) in;
+
+layout(location = 0) in vec4 vTexCoord[][1];
+
+void main()
+{
+ vec4 tmp[gl_MaxPatchVertices][1] = vTexCoord;
+ gl_Position = tmp[0][0] + tmp[2][0] + tmp[3][0];
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv.h b/3rdparty/bgfx/3rdparty/spirv-cross/spirv.h
index f93fde91cdd..1b67617bfd5 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv.h
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv.h
@@ -53,7 +53,7 @@
typedef unsigned int SpvId;
-#define SPV_VERSION 0x10400
+#define SPV_VERSION 0x10500
#define SPV_REVISION 1
static const unsigned int SpvMagicNumber = 0x07230203;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv.hpp
index 1e96f7b4a96..f5cbda1bb80 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv.hpp
@@ -49,7 +49,7 @@ namespace spv {
typedef unsigned int Id;
-#define SPV_VERSION 0x10400
+#define SPV_VERSION 0x10500
#define SPV_REVISION 1
static const unsigned int MagicNumber = 0x07230203;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.cpp
index f1418994a86..463c7562ec7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.cpp
@@ -61,7 +61,7 @@ void CFG::build_immediate_dominators()
if (immediate_dominators[block])
{
assert(immediate_dominators[edge]);
- immediate_dominators[block] = find_common_dominator(block, edge);
+ immediate_dominators[block] = find_common_dominator(immediate_dominators[block], edge);
}
else
immediate_dominators[block] = edge;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_common.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_common.hpp
index c1c6fc8120b..e6a29a19beb 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_common.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_common.hpp
@@ -938,11 +938,6 @@ struct SPIRFunction : IVariant
// Intentionally not a small vector, this one is rare, and std::function can be large.
Vector<std::function<void()>> fixup_hooks_in;
- // On function entry, make sure to copy a constant array into thread addr space to work around
- // the case where we are passing a constant array by value to a function on backends which do not
- // consider arrays value types.
- SmallVector<ID> constant_arrays_needed_on_stack;
-
bool active = false;
bool flush_undeclared = true;
bool do_combined_parameters = true;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.cpp
index c73ecdf10bb..286b4504d67 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.cpp
@@ -2729,6 +2729,12 @@ void Compiler::AnalyzeVariableScopeAccessHandler::notify_variable_access(uint32_
if (id == 0)
return;
+ // Access chains used in multiple blocks mean hoisting all the variables used to construct the access chain as not all backends can use pointers.
+ auto itr = access_chain_children.find(id);
+ if (itr != end(access_chain_children))
+ for (auto child_id : itr->second)
+ notify_variable_access(child_id, block);
+
if (id_is_phi_variable(id))
accessed_variables_to_block[id].insert(block);
else if (id_is_potential_temporary(id))
@@ -2793,14 +2799,21 @@ bool Compiler::AnalyzeVariableScopeAccessHandler::handle(spv::Op op, const uint3
if (length < 3)
return false;
+ // Access chains used in multiple blocks mean hoisting all the variables used to construct the access chain as not all backends can use pointers.
uint32_t ptr = args[2];
auto *var = compiler.maybe_get<SPIRVariable>(ptr);
if (var)
+ {
accessed_variables_to_block[var->self].insert(current_block->self);
+ access_chain_children[args[1]].insert(var->self);
+ }
// args[2] might be another access chain we have to track use of.
for (uint32_t i = 2; i < length; i++)
+ {
notify_variable_access(args[i], current_block->self);
+ access_chain_children[args[1]].insert(args[i]);
+ }
// Also keep track of the access chain pointer itself.
// In exceptionally rare cases, we can end up with a case where
@@ -2889,6 +2902,10 @@ bool Compiler::AnalyzeVariableScopeAccessHandler::handle(spv::Op op, const uint3
if (length < 3)
return false;
+ // Return value may be a temporary.
+ if (compiler.get_type(args[0]).basetype != SPIRType::Void)
+ notify_variable_access(args[1], current_block->self);
+
length -= 3;
args += 3;
@@ -2909,9 +2926,6 @@ bool Compiler::AnalyzeVariableScopeAccessHandler::handle(spv::Op op, const uint3
// Might try to copy a Phi variable here.
notify_variable_access(args[i], current_block->self);
}
-
- // Return value may be a temporary.
- notify_variable_access(args[1], current_block->self);
break;
}
@@ -3290,6 +3304,7 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry, AnalyzeVariableScopeA
DominatorBuilder builder(cfg);
bool force_temporary = false;
+ bool used_in_header_hoisted_continue_block = false;
// Figure out which block is dominating all accesses of those temporaries.
auto &blocks = var.second;
@@ -3304,10 +3319,8 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry, AnalyzeVariableScopeA
// This is moot for complex loops however.
auto &loop_header_block = get<SPIRBlock>(ir.continue_block_to_loop_header[block]);
assert(loop_header_block.merge == SPIRBlock::MergeLoop);
-
- // Only relevant if the loop is not marked as complex.
- if (!loop_header_block.complex_continue)
- builder.add_block(loop_header_block.self);
+ builder.add_block(loop_header_block.self);
+ used_in_header_hoisted_continue_block = true;
}
}
@@ -3332,11 +3345,22 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry, AnalyzeVariableScopeA
{
// Exceptionally rare case.
// We cannot declare temporaries of access chains (except on MSL perhaps with pointers).
- // Rather than do that, we force a complex loop to make sure access chains are created and consumed
- // in expected order.
- auto &loop_header_block = get<SPIRBlock>(dominating_block);
- assert(loop_header_block.merge == SPIRBlock::MergeLoop);
- loop_header_block.complex_continue = true;
+ // Rather than do that, we force the indexing expressions to be declared in the right scope by
+ // tracking their usage to that end. There is no temporary to hoist.
+ // However, we still need to observe declaration order of the access chain.
+
+ if (used_in_header_hoisted_continue_block)
+ {
+ // For this scenario, we used an access chain inside a continue block where we also registered an access to header block.
+ // This is a problem as we need to declare an access chain properly first with full definition.
+ // We cannot use temporaries for these expressions,
+ // so we must make sure the access chain is declared ahead of time.
+ // Force a complex for loop to deal with this.
+ // TODO: Out-of-order declaring for loops where continue blocks are emitted last might be another option.
+ auto &loop_header_block = get<SPIRBlock>(dominating_block);
+ assert(loop_header_block.merge == SPIRBlock::MergeLoop);
+ loop_header_block.complex_continue = true;
+ }
}
else
{
@@ -3773,6 +3797,13 @@ void Compiler::analyze_image_and_sampler_usage()
CombinedImageSamplerUsageHandler handler(*this, dref_handler.dref_combined_samplers);
traverse_all_reachable_opcodes(get<SPIRFunction>(ir.default_entry_point), handler);
+
+ // Need to run this traversal twice. First time, we propagate any comparison sampler usage from leaf functions
+ // down to main().
+ // In the second pass, we can propagate up forced depth state coming from main() up into leaf functions.
+ handler.dependency_hierarchy.clear();
+ traverse_all_reachable_opcodes(get<SPIRFunction>(ir.default_entry_point), handler);
+
comparison_ids = move(handler.comparison_ids);
need_subpass_input = handler.need_subpass_input;
@@ -3888,6 +3919,14 @@ bool Compiler::CFGBuilder::follow_function_call(const SPIRFunction &func)
return false;
}
+void Compiler::CombinedImageSamplerUsageHandler::add_dependency(uint32_t dst, uint32_t src)
+{
+ dependency_hierarchy[dst].insert(src);
+ // Propagate up any comparison state if we're loading from one such variable.
+ if (comparison_ids.count(src))
+ comparison_ids.insert(dst);
+}
+
bool Compiler::CombinedImageSamplerUsageHandler::begin_function_scope(const uint32_t *args, uint32_t length)
{
if (length < 3)
@@ -3900,7 +3939,7 @@ bool Compiler::CombinedImageSamplerUsageHandler::begin_function_scope(const uint
for (uint32_t i = 0; i < length; i++)
{
auto &argument = func.arguments[i];
- dependency_hierarchy[argument.id].insert(arg[i]);
+ add_dependency(argument.id, arg[i]);
}
return true;
@@ -3910,6 +3949,7 @@ void Compiler::CombinedImageSamplerUsageHandler::add_hierarchy_to_comparison_ids
{
// Traverse the variable dependency hierarchy and tag everything in its path with comparison ids.
comparison_ids.insert(id);
+
for (auto &dep_id : dependency_hierarchy[id])
add_hierarchy_to_comparison_ids(dep_id);
}
@@ -3925,7 +3965,8 @@ bool Compiler::CombinedImageSamplerUsageHandler::handle(Op opcode, const uint32_
{
if (length < 3)
return false;
- dependency_hierarchy[args[1]].insert(args[2]);
+
+ add_dependency(args[1], args[2]);
// Ideally defer this to OpImageRead, but then we'd need to track loaded IDs.
// If we load an image, we're going to use it and there is little harm in declaring an unused gl_FragCoord.
@@ -3947,14 +3988,17 @@ bool Compiler::CombinedImageSamplerUsageHandler::handle(Op opcode, const uint32_
uint32_t result_type = args[0];
uint32_t result_id = args[1];
auto &type = compiler.get<SPIRType>(result_type);
+
+ // If the underlying resource has been used for comparison then duplicate loads of that resource must be too.
+ // This image must be a depth image.
+ uint32_t image = args[2];
+ uint32_t sampler = args[3];
+
if (type.image.depth || dref_combined_samplers.count(result_id) != 0)
{
- // This image must be a depth image.
- uint32_t image = args[2];
add_hierarchy_to_comparison_ids(image);
// This sampler must be a SamplerComparisonState, and not a regular SamplerState.
- uint32_t sampler = args[3];
add_hierarchy_to_comparison_ids(sampler);
// Mark the OpSampledImage itself as being comparison state.
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.hpp
index 7385a6c33e5..73d9085c940 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.hpp
@@ -888,6 +888,7 @@ protected:
void add_hierarchy_to_comparison_ids(uint32_t ids);
bool need_subpass_input = false;
+ void add_dependency(uint32_t dst, uint32_t src);
};
void build_function_control_flow_graphs_and_analyze();
@@ -925,6 +926,8 @@ protected:
std::unordered_map<uint32_t, std::unordered_set<uint32_t>> complete_write_variables_to_block;
std::unordered_map<uint32_t, std::unordered_set<uint32_t>> partial_write_variables_to_block;
std::unordered_set<uint32_t> access_chain_expressions;
+ // Access chains used in multiple blocks mean hoisting all the variables used to construct the access chain as not all backends can use pointers.
+ std::unordered_map<uint32_t, std::unordered_set<uint32_t>> access_chain_children;
const SPIRBlock *current_block = nullptr;
};
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp
index c9ac8fca389..4abf89293f7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp
@@ -569,6 +569,30 @@ spvc_result spvc_compiler_options_set_uint(spvc_compiler_options options, spvc_c
case SPVC_COMPILER_OPTION_MSL_DYNAMIC_OFFSETS_BUFFER_INDEX:
options->msl.dynamic_offsets_buffer_index = value;
break;
+
+ case SPVC_COMPILER_OPTION_MSL_TEXTURE_1D_AS_2D:
+ options->msl.texture_1D_as_2D = value != 0;
+ break;
+
+ case SPVC_COMPILER_OPTION_MSL_ENABLE_BASE_INDEX_ZERO:
+ options->msl.enable_base_index_zero = value != 0;
+ break;
+
+ case SPVC_COMPILER_OPTION_MSL_IOS_FRAMEBUFFER_FETCH_SUBPASS:
+ options->msl.ios_use_framebuffer_fetch_subpasses = value != 0;
+ break;
+
+ case SPVC_COMPILER_OPTION_MSL_INVARIANT_FP_MATH:
+ options->msl.invariant_float_math = value != 0;
+ break;
+
+ case SPVC_COMPILER_OPTION_MSL_EMULATE_CUBEMAP_ARRAY:
+ options->msl.emulate_cube_array = value != 0;
+ break;
+
+ case SPVC_COMPILER_OPTION_MSL_ENABLE_DECORATION_BINDING:
+ options->msl.enable_decoration_binding = value != 0;
+ break;
#endif
default:
@@ -946,6 +970,26 @@ spvc_result spvc_compiler_msl_add_discrete_descriptor_set(spvc_compiler compiler
#endif
}
+spvc_result spvc_compiler_msl_set_argument_buffer_device_address_space(spvc_compiler compiler, unsigned desc_set, spvc_bool device_address)
+{
+#if SPIRV_CROSS_C_API_MSL
+ if (compiler->backend != SPVC_BACKEND_MSL)
+ {
+ compiler->context->report_error("MSL function used on a non-MSL backend.");
+ return SPVC_ERROR_INVALID_ARGUMENT;
+ }
+
+ auto &msl = *static_cast<CompilerMSL *>(compiler->compiler.get());
+ msl.set_argument_buffer_device_address_space(desc_set, bool(device_address));
+ return SPVC_SUCCESS;
+#else
+ (void)desc_set;
+ (void)device_address;
+ compiler->context->report_error("MSL function used on a non-MSL backend.");
+ return SPVC_ERROR_INVALID_ARGUMENT;
+#endif
+}
+
spvc_bool spvc_compiler_msl_is_vertex_attribute_used(spvc_compiler compiler, unsigned location)
{
#if SPIRV_CROSS_C_API_MSL
@@ -1619,6 +1663,11 @@ spvc_type spvc_compiler_get_type_handle(spvc_compiler compiler, spvc_type_id id)
SPVC_END_SAFE_SCOPE(compiler->context, nullptr)
}
+spvc_type_id spvc_type_get_base_type_id(spvc_type type)
+{
+ return type->self;
+}
+
static spvc_basetype convert_basetype(SPIRType::BaseType type)
{
// For now the enums match up.
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.h b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.h
index c9f7a006134..367120684c8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.h
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.h
@@ -33,7 +33,7 @@ extern "C" {
/* Bumped if ABI or API breaks backwards compatibility. */
#define SPVC_C_API_VERSION_MAJOR 0
/* Bumped if APIs or enumerations are added in a backwards compatible way. */
-#define SPVC_C_API_VERSION_MINOR 18
+#define SPVC_C_API_VERSION_MINOR 20
/* Bumped if internal implementation details change. */
#define SPVC_C_API_VERSION_PATCH 0
@@ -527,6 +527,12 @@ typedef enum spvc_compiler_option
SPVC_COMPILER_OPTION_MSL_VIEW_INDEX_FROM_DEVICE_INDEX = 41 | SPVC_COMPILER_OPTION_MSL_BIT,
SPVC_COMPILER_OPTION_MSL_DISPATCH_BASE = 42 | SPVC_COMPILER_OPTION_MSL_BIT,
SPVC_COMPILER_OPTION_MSL_DYNAMIC_OFFSETS_BUFFER_INDEX = 43 | SPVC_COMPILER_OPTION_MSL_BIT,
+ SPVC_COMPILER_OPTION_MSL_TEXTURE_1D_AS_2D = 44 | SPVC_COMPILER_OPTION_MSL_BIT,
+ SPVC_COMPILER_OPTION_MSL_ENABLE_BASE_INDEX_ZERO = 45 | SPVC_COMPILER_OPTION_MSL_BIT,
+ SPVC_COMPILER_OPTION_MSL_IOS_FRAMEBUFFER_FETCH_SUBPASS = 46 | SPVC_COMPILER_OPTION_MSL_BIT,
+ SPVC_COMPILER_OPTION_MSL_INVARIANT_FP_MATH = 47 | SPVC_COMPILER_OPTION_MSL_BIT,
+ SPVC_COMPILER_OPTION_MSL_EMULATE_CUBEMAP_ARRAY = 48 | SPVC_COMPILER_OPTION_MSL_BIT,
+ SPVC_COMPILER_OPTION_MSL_ENABLE_DECORATION_BINDING = 49 | SPVC_COMPILER_OPTION_MSL_BIT,
SPVC_COMPILER_OPTION_INT_MAX = 0x7fffffff
} spvc_compiler_option;
@@ -619,6 +625,7 @@ SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_vertex_attribute(spvc_compiler
SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_resource_binding(spvc_compiler compiler,
const spvc_msl_resource_binding *binding);
SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_discrete_descriptor_set(spvc_compiler compiler, unsigned desc_set);
+SPVC_PUBLIC_API spvc_result spvc_compiler_msl_set_argument_buffer_device_address_space(spvc_compiler compiler, unsigned desc_set, spvc_bool device_address);
SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_is_vertex_attribute_used(spvc_compiler compiler, unsigned location);
SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_is_resource_used(spvc_compiler compiler,
SpvExecutionModel model,
@@ -712,6 +719,12 @@ SPVC_PUBLIC_API SpvExecutionModel spvc_compiler_get_execution_model(spvc_compile
*/
SPVC_PUBLIC_API spvc_type spvc_compiler_get_type_handle(spvc_compiler compiler, spvc_type_id id);
+/* Pulls out SPIRType::self. This effectively gives the type ID without array or pointer qualifiers.
+ * This is necessary when reflecting decoration/name information on members of a struct,
+ * which are placed in the base type, not the qualified type.
+ * This is similar to spvc_reflected_resource::base_type_id. */
+SPVC_PUBLIC_API spvc_type_id spvc_type_get_base_type_id(spvc_type type);
+
SPVC_PUBLIC_API spvc_basetype spvc_type_get_basetype(spvc_type type);
SPVC_PUBLIC_API unsigned spvc_type_get_bit_width(spvc_type type);
SPVC_PUBLIC_API unsigned spvc_type_get_vector_size(spvc_type type);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_error_handling.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_error_handling.hpp
index e821c043d5d..153b07d0dbb 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_error_handling.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_error_handling.hpp
@@ -17,10 +17,12 @@
#ifndef SPIRV_CROSS_ERROR_HANDLING
#define SPIRV_CROSS_ERROR_HANDLING
-#include <stdexcept>
#include <stdio.h>
#include <stdlib.h>
#include <string>
+#ifndef SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS
+#include <stdexcept>
+#endif
#ifdef SPIRV_CROSS_NAMESPACE_OVERRIDE
#define SPIRV_CROSS_NAMESPACE SPIRV_CROSS_NAMESPACE_OVERRIDE
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp
index fccc8d36a97..8af7e76e7c9 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp
@@ -324,6 +324,9 @@ void CompilerGLSL::reset()
forwarded_temporaries.clear();
suppressed_usage_tracking.clear();
+ // Ensure that we declare phi-variable copies even if the original declaration isn't deferred
+ flushed_phi_variables.clear();
+
reset_name_caches();
ir.for_each_typed_id<SPIRFunction>([&](uint32_t, SPIRFunction &func) {
@@ -502,6 +505,7 @@ string CompilerGLSL::compile()
backend.allow_precision_qualifiers = true;
backend.force_gl_in_out_block = true;
backend.supports_extensions = true;
+ backend.use_array_constructor = true;
// Scan the SPIR-V to find trivial uses of extensions.
fixup_type_alias();
@@ -3032,7 +3036,7 @@ string CompilerGLSL::to_composite_constructor_expression(uint32_t id)
return to_rerolled_array_expression(to_enclosed_expression(id), type);
}
else
- return to_expression(id);
+ return to_unpacked_expression(id);
}
string CompilerGLSL::to_expression(uint32_t id, bool register_expression_read)
@@ -3394,11 +3398,19 @@ string CompilerGLSL::constant_expression(const SPIRConstant &c)
{
// Handles Arrays and structures.
string res;
+
+ // Allow Metal to use the array<T> template to make arrays a value type
+ bool needs_trailing_tracket = false;
if (backend.use_initializer_list && backend.use_typed_initializer_list && type.basetype == SPIRType::Struct &&
type.array.empty())
{
res = type_to_glsl_constructor(type) + "{ ";
}
+ else if (backend.use_initializer_list && backend.use_typed_initializer_list && !type.array.empty())
+ {
+ res = type_to_glsl_constructor(type) + "({ ";
+ needs_trailing_tracket = true;
+ }
else if (backend.use_initializer_list)
{
res = "{ ";
@@ -3421,8 +3433,23 @@ string CompilerGLSL::constant_expression(const SPIRConstant &c)
}
res += backend.use_initializer_list ? " }" : ")";
+ if (needs_trailing_tracket)
+ res += ")";
+
return res;
}
+ else if (type.basetype == SPIRType::Struct && type.member_types.size() == 0)
+ {
+ // Metal tessellation likes empty structs which are then constant expressions.
+ if (backend.supports_empty_struct)
+ return "{ }";
+ else if (backend.use_typed_initializer_list)
+ return join(type_to_glsl(get<SPIRType>(c.constant_type)), "{ 0 }");
+ else if (backend.use_initializer_list)
+ return "{ 0 }";
+ else
+ return join(type_to_glsl(get<SPIRType>(c.constant_type)), "(0)");
+ }
else if (c.columns() == 1)
{
return constant_expression_vector(c, 0);
@@ -4159,8 +4186,18 @@ void CompilerGLSL::emit_unrolled_unary_op(uint32_t result_type, uint32_t result_
}
void CompilerGLSL::emit_unrolled_binary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1,
- const char *op)
+ const char *op, bool negate, SPIRType::BaseType expected_type)
{
+ auto &type0 = expression_type(op0);
+ auto &type1 = expression_type(op1);
+
+ SPIRType target_type0 = type0;
+ SPIRType target_type1 = type1;
+ target_type0.basetype = expected_type;
+ target_type1.basetype = expected_type;
+ target_type0.vecsize = 1;
+ target_type1.vecsize = 1;
+
auto &type = get<SPIRType>(result_type);
auto expr = type_to_glsl_constructor(type);
expr += '(';
@@ -4168,11 +4205,25 @@ void CompilerGLSL::emit_unrolled_binary_op(uint32_t result_type, uint32_t result
{
// Make sure to call to_expression multiple times to ensure
// that these expressions are properly flushed to temporaries if needed.
- expr += to_extract_component_expression(op0, i);
+ if (negate)
+ expr += "!(";
+
+ if (expected_type != SPIRType::Unknown && type0.basetype != expected_type)
+ expr += bitcast_expression(target_type0, type0.basetype, to_extract_component_expression(op0, i));
+ else
+ expr += to_extract_component_expression(op0, i);
+
expr += ' ';
expr += op;
expr += ' ';
- expr += to_extract_component_expression(op1, i);
+
+ if (expected_type != SPIRType::Unknown && type1.basetype != expected_type)
+ expr += bitcast_expression(target_type1, type1.basetype, to_extract_component_expression(op1, i));
+ else
+ expr += to_extract_component_expression(op1, i);
+
+ if (negate)
+ expr += ")";
if (i + 1 < type.vecsize)
expr += ", ";
@@ -6562,6 +6613,36 @@ const char *CompilerGLSL::index_to_swizzle(uint32_t index)
}
}
+void CompilerGLSL::access_chain_internal_append_index(std::string &expr, uint32_t /*base*/, const SPIRType *type,
+ AccessChainFlags flags, bool & /*access_chain_is_arrayed*/,
+ uint32_t index)
+{
+ bool index_is_literal = (flags & ACCESS_CHAIN_INDEX_IS_LITERAL_BIT) != 0;
+ bool register_expression_read = (flags & ACCESS_CHAIN_SKIP_REGISTER_EXPRESSION_READ_BIT) == 0;
+
+ expr += "[";
+
+ // If we are indexing into an array of SSBOs or UBOs, we need to index it with a non-uniform qualifier.
+ bool nonuniform_index =
+ has_decoration(index, DecorationNonUniformEXT) &&
+ (has_decoration(type->self, DecorationBlock) || has_decoration(type->self, DecorationBufferBlock));
+ if (nonuniform_index)
+ {
+ expr += backend.nonuniform_qualifier;
+ expr += "(";
+ }
+
+ if (index_is_literal)
+ expr += convert_to_string(index);
+ else
+ expr += to_expression(index, register_expression_read);
+
+ if (nonuniform_index)
+ expr += ")";
+
+ expr += "]";
+}
+
string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indices, uint32_t count,
AccessChainFlags flags, AccessChainMeta *meta)
{
@@ -6613,27 +6694,7 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice
bool dimension_flatten = false;
const auto append_index = [&](uint32_t index) {
- expr += "[";
-
- // If we are indexing into an array of SSBOs or UBOs, we need to index it with a non-uniform qualifier.
- bool nonuniform_index =
- has_decoration(index, DecorationNonUniformEXT) &&
- (has_decoration(type->self, DecorationBlock) || has_decoration(type->self, DecorationBufferBlock));
- if (nonuniform_index)
- {
- expr += backend.nonuniform_qualifier;
- expr += "(";
- }
-
- if (index_is_literal)
- expr += convert_to_string(index);
- else
- expr += to_expression(index, register_expression_read);
-
- if (nonuniform_index)
- expr += ")";
-
- expr += "]";
+ access_chain_internal_append_index(expr, base, type, flags, access_chain_is_arrayed, index);
};
for (uint32_t i = 0; i < count; i++)
@@ -6756,7 +6817,9 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice
if (!pending_array_enclose)
expr += "]";
}
- else
+ // Some builtins are arrays in SPIR-V but not in other languages, e.g. gl_SampleMask[] is an array in SPIR-V but not in Metal.
+ // By throwing away the index, we imply the index was 0, which it must be for gl_SampleMask.
+ else if (!builtin_translates_to_nonarray(BuiltIn(get_decoration(base, DecorationBuiltIn))))
{
append_index(index);
}
@@ -6849,8 +6912,16 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice
else if (ir.ids[index].get_type() == TypeConstant && !is_packed && !row_major_matrix_needs_conversion)
{
auto &c = get<SPIRConstant>(index);
- expr += ".";
- expr += index_to_swizzle(c.scalar());
+ if (c.specialization)
+ {
+ // If the index is a spec constant, we cannot turn extract into a swizzle.
+ expr += join("[", to_expression(index), "]");
+ }
+ else
+ {
+ expr += ".";
+ expr += index_to_swizzle(c.scalar());
+ }
}
else if (index_is_literal)
{
@@ -7470,23 +7541,29 @@ string CompilerGLSL::variable_decl_function_local(SPIRVariable &var)
void CompilerGLSL::emit_variable_temporary_copies(const SPIRVariable &var)
{
- if (var.allocate_temporary_copy)
+ // Ensure that we declare phi-variable copies even if the original declaration isn't deferred
+ if (var.allocate_temporary_copy && !flushed_phi_variables.count(var.self))
{
auto &type = get<SPIRType>(var.basetype);
auto &flags = get_decoration_bitset(var.self);
statement(flags_to_qualifiers_glsl(type, flags), variable_decl(type, join("_", var.self, "_copy")), ";");
+ flushed_phi_variables.insert(var.self);
}
}
void CompilerGLSL::flush_variable_declaration(uint32_t id)
{
+ // Ensure that we declare phi-variable copies even if the original declaration isn't deferred
auto *var = maybe_get<SPIRVariable>(id);
if (var && var->deferred_declaration)
{
statement(variable_decl_function_local(*var), ";");
- emit_variable_temporary_copies(*var);
var->deferred_declaration = false;
}
+ if (var)
+ {
+ emit_variable_temporary_copies(*var);
+ }
}
bool CompilerGLSL::remove_duplicate_swizzle(string &op)
@@ -7816,6 +7893,10 @@ uint32_t CompilerGLSL::get_integer_width_for_instruction(const Instruction &inst
case OpSLessThanEqual:
case OpSGreaterThan:
case OpSGreaterThanEqual:
+ case OpULessThan:
+ case OpULessThanEqual:
+ case OpUGreaterThan:
+ case OpUGreaterThanEqual:
return expression_type(ops[2]).width;
default:
@@ -8257,22 +8338,32 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
string constructor_op;
if (backend.use_initializer_list && composite)
{
+ bool needs_trailing_tracket = false;
// Only use this path if we are building composites.
// This path cannot be used for arithmetic.
if (backend.use_typed_initializer_list && out_type.basetype == SPIRType::Struct && out_type.array.empty())
constructor_op += type_to_glsl_constructor(get<SPIRType>(result_type));
+ else if (backend.use_typed_initializer_list && !out_type.array.empty())
+ {
+ // MSL path. Array constructor is baked into type here, do not use _constructor variant.
+ constructor_op += type_to_glsl_constructor(get<SPIRType>(result_type)) + "(";
+ needs_trailing_tracket = true;
+ }
constructor_op += "{ ";
+
if (type_is_empty(out_type) && !backend.supports_empty_struct)
constructor_op += "0";
else if (splat)
- constructor_op += to_expression(elems[0]);
+ constructor_op += to_unpacked_expression(elems[0]);
else
constructor_op += build_composite_combiner(result_type, elems, length);
constructor_op += " }";
+ if (needs_trailing_tracket)
+ constructor_op += ")";
}
else if (swizzle_splat && !composite)
{
- constructor_op = remap_swizzle(get<SPIRType>(result_type), 1, to_expression(elems[0]));
+ constructor_op = remap_swizzle(get<SPIRType>(result_type), 1, to_unpacked_expression(elems[0]));
}
else
{
@@ -8280,7 +8371,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
if (type_is_empty(out_type) && !backend.supports_empty_struct)
constructor_op += "0";
else if (splat)
- constructor_op += to_expression(elems[0]);
+ constructor_op += to_unpacked_expression(elems[0]);
else
constructor_op += build_composite_combiner(result_type, elems, length);
constructor_op += ")";
@@ -8838,7 +8929,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
auto &type = get<SPIRType>(result_type);
if (type.vecsize > 1)
- emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "||");
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "||", false, SPIRType::Unknown);
else
GLSL_BOP(||);
break;
@@ -8852,7 +8943,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
auto &type = get<SPIRType>(result_type);
if (type.vecsize > 1)
- emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "&&");
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "&&", false, SPIRType::Unknown);
else
GLSL_BOP(&&);
break;
@@ -8909,7 +9000,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
case OpUGreaterThan:
case OpSGreaterThan:
{
- auto type = opcode == OpUGreaterThan ? SPIRType::UInt : SPIRType::Int;
+ auto type = opcode == OpUGreaterThan ? uint_type : int_type;
if (expression_type(ops[2]).vecsize > 1)
GLSL_BFOP_CAST(greaterThan, type);
else
@@ -8929,7 +9020,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
case OpUGreaterThanEqual:
case OpSGreaterThanEqual:
{
- auto type = opcode == OpUGreaterThanEqual ? SPIRType::UInt : SPIRType::Int;
+ auto type = opcode == OpUGreaterThanEqual ? uint_type : int_type;
if (expression_type(ops[2]).vecsize > 1)
GLSL_BFOP_CAST(greaterThanEqual, type);
else
@@ -8949,7 +9040,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
case OpULessThan:
case OpSLessThan:
{
- auto type = opcode == OpULessThan ? SPIRType::UInt : SPIRType::Int;
+ auto type = opcode == OpULessThan ? uint_type : int_type;
if (expression_type(ops[2]).vecsize > 1)
GLSL_BFOP_CAST(lessThan, type);
else
@@ -8969,7 +9060,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
case OpULessThanEqual:
case OpSLessThanEqual:
{
- auto type = opcode == OpULessThanEqual ? SPIRType::UInt : SPIRType::Int;
+ auto type = opcode == OpULessThanEqual ? uint_type : int_type;
if (expression_type(ops[2]).vecsize > 1)
GLSL_BFOP_CAST(lessThanEqual, type);
else
@@ -9614,11 +9705,18 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
{
uint32_t result_type = ops[0];
uint32_t id = ops[1];
- auto &e = set<SPIRExpression>(id, join(to_expression(ops[2]), ", ", to_expression(ops[3])), result_type, true);
+
+ auto coord_expr = to_expression(ops[3]);
+ auto target_coord_type = expression_type(ops[3]);
+ target_coord_type.basetype = SPIRType::Int;
+ coord_expr = bitcast_expression(target_coord_type, expression_type(ops[3]).basetype, coord_expr);
+
+ auto &e = set<SPIRExpression>(id, join(to_expression(ops[2]), ", ", coord_expr), result_type, true);
// When using the pointer, we need to know which variable it is actually loaded from.
auto *var = maybe_get_backing_variable(ops[2]);
e.loaded_from = var ? var->self : ID(0);
+ inherit_expression_dependencies(id, ops[3]);
break;
}
@@ -10073,28 +10171,98 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
break;
case OpFUnordEqual:
- GLSL_BFOP(unsupported_FUnordEqual);
- break;
-
case OpFUnordNotEqual:
- GLSL_BFOP(unsupported_FUnordNotEqual);
- break;
-
case OpFUnordLessThan:
- GLSL_BFOP(unsupported_FUnordLessThan);
- break;
-
case OpFUnordGreaterThan:
- GLSL_BFOP(unsupported_FUnordGreaterThan);
- break;
-
case OpFUnordLessThanEqual:
- GLSL_BFOP(unsupported_FUnordLessThanEqual);
- break;
-
case OpFUnordGreaterThanEqual:
- GLSL_BFOP(unsupported_FUnordGreaterThanEqual);
+ {
+ // GLSL doesn't specify if floating point comparisons are ordered or unordered,
+ // but glslang always emits ordered floating point compares for GLSL.
+ // To get unordered compares, we can test the opposite thing and invert the result.
+ // This way, we force true when there is any NaN present.
+ uint32_t op0 = ops[2];
+ uint32_t op1 = ops[3];
+
+ string expr;
+ if (expression_type(op0).vecsize > 1)
+ {
+ const char *comp_op = nullptr;
+ switch (opcode)
+ {
+ case OpFUnordEqual:
+ comp_op = "notEqual";
+ break;
+
+ case OpFUnordNotEqual:
+ comp_op = "equal";
+ break;
+
+ case OpFUnordLessThan:
+ comp_op = "greaterThanEqual";
+ break;
+
+ case OpFUnordLessThanEqual:
+ comp_op = "greaterThan";
+ break;
+
+ case OpFUnordGreaterThan:
+ comp_op = "lessThanEqual";
+ break;
+
+ case OpFUnordGreaterThanEqual:
+ comp_op = "lessThan";
+ break;
+
+ default:
+ assert(0);
+ break;
+ }
+
+ expr = join("not(", comp_op, "(", to_unpacked_expression(op0), ", ", to_unpacked_expression(op1), "))");
+ }
+ else
+ {
+ const char *comp_op = nullptr;
+ switch (opcode)
+ {
+ case OpFUnordEqual:
+ comp_op = " != ";
+ break;
+
+ case OpFUnordNotEqual:
+ comp_op = " == ";
+ break;
+
+ case OpFUnordLessThan:
+ comp_op = " >= ";
+ break;
+
+ case OpFUnordLessThanEqual:
+ comp_op = " > ";
+ break;
+
+ case OpFUnordGreaterThan:
+ comp_op = " <= ";
+ break;
+
+ case OpFUnordGreaterThanEqual:
+ comp_op = " < ";
+ break;
+
+ default:
+ assert(0);
+ break;
+ }
+
+ expr = join("!(", to_enclosed_unpacked_expression(op0), comp_op, to_enclosed_unpacked_expression(op1), ")");
+ }
+
+ emit_op(ops[0], ops[1], expr, should_forward(op0) && should_forward(op1));
+ inherit_expression_dependencies(ops[1], op0);
+ inherit_expression_dependencies(ops[1], op1);
break;
+ }
case OpReportIntersectionNV:
statement("reportIntersectionNV(", to_expression(ops[0]), ", ", to_expression(ops[1]), ");");
@@ -10228,6 +10396,12 @@ void CompilerGLSL::append_global_func_args(const SPIRFunction &func, uint32_t in
string CompilerGLSL::to_member_name(const SPIRType &type, uint32_t index)
{
+ if (type.type_alias != TypeID(0) &&
+ !has_extended_decoration(type.type_alias, SPIRVCrossDecorationBufferBlockRepacked))
+ {
+ return to_member_name(get<SPIRType>(type.type_alias), index);
+ }
+
auto &memb = ir.meta[type.self].members;
if (index < memb.size() && !memb[index].alias.empty())
return memb[index].alias;
@@ -10588,8 +10762,10 @@ string CompilerGLSL::to_array_size(const SPIRType &type, uint32_t index)
// Tessellation control and evaluation shaders must have either gl_MaxPatchVertices or unsized arrays for input arrays.
// Opt for unsized as it's the more "correct" variant to use.
- if (type.storage == StorageClassInput && (get_entry_point().model == ExecutionModelTessellationControl ||
- get_entry_point().model == ExecutionModelTessellationEvaluation))
+ if (type.storage == StorageClassInput &&
+ (get_entry_point().model == ExecutionModelTessellationControl ||
+ get_entry_point().model == ExecutionModelTessellationEvaluation) &&
+ index == uint32_t(type.array.size() - 1))
return "";
auto &size = type.array[index];
@@ -10758,7 +10934,7 @@ string CompilerGLSL::image_type_glsl(const SPIRType &type, uint32_t id)
string CompilerGLSL::type_to_glsl_constructor(const SPIRType &type)
{
- if (type.array.size() > 1)
+ if (backend.use_array_constructor && type.array.size() > 1)
{
if (options.flatten_multidimensional_arrays)
SPIRV_CROSS_THROW("Cannot flatten constructors of multidimensional array constructors, e.g. float[][]().");
@@ -10769,8 +10945,11 @@ string CompilerGLSL::type_to_glsl_constructor(const SPIRType &type)
}
auto e = type_to_glsl(type);
- for (uint32_t i = 0; i < type.array.size(); i++)
- e += "[]";
+ if (backend.use_array_constructor)
+ {
+ for (uint32_t i = 0; i < type.array.size(); i++)
+ e += "[]";
+ }
return e;
}
@@ -11009,6 +11188,11 @@ void CompilerGLSL::flatten_buffer_block(VariableID id)
flattened_buffer_blocks.insert(id);
}
+bool CompilerGLSL::builtin_translates_to_nonarray(spv::BuiltIn /*builtin*/) const
+{
+ return false; // GLSL itself does not need to translate array builtin types to non-array builtin types
+}
+
bool CompilerGLSL::check_atomic_image(uint32_t id)
{
auto &type = expression_type(id);
@@ -11198,14 +11382,6 @@ void CompilerGLSL::emit_function(SPIRFunction &func, const Bitset &return_flags)
current_function = &func;
auto &entry_block = get<SPIRBlock>(func.entry_block);
- sort(begin(func.constant_arrays_needed_on_stack), end(func.constant_arrays_needed_on_stack));
- for (auto &array : func.constant_arrays_needed_on_stack)
- {
- auto &c = get<SPIRConstant>(array);
- auto &type = get<SPIRType>(c.constant_type);
- statement(variable_decl(type, join("_", array, "_array_copy")), " = ", constant_expression(c), ";");
- }
-
for (auto &v : func.local_variables)
{
auto &var = get<SPIRVariable>(v);
@@ -12591,14 +12767,14 @@ void CompilerGLSL::unroll_array_from_complex_load(uint32_t target_id, uint32_t s
auto new_expr = join("_", target_id, "_unrolled");
statement(variable_decl(type, new_expr, target_id), ";");
string array_expr;
- if (type.array_size_literal.front())
+ if (type.array_size_literal.back())
{
- array_expr = convert_to_string(type.array.front());
- if (type.array.front() == 0)
+ array_expr = convert_to_string(type.array.back());
+ if (type.array.back() == 0)
SPIRV_CROSS_THROW("Cannot unroll an array copy from unsized array.");
}
else
- array_expr = to_expression(type.array.front());
+ array_expr = to_expression(type.array.back());
// The array size might be a specialization constant, so use a for-loop instead.
statement("for (int i = 0; i < int(", array_expr, "); i++)");
@@ -12776,6 +12952,14 @@ void CompilerGLSL::fixup_type_alias()
// This is not allowed, drop the type_alias.
type.type_alias = 0;
}
+ else if (type.type_alias && !type_is_block_like(this->get<SPIRType>(type.type_alias)))
+ {
+ // If the alias master is not a block-like type, there is no reason to use type aliasing.
+ // This case can happen if two structs are declared with the same name, but they are unrelated.
+ // Aliases are only used to deal with aliased types for structs which are used in different buffer types
+ // which all create a variant of the same struct with different DecorationOffset values.
+ type.type_alias = 0;
+ }
});
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp
index e989a7904a4..709a9abb6c1 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp
@@ -273,6 +273,8 @@ protected:
virtual std::string unpack_expression_type(std::string expr_str, const SPIRType &type, uint32_t physical_type_id,
bool packed_type, bool row_major);
+ virtual bool builtin_translates_to_nonarray(spv::BuiltIn builtin) const;
+
StringStream<> buffer;
template <typename T>
@@ -338,11 +340,12 @@ protected:
Options options;
- std::string type_to_array_glsl(const SPIRType &type);
+ virtual std::string type_to_array_glsl(
+ const SPIRType &type); // Allow Metal to use the array<T> template to make arrays a value type
std::string to_array_size(const SPIRType &type, uint32_t index);
uint32_t to_array_size_literal(const SPIRType &type, uint32_t index) const;
uint32_t to_array_size_literal(const SPIRType &type) const;
- std::string variable_decl(const SPIRVariable &variable);
+ virtual std::string variable_decl(const SPIRVariable &variable); // Threadgroup arrays can't have a wrapper type
std::string variable_decl_function_local(SPIRVariable &variable);
void add_local_variable_name(uint32_t id);
@@ -414,6 +417,7 @@ protected:
bool native_pointers = false;
bool support_small_type_sampling_result = false;
bool support_case_fallthrough = true;
+ bool use_array_constructor = false;
} backend;
void emit_struct(SPIRType &type);
@@ -471,7 +475,8 @@ protected:
void emit_unary_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op);
void emit_unrolled_unary_op(uint32_t result_type, uint32_t result_id, uint32_t operand, const char *op);
void emit_binary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op);
- void emit_unrolled_binary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op);
+ void emit_unrolled_binary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op,
+ bool negate, SPIRType::BaseType expected_type);
void emit_binary_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op,
SPIRType::BaseType input_type, bool skip_cast_if_equal_type);
@@ -487,6 +492,9 @@ protected:
SPIRExpression &emit_op(uint32_t result_type, uint32_t result_id, const std::string &rhs, bool forward_rhs,
bool suppress_usage_tracking = false);
+ void access_chain_internal_append_index(std::string &expr, uint32_t base, const SPIRType *type,
+ AccessChainFlags flags, bool &access_chain_is_arrayed, uint32_t index);
+
std::string access_chain_internal(uint32_t base, const uint32_t *indices, uint32_t count, AccessChainFlags flags,
AccessChainMeta *meta);
@@ -585,6 +593,9 @@ protected:
std::unordered_set<uint32_t> emitted_functions;
+ // Ensure that we declare phi-variable copies even if the original declaration isn't deferred
+ std::unordered_set<uint32_t> flushed_phi_variables;
+
std::unordered_set<uint32_t> flattened_buffer_blocks;
std::unordered_set<uint32_t> flattened_structs;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp
index 1946096e13a..5045d2ea8b5 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp
@@ -4032,6 +4032,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
// If we need to do implicit bitcasts, make sure we do it with the correct type.
uint32_t integer_width = get_integer_width_for_instruction(instruction);
auto int_type = to_signed_basetype(integer_width);
+ auto uint_type = to_unsigned_basetype(integer_width);
switch (opcode)
{
@@ -4194,7 +4195,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
auto id = ops[1];
if (expression_type(ops[2]).vecsize > 1)
- emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "==");
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "==", false, SPIRType::Unknown);
else
HLSL_BOP_CAST(==, int_type);
break;
@@ -4202,12 +4203,19 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
case OpLogicalEqual:
case OpFOrdEqual:
+ case OpFUnordEqual:
{
+ // HLSL != operator is unordered.
+ // https://docs.microsoft.com/en-us/windows/win32/direct3d10/d3d10-graphics-programming-guide-resources-float-rules.
+ // isnan() is apparently implemented as x != x as well.
+ // We cannot implement UnordEqual as !(OrdNotEqual), as HLSL cannot express OrdNotEqual.
+ // HACK: FUnordEqual will be implemented as FOrdEqual.
+
auto result_type = ops[0];
auto id = ops[1];
if (expression_type(ops[2]).vecsize > 1)
- emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "==");
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "==", false, SPIRType::Unknown);
else
HLSL_BOP(==);
break;
@@ -4219,7 +4227,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
auto id = ops[1];
if (expression_type(ops[2]).vecsize > 1)
- emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "!=");
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "!=", false, SPIRType::Unknown);
else
HLSL_BOP_CAST(!=, int_type);
break;
@@ -4227,12 +4235,23 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
case OpLogicalNotEqual:
case OpFOrdNotEqual:
+ case OpFUnordNotEqual:
{
+ // HLSL != operator is unordered.
+ // https://docs.microsoft.com/en-us/windows/win32/direct3d10/d3d10-graphics-programming-guide-resources-float-rules.
+ // isnan() is apparently implemented as x != x as well.
+
+ // FIXME: FOrdNotEqual cannot be implemented in a crisp and simple way here.
+ // We would need to do something like not(UnordEqual), but that cannot be expressed either.
+ // Adding a lot of NaN checks would be a breaking change from perspective of performance.
+ // SPIR-V will generally use isnan() checks when this even matters.
+ // HACK: FOrdNotEqual will be implemented as FUnordEqual.
+
auto result_type = ops[0];
auto id = ops[1];
if (expression_type(ops[2]).vecsize > 1)
- emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "!=");
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "!=", false, SPIRType::Unknown);
else
HLSL_BOP(!=);
break;
@@ -4243,10 +4262,10 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
{
auto result_type = ops[0];
auto id = ops[1];
- auto type = opcode == OpUGreaterThan ? SPIRType::UInt : SPIRType::Int;
+ auto type = opcode == OpUGreaterThan ? uint_type : int_type;
if (expression_type(ops[2]).vecsize > 1)
- emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">");
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">", false, type);
else
HLSL_BOP_CAST(>, type);
break;
@@ -4258,21 +4277,33 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
auto id = ops[1];
if (expression_type(ops[2]).vecsize > 1)
- emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">");
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">", false, SPIRType::Unknown);
else
HLSL_BOP(>);
break;
}
+ case OpFUnordGreaterThan:
+ {
+ auto result_type = ops[0];
+ auto id = ops[1];
+
+ if (expression_type(ops[2]).vecsize > 1)
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<=", true, SPIRType::Unknown);
+ else
+ CompilerGLSL::emit_instruction(instruction);
+ break;
+ }
+
case OpUGreaterThanEqual:
case OpSGreaterThanEqual:
{
auto result_type = ops[0];
auto id = ops[1];
- auto type = opcode == OpUGreaterThanEqual ? SPIRType::UInt : SPIRType::Int;
+ auto type = opcode == OpUGreaterThanEqual ? uint_type : int_type;
if (expression_type(ops[2]).vecsize > 1)
- emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">=");
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">=", false, type);
else
HLSL_BOP_CAST(>=, type);
break;
@@ -4284,21 +4315,33 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
auto id = ops[1];
if (expression_type(ops[2]).vecsize > 1)
- emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">=");
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">=", false, SPIRType::Unknown);
else
HLSL_BOP(>=);
break;
}
+ case OpFUnordGreaterThanEqual:
+ {
+ auto result_type = ops[0];
+ auto id = ops[1];
+
+ if (expression_type(ops[2]).vecsize > 1)
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<", true, SPIRType::Unknown);
+ else
+ CompilerGLSL::emit_instruction(instruction);
+ break;
+ }
+
case OpULessThan:
case OpSLessThan:
{
auto result_type = ops[0];
auto id = ops[1];
- auto type = opcode == OpULessThan ? SPIRType::UInt : SPIRType::Int;
+ auto type = opcode == OpULessThan ? uint_type : int_type;
if (expression_type(ops[2]).vecsize > 1)
- emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<");
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<", false, type);
else
HLSL_BOP_CAST(<, type);
break;
@@ -4310,21 +4353,33 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
auto id = ops[1];
if (expression_type(ops[2]).vecsize > 1)
- emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<");
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<", false, SPIRType::Unknown);
else
HLSL_BOP(<);
break;
}
+ case OpFUnordLessThan:
+ {
+ auto result_type = ops[0];
+ auto id = ops[1];
+
+ if (expression_type(ops[2]).vecsize > 1)
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">=", true, SPIRType::Unknown);
+ else
+ CompilerGLSL::emit_instruction(instruction);
+ break;
+ }
+
case OpULessThanEqual:
case OpSLessThanEqual:
{
auto result_type = ops[0];
auto id = ops[1];
- auto type = opcode == OpULessThanEqual ? SPIRType::UInt : SPIRType::Int;
+ auto type = opcode == OpULessThanEqual ? uint_type : int_type;
if (expression_type(ops[2]).vecsize > 1)
- emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<=");
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<=", false, type);
else
HLSL_BOP_CAST(<=, type);
break;
@@ -4336,12 +4391,24 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
auto id = ops[1];
if (expression_type(ops[2]).vecsize > 1)
- emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<=");
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<=", false, SPIRType::Unknown);
else
HLSL_BOP(<=);
break;
}
+ case OpFUnordLessThanEqual:
+ {
+ auto result_type = ops[0];
+ auto id = ops[1];
+
+ if (expression_type(ops[2]).vecsize > 1)
+ emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">", true, SPIRType::Unknown);
+ else
+ CompilerGLSL::emit_instruction(instruction);
+ break;
+ }
+
case OpImageQueryLod:
emit_texture_op(instruction);
break;
@@ -4495,6 +4562,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
// When using the pointer, we need to know which variable it is actually loaded from.
auto *var = maybe_get_backing_variable(ops[2]);
e.loaded_from = var ? var->self : ID(0);
+ inherit_expression_dependencies(id, ops[3]);
break;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.cpp
index fa603a74369..bc79e55bec0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.cpp
@@ -27,6 +27,7 @@ using namespace std;
static const uint32_t k_unknown_location = ~0u;
static const uint32_t k_unknown_component = ~0u;
+static const char *force_inline = "static inline __attribute__((always_inline))";
CompilerMSL::CompilerMSL(std::vector<uint32_t> spirv_)
: CompilerGLSL(move(spirv_))
@@ -73,6 +74,17 @@ void CompilerMSL::add_discrete_descriptor_set(uint32_t desc_set)
argument_buffer_discrete_mask |= 1u << desc_set;
}
+void CompilerMSL::set_argument_buffer_device_address_space(uint32_t desc_set, bool device_storage)
+{
+ if (desc_set < kMaxArgumentBuffers)
+ {
+ if (device_storage)
+ argument_buffer_device_storage_mask |= 1u << desc_set;
+ else
+ argument_buffer_device_storage_mask &= ~(1u << desc_set);
+ }
+}
+
bool CompilerMSL::is_msl_vertex_attribute_used(uint32_t location)
{
return vtx_attrs_in_use.count(location) != 0;
@@ -110,6 +122,11 @@ void CompilerMSL::set_fragment_output_components(uint32_t location, uint32_t com
fragment_output_components[location] = components;
}
+bool CompilerMSL::builtin_translates_to_nonarray(spv::BuiltIn builtin) const
+{
+ return (builtin == BuiltInSampleMask);
+}
+
void CompilerMSL::build_implicit_builtins()
{
bool need_sample_pos = active_input_builtins.get(BuiltInSamplePosition);
@@ -146,8 +163,10 @@ void CompilerMSL::build_implicit_builtins()
if (var.storage != StorageClassInput || !ir.meta[var.self].decoration.builtin)
return;
+ // Use Metal's native frame-buffer fetch API for subpass inputs.
BuiltIn builtin = ir.meta[var.self].decoration.builtin_type;
- if (need_subpass_input && builtin == BuiltInFragCoord)
+ if (need_subpass_input && (!msl_options.is_ios() || !msl_options.ios_use_framebuffer_fetch_subpasses) &&
+ builtin == BuiltInFragCoord)
{
builtin_frag_coord_id = var.self;
has_frag_coord = true;
@@ -215,17 +234,19 @@ void CompilerMSL::build_implicit_builtins()
if (need_multiview)
{
- if (builtin == BuiltInInstanceIndex)
+ switch (builtin)
{
+ case BuiltInInstanceIndex:
// The view index here is derived from the instance index.
builtin_instance_idx_id = var.self;
has_instance_idx = true;
- }
-
- if (builtin == BuiltInViewIndex)
- {
+ break;
+ case BuiltInViewIndex:
builtin_view_idx_id = var.self;
has_view_idx = true;
+ break;
+ default:
+ break;
}
}
@@ -237,7 +258,9 @@ void CompilerMSL::build_implicit_builtins()
workgroup_id_type = var.basetype;
});
- if (!has_frag_coord && need_subpass_input)
+ // Use Metal's native frame-buffer fetch API for subpass inputs.
+ if (!has_frag_coord && (!msl_options.is_ios() || !msl_options.ios_use_framebuffer_fetch_subpasses) &&
+ need_subpass_input)
{
uint32_t offset = ir.increase_bound_by(3);
uint32_t type_id = offset;
@@ -568,6 +591,35 @@ void CompilerMSL::build_implicit_builtins()
}
}
+// Checks if the specified builtin variable (e.g. gl_InstanceIndex) is marked as active.
+// If not, it marks it as active and forces a recompilation.
+// This might be used when the optimization of inactive builtins was too optimistic (e.g. when "spvOut" is emitted).
+void CompilerMSL::ensure_builtin(spv::StorageClass storage, spv::BuiltIn builtin)
+{
+ Bitset *active_builtins = nullptr;
+ switch (storage)
+ {
+ case StorageClassInput:
+ active_builtins = &active_input_builtins;
+ break;
+
+ case StorageClassOutput:
+ active_builtins = &active_output_builtins;
+ break;
+
+ default:
+ break;
+ }
+
+ // At this point, the specified builtin variable must have already been declared in the entry point.
+ // If not, mark as active and force recompile.
+ if (active_builtins != nullptr && !active_builtins->get(builtin))
+ {
+ active_builtins->set(builtin);
+ force_recompile();
+ }
+}
+
void CompilerMSL::mark_implicit_builtin(StorageClass storage, BuiltIn builtin, uint32_t id)
{
Bitset *active_builtins = nullptr;
@@ -674,6 +726,8 @@ std::string CompilerMSL::get_tess_factor_struct_name()
void CompilerMSL::emit_entry_point_declarations()
{
// FIXME: Get test coverage here ...
+ // Constant arrays of non-primitive types (i.e. matrices) won't link properly into Metal libraries
+ declare_complex_constant_arrays();
// Emit constexpr samplers here.
for (auto &samp : constexpr_samplers_by_id)
@@ -830,8 +884,10 @@ void CompilerMSL::emit_entry_point_declarations()
SPIRV_CROSS_THROW("Runtime arrays with dynamic offsets are not supported yet.");
else
{
+ use_builtin_array = true;
statement(get_argument_address_space(var), " ", type_to_glsl(type), "* ", to_restrict(var_id), name,
type_to_array_glsl(type), " =");
+
uint32_t dim = uint32_t(type.array.size());
uint32_t j = 0;
for (SmallVector<uint32_t> indices(type.array.size());
@@ -859,6 +915,7 @@ void CompilerMSL::emit_entry_point_declarations()
}
end_scope_decl();
statement_no_indent("");
+ use_builtin_array = false;
}
}
else
@@ -875,8 +932,10 @@ void CompilerMSL::emit_entry_point_declarations()
{
const auto &var = get<SPIRVariable>(array_id);
const auto &type = get_variable_data_type(var);
+ const auto &buffer_type = get_variable_element_type(var);
string name = to_name(array_id);
- statement(get_argument_address_space(var), " ", type_to_glsl(type), "* ", to_restrict(array_id), name, "[] =");
+ statement(get_argument_address_space(var), " ", type_to_glsl(buffer_type), "* ", to_restrict(array_id), name,
+ "[] =");
begin_scope();
for (uint32_t i = 0; i < to_array_size_literal(type); ++i)
statement(name, "_", i, ",");
@@ -914,13 +973,14 @@ string CompilerMSL::compile()
backend.native_row_major_matrix = false;
backend.unsized_array_supported = false;
backend.can_declare_arrays_inline = false;
- backend.can_return_array = false;
+ backend.can_return_array = true; // <-- Allow Metal to use the array<T> template
backend.allow_truncated_access_chain = true;
- backend.array_is_value_type = false;
+ backend.array_is_value_type = true; // <-- Allow Metal to use the array<T> template to make arrays a value type
backend.comparison_image_samples_scalar = true;
backend.native_pointers = true;
backend.nonuniform_qualifier = "";
backend.support_small_type_sampling_result = true;
+ backend.supports_empty_struct = true;
capture_output_to_buffer = msl_options.capture_output_to_buffer;
is_rasterization_disabled = msl_options.disable_rasterization || capture_output_to_buffer;
@@ -1014,6 +1074,7 @@ string CompilerMSL::compile()
buffer.reset();
emit_header();
+ emit_custom_templates();
emit_specialization_constants_and_structs();
emit_resources();
emit_custom_functions();
@@ -1142,8 +1203,10 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std::
if (global_var_ids.find(base_id) != global_var_ids.end())
added_arg_ids.insert(base_id);
+ // Use Metal's native frame-buffer fetch API for subpass inputs.
auto &type = get<SPIRType>(ops[0]);
- if (type.basetype == SPIRType::Image && type.image.dim == DimSubpassData)
+ if (type.basetype == SPIRType::Image && type.image.dim == DimSubpassData &&
+ (!msl_options.is_ios() || !msl_options.ios_use_framebuffer_fetch_subpasses))
{
// Implicitly reads gl_FragCoord.
assert(builtin_frag_coord_id != 0);
@@ -1191,6 +1254,20 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std::
break;
}
+ // Emulate texture2D atomic operations
+ case OpImageTexelPointer:
+ {
+ // When using the pointer, we need to know which variable it is actually loaded from.
+ uint32_t base_id = ops[2];
+ auto *var = maybe_get_backing_variable(base_id);
+ if (var && atomic_image_vars.count(var->self))
+ {
+ if (global_var_ids.find(base_id) != global_var_ids.end())
+ added_arg_ids.insert(base_id);
+ }
+ break;
+ }
+
default:
break;
}
@@ -1534,10 +1611,13 @@ void CompilerMSL::add_composite_variable_to_interface_block(StorageClass storage
if (is_builtin)
set_name(var.self, builtin_to_glsl(builtin, StorageClassFunction));
- entry_func.add_local_variable(var.self);
-
- // We need to declare the variable early and at entry-point scope.
- vars_needing_early_declaration.push_back(var.self);
+ // Only flatten/unflatten IO composites for non-tessellation cases where arrays are not stripped.
+ if (!strip_array)
+ {
+ entry_func.add_local_variable(var.self);
+ // We need to declare the variable early and at entry-point scope.
+ vars_needing_early_declaration.push_back(var.self);
+ }
for (uint32_t i = 0; i < elem_cnt; i++)
{
@@ -1607,6 +1687,7 @@ void CompilerMSL::add_composite_variable_to_interface_block(StorageClass storage
set_extended_member_decoration(ib_type.self, ib_mbr_idx, SPIRVCrossDecorationInterfaceOrigID, var.self);
+ // Only flatten/unflatten IO composites for non-tessellation cases where arrays are not stripped.
if (!strip_array)
{
switch (storage)
@@ -2114,60 +2195,37 @@ void CompilerMSL::add_variable_to_interface_block(StorageClass storage, const st
void CompilerMSL::fix_up_interface_member_indices(StorageClass storage, uint32_t ib_type_id)
{
// Only needed for tessellation shaders.
+ // Need to redirect interface indices back to variables themselves.
+ // For structs, each member of the struct need a separate instance.
if (get_execution_model() != ExecutionModelTessellationControl &&
!(get_execution_model() == ExecutionModelTessellationEvaluation && storage == StorageClassInput))
return;
- bool in_array = false;
- for (uint32_t i = 0; i < ir.meta[ib_type_id].members.size(); i++)
+ auto mbr_cnt = uint32_t(ir.meta[ib_type_id].members.size());
+ for (uint32_t i = 0; i < mbr_cnt; i++)
{
uint32_t var_id = get_extended_member_decoration(ib_type_id, i, SPIRVCrossDecorationInterfaceOrigID);
if (!var_id)
continue;
auto &var = get<SPIRVariable>(var_id);
- // Unfortunately, all this complexity is needed to handle flattened structs and/or
- // arrays.
- if (storage == StorageClassInput)
+ auto &type = get_variable_element_type(var);
+ if (storage == StorageClassInput && type.basetype == SPIRType::Struct)
{
- auto &type = get_variable_element_type(var);
- if (is_array(type) || is_matrix(type))
- {
- if (in_array)
- continue;
- in_array = true;
- set_extended_decoration(var_id, SPIRVCrossDecorationInterfaceMemberIndex, i);
- }
- else
- {
- if (type.basetype == SPIRType::Struct)
- {
- uint32_t mbr_idx =
- get_extended_member_decoration(ib_type_id, i, SPIRVCrossDecorationInterfaceMemberIndex);
- auto &mbr_type = get<SPIRType>(type.member_types[mbr_idx]);
+ uint32_t mbr_idx = get_extended_member_decoration(ib_type_id, i, SPIRVCrossDecorationInterfaceMemberIndex);
- if (is_array(mbr_type) || is_matrix(mbr_type))
- {
- if (in_array)
- continue;
- in_array = true;
- set_extended_member_decoration(var_id, mbr_idx, SPIRVCrossDecorationInterfaceMemberIndex, i);
- }
- else
- {
- in_array = false;
- set_extended_member_decoration(var_id, mbr_idx, SPIRVCrossDecorationInterfaceMemberIndex, i);
- }
- }
- else
- {
- in_array = false;
- set_extended_decoration(var_id, SPIRVCrossDecorationInterfaceMemberIndex, i);
- }
- }
+ // Only set the lowest InterfaceMemberIndex for each variable member.
+ // IB struct members will be emitted in-order w.r.t. interface member index.
+ if (!has_extended_member_decoration(var_id, mbr_idx, SPIRVCrossDecorationInterfaceMemberIndex))
+ set_extended_member_decoration(var_id, mbr_idx, SPIRVCrossDecorationInterfaceMemberIndex, i);
}
else
- set_extended_decoration(var_id, SPIRVCrossDecorationInterfaceMemberIndex, i);
+ {
+ // Only set the lowest InterfaceMemberIndex for each variable.
+ // IB struct members will be emitted in-order w.r.t. interface member index.
+ if (!has_extended_decoration(var_id, SPIRVCrossDecorationInterfaceMemberIndex))
+ set_extended_decoration(var_id, SPIRVCrossDecorationInterfaceMemberIndex, i);
+ }
}
}
@@ -2303,11 +2361,21 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch)
{
// The first member of the indirect buffer is always the number of vertices
// to draw.
- statement("device ", to_name(ir.default_entry_point), "_", ib_var_ref, "& ", ib_var_ref, " = ",
- output_buffer_var_name, "[(", to_expression(builtin_instance_idx_id), " - ",
- to_expression(builtin_base_instance_id), ") * spvIndirectParams[0] + ",
- to_expression(builtin_vertex_idx_id), " - ", to_expression(builtin_base_vertex_id),
- "];");
+ // We zero-base the InstanceID & VertexID variables for HLSL emulation elsewhere, so don't do it twice
+ if (msl_options.enable_base_index_zero)
+ {
+ statement("device ", to_name(ir.default_entry_point), "_", ib_var_ref, "& ", ib_var_ref,
+ " = ", output_buffer_var_name, "[", to_expression(builtin_instance_idx_id),
+ " * spvIndirectParams[0] + ", to_expression(builtin_vertex_idx_id), "];");
+ }
+ else
+ {
+ statement("device ", to_name(ir.default_entry_point), "_", ib_var_ref, "& ", ib_var_ref,
+ " = ", output_buffer_var_name, "[(", to_expression(builtin_instance_idx_id),
+ " - ", to_expression(builtin_base_instance_id), ") * spvIndirectParams[0] + ",
+ to_expression(builtin_vertex_idx_id), " - ",
+ to_expression(builtin_base_vertex_id), "];");
+ }
}
});
break;
@@ -3097,6 +3165,14 @@ void CompilerMSL::emit_store_statement(uint32_t lhs_expression, uint32_t rhs_exp
}
}
+static bool expression_ends_with(const string &expr_str, const std::string &ending)
+{
+ if (expr_str.length() >= ending.length())
+ return (expr_str.compare(expr_str.length() - ending.length(), ending.length(), ending) == 0);
+ else
+ return false;
+}
+
// Converts the format of the current expression from packed to unpacked,
// by wrapping the expression in a constructor of the appropriate type.
// Also, handle special physical ID remapping scenarios, similar to emit_store_statement().
@@ -3118,7 +3194,8 @@ string CompilerMSL::unpack_expression_type(string expr_str, const SPIRType &type
};
// std140 array cases for vectors.
- if (physical_type && is_vector(*physical_type) && is_array(*physical_type) && physical_type->vecsize > type.vecsize)
+ if (physical_type && is_vector(*physical_type) && is_array(*physical_type) &&
+ physical_type->vecsize > type.vecsize && !expression_ends_with(expr_str, swizzle_lut[type.vecsize - 1]))
{
assert(type.vecsize >= 1 && type.vecsize <= 3);
return enclose_expression(expr_str) + swizzle_lut[type.vecsize - 1];
@@ -3161,7 +3238,14 @@ string CompilerMSL::unpack_expression_type(string expr_str, const SPIRType &type
return unpack_expr;
}
else
- return join(type_to_glsl(type), "(", expr_str, ")");
+ {
+ // Don't expose "spvUnsafeArray" when unpacking expressions,
+ // the input "type" will be the unpacked type and might also appear in l-value expressions
+ use_builtin_array = true;
+ string unpack_expr = join(type_to_glsl(type), "(", expr_str, ")");
+ use_builtin_array = false;
+ return unpack_expr;
+ }
}
// Emits the file header info
@@ -3170,6 +3254,11 @@ void CompilerMSL::emit_header()
// This particular line can be overridden during compilation, so make it a flag and not a pragma line.
if (suppress_missing_prototypes)
statement("#pragma clang diagnostic ignored \"-Wmissing-prototypes\"");
+
+ // Disable warning about missing braces for array<T> template to make arrays a value type
+ if (spv_function_implementations.count(SPVFuncImplUnsafeArray) != 0)
+ statement("#pragma clang diagnostic ignored \"-Wmissing-braces\"");
+
for (auto &pragma : pragma_lines)
statement(pragma);
@@ -3207,7 +3296,63 @@ void CompilerMSL::add_typedef_line(const string &line)
force_recompile();
}
+// Template struct like spvUnsafeArray<> need to be declared *before* any resources are declared
+void CompilerMSL::emit_custom_templates()
+{
+ for (const auto &spv_func : spv_function_implementations)
+ {
+ switch (spv_func)
+ {
+ case SPVFuncImplUnsafeArray:
+ statement("template<typename T, size_t Num>");
+ statement("struct spvUnsafeArray");
+ begin_scope();
+ statement("T elements[Num ? Num : 1];");
+ statement("");
+ statement("thread T& operator [] (size_t pos) thread");
+ begin_scope();
+ statement("return elements[pos];");
+ end_scope();
+ statement("constexpr const thread T& operator [] (size_t pos) const thread");
+ begin_scope();
+ statement("return elements[pos];");
+ end_scope();
+ statement("");
+ statement("device T& operator [] (size_t pos) device");
+ begin_scope();
+ statement("return elements[pos];");
+ end_scope();
+ statement("constexpr const device T& operator [] (size_t pos) const device");
+ begin_scope();
+ statement("return elements[pos];");
+ end_scope();
+ statement("");
+ statement("constexpr const constant T& operator [] (size_t pos) const constant");
+ begin_scope();
+ statement("return elements[pos];");
+ end_scope();
+ statement("");
+ statement("threadgroup T& operator [] (size_t pos) threadgroup");
+ begin_scope();
+ statement("return elements[pos];");
+ end_scope();
+ statement("constexpr const threadgroup T& operator [] (size_t pos) const threadgroup");
+ begin_scope();
+ statement("return elements[pos];");
+ end_scope();
+ end_scope_decl();
+ statement("");
+ break;
+
+ default:
+ break;
+ }
+ }
+}
+
// Emits any needed custom function bodies.
+// Metal helper functions must be static force-inline, i.e. static inline __attribute__((always_inline))
+// otherwise they will cause problems when linked together in a single Metallib.
void CompilerMSL::emit_custom_functions()
{
for (uint32_t i = SPVFuncImplArrayCopyMultidimMax; i >= 2; i--)
@@ -3247,7 +3392,7 @@ void CompilerMSL::emit_custom_functions()
spv_function_implementations.insert(SPVFuncImplGetSwizzle);
}
- for (auto &spv_func : spv_function_implementations)
+ for (const auto &spv_func : spv_function_implementations)
{
switch (spv_func)
{
@@ -3379,32 +3524,159 @@ void CompilerMSL::emit_custom_functions()
end_scope();
statement("");
}
-
break;
}
+ // Support for Metal 2.1's new texture_buffer type.
case SPVFuncImplTexelBufferCoords:
{
- string tex_width_str = convert_to_string(msl_options.texel_buffer_texture_width);
- statement("// Returns 2D texture coords corresponding to 1D texel buffer coords");
- statement("inline uint2 spvTexelBufferCoord(uint tc)");
+ if (msl_options.texel_buffer_texture_width > 0)
+ {
+ string tex_width_str = convert_to_string(msl_options.texel_buffer_texture_width);
+ statement("// Returns 2D texture coords corresponding to 1D texel buffer coords");
+ statement(force_inline);
+ statement("uint2 spvTexelBufferCoord(uint tc)");
+ begin_scope();
+ statement(join("return uint2(tc % ", tex_width_str, ", tc / ", tex_width_str, ");"));
+ end_scope();
+ statement("");
+ }
+ else
+ {
+ statement("// Returns 2D texture coords corresponding to 1D texel buffer coords");
+ statement(
+ "#define spvTexelBufferCoord(tc, tex) uint2((tc) % (tex).get_width(), (tc) / (tex).get_width())");
+ statement("");
+ }
+ break;
+ }
+
+ // Emulate texture2D atomic operations
+ case SPVFuncImplImage2DAtomicCoords:
+ {
+ statement("// Returns buffer coords corresponding to 2D texture coords for emulating 2D texture atomics");
+ statement("#define spvImage2DAtomicCoord(tc, tex) (((tex).get_width() * (tc).x) + (tc).y)");
+ statement("");
+ break;
+ }
+
+ // "fadd" intrinsic support
+ case SPVFuncImplFAdd:
+ statement("template<typename T>");
+ statement("T spvFAdd(T l, T r)");
begin_scope();
- statement(join("return uint2(tc % ", tex_width_str, ", tc / ", tex_width_str, ");"));
+ statement("return fma(T(1), l, r);");
+ end_scope();
+ statement("");
+ break;
+
+ // "fmul' intrinsic support
+ case SPVFuncImplFMul:
+ statement("template<typename T>");
+ statement("T spvFMul(T l, T r)");
+ begin_scope();
+ statement("return fma(l, r, T(0));");
+ end_scope();
+ statement("");
+
+ statement("template<typename T, int Cols, int Rows>");
+ statement("vec<T, Cols> spvFMulVectorMatrix(vec<T, Rows> v, matrix<T, Cols, Rows> m)");
+ begin_scope();
+ statement("vec<T, Cols> res = vec<T, Cols>(0);");
+ statement("for (uint i = Rows; i > 0; --i)");
+ begin_scope();
+ statement("vec<T, Cols> tmp(0);");
+ statement("for (uint j = 0; j < Cols; ++j)");
+ begin_scope();
+ statement("tmp[j] = m[j][i - 1];");
+ end_scope();
+ statement("res = fma(tmp, vec<T, Cols>(v[i - 1]), res);");
+ end_scope();
+ statement("return res;");
+ end_scope();
+ statement("");
+
+ statement("template<typename T, int Cols, int Rows>");
+ statement("vec<T, Rows> spvFMulMatrixVector(matrix<T, Cols, Rows> m, vec<T, Cols> v)");
+ begin_scope();
+ statement("vec<T, Rows> res = vec<T, Rows>(0);");
+ statement("for (uint i = Cols; i > 0; --i)");
+ begin_scope();
+ statement("res = fma(m[i - 1], vec<T, Rows>(v[i - 1]), res);");
+ end_scope();
+ statement("return res;");
+ end_scope();
+ statement("");
+
+ statement("template<typename T, int LCols, int LRows, int RCols, int RRows>");
+ statement(
+ "matrix<T, RCols, LRows> spvFMulMatrixMatrix(matrix<T, LCols, LRows> l, matrix<T, RCols, RRows> r)");
+ begin_scope();
+ statement("matrix<T, RCols, LRows> res;");
+ statement("for (uint i = 0; i < RCols; i++)");
+ begin_scope();
+ statement("vec<T, RCols> tmp(0);");
+ statement("for (uint j = 0; j < LCols; j++)");
+ begin_scope();
+ statement("tmp = fma(vec<T, RCols>(r[i][j]), l[j], tmp);");
+ end_scope();
+ statement("res[i] = tmp;");
+ end_scope();
+ statement("return res;");
+ end_scope();
+ statement("");
+ break;
+
+ // Emulate texturecube_array with texture2d_array for iOS where this type is not available
+ case SPVFuncImplCubemapTo2DArrayFace:
+ statement(force_inline);
+ statement("float3 spvCubemapTo2DArrayFace(float3 P)");
+ begin_scope();
+ statement("float3 Coords = abs(P.xyz);");
+ statement("float CubeFace = 0;");
+ statement("float ProjectionAxis = 0;");
+ statement("float u = 0;");
+ statement("float v = 0;");
+ statement("if (Coords.x >= Coords.y && Coords.x >= Coords.z)");
+ begin_scope();
+ statement("CubeFace = P.x >= 0 ? 0 : 1;");
+ statement("ProjectionAxis = Coords.x;");
+ statement("u = P.x >= 0 ? -P.z : P.z;");
+ statement("v = -P.y;");
+ end_scope();
+ statement("else if (Coords.y >= Coords.x && Coords.y >= Coords.z)");
+ begin_scope();
+ statement("CubeFace = P.y >= 0 ? 2 : 3;");
+ statement("ProjectionAxis = Coords.y;");
+ statement("u = P.x;");
+ statement("v = P.y >= 0 ? P.z : -P.z;");
+ end_scope();
+ statement("else");
+ begin_scope();
+ statement("CubeFace = P.z >= 0 ? 4 : 5;");
+ statement("ProjectionAxis = Coords.z;");
+ statement("u = P.z >= 0 ? P.x : -P.x;");
+ statement("v = -P.y;");
+ end_scope();
+ statement("u = 0.5 * (u/ProjectionAxis + 1);");
+ statement("v = 0.5 * (v/ProjectionAxis + 1);");
+ statement("return float3(u, v, CubeFace);");
end_scope();
statement("");
break;
- }
case SPVFuncImplInverse4x4:
statement("// Returns the determinant of a 2x2 matrix.");
- statement("inline float spvDet2x2(float a1, float a2, float b1, float b2)");
+ statement(force_inline);
+ statement("float spvDet2x2(float a1, float a2, float b1, float b2)");
begin_scope();
statement("return a1 * b2 - b1 * a2;");
end_scope();
statement("");
statement("// Returns the determinant of a 3x3 matrix.");
- statement("inline float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, "
+ statement(force_inline);
+ statement("float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, "
"float c2, float c3)");
begin_scope();
statement("return a1 * spvDet2x2(b2, b3, c2, c3) - b1 * spvDet2x2(a2, a3, c2, c3) + c1 * spvDet2x2(a2, a3, "
@@ -3413,7 +3685,8 @@ void CompilerMSL::emit_custom_functions()
statement("");
statement("// Returns the inverse of a matrix, by using the algorithm of calculating the classical");
statement("// adjoint and dividing by the determinant. The contents of the matrix are changed.");
- statement("inline float4x4 spvInverse4x4(float4x4 m)");
+ statement(force_inline);
+ statement("float4x4 spvInverse4x4(float4x4 m)");
begin_scope();
statement("float4x4 adj; // The adjoint matrix (inverse after dividing by determinant)");
statement_no_indent("");
@@ -3469,7 +3742,8 @@ void CompilerMSL::emit_custom_functions()
if (spv_function_implementations.count(SPVFuncImplInverse4x4) == 0)
{
statement("// Returns the determinant of a 2x2 matrix.");
- statement("inline float spvDet2x2(float a1, float a2, float b1, float b2)");
+ statement(force_inline);
+ statement("float spvDet2x2(float a1, float a2, float b1, float b2)");
begin_scope();
statement("return a1 * b2 - b1 * a2;");
end_scope();
@@ -3478,7 +3752,8 @@ void CompilerMSL::emit_custom_functions()
statement("// Returns the inverse of a matrix, by using the algorithm of calculating the classical");
statement("// adjoint and dividing by the determinant. The contents of the matrix are changed.");
- statement("inline float3x3 spvInverse3x3(float3x3 m)");
+ statement(force_inline);
+ statement("float3x3 spvInverse3x3(float3x3 m)");
begin_scope();
statement("float3x3 adj; // The adjoint matrix (inverse after dividing by determinant)");
statement_no_indent("");
@@ -3508,7 +3783,8 @@ void CompilerMSL::emit_custom_functions()
case SPVFuncImplInverse2x2:
statement("// Returns the inverse of a matrix, by using the algorithm of calculating the classical");
statement("// adjoint and dividing by the determinant. The contents of the matrix are changed.");
- statement("inline float2x2 spvInverse2x2(float2x2 m)");
+ statement(force_inline);
+ statement("float2x2 spvInverse2x2(float2x2 m)");
begin_scope();
statement("float2x2 adj; // The adjoint matrix (inverse after dividing by determinant)");
statement_no_indent("");
@@ -4519,6 +4795,8 @@ void CompilerMSL::declare_undefined_values()
void CompilerMSL::declare_constant_arrays()
{
+ bool fully_inlined = ir.ids_for_type[TypeFunction].size() == 1;
+
// MSL cannot declare arrays inline (except when declaring a variable), so we must move them out to
// global constants directly, so we are able to use constants as variable expressions.
bool emitted = false;
@@ -4528,7 +4806,11 @@ void CompilerMSL::declare_constant_arrays()
return;
auto &type = this->get<SPIRType>(c.constant_type);
- if (!type.array.empty())
+ // Constant arrays of non-primitive types (i.e. matrices) won't link properly into Metal libraries.
+ // FIXME: However, hoisting constants to main() means we need to pass down constant arrays to leaf functions if they are used there.
+ // If there are multiple functions in the module, drop this case to avoid breaking use cases which do not need to
+ // link into Metal libraries. This is hacky.
+ if (!type.array.empty() && (!fully_inlined || is_scalar(type) || is_vector(type)))
{
auto name = to_name(c.self);
statement("constant ", variable_decl(type, name), " = ", constant_expression(c), ";");
@@ -4540,6 +4822,36 @@ void CompilerMSL::declare_constant_arrays()
statement("");
}
+// Constant arrays of non-primitive types (i.e. matrices) won't link properly into Metal libraries
+void CompilerMSL::declare_complex_constant_arrays()
+{
+ // If we do not have a fully inlined module, we did not opt in to
+ // declaring constant arrays of complex types. See CompilerMSL::declare_constant_arrays().
+ bool fully_inlined = ir.ids_for_type[TypeFunction].size() == 1;
+ if (!fully_inlined)
+ return;
+
+ // MSL cannot declare arrays inline (except when declaring a variable), so we must move them out to
+ // global constants directly, so we are able to use constants as variable expressions.
+ bool emitted = false;
+
+ ir.for_each_typed_id<SPIRConstant>([&](uint32_t, SPIRConstant &c) {
+ if (c.specialization)
+ return;
+
+ auto &type = this->get<SPIRType>(c.constant_type);
+ if (!type.array.empty() && !(is_scalar(type) || is_vector(type)))
+ {
+ auto name = to_name(c.self);
+ statement("", variable_decl(type, name), " = ", constant_expression(c), ";");
+ emitted = true;
+ }
+ });
+
+ if (emitted)
+ statement("");
+}
+
void CompilerMSL::emit_resources()
{
declare_constant_arrays();
@@ -4705,15 +5017,301 @@ void CompilerMSL::emit_binary_unord_op(uint32_t result_type, uint32_t result_id,
inherit_expression_dependencies(result_id, op1);
}
+bool CompilerMSL::emit_tessellation_io_load(uint32_t result_type_id, uint32_t id, uint32_t ptr)
+{
+ auto &ptr_type = expression_type(ptr);
+ auto &result_type = get<SPIRType>(result_type_id);
+ if (ptr_type.storage != StorageClassInput && ptr_type.storage != StorageClassOutput)
+ return false;
+ if (ptr_type.storage == StorageClassOutput && get_execution_model() == ExecutionModelTessellationEvaluation)
+ return false;
+
+ bool flat_data_type = is_matrix(result_type) || is_array(result_type) || result_type.basetype == SPIRType::Struct;
+ if (!flat_data_type)
+ return false;
+
+ if (has_decoration(ptr, DecorationPatch))
+ return false;
+
+ // Now, we must unflatten a composite type and take care of interleaving array access with gl_in/gl_out.
+ // Lots of painful code duplication since we *really* should not unroll these kinds of loads in entry point fixup
+ // unless we're forced to do this when the code is emitting inoptimal OpLoads.
+ string expr;
+
+ uint32_t interface_index = get_extended_decoration(ptr, SPIRVCrossDecorationInterfaceMemberIndex);
+ auto *var = maybe_get_backing_variable(ptr);
+ bool ptr_is_io_variable = ir.ids[ptr].get_type() == TypeVariable;
+
+ const auto &iface_type = expression_type(stage_in_ptr_var_id);
+
+ if (result_type.array.size() > 2)
+ {
+ SPIRV_CROSS_THROW("Cannot load tessellation IO variables with more than 2 dimensions.");
+ }
+ else if (result_type.array.size() == 2)
+ {
+ if (!ptr_is_io_variable)
+ SPIRV_CROSS_THROW("Loading an array-of-array must be loaded directly from an IO variable.");
+ if (interface_index == uint32_t(-1))
+ SPIRV_CROSS_THROW("Interface index is unknown. Cannot continue.");
+ if (result_type.basetype == SPIRType::Struct || is_matrix(result_type))
+ SPIRV_CROSS_THROW("Cannot load array-of-array of composite type in tessellation IO.");
+
+ expr += type_to_glsl(result_type) + "({ ";
+ uint32_t num_control_points = to_array_size_literal(result_type, 1);
+ uint32_t base_interface_index = interface_index;
+
+ auto &sub_type = get<SPIRType>(result_type.parent_type);
+
+ for (uint32_t i = 0; i < num_control_points; i++)
+ {
+ expr += type_to_glsl(sub_type) + "({ ";
+ interface_index = base_interface_index;
+ uint32_t array_size = to_array_size_literal(result_type, 0);
+ for (uint32_t j = 0; j < array_size; j++, interface_index++)
+ {
+ const uint32_t indices[2] = { i, interface_index };
+
+ AccessChainMeta meta;
+ expr += access_chain_internal(stage_in_ptr_var_id, indices, 2,
+ ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_PTR_CHAIN_BIT, &meta);
+
+ if (j + 1 < array_size)
+ expr += ", ";
+ }
+ expr += " })";
+ if (i + 1 < num_control_points)
+ expr += ", ";
+ }
+ expr += " })";
+ }
+ else if (result_type.basetype == SPIRType::Struct)
+ {
+ bool is_array_of_struct = is_array(result_type);
+ if (is_array_of_struct && !ptr_is_io_variable)
+ SPIRV_CROSS_THROW("Loading array of struct from IO variable must come directly from IO variable.");
+
+ uint32_t num_control_points = 1;
+ if (is_array_of_struct)
+ {
+ num_control_points = to_array_size_literal(result_type, 0);
+ expr += type_to_glsl(result_type) + "({ ";
+ }
+
+ auto &struct_type = is_array_of_struct ? get<SPIRType>(result_type.parent_type) : result_type;
+ assert(struct_type.array.empty());
+
+ for (uint32_t i = 0; i < num_control_points; i++)
+ {
+ expr += type_to_glsl(struct_type) + "{ ";
+ for (uint32_t j = 0; j < uint32_t(struct_type.member_types.size()); j++)
+ {
+ // The base interface index is stored per variable for structs.
+ if (var)
+ {
+ interface_index =
+ get_extended_member_decoration(var->self, j, SPIRVCrossDecorationInterfaceMemberIndex);
+ }
+
+ if (interface_index == uint32_t(-1))
+ SPIRV_CROSS_THROW("Interface index is unknown. Cannot continue.");
+
+ const auto &mbr_type = get<SPIRType>(struct_type.member_types[j]);
+ if (is_matrix(mbr_type))
+ {
+ expr += type_to_glsl(mbr_type) + "(";
+ for (uint32_t k = 0; k < mbr_type.columns; k++, interface_index++)
+ {
+ if (is_array_of_struct)
+ {
+ const uint32_t indices[2] = { i, interface_index };
+ AccessChainMeta meta;
+ expr += access_chain_internal(
+ stage_in_ptr_var_id, indices, 2,
+ ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_PTR_CHAIN_BIT, &meta);
+ }
+ else
+ expr += to_expression(ptr) + "." + to_member_name(iface_type, interface_index);
+
+ if (k + 1 < mbr_type.columns)
+ expr += ", ";
+ }
+ expr += ")";
+ }
+ else if (is_array(mbr_type))
+ {
+ expr += type_to_glsl(mbr_type) + "({ ";
+ uint32_t array_size = to_array_size_literal(mbr_type, 0);
+ for (uint32_t k = 0; k < array_size; k++, interface_index++)
+ {
+ if (is_array_of_struct)
+ {
+ const uint32_t indices[2] = { i, interface_index };
+ AccessChainMeta meta;
+ expr += access_chain_internal(
+ stage_in_ptr_var_id, indices, 2,
+ ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_PTR_CHAIN_BIT, &meta);
+ }
+ else
+ expr += to_expression(ptr) + "." + to_member_name(iface_type, interface_index);
+
+ if (k + 1 < array_size)
+ expr += ", ";
+ }
+ expr += " })";
+ }
+ else
+ {
+ if (is_array_of_struct)
+ {
+ const uint32_t indices[2] = { i, interface_index };
+ AccessChainMeta meta;
+ expr += access_chain_internal(stage_in_ptr_var_id, indices, 2,
+ ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_PTR_CHAIN_BIT,
+ &meta);
+ }
+ else
+ expr += to_expression(ptr) + "." + to_member_name(iface_type, interface_index);
+ }
+
+ if (j + 1 < struct_type.member_types.size())
+ expr += ", ";
+ }
+ expr += " }";
+ if (i + 1 < num_control_points)
+ expr += ", ";
+ }
+ if (is_array_of_struct)
+ expr += " })";
+ }
+ else if (is_matrix(result_type))
+ {
+ bool is_array_of_matrix = is_array(result_type);
+ if (is_array_of_matrix && !ptr_is_io_variable)
+ SPIRV_CROSS_THROW("Loading array of matrix from IO variable must come directly from IO variable.");
+ if (interface_index == uint32_t(-1))
+ SPIRV_CROSS_THROW("Interface index is unknown. Cannot continue.");
+
+ if (is_array_of_matrix)
+ {
+ // Loading a matrix from each control point.
+ uint32_t base_interface_index = interface_index;
+ uint32_t num_control_points = to_array_size_literal(result_type, 0);
+ expr += type_to_glsl(result_type) + "({ ";
+
+ auto &matrix_type = get_variable_element_type(get<SPIRVariable>(ptr));
+
+ for (uint32_t i = 0; i < num_control_points; i++)
+ {
+ interface_index = base_interface_index;
+ expr += type_to_glsl(matrix_type) + "(";
+ for (uint32_t j = 0; j < result_type.columns; j++, interface_index++)
+ {
+ const uint32_t indices[2] = { i, interface_index };
+
+ AccessChainMeta meta;
+ expr +=
+ access_chain_internal(stage_in_ptr_var_id, indices, 2,
+ ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_PTR_CHAIN_BIT, &meta);
+ if (j + 1 < result_type.columns)
+ expr += ", ";
+ }
+ expr += ")";
+ if (i + 1 < num_control_points)
+ expr += ", ";
+ }
+
+ expr += " })";
+ }
+ else
+ {
+ expr += type_to_glsl(result_type) + "(";
+ for (uint32_t i = 0; i < result_type.columns; i++, interface_index++)
+ {
+ expr += to_expression(ptr) + "." + to_member_name(iface_type, interface_index);
+ if (i + 1 < result_type.columns)
+ expr += ", ";
+ }
+ expr += ")";
+ }
+ }
+ else if (ptr_is_io_variable)
+ {
+ assert(is_array(result_type));
+ assert(result_type.array.size() == 1);
+ if (interface_index == uint32_t(-1))
+ SPIRV_CROSS_THROW("Interface index is unknown. Cannot continue.");
+
+ // We're loading an array directly from a global variable.
+ // This means we're loading one member from each control point.
+ expr += type_to_glsl(result_type) + "({ ";
+ uint32_t num_control_points = to_array_size_literal(result_type, 0);
+
+ for (uint32_t i = 0; i < num_control_points; i++)
+ {
+ const uint32_t indices[2] = { i, interface_index };
+
+ AccessChainMeta meta;
+ expr += access_chain_internal(stage_in_ptr_var_id, indices, 2,
+ ACCESS_CHAIN_INDEX_IS_LITERAL_BIT | ACCESS_CHAIN_PTR_CHAIN_BIT, &meta);
+
+ if (i + 1 < num_control_points)
+ expr += ", ";
+ }
+ expr += " })";
+ }
+ else
+ {
+ // We're loading an array from a concrete control point.
+ assert(is_array(result_type));
+ assert(result_type.array.size() == 1);
+ if (interface_index == uint32_t(-1))
+ SPIRV_CROSS_THROW("Interface index is unknown. Cannot continue.");
+
+ expr += type_to_glsl(result_type) + "({ ";
+ uint32_t array_size = to_array_size_literal(result_type, 0);
+ for (uint32_t i = 0; i < array_size; i++, interface_index++)
+ {
+ expr += to_expression(ptr) + "." + to_member_name(iface_type, interface_index);
+ if (i + 1 < array_size)
+ expr += ", ";
+ }
+ expr += " })";
+ }
+
+ emit_op(result_type_id, id, expr, false);
+ register_read(id, ptr, false);
+ return true;
+}
+
bool CompilerMSL::emit_tessellation_access_chain(const uint32_t *ops, uint32_t length)
{
// If this is a per-vertex output, remap it to the I/O array buffer.
- auto *var = maybe_get<SPIRVariable>(ops[2]);
+
+ // Any object which did not go through IO flattening shenanigans will go there instead.
+ // We will unflatten on-demand instead as needed, but not all possible cases can be supported, especially with arrays.
+
+ auto *var = maybe_get_backing_variable(ops[2]);
+ bool patch = false;
+ bool flat_data = false;
+ bool ptr_is_chain = false;
+
+ if (var)
+ {
+ patch = has_decoration(ops[2], DecorationPatch) || is_patch_block(get_variable_data_type(*var));
+
+ // Should match strip_array in add_interface_block.
+ flat_data = var->storage == StorageClassInput ||
+ (var->storage == StorageClassOutput && get_execution_model() == ExecutionModelTessellationControl);
+
+ // We might have a chained access chain, where
+ // we first take the access chain to the control point, and then we chain into a member or something similar.
+ // In this case, we need to skip gl_in/gl_out remapping.
+ ptr_is_chain = var->self != ID(ops[2]);
+ }
+
BuiltIn bi_type = BuiltIn(get_decoration(ops[2], DecorationBuiltIn));
- if (var &&
- (var->storage == StorageClassInput ||
- (get_execution_model() == ExecutionModelTessellationControl && var->storage == StorageClassOutput)) &&
- !(has_decoration(ops[2], DecorationPatch) || is_patch_block(get_variable_data_type(*var))) &&
+ if (var && flat_data && !patch &&
(!is_builtin_variable(*var) || bi_type == BuiltInPosition || bi_type == BuiltInPointSize ||
bi_type == BuiltInClipDistance || bi_type == BuiltInCullDistance ||
get_variable_data_type(*var).basetype == SPIRType::Struct))
@@ -4729,26 +5327,35 @@ bool CompilerMSL::emit_tessellation_access_chain(const uint32_t *ops, uint32_t l
new_uint_type.width = 32;
set<SPIRType>(type_id, new_uint_type);
- indices.push_back(ops[3]);
+ uint32_t first_non_array_index = ptr_is_chain ? 3 : 4;
+ VariableID stage_var_id = var->storage == StorageClassInput ? stage_in_ptr_var_id : stage_out_ptr_var_id;
+ VariableID ptr = ptr_is_chain ? VariableID(ops[2]) : stage_var_id;
+ if (!ptr_is_chain)
+ {
+ // Index into gl_in/gl_out with first array index.
+ indices.push_back(ops[3]);
+ }
+
+ auto &result_ptr_type = get<SPIRType>(ops[0]);
uint32_t const_mbr_id = next_id++;
- uint32_t index = get_extended_decoration(ops[2], SPIRVCrossDecorationInterfaceMemberIndex);
- uint32_t ptr = var->storage == StorageClassInput ? stage_in_ptr_var_id : stage_out_ptr_var_id;
+ uint32_t index = get_extended_decoration(var->self, SPIRVCrossDecorationInterfaceMemberIndex);
if (var->storage == StorageClassInput || has_decoration(get_variable_element_type(*var).self, DecorationBlock))
{
- uint32_t i = 4;
+ uint32_t i = first_non_array_index;
auto *type = &get_variable_element_type(*var);
- if (index == uint32_t(-1) && length >= 5)
+ if (index == uint32_t(-1) && length >= (first_non_array_index + 1))
{
// Maybe this is a struct type in the input class, in which case
// we put it as a decoration on the corresponding member.
- index = get_extended_member_decoration(ops[2], get_constant(ops[4]).scalar(),
+ index = get_extended_member_decoration(var->self, get_constant(ops[first_non_array_index]).scalar(),
SPIRVCrossDecorationInterfaceMemberIndex);
assert(index != uint32_t(-1));
i++;
- type = &get<SPIRType>(type->member_types[get_constant(ops[4]).scalar()]);
+ type = &get<SPIRType>(type->member_types[get_constant(ops[first_non_array_index]).scalar()]);
}
- // In this case, we flattened structures and arrays, so now we have to
+
+ // In this case, we're poking into flattened structures and arrays, so now we have to
// combine the following indices. If we encounter a non-constant index,
// we're hosed.
for (; i < length; ++i)
@@ -4756,92 +5363,35 @@ bool CompilerMSL::emit_tessellation_access_chain(const uint32_t *ops, uint32_t l
if (!is_array(*type) && !is_matrix(*type) && type->basetype != SPIRType::Struct)
break;
- auto &c = get_constant(ops[i]);
- index += c.scalar();
+ auto *c = maybe_get<SPIRConstant>(ops[i]);
+ if (!c || c->specialization)
+ SPIRV_CROSS_THROW("Trying to dynamically index into an array interface variable in tessellation. "
+ "This is currently unsupported.");
+
+ // We're in flattened space, so just increment the member index into IO block.
+ // We can only do this once in the current implementation, so either:
+ // Struct, Matrix or 1-dimensional array for a control point.
+ index += c->scalar();
+
if (type->parent_type)
type = &get<SPIRType>(type->parent_type);
else if (type->basetype == SPIRType::Struct)
- type = &get<SPIRType>(type->member_types[c.scalar()]);
+ type = &get<SPIRType>(type->member_types[c->scalar()]);
}
- // If the access chain terminates at a composite type, the composite
- // itself might be copied. In that case, we must unflatten it.
- if (is_matrix(*type) || is_array(*type) || type->basetype == SPIRType::Struct)
- {
- std::string temp_name = join(to_name(var->self), "_", ops[1]);
- statement(variable_decl(*type, temp_name, var->self), ";");
- // Set up the initializer for this temporary variable.
- indices.push_back(const_mbr_id);
- if (type->basetype == SPIRType::Struct)
- {
- for (uint32_t j = 0; j < type->member_types.size(); j++)
- {
- index = get_extended_member_decoration(ops[2], j, SPIRVCrossDecorationInterfaceMemberIndex);
- const auto &mbr_type = get<SPIRType>(type->member_types[j]);
- if (is_matrix(mbr_type))
- {
- for (uint32_t k = 0; k < mbr_type.columns; k++, index++)
- {
- set<SPIRConstant>(const_mbr_id, type_id, index, false);
- auto e = access_chain(ptr, indices.data(), uint32_t(indices.size()), mbr_type, nullptr,
- true);
- statement(temp_name, ".", to_member_name(*type, j), "[", k, "] = ", e, ";");
- }
- }
- else if (is_array(mbr_type))
- {
- for (uint32_t k = 0; k < to_array_size_literal(mbr_type, 0); k++, index++)
- {
- set<SPIRConstant>(const_mbr_id, type_id, index, false);
- auto e = access_chain(ptr, indices.data(), uint32_t(indices.size()), mbr_type, nullptr,
- true);
- statement(temp_name, ".", to_member_name(*type, j), "[", k, "] = ", e, ";");
- }
- }
- else
- {
- set<SPIRConstant>(const_mbr_id, type_id, index, false);
- auto e =
- access_chain(ptr, indices.data(), uint32_t(indices.size()), mbr_type, nullptr, true);
- statement(temp_name, ".", to_member_name(*type, j), " = ", e, ";");
- }
- }
- }
- else if (is_matrix(*type))
- {
- for (uint32_t j = 0; j < type->columns; j++, index++)
- {
- set<SPIRConstant>(const_mbr_id, type_id, index, false);
- auto e = access_chain(ptr, indices.data(), uint32_t(indices.size()), *type, nullptr, true);
- statement(temp_name, "[", j, "] = ", e, ";");
- }
- }
- else // Must be an array
- {
- assert(is_array(*type));
- for (uint32_t j = 0; j < to_array_size_literal(*type, 0); j++, index++)
- {
- set<SPIRConstant>(const_mbr_id, type_id, index, false);
- auto e = access_chain(ptr, indices.data(), uint32_t(indices.size()), *type, nullptr, true);
- statement(temp_name, "[", j, "] = ", e, ";");
- }
- }
- // This needs to be a variable instead of an expression so we don't
- // try to dereference this as a variable pointer.
- set<SPIRVariable>(ops[1], ops[0], var->storage);
- ir.meta[ops[1]] = ir.meta[ops[2]];
- set_name(ops[1], temp_name);
- if (has_decoration(var->self, DecorationInvariant))
- set_decoration(ops[1], DecorationInvariant);
- for (uint32_t j = 2; j < length; j++)
- inherit_expression_dependencies(ops[1], ops[j]);
- return true;
+ if (is_matrix(result_ptr_type) || is_array(result_ptr_type) || result_ptr_type.basetype == SPIRType::Struct)
+ {
+ // We're not going to emit the actual member name, we let any further OpLoad take care of that.
+ // Tag the access chain with the member index we're referencing.
+ set_extended_decoration(ops[1], SPIRVCrossDecorationInterfaceMemberIndex, index);
}
else
{
+ // Access the appropriate member of gl_in/gl_out.
set<SPIRConstant>(const_mbr_id, type_id, index, false);
indices.push_back(const_mbr_id);
+ // Append any straggling access chain indices.
if (i < length)
indices.insert(indices.end(), ops + i, ops + length);
}
@@ -4857,7 +5407,39 @@ bool CompilerMSL::emit_tessellation_access_chain(const uint32_t *ops, uint32_t l
// We use the pointer to the base of the input/output array here,
// so this is always a pointer chain.
- auto e = access_chain(ptr, indices.data(), uint32_t(indices.size()), get<SPIRType>(ops[0]), &meta, true);
+ string e;
+
+ if (!ptr_is_chain)
+ {
+ // This is the start of an access chain, use ptr_chain to index into control point array.
+ e = access_chain(ptr, indices.data(), uint32_t(indices.size()), result_ptr_type, &meta, true);
+ }
+ else
+ {
+ // If we're accessing a struct, we need to use member indices which are based on the IO block,
+ // not actual struct type, so we have to use a split access chain here where
+ // first path resolves the control point index, i.e. gl_in[index], and second half deals with
+ // looking up flattened member name.
+
+ // However, it is possible that we partially accessed a struct,
+ // by taking pointer to member inside the control-point array.
+ // For this case, we fall back to a natural access chain since we have already dealt with remapping struct members.
+ // One way to check this here is if we have 2 implied read expressions.
+ // First one is the gl_in/gl_out struct itself, then an index into that array.
+ // If we have traversed further, we use a normal access chain formulation.
+ auto *ptr_expr = maybe_get<SPIRExpression>(ptr);
+ if (ptr_expr && ptr_expr->implied_read_expressions.size() == 2)
+ {
+ e = join(to_expression(ptr),
+ access_chain_internal(stage_var_id, indices.data(), uint32_t(indices.size()),
+ ACCESS_CHAIN_CHAIN_ONLY_BIT, &meta));
+ }
+ else
+ {
+ e = access_chain_internal(ptr, indices.data(), uint32_t(indices.size()), 0, &meta);
+ }
+ }
+
auto &expr = set<SPIRExpression>(ops[1], move(e), ops[0], should_forward(ops[2]));
expr.loaded_from = var->self;
expr.need_transpose = meta.need_transpose;
@@ -4871,12 +5453,24 @@ bool CompilerMSL::emit_tessellation_access_chain(const uint32_t *ops, uint32_t l
if (meta.storage_is_invariant)
set_decoration(ops[1], DecorationInvariant);
+ // If we have some expression dependencies in our access chain, this access chain is technically a forwarded
+ // temporary which could be subject to invalidation.
+ // Need to assume we're forwarded while calling inherit_expression_depdendencies.
+ forwarded_temporaries.insert(ops[1]);
+ // The access chain itself is never forced to a temporary, but its dependencies might.
+ suppressed_usage_tracking.insert(ops[1]);
+
for (uint32_t i = 2; i < length; i++)
{
inherit_expression_dependencies(ops[1], ops[i]);
add_implied_read_expression(expr, ops[i]);
}
+ // If we have no dependencies after all, i.e., all indices in the access chain are immutable temporaries,
+ // we're not forwarded after all.
+ if (expr.expression_dependencies.empty())
+ forwarded_temporaries.erase(ops[1]);
+
return true;
}
@@ -4955,6 +5549,24 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
switch (opcode)
{
+ case OpLoad:
+ {
+ uint32_t id = ops[1];
+ uint32_t ptr = ops[2];
+ if (is_tessellation_shader())
+ {
+ if (!emit_tessellation_io_load(ops[0], id, ptr))
+ CompilerGLSL::emit_instruction(instruction);
+ }
+ else
+ {
+ // Sample mask input for Metal is not an array
+ if (BuiltIn(get_decoration(ptr, DecorationBuiltIn)) == BuiltInSampleMask)
+ set_decoration(id, DecorationBuiltIn, BuiltInSampleMask);
+ CompilerGLSL::emit_instruction(instruction);
+ }
+ break;
+ }
// Comparisons
case OpIEqual:
@@ -5106,6 +5718,20 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
MSL_BFOP(fmod);
break;
+ case OpFMul:
+ if (msl_options.invariant_float_math)
+ MSL_BFOP(spvFMul);
+ else
+ MSL_BOP(*);
+ break;
+
+ case OpFAdd:
+ if (msl_options.invariant_float_math)
+ MSL_BFOP(spvFAdd);
+ else
+ MSL_BOP(+);
+ break;
+
// Atomics
case OpAtomicExchange:
{
@@ -5231,6 +5857,41 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
break;
}
+ // Emulate texture2D atomic operations
+ case OpImageTexelPointer:
+ {
+ // When using the pointer, we need to know which variable it is actually loaded from.
+ auto *var = maybe_get_backing_variable(ops[2]);
+ if (var && atomic_image_vars.count(var->self))
+ {
+ uint32_t result_type = ops[0];
+ uint32_t id = ops[1];
+
+ std::string coord = to_expression(ops[3]);
+ auto &type = expression_type(ops[2]);
+ if (type.image.dim == Dim2D)
+ {
+ coord = join("spvImage2DAtomicCoord(", coord, ", ", to_expression(ops[2]), ")");
+ }
+
+ auto &e = set<SPIRExpression>(id, join(to_expression(ops[2]), "_atomic[", coord, "]"), result_type, true);
+ e.loaded_from = var ? var->self : ID(0);
+ inherit_expression_dependencies(id, ops[3]);
+ }
+ else
+ {
+ uint32_t result_type = ops[0];
+ uint32_t id = ops[1];
+ auto &e =
+ set<SPIRExpression>(id, join(to_expression(ops[2]), ", ", to_expression(ops[3])), result_type, true);
+
+ // When using the pointer, we need to know which variable it is actually loaded from.
+ e.loaded_from = var ? var->self : ID(0);
+ inherit_expression_dependencies(id, ops[3]);
+ }
+ break;
+ }
+
case OpImageWrite:
{
uint32_t img_id = ops[0];
@@ -5326,7 +5987,11 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
expr += ", " + img_exp + ".get_depth(" + lod + ")";
if (img_is_array)
+ {
expr += ", " + img_exp + ".get_array_size()";
+ if (img_dim == DimCube && msl_options.emulate_cube_array)
+ expr += " / 6";
+ }
expr += ")";
@@ -5408,9 +6073,6 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
break;
}
- case OpImageTexelPointer:
- SPIRV_CROSS_THROW("MSL does not support atomic operations on images or texel buffers.");
-
// Casting
case OpQuantizeToF16:
{
@@ -5503,6 +6165,85 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
break;
}
+ case OpVectorTimesMatrix:
+ case OpMatrixTimesVector:
+ {
+ if (!msl_options.invariant_float_math)
+ {
+ CompilerGLSL::emit_instruction(instruction);
+ break;
+ }
+
+ // If the matrix needs transpose, just flip the multiply order.
+ auto *e = maybe_get<SPIRExpression>(ops[opcode == OpMatrixTimesVector ? 2 : 3]);
+ if (e && e->need_transpose)
+ {
+ e->need_transpose = false;
+ string expr;
+
+ if (opcode == OpMatrixTimesVector)
+ {
+ expr = join("spvFMulVectorMatrix(", to_enclosed_unpacked_expression(ops[3]), ", ",
+ to_unpacked_row_major_matrix_expression(ops[2]), ")");
+ }
+ else
+ {
+ expr = join("spvFMulMatrixVector(", to_unpacked_row_major_matrix_expression(ops[3]), ", ",
+ to_enclosed_unpacked_expression(ops[2]), ")");
+ }
+
+ bool forward = should_forward(ops[2]) && should_forward(ops[3]);
+ emit_op(ops[0], ops[1], expr, forward);
+ e->need_transpose = true;
+ inherit_expression_dependencies(ops[1], ops[2]);
+ inherit_expression_dependencies(ops[1], ops[3]);
+ }
+ else
+ {
+ if (opcode == OpMatrixTimesVector)
+ MSL_BFOP(spvFMulMatrixVector);
+ else
+ MSL_BFOP(spvFMulVectorMatrix);
+ }
+ break;
+ }
+
+ case OpMatrixTimesMatrix:
+ {
+ if (!msl_options.invariant_float_math)
+ {
+ CompilerGLSL::emit_instruction(instruction);
+ break;
+ }
+
+ auto *a = maybe_get<SPIRExpression>(ops[2]);
+ auto *b = maybe_get<SPIRExpression>(ops[3]);
+
+ // If both matrices need transpose, we can multiply in flipped order and tag the expression as transposed.
+ // a^T * b^T = (b * a)^T.
+ if (a && b && a->need_transpose && b->need_transpose)
+ {
+ a->need_transpose = false;
+ b->need_transpose = false;
+
+ auto expr =
+ join("spvFMulMatrixMatrix(", enclose_expression(to_unpacked_row_major_matrix_expression(ops[3])), ", ",
+ enclose_expression(to_unpacked_row_major_matrix_expression(ops[2])), ")");
+
+ bool forward = should_forward(ops[2]) && should_forward(ops[3]);
+ auto &e = emit_op(ops[0], ops[1], expr, forward);
+ e.need_transpose = true;
+ a->need_transpose = true;
+ b->need_transpose = true;
+ inherit_expression_dependencies(ops[1], ops[2]);
+ inherit_expression_dependencies(ops[1], ops[3]);
+ }
+ else
+ MSL_BFOP(spvFMulMatrixMatrix);
+
+ break;
+ }
+
case OpIAddCarry:
case OpISubBorrow:
{
@@ -5643,6 +6384,34 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
previous_instruction_opcode = opcode;
}
+void CompilerMSL::emit_texture_op(const Instruction &i)
+{
+ if (msl_options.is_ios() && msl_options.ios_use_framebuffer_fetch_subpasses)
+ {
+ auto *ops = stream(i);
+
+ uint32_t result_type_id = ops[0];
+ uint32_t id = ops[1];
+ uint32_t img = ops[2];
+
+ auto &type = expression_type(img);
+ auto &imgtype = get<SPIRType>(type.self);
+
+ // Use Metal's native frame-buffer fetch API for subpass inputs.
+ if (imgtype.image.dim == DimSubpassData)
+ {
+ // Subpass inputs cannot be invalidated,
+ // so just forward the expression directly.
+ string expr = to_expression(img);
+ emit_op(result_type_id, id, expr, true);
+ return;
+ }
+ }
+
+ // Fallback to default implementation
+ CompilerGLSL::emit_texture_op(i);
+}
+
void CompilerMSL::emit_barrier(uint32_t id_exe_scope, uint32_t id_mem_scope, uint32_t id_mem_sem)
{
if (get_execution_model() != ExecutionModelGLCompute && get_execution_model() != ExecutionModelTessellationControl)
@@ -5671,8 +6440,11 @@ void CompilerMSL::emit_barrier(uint32_t id_exe_scope, uint32_t id_mem_scope, uin
if (get_execution_model() == ExecutionModelTessellationControl ||
(mem_sem & (MemorySemanticsUniformMemoryMask | MemorySemanticsCrossWorkgroupMemoryMask)))
mem_flags += "mem_flags::mem_device";
- if (mem_sem & (MemorySemanticsSubgroupMemoryMask | MemorySemanticsWorkgroupMemoryMask |
- MemorySemanticsAtomicCounterMemoryMask))
+
+ // Fix tessellation patch function processing
+ if (get_execution_model() == ExecutionModelTessellationControl ||
+ (mem_sem & (MemorySemanticsSubgroupMemoryMask | MemorySemanticsWorkgroupMemoryMask |
+ MemorySemanticsAtomicCounterMemoryMask)))
{
if (!mem_flags.empty())
mem_flags += " | ";
@@ -5742,59 +6514,76 @@ void CompilerMSL::emit_barrier(uint32_t id_exe_scope, uint32_t id_mem_scope, uin
void CompilerMSL::emit_array_copy(const string &lhs, uint32_t rhs_id, StorageClass lhs_storage,
StorageClass rhs_storage)
{
- // Assignment from an array initializer is fine.
- auto &type = expression_type(rhs_id);
- auto *var = maybe_get_backing_variable(rhs_id);
+ // Allow Metal to use the array<T> template to make arrays a value type.
+ // This, however, cannot be used for threadgroup address specifiers, so consider the custom array copy as fallback.
+ bool lhs_thread = (lhs_storage == StorageClassOutput || lhs_storage == StorageClassFunction ||
+ lhs_storage == StorageClassGeneric || lhs_storage == StorageClassPrivate);
+ bool rhs_thread = (rhs_storage == StorageClassInput || rhs_storage == StorageClassFunction ||
+ rhs_storage == StorageClassGeneric || rhs_storage == StorageClassPrivate);
- // Unfortunately, we cannot template on address space in MSL,
- // so explicit address space redirection it is ...
- bool is_constant = false;
- if (ir.ids[rhs_id].get_type() == TypeConstant)
+ // If threadgroup storage qualifiers are *not* used:
+ // Avoid spvCopy* wrapper functions; Otherwise, spvUnsafeArray<> template cannot be used with that storage qualifier.
+ if (lhs_thread && rhs_thread && !use_builtin_array)
{
- is_constant = true;
+ statement(lhs, " = ", to_expression(rhs_id), ";");
}
- else if (var && var->remapped_variable && var->statically_assigned &&
- ir.ids[var->static_expression].get_type() == TypeConstant)
+ else
{
- is_constant = true;
- }
+ // Assignment from an array initializer is fine.
+ auto &type = expression_type(rhs_id);
+ auto *var = maybe_get_backing_variable(rhs_id);
- // For the case where we have OpLoad triggering an array copy,
- // we cannot easily detect this case ahead of time since it's
- // context dependent. We might have to force a recompile here
- // if this is the only use of array copies in our shader.
- if (type.array.size() > 1)
- {
- if (type.array.size() > SPVFuncImplArrayCopyMultidimMax)
- SPIRV_CROSS_THROW("Cannot support this many dimensions for arrays of arrays.");
- auto func = static_cast<SPVFuncImpl>(SPVFuncImplArrayCopyMultidimBase + type.array.size());
- add_spv_func_and_recompile(func);
- }
- else
- add_spv_func_and_recompile(SPVFuncImplArrayCopy);
-
- bool lhs_thread =
- lhs_storage == StorageClassOutput || lhs_storage == StorageClassFunction || lhs_storage == StorageClassGeneric || lhs_storage == StorageClassPrivate;
- bool rhs_thread =
- rhs_storage == StorageClassInput || rhs_storage == StorageClassFunction || rhs_storage == StorageClassGeneric || rhs_storage == StorageClassPrivate;
-
- const char *tag = nullptr;
- if (lhs_thread && is_constant)
- tag = "FromConstantToStack";
- else if (lhs_storage == StorageClassWorkgroup && is_constant)
- tag = "FromConstantToThreadGroup";
- else if (lhs_thread && rhs_thread)
- tag = "FromStackToStack";
- else if (lhs_storage == StorageClassWorkgroup && rhs_thread)
- tag = "FromStackToThreadGroup";
- else if (lhs_thread && rhs_storage == StorageClassWorkgroup)
- tag = "FromThreadGroupToStack";
- else if (lhs_storage == StorageClassWorkgroup && rhs_storage == StorageClassWorkgroup)
- tag = "FromThreadGroupToThreadGroup";
- else
- SPIRV_CROSS_THROW("Unknown storage class used for copying arrays.");
+ // Unfortunately, we cannot template on address space in MSL,
+ // so explicit address space redirection it is ...
+ bool is_constant = false;
+ if (ir.ids[rhs_id].get_type() == TypeConstant)
+ {
+ is_constant = true;
+ }
+ else if (var && var->remapped_variable && var->statically_assigned &&
+ ir.ids[var->static_expression].get_type() == TypeConstant)
+ {
+ is_constant = true;
+ }
+
+ // For the case where we have OpLoad triggering an array copy,
+ // we cannot easily detect this case ahead of time since it's
+ // context dependent. We might have to force a recompile here
+ // if this is the only use of array copies in our shader.
+ if (type.array.size() > 1)
+ {
+ if (type.array.size() > SPVFuncImplArrayCopyMultidimMax)
+ SPIRV_CROSS_THROW("Cannot support this many dimensions for arrays of arrays.");
+ auto func = static_cast<SPVFuncImpl>(SPVFuncImplArrayCopyMultidimBase + type.array.size());
+ add_spv_func_and_recompile(func);
+ }
+ else
+ add_spv_func_and_recompile(SPVFuncImplArrayCopy);
+
+ const char *tag = nullptr;
+ if (lhs_thread && is_constant)
+ tag = "FromConstantToStack";
+ else if (lhs_storage == StorageClassWorkgroup && is_constant)
+ tag = "FromConstantToThreadGroup";
+ else if (lhs_thread && rhs_thread)
+ tag = "FromStackToStack";
+ else if (lhs_storage == StorageClassWorkgroup && rhs_thread)
+ tag = "FromStackToThreadGroup";
+ else if (lhs_thread && rhs_storage == StorageClassWorkgroup)
+ tag = "FromThreadGroupToStack";
+ else if (lhs_storage == StorageClassWorkgroup && rhs_storage == StorageClassWorkgroup)
+ tag = "FromThreadGroupToThreadGroup";
+ else
+ SPIRV_CROSS_THROW("Unknown storage class used for copying arrays.");
- statement("spvArrayCopy", tag, type.array.size(), "(", lhs, ", ", to_expression(rhs_id), ");");
+ // Pass internal array of spvUnsafeArray<> into wrapper functions
+ if (lhs_thread)
+ statement("spvArrayCopy", tag, type.array.size(), "(", lhs, ".elements, ", to_expression(rhs_id), ");");
+ else if (rhs_thread)
+ statement("spvArrayCopy", tag, type.array.size(), "(", lhs, ", ", to_expression(rhs_id), ".elements);");
+ else
+ statement("spvArrayCopy", tag, type.array.size(), "(", lhs, ", ", to_expression(rhs_id), ");");
+ }
}
// Since MSL does not allow arrays to be copied via simple variable assignment,
@@ -5849,7 +6638,18 @@ void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id,
auto *var = maybe_get_backing_variable(obj);
if (!var)
SPIRV_CROSS_THROW("No backing variable for atomic operation.");
- exp += get_argument_address_space(*var);
+
+ // Emulate texture2D atomic operations
+ const auto &res_type = get<SPIRType>(var->basetype);
+ if (res_type.storage == StorageClassUniformConstant && res_type.basetype == SPIRType::Image)
+ {
+ exp += "device";
+ }
+ else
+ {
+ exp += get_argument_address_space(*var);
+ }
+
exp += " atomic_";
exp += type_to_glsl(type);
exp += "*)";
@@ -6219,38 +7019,21 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &)
add_function_overload(func);
local_variable_names = resource_names;
+ string decl;
processing_entry_point = func.self == ir.default_entry_point;
- string decl = processing_entry_point ? "" : "inline ";
+ // Metal helper functions must be static force-inline otherwise they will cause problems when linked together in a single Metallib.
+ if (!processing_entry_point)
+ statement(force_inline);
auto &type = get<SPIRType>(func.return_type);
- if (type.array.empty())
- {
- decl += func_type_decl(type);
- }
- else
- {
- // We cannot return arrays in MSL, so "return" through an out variable.
- decl += "void";
- }
-
+ decl += func_type_decl(type);
decl += " ";
decl += to_name(func.self);
decl += "(";
- if (!type.array.empty())
- {
- // Fake arrays returns by writing to an out array instead.
- decl += "thread ";
- decl += type_to_glsl(type);
- decl += " (&SPIRV_Cross_return_value)";
- decl += type_to_array_glsl(type);
- if (!func.arguments.empty())
- decl += ", ";
- }
-
if (processing_entry_point)
{
if (msl_options.argument_buffers)
@@ -6585,6 +7368,14 @@ string CompilerMSL::to_function_args(VariableID img, const SPIRType &imgtype, bo
else if (sampling_type_needs_f32_conversion(coord_type))
tex_coords = convert_to_f32(tex_coords, 1);
+ if (msl_options.texture_1D_as_2D)
+ {
+ if (is_fetch)
+ tex_coords = "uint2(" + tex_coords + ", 0)";
+ else
+ tex_coords = "float2(" + tex_coords + ", 0.5)";
+ }
+
alt_coord_component = 1;
break;
@@ -6599,14 +7390,27 @@ string CompilerMSL::to_function_args(VariableID img, const SPIRType &imgtype, bo
else
{
// Metal texel buffer textures are 2D, so convert 1D coord to 2D.
+ // Support for Metal 2.1's new texture_buffer type.
if (is_fetch)
- tex_coords = "spvTexelBufferCoord(" + round_fp_tex_coords(tex_coords, coord_is_fp) + ")";
+ {
+ if (msl_options.texel_buffer_texture_width > 0)
+ {
+ tex_coords = "spvTexelBufferCoord(" + round_fp_tex_coords(tex_coords, coord_is_fp) + ")";
+ }
+ else
+ {
+ tex_coords = "spvTexelBufferCoord(" + round_fp_tex_coords(tex_coords, coord_is_fp) + ", " +
+ to_expression(img) + ")";
+ }
+ }
}
alt_coord_component = 1;
break;
case DimSubpassData:
+ // If we're using Metal's native frame-buffer fetch API for subpass inputs,
+ // this path will not be hit.
if (imgtype.image.ms)
tex_coords = "uint2(gl_FragCoord.xy)";
else
@@ -6692,28 +7496,46 @@ string CompilerMSL::to_function_args(VariableID img, const SPIRType &imgtype, bo
if (!farg_str.empty())
farg_str += ", ";
- farg_str += tex_coords;
- // If fetch from cube, add face explicitly
- if (is_cube_fetch)
+ if (imgtype.image.dim == DimCube && imgtype.image.arrayed && msl_options.emulate_cube_array)
{
- // Special case for cube arrays, face and layer are packed in one dimension.
- if (imgtype.image.arrayed)
- farg_str += ", uint(" + to_extract_component_expression(coord, 2) + ") % 6u";
- else
- farg_str += ", uint(" + round_fp_tex_coords(to_extract_component_expression(coord, 2), coord_is_fp) + ")";
- }
+ farg_str += "spvCubemapTo2DArrayFace(" + tex_coords + ").xy";
- // If array, use alt coord
- if (imgtype.image.arrayed)
- {
- // Special case for cube arrays, face and layer are packed in one dimension.
- if (imgtype.image.dim == DimCube && is_fetch)
- farg_str += ", uint(" + to_extract_component_expression(coord, 2) + ") / 6u";
+ if (is_cube_fetch)
+ farg_str += ", uint(" + to_extract_component_expression(coord, 2) + ")";
else
- farg_str += ", uint(" +
+ farg_str += ", uint(spvCubemapTo2DArrayFace(" + tex_coords + ").z) + (uint(" +
round_fp_tex_coords(to_extract_component_expression(coord, alt_coord_component), coord_is_fp) +
- ")";
+ ") * 6u)";
+
+ add_spv_func_and_recompile(SPVFuncImplCubemapTo2DArrayFace);
+ }
+ else
+ {
+ farg_str += tex_coords;
+
+ // If fetch from cube, add face explicitly
+ if (is_cube_fetch)
+ {
+ // Special case for cube arrays, face and layer are packed in one dimension.
+ if (imgtype.image.arrayed)
+ farg_str += ", uint(" + to_extract_component_expression(coord, 2) + ") % 6u";
+ else
+ farg_str +=
+ ", uint(" + round_fp_tex_coords(to_extract_component_expression(coord, 2), coord_is_fp) + ")";
+ }
+
+ // If array, use alt coord
+ if (imgtype.image.arrayed)
+ {
+ // Special case for cube arrays, face and layer are packed in one dimension.
+ if (imgtype.image.dim == DimCube && is_fetch)
+ farg_str += ", uint(" + to_extract_component_expression(coord, 2) + ") / 6u";
+ else
+ farg_str +=
+ ", uint(" +
+ round_fp_tex_coords(to_extract_component_expression(coord, alt_coord_component), coord_is_fp) + ")";
+ }
}
// Depth compare reference value
@@ -6776,14 +7598,14 @@ string CompilerMSL::to_function_args(VariableID img, const SPIRType &imgtype, bo
// LOD Options
// Metal does not support LOD for 1D textures.
- if (bias && imgtype.image.dim != Dim1D)
+ if (bias && (imgtype.image.dim != Dim1D || msl_options.texture_1D_as_2D))
{
forward = forward && should_forward(bias);
farg_str += ", bias(" + to_expression(bias) + ")";
}
// Metal does not support LOD for 1D textures.
- if (lod && imgtype.image.dim != Dim1D)
+ if (lod && (imgtype.image.dim != Dim1D || msl_options.texture_1D_as_2D))
{
forward = forward && should_forward(lod);
if (is_fetch)
@@ -6795,8 +7617,8 @@ string CompilerMSL::to_function_args(VariableID img, const SPIRType &imgtype, bo
farg_str += ", level(" + to_expression(lod) + ")";
}
}
- else if (is_fetch && !lod && imgtype.image.dim != Dim1D && imgtype.image.dim != DimBuffer && !imgtype.image.ms &&
- imgtype.image.sampled != 2)
+ else if (is_fetch && !lod && (imgtype.image.dim != Dim1D || msl_options.texture_1D_as_2D) &&
+ imgtype.image.dim != DimBuffer && !imgtype.image.ms && imgtype.image.sampled != 2)
{
// Lod argument is optional in OpImageFetch, but we require a LOD value, pick 0 as the default.
// Check for sampled type as well, because is_fetch is also used for OpImageRead in MSL.
@@ -6804,7 +7626,7 @@ string CompilerMSL::to_function_args(VariableID img, const SPIRType &imgtype, bo
}
// Metal does not support LOD for 1D textures.
- if ((grad_x || grad_y) && imgtype.image.dim != Dim1D)
+ if ((grad_x || grad_y) && (imgtype.image.dim != Dim1D || msl_options.texture_1D_as_2D))
{
forward = forward && should_forward(grad_x);
forward = forward && should_forward(grad_y);
@@ -6818,7 +7640,10 @@ string CompilerMSL::to_function_args(VariableID img, const SPIRType &imgtype, bo
grad_opt = "3d";
break;
case DimCube:
- grad_opt = "cube";
+ if (imgtype.image.arrayed && msl_options.emulate_cube_array)
+ grad_opt = "2d";
+ else
+ grad_opt = "cube";
break;
default:
grad_opt = "unsupported_gradient_dimension";
@@ -7153,38 +7978,16 @@ string CompilerMSL::to_func_call_arg(const SPIRFunction::Parameter &arg, uint32_
if (is_dynamic_img_sampler && !arg_is_dynamic_img_sampler)
arg_str = join("spvDynamicImageSampler<", type_to_glsl(get<SPIRType>(type.image.type)), ">(");
- auto *c = maybe_get<SPIRConstant>(id);
- if (c && !get<SPIRType>(c->constant_type).array.empty())
- {
- // If we are passing a constant array directly to a function for some reason,
- // the callee will expect an argument in thread const address space
- // (since we can only bind to arrays with references in MSL).
- // To resolve this, we must emit a copy in this address space.
- // This kind of code gen should be rare enough that performance is not a real concern.
- // Inline the SPIR-V to avoid this kind of suboptimal codegen.
- //
- // We risk calling this inside a continue block (invalid code),
- // so just create a thread local copy in the current function.
- arg_str = join("_", id, "_array_copy");
- auto &constants = current_function->constant_arrays_needed_on_stack;
- auto itr = find(begin(constants), end(constants), ID(id));
- if (itr == end(constants))
- {
- force_recompile();
- constants.push_back(id);
- }
- }
- else
- arg_str += CompilerGLSL::to_func_call_arg(arg, id);
+ arg_str += CompilerGLSL::to_func_call_arg(arg, id);
+
+ // Need to check the base variable in case we need to apply a qualified alias.
+ uint32_t var_id = 0;
+ auto *var = maybe_get<SPIRVariable>(id);
+ if (var)
+ var_id = var->basevariable;
if (!arg_is_dynamic_img_sampler)
{
- // Need to check the base variable in case we need to apply a qualified alias.
- uint32_t var_id = 0;
- auto *var = maybe_get<SPIRVariable>(id);
- if (var)
- var_id = var->basevariable;
-
auto *constexpr_sampler = find_constexpr_sampler(var_id ? var_id : id);
if (type.basetype == SPIRType::SampledImage)
{
@@ -7276,6 +8079,13 @@ string CompilerMSL::to_func_call_arg(const SPIRFunction::Parameter &arg, uint32_
arg_str += ")";
}
+ // Emulate texture2D atomic operations
+ auto *backing_var = maybe_get_backing_variable(var_id);
+ if (backing_var && atomic_image_vars.count(backing_var->self))
+ {
+ arg_str += ", " + to_expression(var_id) + "_atomic";
+ }
+
return arg_str;
}
@@ -7424,6 +8234,7 @@ string CompilerMSL::to_struct_member(const SPIRType &type, uint32_t member_type_
// If this member is packed, mark it as so.
string pack_pfx;
+ // Allow Metal to use the array<T> template to make arrays a value type
uint32_t orig_id = 0;
if (has_extended_member_decoration(type.self, index, SPIRVCrossDecorationInterfaceOrigID))
orig_id = get_extended_member_decoration(type.self, index, SPIRVCrossDecorationInterfaceOrigID);
@@ -7435,6 +8246,17 @@ string CompilerMSL::to_struct_member(const SPIRType &type, uint32_t member_type_
SPIRType row_major_physical_type;
const SPIRType *declared_type = &physical_type;
+ // If a struct is being declared with physical layout,
+ // do not use array<T> wrappers.
+ // This avoids a lot of complicated cases with packed vectors and matrices,
+ // and generally we cannot copy full arrays in and out of buffers into Function
+ // address space.
+ // Array of resources should also be declared as builtin arrays.
+ if (has_member_decoration(type.self, index, DecorationOffset))
+ use_builtin_array = true;
+ else if (has_extended_member_decoration(type.self, index, SPIRVCrossDecorationResourceIndexPrimary))
+ use_builtin_array = true;
+
if (member_is_packed_physical_type(type, index))
{
// If we're packing a matrix, output an appropriate typedef
@@ -7487,11 +8309,17 @@ string CompilerMSL::to_struct_member(const SPIRType &type, uint32_t member_type_
if (physical_type.basetype != SPIRType::Image && physical_type.basetype != SPIRType::Sampler &&
physical_type.basetype != SPIRType::SampledImage)
{
+ BuiltIn builtin = BuiltInMax;
+ if (is_member_builtin(type, index, &builtin))
+ use_builtin_array = true;
array_type = type_to_array_glsl(physical_type);
}
- return join(pack_pfx, type_to_glsl(*declared_type, orig_id), " ", qualifier, to_member_name(type, index),
- member_attribute_qualifier(type, index), array_type, ";");
+ auto result = join(pack_pfx, type_to_glsl(*declared_type, orig_id), " ", qualifier, to_member_name(type, index),
+ member_attribute_qualifier(type, index), array_type, ";");
+
+ use_builtin_array = false;
+ return result;
}
// Emit a structure member, padding and packing to maintain the correct memeber alignments.
@@ -7505,7 +8333,10 @@ void CompilerMSL::emit_struct_member(const SPIRType &type, uint32_t member_type_
statement("char _m", index, "_pad", "[", pad_len, "];");
}
+ // Handle HLSL-style 0-based vertex/instance index.
+ builtin_declaration = true;
statement(to_struct_member(type, member_type_id, index, qualifier));
+ builtin_declaration = false;
}
void CompilerMSL::emit_struct_padding_target(const SPIRType &type)
@@ -8060,6 +8891,8 @@ void CompilerMSL::entry_point_args_builtin(string &ep_args)
if (!ep_args.empty())
ep_args += ", ";
+ // Handle HLSL-style 0-based vertex/instance index.
+ builtin_declaration = true;
ep_args += builtin_type_decl(bi_type, var_id) + " " + to_expression(var_id);
ep_args += " [[" + builtin_qualifier(bi_type);
if (bi_type == BuiltInSampleMask && get_entry_point().flags.get(ExecutionModePostDepthCoverage))
@@ -8071,6 +8904,7 @@ void CompilerMSL::entry_point_args_builtin(string &ep_args)
ep_args += ", post_depth_coverage";
}
ep_args += "]]";
+ builtin_declaration = false;
}
}
@@ -8094,12 +8928,12 @@ void CompilerMSL::entry_point_args_builtin(string &ep_args)
for (auto &var : active_builtins)
var.first->basetype = ensure_correct_builtin_type(var.first->basetype, var.second);
- // Vertex and instance index built-ins
- if (needs_vertex_idx_arg)
- ep_args += built_in_func_arg(BuiltInVertexIndex, !ep_args.empty());
+ // Handle HLSL-style 0-based vertex/instance index.
+ if (needs_base_vertex_arg == TriState::Yes)
+ ep_args += built_in_func_arg(BuiltInBaseVertex, !ep_args.empty());
- if (needs_instance_idx_arg)
- ep_args += built_in_func_arg(BuiltInInstanceIndex, !ep_args.empty());
+ if (needs_base_instance_arg == TriState::Yes)
+ ep_args += built_in_func_arg(BuiltInBaseInstance, !ep_args.empty());
if (capture_output_to_buffer)
{
@@ -8244,6 +9078,7 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
SPIRType::BaseType basetype;
uint32_t index;
uint32_t plane;
+ uint32_t secondary_index;
};
SmallVector<Resource> resources;
@@ -8278,6 +9113,13 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
}
}
+ // Emulate texture2D atomic operations
+ uint32_t secondary_index = 0;
+ if (atomic_image_vars.count(var.self))
+ {
+ secondary_index = get_metal_resource_index(var, SPIRType::AtomicCounter, 0);
+ }
+
if (type.basetype == SPIRType::SampledImage)
{
add_resource_name(var_id);
@@ -8288,20 +9130,20 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
for (uint32_t i = 0; i < plane_count; i++)
resources.push_back({ &var, to_name(var_id), SPIRType::Image,
- get_metal_resource_index(var, SPIRType::Image, i), i });
+ get_metal_resource_index(var, SPIRType::Image, i), i, secondary_index });
if (type.image.dim != DimBuffer && !constexpr_sampler)
{
resources.push_back({ &var, to_sampler_expression(var_id), SPIRType::Sampler,
- get_metal_resource_index(var, SPIRType::Sampler), 0 });
+ get_metal_resource_index(var, SPIRType::Sampler), 0, 0 });
}
}
else if (!constexpr_sampler)
{
// constexpr samplers are not declared as resources.
add_resource_name(var_id);
- resources.push_back(
- { &var, to_name(var_id), type.basetype, get_metal_resource_index(var, type.basetype), 0 });
+ resources.push_back({ &var, to_name(var_id), type.basetype,
+ get_metal_resource_index(var, type.basetype), 0, secondary_index });
}
}
});
@@ -8337,6 +9179,8 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
if (array_size == 0)
SPIRV_CROSS_THROW("Unsized arrays of buffers are not supported in MSL.");
+ // Allow Metal to use the array<T> template to make arrays a value type
+ use_builtin_array = true;
buffer_arrays.push_back(var_id);
for (uint32_t i = 0; i < array_size; ++i)
{
@@ -8349,6 +9193,7 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
ep_args += ", raster_order_group(0)";
ep_args += "]]";
}
+ use_builtin_array = false;
}
else
{
@@ -8370,16 +9215,38 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
ep_args += " [[sampler(" + convert_to_string(r.index) + ")]]";
break;
case SPIRType::Image:
+ {
if (!ep_args.empty())
ep_args += ", ";
- ep_args += image_type_glsl(type, var_id) + " " + r.name;
- if (r.plane > 0)
- ep_args += join(plane_name_suffix, r.plane);
- ep_args += " [[texture(" + convert_to_string(r.index) + ")";
- if (interlocked_resources.count(var_id))
- ep_args += ", raster_order_group(0)";
- ep_args += "]]";
+
+ // Use Metal's native frame-buffer fetch API for subpass inputs.
+ const auto &basetype = get<SPIRType>(var.basetype);
+ if (basetype.image.dim != DimSubpassData || !msl_options.is_ios() ||
+ !msl_options.ios_use_framebuffer_fetch_subpasses)
+ {
+ ep_args += image_type_glsl(type, var_id) + " " + r.name;
+ if (r.plane > 0)
+ ep_args += join(plane_name_suffix, r.plane);
+ ep_args += " [[texture(" + convert_to_string(r.index) + ")";
+ if (interlocked_resources.count(var_id))
+ ep_args += ", raster_order_group(0)";
+ ep_args += "]]";
+ }
+ else
+ {
+ ep_args += image_type_glsl(type, var_id) + "4 " + r.name;
+ ep_args += " [[color(" + convert_to_string(r.index) + ")]]";
+ }
+
+ // Emulate texture2D atomic operations
+ if (atomic_image_vars.count(var.self))
+ {
+ ep_args += ", device atomic_" + type_to_glsl(get<SPIRType>(basetype.image.type), 0);
+ ep_args += "* " + r.name + "_atomic";
+ ep_args += " [[buffer(" + convert_to_string(r.secondary_index) + ")]]";
+ }
break;
+ }
default:
if (!ep_args.empty())
ep_args += ", ";
@@ -8788,6 +9655,19 @@ uint32_t CompilerMSL::get_metal_resource_index(SPIRVariable &var, SPIRType::Base
if (has_extended_decoration(var.self, resource_decoration))
return get_extended_decoration(var.self, resource_decoration);
+ // Allow user to enable decoration binding
+ if (msl_options.enable_decoration_binding)
+ {
+ // If there is no explicit mapping of bindings to MSL, use the declared binding.
+ if (has_decoration(var.self, DecorationBinding))
+ {
+ var_binding = get_decoration(var.self, DecorationBinding);
+ // Avoid emitting sentinel bindings.
+ if (var_binding < 0x80000000u)
+ return var_binding;
+ }
+ }
+
// If we did not explicitly remap, allocate bindings on demand.
// We cannot reliably use Binding decorations since SPIR-V and MSL's binding models are very different.
@@ -8876,13 +9756,22 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg)
type.image.dim == Dim2D && type_is_floating_point(get<SPIRType>(type.image.type)) &&
spv_function_implementations.count(SPVFuncImplDynamicImageSampler);
+ // Allow Metal to use the array<T> template to make arrays a value type
+ string address_space = get_argument_address_space(var);
bool builtin = is_builtin_variable(var);
+ use_builtin_array = builtin;
+ if (address_space == "threadgroup")
+ use_builtin_array = true;
+
if (var.basevariable && (var.basevariable == stage_in_ptr_var_id || var.basevariable == stage_out_ptr_var_id))
decl += type_to_glsl(type, arg.id);
else if (builtin)
decl += builtin_type_decl(static_cast<BuiltIn>(get_decoration(arg.id, DecorationBuiltIn)), arg.id);
else if ((storage == StorageClassUniform || storage == StorageClassStorageBuffer) && is_array(type))
+ {
+ use_builtin_array = true;
decl += join(type_to_glsl(type, arg.id), "*");
+ }
else if (is_dynamic_img_sampler)
{
decl += join("spvDynamicImageSampler<", type_to_glsl(get<SPIRType>(type.image.type)), ">");
@@ -8894,40 +9783,14 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg)
bool opaque_handle = storage == StorageClassUniformConstant;
- string address_space = get_argument_address_space(var);
-
if (!builtin && !opaque_handle && !is_pointer &&
(storage == StorageClassFunction || storage == StorageClassGeneric))
{
// If the argument is a pure value and not an opaque type, we will pass by value.
- if (is_array(type))
- {
- // We are receiving an array by value. This is problematic.
- // We cannot be sure of the target address space since we are supposed to receive a copy,
- // but this is not possible with MSL without some extra work.
- // We will have to assume we're getting a reference in thread address space.
- // If we happen to get a reference in constant address space, the caller must emit a copy and pass that.
- // Thread const therefore becomes the only logical choice, since we cannot "create" a constant array from
- // non-constant arrays, but we can create thread const from constant.
- decl = string("thread const ") + decl;
- decl += " (&";
- const char *restrict_kw = to_restrict(name_id);
- if (*restrict_kw)
- {
- decl += " ";
- decl += restrict_kw;
- }
- decl += to_expression(name_id);
- decl += ")";
- decl += type_to_array_glsl(type);
- }
- else
- {
- if (!address_space.empty())
- decl = join(address_space, " ", decl);
- decl += " ";
- decl += to_expression(name_id);
- }
+ if (!address_space.empty())
+ decl = join(address_space, " ", decl);
+ decl += " ";
+ decl += to_expression(name_id);
}
else if (is_array(type) && !type_is_image)
{
@@ -8950,7 +9813,13 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg)
// constant SSBO * constant (&array)[N].
// However, this only matters for argument buffers, since for MSL 1.0 style codegen,
// we emit the buffer array on stack instead, and that seems to work just fine apparently.
- decl += " constant";
+
+ // If the argument was marked as being in device address space, any pointer to member would
+ // be const device, not constant.
+ if (argument_buffer_device_storage_mask & (1u << desc_set))
+ decl += " const device";
+ else
+ decl += " constant";
}
}
@@ -8989,6 +9858,16 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg)
decl += to_expression(name_id);
}
+ // Emulate texture2D atomic operations
+ auto *backing_var = maybe_get_backing_variable(name_id);
+ if (backing_var && atomic_image_vars.count(backing_var->self))
+ {
+ decl += ", device atomic_" + type_to_glsl(get<SPIRType>(var_type.image.type), 0);
+ decl += "* " + to_expression(name_id) + "_atomic";
+ }
+
+ use_builtin_array = false;
+
return decl;
}
@@ -9359,6 +10238,7 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id)
{
const char *restrict_kw;
type_name = join(get_type_address_space(type, id), " ", type_to_glsl(get<SPIRType>(type.parent_type), id));
+
switch (type.basetype)
{
case SPIRType::Image:
@@ -9384,7 +10264,9 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id)
{
case SPIRType::Struct:
// Need OpName lookup here to get a "sensible" name for a struct.
- return to_name(type.self);
+ // Allow Metal to use the array<T> template to make arrays a value type
+ type_name = to_name(type.self);
+ break;
case SPIRType::Image:
case SPIRType::SampledImage:
@@ -9457,7 +10339,69 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id)
if (type.vecsize > 1)
type_name += to_string(type.vecsize);
- return type_name;
+ if (type.array.empty() || use_builtin_array)
+ {
+ return type_name;
+ }
+ else
+ {
+ // Allow Metal to use the array<T> template to make arrays a value type
+ add_spv_func_and_recompile(SPVFuncImplUnsafeArray);
+ string res;
+ string sizes;
+
+ for (uint32_t i = 0; i < uint32_t(type.array.size()); i++)
+ {
+ res += "spvUnsafeArray<";
+ sizes += ", ";
+ sizes += to_array_size(type, i);
+ sizes += ">";
+ }
+
+ res += type_name + sizes;
+ return res;
+ }
+}
+
+string CompilerMSL::type_to_array_glsl(const SPIRType &type)
+{
+ // Allow Metal to use the array<T> template to make arrays a value type
+ switch (type.basetype)
+ {
+ case SPIRType::AtomicCounter:
+ case SPIRType::ControlPointArray:
+ {
+ return CompilerGLSL::type_to_array_glsl(type);
+ }
+ default:
+ {
+ if (use_builtin_array)
+ return CompilerGLSL::type_to_array_glsl(type);
+ else
+ return "";
+ }
+ }
+}
+
+// Threadgroup arrays can't have a wrapper type
+std::string CompilerMSL::variable_decl(const SPIRVariable &variable)
+{
+ if (variable.storage == StorageClassWorkgroup)
+ {
+ use_builtin_array = true;
+ }
+ std::string expr = CompilerGLSL::variable_decl(variable);
+ if (variable.storage == StorageClassWorkgroup)
+ {
+ use_builtin_array = false;
+ }
+ return expr;
+}
+
+// GCC workaround of lambdas calling protected funcs
+std::string CompilerMSL::variable_decl(const SPIRType &type, const std::string &name, uint32_t id)
+{
+ return CompilerGLSL::variable_decl(type, name, id);
}
std::string CompilerMSL::sampler_type(const SPIRType &type)
@@ -9530,9 +10474,14 @@ string CompilerMSL::image_type_glsl(const SPIRType &type, uint32_t id)
switch (img_type.dim)
{
case Dim1D:
- img_type_name += "depth1d_unsupported_by_metal";
- break;
case Dim2D:
+ if (img_type.dim == Dim1D && !msl_options.texture_1D_as_2D)
+ {
+ // Use a native Metal 1D texture
+ img_type_name += "depth1d_unsupported_by_metal";
+ break;
+ }
+
if (img_type.ms && img_type.arrayed)
{
if (!msl_options.supports_msl_version(2, 1))
@@ -9550,7 +10499,10 @@ string CompilerMSL::image_type_glsl(const SPIRType &type, uint32_t id)
img_type_name += "depth3d_unsupported_by_metal";
break;
case DimCube:
- img_type_name += (img_type.arrayed ? "depthcube_array" : "depthcube");
+ if (!msl_options.emulate_cube_array)
+ img_type_name += (img_type.arrayed ? "depthcube_array" : "depthcube");
+ else
+ img_type_name += (img_type.arrayed ? "depth2d_array" : "depthcube");
break;
default:
img_type_name += "unknown_depth_texture_type";
@@ -9561,9 +10513,6 @@ string CompilerMSL::image_type_glsl(const SPIRType &type, uint32_t id)
{
switch (img_type.dim)
{
- case Dim1D:
- img_type_name += (img_type.arrayed ? "texture1d_array" : "texture1d");
- break;
case DimBuffer:
if (img_type.ms || img_type.arrayed)
SPIRV_CROSS_THROW("Cannot use texel buffers with multisampling or array layers.");
@@ -9577,8 +10526,22 @@ string CompilerMSL::image_type_glsl(const SPIRType &type, uint32_t id)
else
img_type_name += "texture2d";
break;
+ case Dim1D:
case Dim2D:
case DimSubpassData:
+ if (img_type.dim == Dim1D && !msl_options.texture_1D_as_2D)
+ {
+ // Use a native Metal 1D texture
+ img_type_name += (img_type.arrayed ? "texture1d_array" : "texture1d");
+ break;
+ }
+
+ // Use Metal's native frame-buffer fetch API for subpass inputs.
+ if (img_type.dim == DimSubpassData && msl_options.is_ios() &&
+ msl_options.ios_use_framebuffer_fetch_subpasses)
+ {
+ return type_to_glsl(get<SPIRType>(img_type.type));
+ }
if (img_type.ms && img_type.arrayed)
{
if (!msl_options.supports_msl_version(2, 1))
@@ -9596,7 +10559,10 @@ string CompilerMSL::image_type_glsl(const SPIRType &type, uint32_t id)
img_type_name += "texture3d";
break;
case DimCube:
- img_type_name += (img_type.arrayed ? "texturecube_array" : "texturecube");
+ if (!msl_options.emulate_cube_array)
+ img_type_name += (img_type.arrayed ? "texturecube_array" : "texturecube");
+ else
+ img_type_name += (img_type.arrayed ? "texture2d_array" : "texturecube");
break;
default:
img_type_name += "unknown_texture_type";
@@ -9909,19 +10875,114 @@ string CompilerMSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage)
switch (builtin)
{
+ // Handle HLSL-style 0-based vertex/instance index.
// Override GLSL compiler strictness
case BuiltInVertexId:
- return "gl_VertexID";
+ ensure_builtin(StorageClassInput, BuiltInVertexId);
+ if (msl_options.enable_base_index_zero && msl_options.supports_msl_version(1, 1) &&
+ (msl_options.ios_support_base_vertex_instance || msl_options.is_macos()))
+ {
+ if (builtin_declaration)
+ {
+ if (needs_base_vertex_arg != TriState::No)
+ needs_base_vertex_arg = TriState::Yes;
+ return "gl_VertexID";
+ }
+ else
+ {
+ ensure_builtin(StorageClassInput, BuiltInBaseVertex);
+ return "(gl_VertexID - gl_BaseVertex)";
+ }
+ }
+ else
+ {
+ return "gl_VertexID";
+ }
case BuiltInInstanceId:
- return "gl_InstanceID";
+ ensure_builtin(StorageClassInput, BuiltInInstanceId);
+ if (msl_options.enable_base_index_zero && msl_options.supports_msl_version(1, 1) &&
+ (msl_options.ios_support_base_vertex_instance || msl_options.is_macos()))
+ {
+ if (builtin_declaration)
+ {
+ if (needs_base_instance_arg != TriState::No)
+ needs_base_instance_arg = TriState::Yes;
+ return "gl_InstanceID";
+ }
+ else
+ {
+ ensure_builtin(StorageClassInput, BuiltInBaseInstance);
+ return "(gl_InstanceID - gl_BaseInstance)";
+ }
+ }
+ else
+ {
+ return "gl_InstanceID";
+ }
case BuiltInVertexIndex:
- return "gl_VertexIndex";
+ ensure_builtin(StorageClassInput, BuiltInVertexIndex);
+ if (msl_options.enable_base_index_zero && msl_options.supports_msl_version(1, 1) &&
+ (msl_options.ios_support_base_vertex_instance || msl_options.is_macos()))
+ {
+ if (builtin_declaration)
+ {
+ if (needs_base_vertex_arg != TriState::No)
+ needs_base_vertex_arg = TriState::Yes;
+ return "gl_VertexIndex";
+ }
+ else
+ {
+ ensure_builtin(StorageClassInput, BuiltInBaseVertex);
+ return "(gl_VertexIndex - gl_BaseVertex)";
+ }
+ }
+ else
+ {
+ return "gl_VertexIndex";
+ }
case BuiltInInstanceIndex:
- return "gl_InstanceIndex";
+ ensure_builtin(StorageClassInput, BuiltInInstanceIndex);
+ if (msl_options.enable_base_index_zero && msl_options.supports_msl_version(1, 1) &&
+ (msl_options.ios_support_base_vertex_instance || msl_options.is_macos()))
+ {
+ if (builtin_declaration)
+ {
+ if (needs_base_instance_arg != TriState::No)
+ needs_base_instance_arg = TriState::Yes;
+ return "gl_InstanceIndex";
+ }
+ else
+ {
+ ensure_builtin(StorageClassInput, BuiltInBaseInstance);
+ return "(gl_InstanceIndex - gl_BaseInstance)";
+ }
+ }
+ else
+ {
+ return "gl_InstanceIndex";
+ }
case BuiltInBaseVertex:
- return "gl_BaseVertex";
+ if (msl_options.supports_msl_version(1, 1) &&
+ (msl_options.ios_support_base_vertex_instance || msl_options.is_macos()))
+ {
+ needs_base_vertex_arg = TriState::No;
+ return "gl_BaseVertex";
+ }
+ else
+ {
+ SPIRV_CROSS_THROW("BaseVertex requires Metal 1.1 and Mac or Apple A9+ hardware.");
+ }
case BuiltInBaseInstance:
- return "gl_BaseInstance";
+ if (msl_options.supports_msl_version(1, 1) &&
+ (msl_options.ios_support_base_vertex_instance || msl_options.is_macos()))
+ {
+ needs_base_instance_arg = TriState::No;
+ return "gl_BaseInstance";
+ }
+ else
+ {
+ SPIRV_CROSS_THROW("BaseInstance requires Metal 1.1 and Mac or Apple A9+ hardware.");
+ }
case BuiltInDrawIndex:
SPIRV_CROSS_THROW("DrawIndex is not supported in MSL.");
@@ -10304,9 +11365,12 @@ string CompilerMSL::built_in_func_arg(BuiltIn builtin, bool prefix_comma)
if (prefix_comma)
bi_arg += ", ";
+ // Handle HLSL-style 0-based vertex/instance index.
+ builtin_declaration = true;
bi_arg += builtin_type_decl(builtin);
bi_arg += " " + builtin_to_glsl(builtin, StorageClassInput);
bi_arg += " [[" + builtin_qualifier(builtin) + "]]";
+ builtin_declaration = false;
return bi_arg;
}
@@ -10600,6 +11664,14 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui
suppress_missing_prototypes = true;
break;
+ // Emulate texture2D atomic operations
+ case OpImageTexelPointer:
+ {
+ auto *var = compiler.maybe_get_backing_variable(args[2]);
+ image_pointers[args[1]] = var ? var->self : ID(0);
+ break;
+ }
+
case OpImageWrite:
uses_resource_write = true;
break;
@@ -10608,6 +11680,7 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui
check_resource_write(args[0]);
break;
+ // Emulate texture2D atomic operations
case OpAtomicExchange:
case OpAtomicCompareExchange:
case OpAtomicCompareExchangeWeak:
@@ -10622,13 +11695,39 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui
case OpAtomicAnd:
case OpAtomicOr:
case OpAtomicXor:
+ {
uses_atomics = true;
+ auto it = image_pointers.find(args[2]);
+ if (it != image_pointers.end())
+ {
+ compiler.atomic_image_vars.insert(it->second);
+ }
check_resource_write(args[2]);
break;
+ }
+
+ case OpAtomicStore:
+ {
+ uses_atomics = true;
+ auto it = image_pointers.find(args[0]);
+ if (it != image_pointers.end())
+ {
+ compiler.atomic_image_vars.insert(it->second);
+ }
+ check_resource_write(args[0]);
+ break;
+ }
case OpAtomicLoad:
+ {
uses_atomics = true;
+ auto it = image_pointers.find(args[2]);
+ if (it != image_pointers.end())
+ {
+ compiler.atomic_image_vars.insert(it->second);
+ }
break;
+ }
case OpGroupNonUniformInverseBallot:
needs_subgroup_invocation_id = true;
@@ -10655,6 +11754,7 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui
uint32_t result_type = args[0];
uint32_t id = args[1];
uint32_t ptr = args[2];
+
compiler.set<SPIRExpression>(id, "", result_type, true);
compiler.register_read(id, ptr, true);
compiler.ir.ids[id].set_allow_type_rewrite();
@@ -10690,60 +11790,55 @@ CompilerMSL::SPVFuncImpl CompilerMSL::OpCodePreprocessor::get_spv_func_impl(Op o
case OpFMod:
return SPVFuncImplMod;
- case OpFunctionCall:
- {
- auto &return_type = compiler.get<SPIRType>(args[0]);
- if (return_type.array.size() > 1)
+ case OpFAdd:
+ if (compiler.msl_options.invariant_float_math)
{
- if (return_type.array.size() > SPVFuncImplArrayCopyMultidimMax)
- SPIRV_CROSS_THROW("Cannot support this many dimensions for arrays of arrays.");
- return static_cast<SPVFuncImpl>(SPVFuncImplArrayCopyMultidimBase + return_type.array.size());
+ return SPVFuncImplFAdd;
}
- else if (return_type.array.size() > 0)
- return SPVFuncImplArrayCopy;
-
break;
- }
-
- case OpStore:
- {
- // Get the result type of the RHS. Since this is run as a pre-processing stage,
- // we must extract the result type directly from the Instruction, rather than the ID.
- uint32_t id_lhs = args[0];
- uint32_t id_rhs = args[1];
- const SPIRType *type = nullptr;
- if (compiler.ir.ids[id_rhs].get_type() != TypeNone)
- {
- // Could be a constant, or similar.
- type = &compiler.expression_type(id_rhs);
- }
- else
+ case OpFMul:
+ case OpOuterProduct:
+ case OpMatrixTimesVector:
+ case OpVectorTimesMatrix:
+ case OpMatrixTimesMatrix:
+ if (compiler.msl_options.invariant_float_math)
{
- // Or ... an expression.
- uint32_t tid = result_types[id_rhs];
- if (tid)
- type = &compiler.get<SPIRType>(tid);
+ return SPVFuncImplFMul;
}
+ break;
- auto *var = compiler.maybe_get<SPIRVariable>(id_lhs);
+ case OpTypeArray:
+ {
+ // Allow Metal to use the array<T> template to make arrays a value type
+ return SPVFuncImplUnsafeArray;
+ }
- // Are we simply assigning to a statically assigned variable which takes a constant?
- // Don't bother emitting this function.
- bool static_expression_lhs =
- var && var->storage == StorageClassFunction && var->statically_assigned && var->remapped_variable;
- if (type && compiler.is_array(*type) && !static_expression_lhs)
+ // Emulate texture2D atomic operations
+ case OpAtomicExchange:
+ case OpAtomicCompareExchange:
+ case OpAtomicCompareExchangeWeak:
+ case OpAtomicIIncrement:
+ case OpAtomicIDecrement:
+ case OpAtomicIAdd:
+ case OpAtomicISub:
+ case OpAtomicSMin:
+ case OpAtomicUMin:
+ case OpAtomicSMax:
+ case OpAtomicUMax:
+ case OpAtomicAnd:
+ case OpAtomicOr:
+ case OpAtomicXor:
+ case OpAtomicLoad:
+ case OpAtomicStore:
+ {
+ auto it = image_pointers.find(args[opcode == OpAtomicStore ? 0 : 2]);
+ if (it != image_pointers.end())
{
- if (type->array.size() > 1)
- {
- if (type->array.size() > SPVFuncImplArrayCopyMultidimMax)
- SPIRV_CROSS_THROW("Cannot support this many dimensions for arrays of arrays.");
- return static_cast<SPVFuncImpl>(SPVFuncImplArrayCopyMultidimBase + type->array.size());
- }
- else
- return SPVFuncImplArrayCopy;
+ uint32_t tid = compiler.get<SPIRVariable>(it->second).basetype;
+ if (tid && compiler.get<SPIRType>(tid).image.dim == Dim2D)
+ return SPVFuncImplImage2DAtomicCoords;
}
-
break;
}
@@ -11213,8 +12308,20 @@ void CompilerMSL::analyze_argument_buffers()
argument_buffer_ids[desc_set] = next_id;
auto &buffer_type = set<SPIRType>(type_id);
- buffer_type.storage = StorageClassUniform;
+
buffer_type.basetype = SPIRType::Struct;
+
+ if ((argument_buffer_device_storage_mask & (1u << desc_set)) != 0)
+ {
+ buffer_type.storage = StorageClassStorageBuffer;
+ // Make sure the argument buffer gets marked as const device.
+ set_decoration(next_id, DecorationNonWritable);
+ // Need to mark the type as a Block to enable this.
+ set_decoration(type_id, DecorationBlock);
+ }
+ else
+ buffer_type.storage = StorageClassUniform;
+
set_name(type_id, join("spvDescriptorSetBuffer", desc_set));
auto &ptr_type = set<SPIRType>(ptr_type_id);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.hpp
index 4819607610a..31fcc2c9491 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.hpp
@@ -274,15 +274,34 @@ public:
bool multiview = false;
bool view_index_from_device_index = false;
bool dispatch_base = false;
+ bool texture_1D_as_2D = false;
// Enable use of MSL 2.0 indirect argument buffers.
// MSL 2.0 must also be enabled.
bool argument_buffers = false;
+ // Ensures vertex and instance indices start at zero. This reflects the behavior of HLSL with SV_VertexID and SV_InstanceID.
+ bool enable_base_index_zero = false;
+
// Fragment output in MSL must have at least as many components as the render pass.
// Add support to explicit pad out components.
bool pad_fragment_output_components = false;
+ // Specifies whether the iOS target version supports the [[base_vertex]] and [[base_instance]] attributes.
+ bool ios_support_base_vertex_instance = false;
+
+ // Use Metal's native frame-buffer fetch API for subpass inputs.
+ bool ios_use_framebuffer_fetch_subpasses = false;
+
+ // Enables use of "fma" intrinsic for invariant float math
+ bool invariant_float_math = false;
+
+ // Emulate texturecube_array with texture2d_array for iOS where this type is not available
+ bool emulate_cube_array = false;
+
+ // Allow user to enable decoration binding
+ bool enable_decoration_binding = false;
+
// Requires MSL 2.1, use the native support for texel buffers.
bool texture_buffer_native = false;
@@ -410,6 +429,10 @@ public:
// This corresponds to VK_KHR_push_descriptor in Vulkan.
void add_discrete_descriptor_set(uint32_t desc_set);
+ // If an argument buffer is large enough, it may need to be in the device storage space rather than
+ // constant. Opt-in to this behavior here on a per set basis.
+ void set_argument_buffer_device_address_space(uint32_t desc_set, bool device_storage);
+
// Query after compilation is done. This allows you to check if a location or set/binding combination was used by the shader.
bool is_msl_vertex_attribute_used(uint32_t location);
@@ -483,6 +506,11 @@ protected:
SPVFuncImplArrayOfArrayCopy5Dim = SPVFuncImplArrayCopyMultidimBase + 5,
SPVFuncImplArrayOfArrayCopy6Dim = SPVFuncImplArrayCopyMultidimBase + 6,
SPVFuncImplTexelBufferCoords,
+ SPVFuncImplImage2DAtomicCoords, // Emulate texture2D atomic operations
+ SPVFuncImplFMul,
+ SPVFuncImplFAdd,
+ SPVFuncImplCubemapTo2DArrayFace,
+ SPVFuncImplUnsafeArray, // Allow Metal to use the array<T> template to make arrays a value type
SPVFuncImplInverse4x4,
SPVFuncImplInverse3x3,
SPVFuncImplInverse2x2,
@@ -527,6 +555,9 @@ protected:
SPVFuncImplArrayCopyMultidimMax = 6
};
+ // If the underlying resource has been used for comparison then duplicate loads of that resource must be too
+ // Use Metal's native frame-buffer fetch API for subpass inputs.
+ void emit_texture_op(const Instruction &i) override;
void emit_binary_unord_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op);
void emit_instruction(const Instruction &instr) override;
void emit_glsl_op(uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args,
@@ -546,6 +577,16 @@ protected:
const std::string &qualifier = "", uint32_t base_offset = 0) override;
void emit_struct_padding_target(const SPIRType &type) override;
std::string type_to_glsl(const SPIRType &type, uint32_t id = 0) override;
+
+ // Allow Metal to use the array<T> template to make arrays a value type
+ std::string type_to_array_glsl(const SPIRType &type) override;
+
+ // Threadgroup arrays can't have a wrapper type
+ std::string variable_decl(const SPIRVariable &variable) override;
+
+ // GCC workaround of lambdas calling protected functions (for older GCC versions)
+ std::string variable_decl(const SPIRType &type, const std::string &name, uint32_t id = 0) override;
+
std::string image_type_glsl(const SPIRType &type, uint32_t id = 0) override;
std::string sampler_type(const SPIRType &type);
std::string builtin_to_glsl(spv::BuiltIn builtin, spv::StorageClass storage) override;
@@ -559,9 +600,13 @@ protected:
uint32_t grad_y, uint32_t lod, uint32_t coffset, uint32_t offset, uint32_t bias,
uint32_t comp, uint32_t sample, uint32_t minlod, bool *p_forward) override;
std::string to_initializer_expression(const SPIRVariable &var) override;
+
std::string unpack_expression_type(std::string expr_str, const SPIRType &type, uint32_t physical_type_id,
bool is_packed, bool row_major) override;
+ // Returns true for BuiltInSampleMask because gl_SampleMask[] is an array in SPIR-V, but [[sample_mask]] is a scalar in Metal.
+ bool builtin_translates_to_nonarray(spv::BuiltIn builtin) const override;
+
std::string bitcast_glsl_op(const SPIRType &result_type, const SPIRType &argument_type) override;
bool skip_argument(uint32_t id) const override;
std::string to_member_reference(uint32_t base, const SPIRType &type, uint32_t index, bool ptr_chain) override;
@@ -569,6 +614,10 @@ protected:
void replace_illegal_names() override;
void declare_undefined_values() override;
void declare_constant_arrays();
+
+ // Constant arrays of non-primitive types (i.e. matrices) won't link properly into Metal libraries
+ void declare_complex_constant_arrays();
+
bool is_patch_block(const SPIRType &type);
bool is_non_native_row_major_matrix(uint32_t id) override;
bool member_is_non_native_row_major_matrix(const SPIRType &type, uint32_t index) override;
@@ -609,6 +658,7 @@ protected:
uint32_t ensure_correct_builtin_type(uint32_t type_id, spv::BuiltIn builtin);
uint32_t ensure_correct_attribute_type(uint32_t type_id, uint32_t location);
+ void emit_custom_templates();
void emit_custom_functions();
void emit_resources();
void emit_specialization_constants_and_structs();
@@ -706,8 +756,11 @@ protected:
void analyze_sampled_image_usage();
bool emit_tessellation_access_chain(const uint32_t *ops, uint32_t length);
+ bool emit_tessellation_io_load(uint32_t result_type, uint32_t id, uint32_t ptr);
bool is_out_of_bounds_tessellation_level(uint32_t id_lhs);
+ void ensure_builtin(spv::StorageClass storage, spv::BuiltIn builtin);
+
void mark_implicit_builtin(spv::StorageClass storage, spv::BuiltIn builtin, uint32_t id);
std::string convert_to_f32(const std::string &expr, uint32_t components);
@@ -758,9 +811,20 @@ protected:
VariableID patch_stage_out_var_id = 0;
VariableID stage_in_ptr_var_id = 0;
VariableID stage_out_ptr_var_id = 0;
+
+ // Handle HLSL-style 0-based vertex/instance index.
+ enum class TriState
+ {
+ Neutral,
+ No,
+ Yes
+ };
+ TriState needs_base_vertex_arg = TriState::Neutral;
+ TriState needs_base_instance_arg = TriState::Neutral;
+
bool has_sampled_images = false;
- bool needs_vertex_idx_arg = false;
- bool needs_instance_idx_arg = false;
+ bool builtin_declaration = false; // Handle HLSL-style 0-based vertex/instance index.
+ bool use_builtin_array = false; // Force the use of C style array declaration.
bool is_rasterization_disabled = false;
bool capture_output_to_buffer = false;
bool needs_swizzle_buffer_def = false;
@@ -789,12 +853,15 @@ protected:
std::unordered_set<uint32_t> buffers_requiring_array_length;
SmallVector<uint32_t> buffer_arrays;
+ std::unordered_set<uint32_t> atomic_image_vars; // Emulate texture2D atomic operations
// Must be ordered since array is in a specific order.
std::map<SetBindingPair, std::pair<uint32_t, uint32_t>> buffers_requiring_dynamic_offset;
uint32_t argument_buffer_ids[kMaxArgumentBuffers];
uint32_t argument_buffer_discrete_mask = 0;
+ uint32_t argument_buffer_device_storage_mask = 0;
+
void analyze_argument_buffers();
bool descriptor_set_is_argument_buffer(uint32_t desc_set) const;
@@ -819,6 +886,7 @@ protected:
CompilerMSL &compiler;
std::unordered_map<uint32_t, uint32_t> result_types;
+ std::unordered_map<uint32_t, uint32_t> image_pointers; // Emulate texture2D atomic operations
bool suppress_missing_prototypes = false;
bool uses_atomics = false;
bool uses_resource_write = false;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_reflect.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_reflect.cpp
index 4fe377ade32..1e8f615c701 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_reflect.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_reflect.cpp
@@ -443,9 +443,12 @@ void CompilerReflection::emit_entry_points()
get_work_group_size_specialization_constants(spec_x, spec_y, spec_z);
json_stream->emit_json_key_array("workgroup_size");
- json_stream->emit_json_array_value(spec_x.id != ID(0) ? spec_x.constant_id : spv_entry.workgroup_size.x);
- json_stream->emit_json_array_value(spec_y.id != ID(0) ? spec_y.constant_id : spv_entry.workgroup_size.y);
- json_stream->emit_json_array_value(spec_z.id != ID(0) ? spec_z.constant_id : spv_entry.workgroup_size.z);
+ json_stream->emit_json_array_value(spec_x.id != ID(0) ? spec_x.constant_id :
+ spv_entry.workgroup_size.x);
+ json_stream->emit_json_array_value(spec_y.id != ID(0) ? spec_y.constant_id :
+ spv_entry.workgroup_size.y);
+ json_stream->emit_json_array_value(spec_z.id != ID(0) ? spec_z.constant_id :
+ spv_entry.workgroup_size.z);
json_stream->end_json_array();
json_stream->emit_json_key_array("workgroup_size_is_spec_constant_id");
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/test_shaders.py b/3rdparty/bgfx/3rdparty/spirv-cross/test_shaders.py
index f58018e9a73..73187b36e7a 100755
--- a/3rdparty/bgfx/3rdparty/spirv-cross/test_shaders.py
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/test_shaders.py
@@ -174,7 +174,10 @@ def cross_compile_msl(shader, spirv, opt, iterations, paths):
subprocess.check_call([paths.glslang, '--amb' ,'--target-env', 'vulkan1.1', '-V', '-o', spirv_path, shader])
if opt:
- subprocess.check_call([paths.spirv_opt, '--skip-validation', '-O', '-o', spirv_path, spirv_path])
+ if '.graphics-robust-access.' in shader:
+ subprocess.check_call([paths.spirv_opt, '--skip-validation', '-O', '--graphics-robust-access', '-o', spirv_path, spirv_path])
+ else:
+ subprocess.check_call([paths.spirv_opt, '--skip-validation', '-O', '-o', spirv_path, spirv_path])
spirv_cross_path = paths.spirv_cross
@@ -195,6 +198,12 @@ def cross_compile_msl(shader, spirv, opt, iterations, paths):
msl_args.append('--msl-argument-buffers')
if '.texture-buffer-native.' in shader:
msl_args.append('--msl-texture-buffer-native')
+ if '.framebuffer-fetch.' in shader:
+ msl_args.append('--msl-framebuffer-fetch')
+ if '.invariant-float-math.' in shader:
+ msl_args.append('--msl-invariant-float-math')
+ if '.emulate-cube-array.' in shader:
+ msl_args.append('--msl-emulate-cube-array')
if '.discrete.' in shader:
# Arbitrary for testing purposes.
msl_args.append('--msl-discrete-descriptor-set')
@@ -217,6 +226,11 @@ def cross_compile_msl(shader, spirv, opt, iterations, paths):
msl_args.append('--msl-dynamic-buffer')
msl_args.append('1')
msl_args.append('2')
+ if '.device-argument-buffer.' in shader:
+ msl_args.append('--msl-device-argument-buffer')
+ msl_args.append('0')
+ msl_args.append('--msl-device-argument-buffer')
+ msl_args.append('1')
subprocess.check_call(msl_args)
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/test_shaders.sh b/3rdparty/bgfx/3rdparty/spirv-cross/test_shaders.sh
index 4498ac3f08c..ee47ec64c38 100755
--- a/3rdparty/bgfx/3rdparty/spirv-cross/test_shaders.sh
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/test_shaders.sh
@@ -21,4 +21,6 @@ echo "Using SPIRV-Cross in: \"$SPIRV_CROSS_PATH\"."
./test_shaders.py shaders-hlsl --hlsl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
./test_shaders.py shaders-hlsl-no-opt --hlsl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
./test_shaders.py shaders-reflection --reflect --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-ue4 --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-ue4 --msl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/update_test_shaders.sh b/3rdparty/bgfx/3rdparty/spirv-cross/update_test_shaders.sh
index c33afc5caaa..7366e0bc94e 100755
--- a/3rdparty/bgfx/3rdparty/spirv-cross/update_test_shaders.sh
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/update_test_shaders.sh
@@ -21,5 +21,7 @@ echo "Using SPIRV-Cross in: \"$SPIRV_CROSS_PATH\"."
./test_shaders.py shaders-hlsl --update --hlsl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
./test_shaders.py shaders-hlsl-no-opt --update --hlsl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
./test_shaders.py shaders-reflection --reflect --update --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-ue4 --update --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-ue4 --update --msl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.h b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.h
index 1b67617bfd5..53928a4a9e1 100644
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.h
+++ b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.h
@@ -57,7 +57,7 @@ typedef unsigned int SpvId;
#define SPV_REVISION 1
static const unsigned int SpvMagicNumber = 0x07230203;
-static const unsigned int SpvVersion = 0x00010400;
+static const unsigned int SpvVersion = 0x00010500;
static const unsigned int SpvRevision = 1;
static const unsigned int SpvOpCodeMask = 0xffff;
static const unsigned int SpvWordCountShift = 16;
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp
index f5cbda1bb80..ae999578f27 100644
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp
@@ -53,7 +53,7 @@ typedef unsigned int Id;
#define SPV_REVISION 1
static const unsigned int MagicNumber = 0x07230203;
-static const unsigned int Version = 0x00010400;
+static const unsigned int Version = 0x00010500;
static const unsigned int Revision = 1;
static const unsigned int OpCodeMask = 0xffff;
static const unsigned int WordCountShift = 16;
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11
index 00c7b1803c0..34ee3b498f7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11
+++ b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11
@@ -53,7 +53,7 @@ typedef unsigned int Id;
#define SPV_REVISION 1
static const unsigned int MagicNumber = 0x07230203;
-static const unsigned int Version = 0x00010400;
+static const unsigned int Version = 0x00010500;
static const unsigned int Revision = 1;
static const unsigned int OpCodeMask = 0xffff;
static const unsigned int WordCountShift = 16;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/BUILD.gn b/3rdparty/bgfx/3rdparty/spirv-tools/BUILD.gn
index a8bd134e68f..5c8eb9a0d80 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/BUILD.gn
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/BUILD.gn
@@ -295,6 +295,14 @@ config("spvtools_internal_config") {
}
}
+source_set("spv_headers") {
+ sources = [
+ "$spirv_headers/include/spirv/1.2/GLSL.std.450.h",
+ "$spirv_headers/include/spirv/unified1/OpenCL.std.h",
+ "$spirv_headers/include/spirv/unified1/spirv.h",
+ ]
+}
+
source_set("spvtools_headers") {
sources = [
"include/spirv-tools/instrument.hpp",
@@ -324,16 +332,22 @@ static_library("spvtools") {
"source/assembly_grammar.h",
"source/binary.cpp",
"source/binary.h",
+ "source/cfa.h",
"source/diagnostic.cpp",
"source/diagnostic.h",
"source/disassemble.cpp",
+ "source/disassemble.h",
"source/enum_set.h",
"source/enum_string_mapping.cpp",
+ "source/enum_string_mapping.h",
"source/ext_inst.cpp",
"source/ext_inst.h",
"source/extensions.cpp",
"source/extensions.h",
"source/instruction.h",
+ "source/latest_version_glsl_std_450_header.h",
+ "source/latest_version_opencl_std_header.h",
+ "source/latest_version_spirv_header.h",
"source/libspirv.cpp",
"source/macro.h",
"source/name_mapper.cpp",
@@ -379,6 +393,7 @@ static_library("spvtools") {
]
public_deps = [
+ ":spv_headers",
":spvtools_core_enums_unified1",
":spvtools_headers",
]
@@ -393,8 +408,12 @@ static_library("spvtools") {
static_library("spvtools_val") {
sources = [
"source/val/basic_block.cpp",
+ "source/val/basic_block.h",
"source/val/construct.cpp",
+ "source/val/construct.h",
+ "source/val/decoration.h",
"source/val/function.cpp",
+ "source/val/function.h",
"source/val/instruction.cpp",
"source/val/validate.cpp",
"source/val/validate.h",
@@ -425,14 +444,17 @@ static_library("spvtools_val") {
"source/val/validate_logicals.cpp",
"source/val/validate_memory.cpp",
"source/val/validate_memory_semantics.cpp",
+ "source/val/validate_memory_semantics.h",
"source/val/validate_misc.cpp",
"source/val/validate_mode_setting.cpp",
"source/val/validate_non_uniform.cpp",
"source/val/validate_primitives.cpp",
"source/val/validate_scopes.cpp",
+ "source/val/validate_scopes.h",
"source/val/validate_small_type_uses.cpp",
"source/val/validate_type.cpp",
"source/val/validation_state.cpp",
+ "source/val/validation_state.h",
]
deps = [
@@ -720,6 +742,7 @@ static_library("spvtools_reduce") {
"source/reduce/reducer.h",
"source/reduce/reduction_opportunity.cpp",
"source/reduce/reduction_opportunity.h",
+ "source/reduce/reduction_opportunity_finder.h",
"source/reduce/reduction_pass.cpp",
"source/reduce/reduction_pass.h",
"source/reduce/reduction_util.cpp",
@@ -734,10 +757,6 @@ static_library("spvtools_reduce") {
"source/reduce/remove_function_reduction_opportunity_finder.h",
"source/reduce/remove_instruction_reduction_opportunity.cpp",
"source/reduce/remove_instruction_reduction_opportunity.h",
- "source/reduce/remove_opname_instruction_reduction_opportunity_finder.cpp",
- "source/reduce/remove_opname_instruction_reduction_opportunity_finder.h",
- "source/reduce/remove_relaxed_precision_decoration_opportunity_finder.cpp",
- "source/reduce/remove_relaxed_precision_decoration_opportunity_finder.h",
"source/reduce/remove_selection_reduction_opportunity.cpp",
"source/reduce/remove_selection_reduction_opportunity.h",
"source/reduce/remove_selection_reduction_opportunity_finder.cpp",
@@ -876,7 +895,9 @@ source_set("spvtools_util_cli_consumer") {
"tools/util/cli_consumer.cpp",
"tools/util/cli_consumer.h",
]
- deps = [ ":spvtools_headers" ]
+ deps = [
+ ":spvtools_headers",
+ ]
configs += [ ":spvtools_internal_config" ]
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/CHANGES b/3rdparty/bgfx/3rdparty/spirv-tools/CHANGES
index 10062f93b80..5263f1296bf 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/CHANGES
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/CHANGES
@@ -1,7 +1,17 @@
Revision history for SPIRV-Tools
-v2019.5-dev 2019-08-08
+v2019.5-dev 2019-10-21
- General:
+ - Export SPIRV-Tools targets on installation
+ - SPIRV-Tools support for SPIR-V 1.5 (#2865)
+ - Add WebGPU SPIR-V Assembler in JavaScript. (#2876)
+ - Add Bazel build configuration. (#2891)
+ - Add support for building with emscripten (#2948)
+ - Update SPIR-V binary header test for SPIR-V 1.5 (#2967)
+ - Add fuzzer for spirv-as call path (#2976)
+ - Improved CMake install step. (#2963)
+ - Add fuzzer for spirv-dis call path (#2977)
+ - Ensure timestamp does not vary with timezone. (#2982)
- Optimizer
- Add descriptor array scalar replacement (#2742)
- Add pass to wrap OpKill in a function call (#2790)
@@ -9,17 +19,51 @@ v2019.5-dev 2019-08-08
- Add pass to replace AMD shader ballot extension (#2811)
- Add pass to make Float32 operation relax precision (#2808)
- Add pass to make relax precision operation Float16 (#2808)
+ - Add pass to replace uses of 3 AMD extensions (#2814)
+ - Fold Min, Max, and Clamp instructions. (#2836)
+ - Better handling of OpKill in continues (#2842,#2922,#2933)
+ - Enable OpTypeCooperativeMatrix specialization (#2927)
+ - Support constant-folding UConvert and SConvert (#2960)
Fixes:
- Instrument: Fix version 2 output record write for tess eval shaders. (#2782)
- Instrument: Add support for Buffer Device Address extension (#2792)
- Fix check for changed binary in API call. (#2798)
+ - Instrument: Fix version 2 output record write for tess eval shaders. (#2782)
+ - Instrument: Add support for Buffer Device Address extension (#2792)
+ - Fix check for changed binary in API call. (#2798)
+ - For WebGPU<->Vulkan optimization, set correct execution environment (#2834)
+ - Handle OpConstantNull in copy-prop-arrays. (#2870)
+ - Use OpReturn* in wrap-opkill (#2886)
- Validator
+ - Add generic builtin validation of target (#2843)
+ - Extra resource interface validation (#2864)
+ - Adding valilidation checks for OpEntryPoint duplicate names and execution mode (#2862)
+ - Relaxed bitcast with pointers (#2878)
+ - Validate physical storage buffer restrictions (#2930)
+ - Add SPV_KHR_shader_clock validation (#2879)
+ - Validate that selections are structured (#2962)
+ - Disallow use of OpCompositeExtract/OpCompositeInsert with no indices (#2980)
+ - Check that derivatives operate on 32-bit values (#2983)
Fixes:
- Fix validation of constant matrices (#2794)
- Update "remquor" validation
+ - Fix validation of constant matrices (#2794)
+ - Update "remquor" validation
+ - Only allow previously declared forward refs in structs (#2920)
- Reduce
- Remove relaxed precision decorations (#2797)
+ - Reduce/fuzz: improve command line args (#2932)
+ - Improve remove unref instr pass (#2945)
Fixes:
+ - Fuzz
+ - Fix add-dead-break and add-dead-continue passes to respect dominance (#2838)
+ - Add fuzzer pass to copy objects (#2853)
+ - Add fuzzer pass to replace ids with synonyms (#2857)
+ - Allow validation during spirv-fuzz replay (#2873)
+ - Employ the "swarm testing" idea in spirv-fuzz (#2890)
+ - reduce/fuzz: improve command line args (#2932)
+ - option to convert shader into a form that renders red (#2934)
+ - Add fuzzer pass to change selection controls (#2944)
+ - add transformation and pass to construct composites (#2941)
+ - Add fuzzer pass to change loop controls (#2949)
+ - Add fuzzer pass to change function controls (#2951)
+ - Add fuzzer pass to add NoContraction decorations (#2950)
+
v2019.4 2019-08-08
- General:
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/DEPS b/3rdparty/bgfx/3rdparty/spirv-tools/DEPS
index 8a61f227d9a..311b7edd9c0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/DEPS
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/DEPS
@@ -6,7 +6,7 @@ vars = {
'effcee_revision': 'cd25ec17e9382f99a895b9ef53ff3c277464d07d',
'googletest_revision': 'f2fb48c3b3d79a75a88a99fba6576b25d42ec528',
're2_revision': '5bd613749fd530b576b890283bfb6bc6ea6246cb',
- 'spirv_headers_revision': '842ec90674627ed2ffef609e3cd79d1562eded01',
+ 'spirv_headers_revision': 'af64a9e826bf5bb5fcd2434dd71be1e41e922563',
}
deps = {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/build-version.inc b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/build-version.inc
index 115b30e9dfd..77f10bc9b82 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/build-version.inc
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/build-version.inc
@@ -1 +1 @@
-"v2019.5-dev", "SPIRV-Tools v2019.5-dev v2019.4-102-gc18c9ff6"
+"v2019.5-dev", "SPIRV-Tools v2019.5-dev v2019.4-153-ge0d5544c"
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/CMakeLists.txt b/3rdparty/bgfx/3rdparty/spirv-tools/source/CMakeLists.txt
index a083995c49f..f3b5942bc85 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/CMakeLists.txt
@@ -340,7 +340,7 @@ spvtools_default_compile_options(${SPIRV_TOOLS})
target_include_directories(${SPIRV_TOOLS}
PUBLIC
$<BUILD_INTERFACE:${spirv-tools_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/include>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${spirv-tools_BINARY_DIR}
PRIVATE ${SPIRV_HEADER_INCLUDE_DIR}
)
@@ -353,7 +353,7 @@ spvtools_default_compile_options(${SPIRV_TOOLS}-shared)
target_include_directories(${SPIRV_TOOLS}-shared
PUBLIC
$<BUILD_INTERFACE:${spirv-tools_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/include>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${spirv-tools_BINARY_DIR}
PRIVATE ${SPIRV_HEADER_INCLUDE_DIR}
)
@@ -379,7 +379,17 @@ if(ENABLE_SPIRV_TOOLS_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
- install(EXPORT ${SPIRV_TOOLS}Targets DESTINATION lib/cmake)
+ export(EXPORT ${SPIRV_TOOLS}Targets FILE ${SPIRV_TOOLS}Target.cmake)
+
+ spvtools_config_package_dir(${SPIRV_TOOLS} PACKAGE_DIR)
+ install(EXPORT ${SPIRV_TOOLS}Targets FILE ${SPIRV_TOOLS}Target.cmake DESTINATION ${PACKAGE_DIR})
+
+ # Special config file for root library compared to other libs.
+ file(WRITE ${CMAKE_BINARY_DIR}/${SPIRV_TOOLS}Config.cmake
+ "include(\${CMAKE_CURRENT_LIST_DIR}/${SPIRV_TOOLS}Target.cmake)\n"
+ "set(${SPIRV_TOOLS}_LIBRARIES ${SPIRV_TOOLS})\n"
+ "get_target_property(${SPIRV_TOOLS}_INCLUDE_DIRS ${SPIRV_TOOLS} INTERFACE_INCLUDE_DIRECTORIES)\n")
+ install(FILES ${CMAKE_BINARY_DIR}/${SPIRV_TOOLS}Config.cmake DESTINATION ${PACKAGE_DIR})
endif(ENABLE_SPIRV_TOOLS_INSTALL)
if(MSVC)
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp
index 636dac8c875..1d31283731c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp
@@ -781,9 +781,10 @@ spv_result_t spvBinaryParse(const spv_const_context context, void* user_data,
// TODO(dneto): This probably belongs in text.cpp since that's the only place
// that a spv_binary_t value is created.
void spvBinaryDestroy(spv_binary binary) {
- if (!binary) return;
- delete[] binary->code;
- delete binary;
+ if (binary) {
+ if (binary->code) delete[] binary->code;
+ delete binary;
+ }
}
size_t spv_strnlen_s(const char* str, size_t strsz) {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/CMakeLists.txt b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/CMakeLists.txt
index b21d210d055..627fcba87f8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/CMakeLists.txt
@@ -30,6 +30,7 @@ if(SPIRV_BUILD_FUZZER)
set(SPIRV_TOOLS_FUZZ_SOURCES
data_descriptor.h
+ equivalence_relation.h
fact_manager.h
force_render_red.h
fuzzer.h
@@ -37,14 +38,21 @@ if(SPIRV_BUILD_FUZZER)
fuzzer_pass.h
fuzzer_pass_add_dead_breaks.h
fuzzer_pass_add_dead_continues.h
+ fuzzer_pass_add_no_contraction_decorations.h
fuzzer_pass_add_useful_constructs.h
+ fuzzer_pass_adjust_function_controls.h
+ fuzzer_pass_adjust_loop_controls.h
+ fuzzer_pass_adjust_memory_operands_masks.h
+ fuzzer_pass_adjust_selection_controls.h
fuzzer_pass_apply_id_synonyms.h
+ fuzzer_pass_construct_composites.h
fuzzer_pass_copy_objects.h
fuzzer_pass_obfuscate_constants.h
fuzzer_pass_permute_blocks.h
fuzzer_pass_split_blocks.h
fuzzer_util.h
id_use_descriptor.h
+ instruction_descriptor.h
protobufs/spirvfuzz_protobufs.h
pseudo_random_generator.h
random_generator.h
@@ -55,15 +63,22 @@ if(SPIRV_BUILD_FUZZER)
transformation_add_constant_scalar.h
transformation_add_dead_break.h
transformation_add_dead_continue.h
+ transformation_add_no_contraction_decoration.h
transformation_add_type_boolean.h
transformation_add_type_float.h
transformation_add_type_int.h
transformation_add_type_pointer.h
+ transformation_composite_construct.h
+ transformation_composite_extract.h
transformation_copy_object.h
transformation_move_block_down.h
transformation_replace_boolean_constant_with_constant_binary.h
transformation_replace_constant_with_uniform.h
transformation_replace_id_with_synonym.h
+ transformation_set_function_control.h
+ transformation_set_loop_control.h
+ transformation_set_memory_operands_mask.h
+ transformation_set_selection_control.h
transformation_split_block.h
uniform_buffer_element_descriptor.h
${CMAKE_CURRENT_BINARY_DIR}/protobufs/spvtoolsfuzz.pb.h
@@ -76,14 +91,21 @@ if(SPIRV_BUILD_FUZZER)
fuzzer_pass.cpp
fuzzer_pass_add_dead_breaks.cpp
fuzzer_pass_add_dead_continues.cpp
+ fuzzer_pass_add_no_contraction_decorations.cpp
fuzzer_pass_add_useful_constructs.cpp
+ fuzzer_pass_adjust_function_controls.cpp
+ fuzzer_pass_adjust_loop_controls.cpp
+ fuzzer_pass_adjust_memory_operands_masks.cpp
+ fuzzer_pass_adjust_selection_controls.cpp
fuzzer_pass_apply_id_synonyms.cpp
+ fuzzer_pass_construct_composites.cpp
fuzzer_pass_copy_objects.cpp
fuzzer_pass_obfuscate_constants.cpp
fuzzer_pass_permute_blocks.cpp
fuzzer_pass_split_blocks.cpp
fuzzer_util.cpp
id_use_descriptor.cpp
+ instruction_descriptor.cpp
pseudo_random_generator.cpp
random_generator.cpp
replayer.cpp
@@ -93,15 +115,22 @@ if(SPIRV_BUILD_FUZZER)
transformation_add_constant_scalar.cpp
transformation_add_dead_break.cpp
transformation_add_dead_continue.cpp
+ transformation_add_no_contraction_decoration.cpp
transformation_add_type_boolean.cpp
transformation_add_type_float.cpp
transformation_add_type_int.cpp
transformation_add_type_pointer.cpp
+ transformation_composite_construct.cpp
+ transformation_composite_extract.cpp
transformation_copy_object.cpp
transformation_move_block_down.cpp
transformation_replace_boolean_constant_with_constant_binary.cpp
transformation_replace_constant_with_uniform.cpp
transformation_replace_id_with_synonym.cpp
+ transformation_set_function_control.cpp
+ transformation_set_loop_control.cpp
+ transformation_set_memory_operands_mask.cpp
+ transformation_set_selection_control.cpp
transformation_split_block.cpp
uniform_buffer_element_descriptor.cpp
${CMAKE_CURRENT_BINARY_DIR}/protobufs/spvtoolsfuzz.pb.cc
@@ -131,8 +160,6 @@ if(SPIRV_BUILD_FUZZER)
target_include_directories(SPIRV-Tools-fuzz
PUBLIC
$<BUILD_INTERFACE:${spirv-tools_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/include>
- PUBLIC
$<BUILD_INTERFACE:${SPIRV_HEADER_INCLUDE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${spirv-tools_BINARY_DIR}
@@ -152,7 +179,14 @@ if(SPIRV_BUILD_FUZZER)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
- install(EXPORT SPIRV-Tools-fuzzTargets DESTINATION lib/cmake)
+ export(EXPORT SPIRV-Tools-fuzzTargets FILE SPIRV-Tools-fuzzTarget.cmake)
+
+ spvtools_config_package_dir(SPIRV-Tools-fuzz PACKAGE_DIR)
+ install(EXPORT SPIRV-Tools-fuzzTargets FILE SPIRV-Tools-fuzzTarget.cmake
+ DESTINATION ${PACKAGE_DIR})
+
+ spvtools_generate_config_file(SPIRV-Tools-fuzz)
+ install(FILES ${CMAKE_BINARY_DIR}/SPIRV-Tools-fuzzConfig.cmake DESTINATION ${PACKAGE_DIR})
endif(ENABLE_SPIRV_TOOLS_INSTALL)
endif(SPIRV_BUILD_FUZZER)
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/data_descriptor.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/data_descriptor.cpp
index 9cdb2c53638..86e5325f142 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/data_descriptor.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/data_descriptor.cpp
@@ -29,6 +29,16 @@ protobufs::DataDescriptor MakeDataDescriptor(uint32_t object,
return result;
}
+size_t DataDescriptorHash::operator()(
+ const protobufs::DataDescriptor* data_descriptor) const {
+ std::u32string hash;
+ hash.push_back(data_descriptor->object());
+ for (auto an_index : data_descriptor->index()) {
+ hash.push_back(an_index);
+ }
+ return std::hash<std::u32string>()(hash);
+}
+
bool DataDescriptorEquals::operator()(
const protobufs::DataDescriptor* first,
const protobufs::DataDescriptor* second) const {
@@ -38,5 +48,22 @@ bool DataDescriptorEquals::operator()(
second->index().begin());
}
+std::ostream& operator<<(std::ostream& out,
+ const protobufs::DataDescriptor& data_descriptor) {
+ out << data_descriptor.object();
+ out << "[";
+ bool first = true;
+ for (auto index : data_descriptor.index()) {
+ if (first) {
+ first = false;
+ } else {
+ out << ", ";
+ }
+ out << index;
+ }
+ out << "]";
+ return out;
+}
+
} // namespace fuzz
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/data_descriptor.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/data_descriptor.h
index 856c653c72d..c569ac80a45 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/data_descriptor.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/data_descriptor.h
@@ -17,6 +17,7 @@
#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
+#include <ostream>
#include <vector>
namespace spvtools {
@@ -27,12 +28,20 @@ namespace fuzz {
protobufs::DataDescriptor MakeDataDescriptor(uint32_t object,
std::vector<uint32_t>&& indices);
+// Hash function for data descriptors.
+struct DataDescriptorHash {
+ size_t operator()(const protobufs::DataDescriptor* data_descriptor) const;
+};
+
// Equality function for data descriptors.
struct DataDescriptorEquals {
bool operator()(const protobufs::DataDescriptor* first,
const protobufs::DataDescriptor* second) const;
};
+std::ostream& operator<<(std::ostream& out,
+ const protobufs::DataDescriptor& data_descriptor);
+
} // namespace fuzz
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/equivalence_relation.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/equivalence_relation.h
new file mode 100644
index 00000000000..4f7eff1d409
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/equivalence_relation.h
@@ -0,0 +1,232 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_FUZZ_EQUIVALENCE_RELATION_H_
+#define SOURCE_FUZZ_EQUIVALENCE_RELATION_H_
+
+#include <memory>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+
+#include "source/util/make_unique.h"
+
+namespace spvtools {
+namespace fuzz {
+
+// A class for representing an equivalence relation on objects of type |T|,
+// which should be a value type. The type |T| is required to have a copy
+// constructor, and |PointerHashT| and |PointerEqualsT| must be functors
+// providing hashing and equality testing functionality for pointers to objects
+// of type |T|.
+//
+// A disjoint-set (a.k.a. union-find or merge-find) data structure is used to
+// represent the equivalence relation. Path compression is used. Union by
+// rank/size is not used.
+//
+// Each disjoint set is represented as a tree, rooted at the representative
+// of the set.
+//
+// Getting the representative of a value simply requires chasing parent pointers
+// from the value until you reach the root.
+//
+// Checking equivalence of two elements requires checking that the
+// representatives are equal.
+//
+// Traversing the tree rooted at a value's representative visits the value's
+// equivalence class.
+//
+// |PointerHashT| and |PointerEqualsT| are used to define *equality* between
+// values, and otherwise are *not* used to define the equivalence relation
+// (except that equal values are equivalent). The equivalence relation is
+// constructed by repeatedly adding pairs of (typically non-equal) values that
+// are deemed to be equivalent.
+//
+// For example in an equivalence relation on integers, 1 and 5 might be added
+// as equivalent, so that IsEquivalent(1, 5) holds, because they represent
+// IDs in a SPIR-V binary that are known to contain the same value at run time,
+// but clearly 1 != 5. Since 1 and 1 are equal, IsEquivalent(1, 1) will also
+// hold.
+//
+// Each unique (up to equality) value added to the relation is copied into
+// |owned_values_|, so there is one canonical memory address per unique value.
+// Uniqueness is ensured by storing (and checking) a set of pointers to these
+// values in |value_set_|, which uses |PointerHashT| and |PointerEqualsT|.
+//
+// |parent_| and |children_| encode the equivalence relation, i.e., the trees.
+template <typename T, typename PointerHashT, typename PointerEqualsT>
+class EquivalenceRelation {
+ public:
+ // Merges the equivalence classes associated with |value1| and |value2|.
+ // If any of these values was not previously in the equivalence relation, it
+ // is added to the pool of values known to be in the relation.
+ void MakeEquivalent(const T& value1, const T& value2) {
+ // Register each value if necessary.
+ for (auto value : {value1, value2}) {
+ if (!Exists(value)) {
+ // Register the value in the equivalence relation. This relies on
+ // T having a copy constructor.
+ auto unique_pointer_to_value = MakeUnique<T>(value);
+ auto pointer_to_value = unique_pointer_to_value.get();
+ owned_values_.push_back(std::move(unique_pointer_to_value));
+ value_set_.insert(pointer_to_value);
+
+ // Initially say that the value is its own parent and that it has no
+ // children.
+ assert(pointer_to_value && "Representatives should never be null.");
+ parent_[pointer_to_value] = pointer_to_value;
+ children_[pointer_to_value] = std::unordered_set<const T*>();
+ }
+ }
+
+ // Look up canonical pointers to each of the values in the value pool.
+ const T* value1_ptr = *value_set_.find(&value1);
+ const T* value2_ptr = *value_set_.find(&value2);
+
+ // If the values turn out to be identical, they are already in the same
+ // equivalence class so there is nothing to do.
+ if (value1_ptr == value2_ptr) {
+ return;
+ }
+
+ // Find the representative for each value's equivalence class, and if they
+ // are not already in the same class, make one the parent of the other.
+ const T* representative1 = Find(value1_ptr);
+ const T* representative2 = Find(value2_ptr);
+ assert(representative1 && "Representatives should never be null.");
+ assert(representative2 && "Representatives should never be null.");
+ if (representative1 != representative2) {
+ parent_[representative1] = representative2;
+ children_[representative2].insert(representative1);
+ }
+ }
+
+ // Returns exactly one representative per equivalence class.
+ std::vector<const T*> GetEquivalenceClassRepresentatives() const {
+ std::vector<const T*> result;
+ for (auto& value : owned_values_) {
+ if (parent_[value.get()] == value.get()) {
+ result.push_back(value.get());
+ }
+ }
+ return result;
+ }
+
+ // Returns pointers to all values in the equivalence class of |value|, which
+ // must already be part of the equivalence relation.
+ std::vector<const T*> GetEquivalenceClass(const T& value) const {
+ assert(Exists(value));
+
+ std::vector<const T*> result;
+
+ // Traverse the tree of values rooted at the representative of the
+ // equivalence class to which |value| belongs, and collect up all the values
+ // that are encountered. This constitutes the whole equivalence class.
+ std::vector<const T*> stack;
+ stack.push_back(Find(*value_set_.find(&value)));
+ while (!stack.empty()) {
+ const T* item = stack.back();
+ result.push_back(item);
+ stack.pop_back();
+ for (auto child : children_[item]) {
+ stack.push_back(child);
+ }
+ }
+ return result;
+ }
+
+ // Returns true if and only if |value1| and |value2| are in the same
+ // equivalence class. Both values must already be known to the equivalence
+ // relation.
+ bool IsEquivalent(const T& value1, const T& value2) const {
+ return Find(&value1) == Find(&value2);
+ }
+
+ // Returns all values known to be part of the equivalence relation.
+ std::vector<const T*> GetAllKnownValues() const {
+ std::vector<const T*> result;
+ for (auto& value : owned_values_) {
+ result.push_back(value.get());
+ }
+ return result;
+ }
+
+ // Returns true if and only if |value| is known to be part of the equivalence
+ // relation.
+ bool Exists(const T& value) const {
+ return value_set_.find(&value) != value_set_.end();
+ }
+
+ private:
+ // Returns the representative of the equivalence class of |value|, which must
+ // already be known to the equivalence relation. This is the 'Find' operation
+ // in a classic union-find data structure.
+ const T* Find(const T* value) const {
+ assert(Exists(*value));
+
+ // Get the canonical pointer to the value from the value pool.
+ const T* known_value = *value_set_.find(value);
+ assert(parent_[known_value] && "Every known value should have a parent.");
+
+ // Compute the result by chasing parents until we find a value that is its
+ // own parent.
+ const T* result = known_value;
+ while (parent_[result] != result) {
+ result = parent_[result];
+ }
+ assert(result && "Representatives should never be null.");
+
+ // At this point, |result| is the representative of the equivalence class.
+ // Now perform the 'path compression' optimization by doing another pass up
+ // the parent chain, setting the parent of each node to be the
+ // representative, and rewriting children correspondingly.
+ const T* current = known_value;
+ while (parent_[current] != result) {
+ const T* next = parent_[current];
+ parent_[current] = result;
+ children_[result].insert(current);
+ children_[next].erase(current);
+ current = next;
+ }
+ return result;
+ }
+
+ // Maps every value to a parent. The representative of an equivalence class
+ // is its own parent. A value's representative can be found by walking its
+ // chain of ancestors.
+ //
+ // Mutable because the intuitively const method, 'Find', performs path
+ // compression.
+ mutable std::unordered_map<const T*, const T*> parent_;
+
+ // Stores the children of each value. This allows the equivalence class of
+ // a value to be calculated by traversing all descendents of the class's
+ // representative.
+ //
+ // Mutable because the intuitively const method, 'Find', performs path
+ // compression.
+ mutable std::unordered_map<const T*, std::unordered_set<const T*>> children_;
+
+ // The values known to the equivalence relation are alloacated in
+ // |owned_values_|, and |value_pool_| provides (via |PointerHashT| and
+ // |PointerEqualsT|) a means for mapping a value of interest to a pointer
+ // into an equivalent value in |owned_values_|.
+ std::unordered_set<const T*, PointerHashT, PointerEqualsT> value_set_;
+ std::vector<std::unique_ptr<T>> owned_values_;
+};
+
+} // namespace fuzz
+} // namespace spvtools
+
+#endif // SOURCE_FUZZ_EQUIVALENCE_RELATION_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fact_manager.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fact_manager.cpp
index 61daa64b3f7..017db2125f2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fact_manager.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fact_manager.cpp
@@ -14,8 +14,11 @@
#include "source/fuzz/fact_manager.h"
+#include <map>
#include <sstream>
+#include "source/fuzz/equivalence_relation.h"
+#include "source/fuzz/fuzzer_util.h"
#include "source/fuzz/uniform_buffer_element_descriptor.h"
#include "source/opt/ir_context.h"
@@ -276,42 +279,20 @@ bool FactManager::ConstantUniformFacts::AddFact(
}
auto should_be_uniform_pointer_instruction =
context->get_def_use_mgr()->GetDef(uniform_variable->type_id());
- auto element_type =
+ auto composite_type =
should_be_uniform_pointer_instruction->GetSingleWordInOperand(1);
- for (auto index : fact.uniform_buffer_element_descriptor().index()) {
- auto should_be_composite_type =
- context->get_def_use_mgr()->GetDef(element_type);
- if (SpvOpTypeStruct == should_be_composite_type->opcode()) {
- if (index >= should_be_composite_type->NumInOperands()) {
- return false;
- }
- element_type = should_be_composite_type->GetSingleWordInOperand(index);
- } else if (SpvOpTypeArray == should_be_composite_type->opcode()) {
- auto array_length_constant =
- context->get_constant_mgr()
- ->GetConstantFromInst(context->get_def_use_mgr()->GetDef(
- should_be_composite_type->GetSingleWordInOperand(1)))
- ->AsIntConstant();
- if (array_length_constant->words().size() != 1) {
- return false;
- }
- auto array_length = array_length_constant->GetU32();
- if (index >= array_length) {
- return false;
- }
- element_type = should_be_composite_type->GetSingleWordInOperand(0);
- } else if (SpvOpTypeVector == should_be_composite_type->opcode()) {
- auto vector_length = should_be_composite_type->GetSingleWordInOperand(1);
- if (index >= vector_length) {
- return false;
- }
- element_type = should_be_composite_type->GetSingleWordInOperand(0);
- } else {
- return false;
- }
+ auto final_element_type_id = fuzzerutil::WalkCompositeTypeIndices(
+ context, composite_type,
+ fact.uniform_buffer_element_descriptor().index());
+ if (!final_element_type_id) {
+ return false;
}
- auto final_element_type = context->get_type_mgr()->GetType(element_type);
+ auto final_element_type =
+ context->get_type_mgr()->GetType(final_element_type_id);
+ assert(final_element_type &&
+ "There should be a type corresponding to this id.");
+
if (!(final_element_type->AsFloat() || final_element_type->AsInteger())) {
return false;
}
@@ -329,7 +310,8 @@ bool FactManager::ConstantUniformFacts::AddFact(
return false;
}
facts_and_type_ids.emplace_back(
- std::pair<protobufs::FactConstantUniform, uint32_t>(fact, element_type));
+ std::pair<protobufs::FactConstantUniform, uint32_t>(
+ fact, final_element_type_id));
return true;
}
@@ -337,39 +319,42 @@ bool FactManager::ConstantUniformFacts::AddFact(
//==============================
//==============================
-// Id synonym facts
+// Data synonym facts
// The purpose of this struct is to group the fields and data used to represent
-// facts about id synonyms.
-struct FactManager::IdSynonymFacts {
+// facts about data synonyms.
+struct FactManager::DataSynonymFacts {
// See method in FactManager which delegates to this method.
- void AddFact(const protobufs::FactIdSynonym& fact);
+ void AddFact(const protobufs::FactDataSynonym& fact);
- // A record of all the synonyms that are available.
- std::map<uint32_t, std::vector<protobufs::DataDescriptor>> synonyms;
+ // See method in FactManager which delegates to this method.
+ bool IsSynonymous(const protobufs::DataDescriptor& data_descriptor1,
+ const protobufs::DataDescriptor& data_descriptor2) const;
- // The set of keys to the above map; useful if you just want to know which ids
- // have synonyms.
- std::set<uint32_t> ids_with_synonyms;
+ EquivalenceRelation<protobufs::DataDescriptor, DataDescriptorHash,
+ DataDescriptorEquals>
+ synonymous;
};
-void FactManager::IdSynonymFacts::AddFact(
- const protobufs::FactIdSynonym& fact) {
- if (synonyms.count(fact.id()) == 0) {
- assert(ids_with_synonyms.count(fact.id()) == 0);
- ids_with_synonyms.insert(fact.id());
- synonyms[fact.id()] = std::vector<protobufs::DataDescriptor>();
- }
- assert(ids_with_synonyms.count(fact.id()) == 1);
- synonyms[fact.id()].push_back(fact.data_descriptor());
+void FactManager::DataSynonymFacts::AddFact(
+ const protobufs::FactDataSynonym& fact) {
+ synonymous.MakeEquivalent(fact.data1(), fact.data2());
}
-// End of id synonym facts
+bool FactManager::DataSynonymFacts::IsSynonymous(
+ const protobufs::DataDescriptor& data_descriptor1,
+ const protobufs::DataDescriptor& data_descriptor2) const {
+ return synonymous.Exists(data_descriptor1) &&
+ synonymous.Exists(data_descriptor2) &&
+ synonymous.IsEquivalent(data_descriptor1, data_descriptor2);
+}
+
+// End of data synonym facts
//==============================
FactManager::FactManager()
: uniform_constant_facts_(MakeUnique<ConstantUniformFacts>()),
- id_synonym_facts_(MakeUnique<IdSynonymFacts>()) {}
+ data_synonym_facts_(MakeUnique<DataSynonymFacts>()) {}
FactManager::~FactManager() = default;
@@ -385,14 +370,14 @@ void FactManager::AddFacts(const MessageConsumer& message_consumer,
}
}
-bool FactManager::AddFact(const spvtools::fuzz::protobufs::Fact& fact,
- spvtools::opt::IRContext* context) {
+bool FactManager::AddFact(const fuzz::protobufs::Fact& fact,
+ opt::IRContext* context) {
switch (fact.fact_case()) {
case protobufs::Fact::kConstantUniformFact:
return uniform_constant_facts_->AddFact(fact.constant_uniform_fact(),
context);
- case protobufs::Fact::kIdSynonymFact:
- id_synonym_facts_->AddFact(fact.id_synonym_fact());
+ case protobufs::Fact::kDataSynonymFact:
+ data_synonym_facts_->AddFact(fact.data_synonym_fact());
return true;
default:
assert(false && "Unknown fact type.");
@@ -400,6 +385,15 @@ bool FactManager::AddFact(const spvtools::fuzz::protobufs::Fact& fact,
}
}
+void FactManager::AddFactDataSynonym(const protobufs::DataDescriptor& data1,
+ const protobufs::DataDescriptor& data2,
+ opt::IRContext* /*unused*/) {
+ protobufs::FactDataSynonym fact;
+ *fact.mutable_data1() = data1;
+ *fact.mutable_data2() = data2;
+ data_synonym_facts_->AddFact(fact);
+}
+
std::vector<uint32_t> FactManager::GetConstantsAvailableFromUniformsForType(
opt::IRContext* ir_context, uint32_t type_id) const {
return uniform_constant_facts_->GetConstantsAvailableFromUniformsForType(
@@ -430,14 +424,28 @@ FactManager::GetConstantUniformFactsAndTypes() const {
return uniform_constant_facts_->facts_and_type_ids;
}
-const std::set<uint32_t>& FactManager::GetIdsForWhichSynonymsAreKnown() const {
- return id_synonym_facts_->ids_with_synonyms;
+std::vector<uint32_t> FactManager::GetIdsForWhichSynonymsAreKnown() const {
+ std::vector<uint32_t> result;
+ for (auto& data_descriptor :
+ data_synonym_facts_->synonymous.GetAllKnownValues()) {
+ if (data_descriptor->index().empty()) {
+ result.push_back(data_descriptor->object());
+ }
+ }
+ return result;
}
-const std::vector<protobufs::DataDescriptor>& FactManager::GetSynonymsForId(
+std::vector<const protobufs::DataDescriptor*> FactManager::GetSynonymsForId(
uint32_t id) const {
- return id_synonym_facts_->synonyms.at(id);
+ return data_synonym_facts_->synonymous.GetEquivalenceClass(
+ MakeDataDescriptor(id, {}));
}
+bool FactManager::IsSynonymous(
+ const protobufs::DataDescriptor& data_descriptor1,
+ const protobufs::DataDescriptor& data_descriptor2) const {
+ return data_synonym_facts_->IsSynonymous(data_descriptor1, data_descriptor2);
+};
+
} // namespace fuzz
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fact_manager.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fact_manager.h
index e2fccbb7a91..7ee31d022c6 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fact_manager.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fact_manager.h
@@ -20,6 +20,7 @@
#include <utility>
#include <vector>
+#include "source/fuzz/data_descriptor.h"
#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
#include "source/opt/constants.h"
@@ -52,6 +53,11 @@ class FactManager {
// fact manager.
bool AddFact(const protobufs::Fact& fact, opt::IRContext* context);
+ // Record the fact that |data1| and |data2| are synonymous.
+ void AddFactDataSynonym(const protobufs::DataDescriptor& data1,
+ const protobufs::DataDescriptor& data2,
+ opt::IRContext* context);
+
// The fact manager is responsible for managing a few distinct categories of
// facts. In principle there could be different fact managers for each kind
// of fact, but in practice providing one 'go to' place for facts is
@@ -101,13 +107,18 @@ class FactManager {
// Returns every id for which a fact of the form "this id is synonymous
// with this piece of data" is known.
- const std::set<uint32_t>& GetIdsForWhichSynonymsAreKnown() const;
+ std::vector<uint32_t> GetIdsForWhichSynonymsAreKnown() const;
- // Requires that at least one synonym for |id| is known, and returns the
- // sequence of all known synonyms.
- const std::vector<protobufs::DataDescriptor>& GetSynonymsForId(
+ // Returns the equivalence class of all known synonyms of |id|, or an empty
+ // set if no synonyms are known.
+ std::vector<const protobufs::DataDescriptor*> GetSynonymsForId(
uint32_t id) const;
+ // Return true if and ony if |data_descriptor1| and |data_descriptor2| are
+ // known to be synonymous.
+ bool IsSynonymous(const protobufs::DataDescriptor& data_descriptor1,
+ const protobufs::DataDescriptor& data_descriptor2) const;
+
// End of id synonym facts
//==============================
@@ -115,14 +126,15 @@ class FactManager {
// For each distinct kind of fact to be managed, we use a separate opaque
// struct type.
- struct ConstantUniformFacts; // Opaque struct for holding data about uniform
- // buffer elements.
+ struct ConstantUniformFacts; // Opaque class for management of
+ // constant uniform facts.
std::unique_ptr<ConstantUniformFacts>
uniform_constant_facts_; // Unique pointer to internal data.
- struct IdSynonymFacts; // Opaque struct for holding data about id synonyms.
- std::unique_ptr<IdSynonymFacts>
- id_synonym_facts_; // Unique pointer to internal data.
+ struct DataSynonymFacts; // Opaque class for management of data synonym
+ // facts.
+ std::unique_ptr<DataSynonymFacts>
+ data_synonym_facts_; // Unique pointer to internal data.
};
} // namespace fuzz
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/force_render_red.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/force_render_red.cpp
index 3bc11724927..46e23e80e61 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/force_render_red.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/force_render_red.cpp
@@ -15,6 +15,7 @@
#include "source/fuzz/force_render_red.h"
#include "source/fuzz/fact_manager.h"
+#include "source/fuzz/instruction_descriptor.h"
#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
#include "source/fuzz/transformation_replace_constant_with_uniform.h"
#include "source/fuzz/uniform_buffer_element_descriptor.h"
@@ -147,9 +148,10 @@ MakeConstantUniformReplacement(opt::IRContext* ir_context,
uint32_t greater_than_instruction,
uint32_t in_operand_index) {
return MakeUnique<TransformationReplaceConstantWithUniform>(
- transformation::MakeIdUseDescriptor(constant_id, SpvOpFOrdGreaterThan,
- in_operand_index,
- greater_than_instruction, 0),
+ MakeIdUseDescriptor(constant_id,
+ MakeInstructionDescriptor(greater_than_instruction,
+ SpvOpFOrdGreaterThan, 0),
+ in_operand_index),
fact_manager.GetUniformDescriptorsForConstant(ir_context, constant_id)[0],
ir_context->TakeNextId(), ir_context->TakeNextId());
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer.cpp
index 8e36a323a67..01b4258d371 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer.cpp
@@ -18,12 +18,18 @@
#include <memory>
#include <sstream>
+#include "fuzzer_pass_adjust_memory_operands_masks.h"
#include "source/fuzz/fact_manager.h"
#include "source/fuzz/fuzzer_context.h"
#include "source/fuzz/fuzzer_pass_add_dead_breaks.h"
#include "source/fuzz/fuzzer_pass_add_dead_continues.h"
+#include "source/fuzz/fuzzer_pass_add_no_contraction_decorations.h"
#include "source/fuzz/fuzzer_pass_add_useful_constructs.h"
+#include "source/fuzz/fuzzer_pass_adjust_function_controls.h"
+#include "source/fuzz/fuzzer_pass_adjust_loop_controls.h"
+#include "source/fuzz/fuzzer_pass_adjust_selection_controls.h"
#include "source/fuzz/fuzzer_pass_apply_id_synonyms.h"
+#include "source/fuzz/fuzzer_pass_construct_composites.h"
#include "source/fuzz/fuzzer_pass_copy_objects.h"
#include "source/fuzz/fuzzer_pass_obfuscate_constants.h"
#include "source/fuzz/fuzzer_pass_permute_blocks.h"
@@ -138,6 +144,9 @@ Fuzzer::FuzzerResultStatus Fuzzer::Run(
MaybeAddPass<FuzzerPassApplyIdSynonyms>(&passes, ir_context.get(),
&fact_manager, &fuzzer_context,
transformation_sequence_out);
+ MaybeAddPass<FuzzerPassConstructComposites>(&passes, ir_context.get(),
+ &fact_manager, &fuzzer_context,
+ transformation_sequence_out);
MaybeAddPass<FuzzerPassCopyObjects>(&passes, ir_context.get(),
&fact_manager, &fuzzer_context,
transformation_sequence_out);
@@ -162,6 +171,32 @@ Fuzzer::FuzzerResultStatus Fuzzer::Run(
passes[fuzzer_context.RandomIndex(passes)]->Apply();
}
+ // Now apply some passes that it does not make sense to apply repeatedly,
+ // as they do not unlock other passes.
+ std::vector<std::unique_ptr<FuzzerPass>> final_passes;
+ MaybeAddPass<FuzzerPassAdjustFunctionControls>(
+ &final_passes, ir_context.get(), &fact_manager, &fuzzer_context,
+ transformation_sequence_out);
+ MaybeAddPass<FuzzerPassAdjustLoopControls>(&final_passes, ir_context.get(),
+ &fact_manager, &fuzzer_context,
+ transformation_sequence_out);
+ MaybeAddPass<FuzzerPassAdjustMemoryOperandsMasks>(
+ &final_passes, ir_context.get(), &fact_manager, &fuzzer_context,
+ transformation_sequence_out);
+ MaybeAddPass<FuzzerPassAdjustSelectionControls>(
+ &final_passes, ir_context.get(), &fact_manager, &fuzzer_context,
+ transformation_sequence_out);
+ for (auto& pass : final_passes) {
+ pass->Apply();
+ }
+
+ if (fuzzer_context.ChooseEven()) {
+ FuzzerPassAddNoContractionDecorations(ir_context.get(), &fact_manager,
+ &fuzzer_context,
+ transformation_sequence_out)
+ .Apply();
+ }
+
// Encode the module as a binary.
ir_context->module()->ToBinary(binary_out, false);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_context.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_context.cpp
index 69c6e56889f..356cb359985 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_context.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_context.cpp
@@ -25,12 +25,27 @@ namespace {
const std::pair<uint32_t, uint32_t> kChanceOfAddingDeadBreak = {5, 80};
const std::pair<uint32_t, uint32_t> kChanceOfAddingDeadContinue = {5, 80};
+const std::pair<uint32_t, uint32_t> kChanceOfAddingNoContractionDecoration = {
+ 5, 70};
+const std::pair<uint32_t, uint32_t> kChanceOfAdjustingFunctionControl = {20,
+ 70};
+const std::pair<uint32_t, uint32_t> kChanceOfAdjustingLoopControl = {20, 90};
+const std::pair<uint32_t, uint32_t> kChanceOfAdjustingMemoryOperandsMask = {20,
+ 90};
+const std::pair<uint32_t, uint32_t> kChanceOfAdjustingSelectionControl = {20,
+ 90};
const std::pair<uint32_t, uint32_t> kChanceOfCopyingObject = {20, 50};
+const std::pair<uint32_t, uint32_t> kChanceOfConstructingComposite = {20, 50};
const std::pair<uint32_t, uint32_t> kChanceOfMovingBlockDown = {20, 50};
const std::pair<uint32_t, uint32_t> kChanceOfObfuscatingConstant = {10, 90};
const std::pair<uint32_t, uint32_t> kChanceOfReplacingIdWithSynonym = {10, 90};
const std::pair<uint32_t, uint32_t> kChanceOfSplittingBlock = {40, 95};
+// Default limits for various quantities that are chosen during fuzzing.
+// Keep them in alphabetical order.
+const uint32_t kDefaultMaxLoopControlPartialCount = 100;
+const uint32_t kDefaultMaxLoopControlPeelCount = 100;
+
// Default functions for controlling how deep to go during recursive
// generation/transformation. Keep them in alphabetical order.
@@ -53,6 +68,18 @@ FuzzerContext::FuzzerContext(RandomGenerator* random_generator,
ChooseBetweenMinAndMax(kChanceOfAddingDeadBreak);
chance_of_adding_dead_continue_ =
ChooseBetweenMinAndMax(kChanceOfAddingDeadContinue);
+ chance_of_adding_no_contraction_decoration_ =
+ ChooseBetweenMinAndMax(kChanceOfAddingNoContractionDecoration);
+ chance_of_adjusting_function_control_ =
+ ChooseBetweenMinAndMax(kChanceOfAdjustingFunctionControl);
+ chance_of_adjusting_loop_control_ =
+ ChooseBetweenMinAndMax(kChanceOfAdjustingLoopControl);
+ chance_of_adjusting_memory_operands_mask_ =
+ ChooseBetweenMinAndMax(kChanceOfAdjustingMemoryOperandsMask);
+ chance_of_adjusting_selection_control_ =
+ ChooseBetweenMinAndMax(kChanceOfAdjustingSelectionControl);
+ chance_of_constructing_composite_ =
+ ChooseBetweenMinAndMax(kChanceOfConstructingComposite);
chance_of_copying_object_ = ChooseBetweenMinAndMax(kChanceOfCopyingObject);
chance_of_moving_block_down_ =
ChooseBetweenMinAndMax(kChanceOfMovingBlockDown);
@@ -61,6 +88,8 @@ FuzzerContext::FuzzerContext(RandomGenerator* random_generator,
chance_of_replacing_id_with_synonym_ =
ChooseBetweenMinAndMax(kChanceOfReplacingIdWithSynonym);
chance_of_splitting_block_ = ChooseBetweenMinAndMax(kChanceOfSplittingBlock);
+ max_loop_control_partial_count_ = kDefaultMaxLoopControlPartialCount;
+ max_loop_control_peel_count_ = kDefaultMaxLoopControlPeelCount;
}
FuzzerContext::~FuzzerContext() = default;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_context.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_context.h
index a1ad66f8d9c..c8242e61738 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_context.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_context.h
@@ -62,6 +62,24 @@ class FuzzerContext {
uint32_t GetChanceOfAddingDeadContinue() {
return chance_of_adding_dead_continue_;
}
+ uint32_t GetChanceOfAddingNoContractionDecoration() {
+ return chance_of_adding_no_contraction_decoration_;
+ }
+ uint32_t GetChanceOfAdjustingFunctionControl() {
+ return chance_of_adjusting_function_control_;
+ }
+ uint32_t GetChanceOfAdjustingLoopControl() {
+ return chance_of_adjusting_loop_control_;
+ }
+ uint32_t GetChanceOfAdjustingMemoryOperandsMask() {
+ return chance_of_adjusting_memory_operands_mask_;
+ }
+ uint32_t GetChanceOfAdjustingSelectionControl() {
+ return chance_of_adjusting_selection_control_;
+ }
+ uint32_t GetChanceOfConstructingComposite() {
+ return chance_of_constructing_composite_;
+ }
uint32_t GetChanceOfCopyingObject() { return chance_of_copying_object_; }
uint32_t GetChanceOfMovingBlockDown() { return chance_of_moving_block_down_; }
uint32_t GetChanceOfObfuscatingConstant() {
@@ -71,6 +89,12 @@ class FuzzerContext {
return chance_of_replacing_id_with_synonym_;
}
uint32_t GetChanceOfSplittingBlock() { return chance_of_splitting_block_; }
+ uint32_t GetRandomLoopControlPeelCount() {
+ return random_generator_->RandomUint32(max_loop_control_peel_count_);
+ }
+ uint32_t GetRandomLoopControlPartialCount() {
+ return random_generator_->RandomUint32(max_loop_control_partial_count_);
+ }
// Functions to control how deeply to recurse.
// Keep them in alphabetical order.
@@ -88,12 +112,24 @@ class FuzzerContext {
// Keep them in alphabetical order.
uint32_t chance_of_adding_dead_break_;
uint32_t chance_of_adding_dead_continue_;
+ uint32_t chance_of_adding_no_contraction_decoration_;
+ uint32_t chance_of_adjusting_function_control_;
+ uint32_t chance_of_adjusting_loop_control_;
+ uint32_t chance_of_adjusting_memory_operands_mask_;
+ uint32_t chance_of_adjusting_selection_control_;
+ uint32_t chance_of_constructing_composite_;
uint32_t chance_of_copying_object_;
uint32_t chance_of_moving_block_down_;
uint32_t chance_of_obfuscating_constant_;
uint32_t chance_of_replacing_id_with_synonym_;
uint32_t chance_of_splitting_block_;
+ // Limits associated with various quantities for which random values are
+ // chosen during fuzzing.
+ // Keep them in alphabetical order.
+ uint32_t max_loop_control_partial_count_;
+ uint32_t max_loop_control_peel_count_;
+
// Functions to determine with what probability to go deeper when generating
// or mutating constructs recursively.
const std::function<bool(uint32_t, RandomGenerator*)>&
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass.cpp
index 823f2e09a23..1da53f42620 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass.cpp
@@ -14,6 +14,8 @@
#include "source/fuzz/fuzzer_pass.h"
+#include "source/fuzz/instruction_descriptor.h"
+
namespace spvtools {
namespace fuzz {
@@ -27,5 +29,104 @@ FuzzerPass::FuzzerPass(opt::IRContext* ir_context, FactManager* fact_manager,
FuzzerPass::~FuzzerPass() = default;
+std::vector<opt::Instruction*> FuzzerPass::FindAvailableInstructions(
+ const opt::Function& function, opt::BasicBlock* block,
+ opt::BasicBlock::iterator inst_it,
+ std::function<bool(opt::IRContext*, opt::Instruction*)>
+ instruction_is_relevant) {
+ // TODO(afd) The following is (relatively) simple, but may end up being
+ // prohibitively inefficient, as it walks the whole dominator tree for
+ // every instruction that is considered.
+
+ std::vector<opt::Instruction*> result;
+ // Consider all global declarations
+ for (auto& global : GetIRContext()->module()->types_values()) {
+ if (instruction_is_relevant(GetIRContext(), &global)) {
+ result.push_back(&global);
+ }
+ }
+
+ // Consider all previous instructions in this block
+ for (auto prev_inst_it = block->begin(); prev_inst_it != inst_it;
+ ++prev_inst_it) {
+ if (instruction_is_relevant(GetIRContext(), &*prev_inst_it)) {
+ result.push_back(&*prev_inst_it);
+ }
+ }
+
+ // Walk the dominator tree to consider all instructions from dominating
+ // blocks
+ auto dominator_analysis = GetIRContext()->GetDominatorAnalysis(&function);
+ for (auto next_dominator = dominator_analysis->ImmediateDominator(block);
+ next_dominator != nullptr;
+ next_dominator =
+ dominator_analysis->ImmediateDominator(next_dominator)) {
+ for (auto& dominating_inst : *next_dominator) {
+ if (instruction_is_relevant(GetIRContext(), &dominating_inst)) {
+ result.push_back(&dominating_inst);
+ }
+ }
+ }
+ return result;
+}
+
+void FuzzerPass::MaybeAddTransformationBeforeEachInstruction(
+ std::function<
+ void(const opt::Function& function, opt::BasicBlock* block,
+ opt::BasicBlock::iterator inst_it,
+ const protobufs::InstructionDescriptor& instruction_descriptor)>
+ maybe_apply_transformation) {
+ // Consider every block in every function.
+ for (auto& function : *GetIRContext()->module()) {
+ for (auto& block : function) {
+ // We now consider every instruction in the block, randomly deciding
+ // whether to apply a transformation before it.
+
+ // In order for transformations to insert new instructions, they need to
+ // be able to identify the instruction to insert before. We describe an
+ // instruction via its opcode, 'opc', a base instruction 'base' that has a
+ // result id, and the number of instructions with opcode 'opc' that we
+ // should skip when searching from 'base' for the desired instruction.
+ // (An instruction that has a result id is represented by its own opcode,
+ // itself as 'base', and a skip-count of 0.)
+ std::vector<std::tuple<uint32_t, SpvOp, uint32_t>>
+ base_opcode_skip_triples;
+
+ // The initial base instruction is the block label.
+ uint32_t base = block.id();
+
+ // Counts the number of times we have seen each opcode since we reset the
+ // base instruction.
+ std::map<SpvOp, uint32_t> skip_count;
+
+ // Consider every instruction in the block. The label is excluded: it is
+ // only necessary to consider it as a base in case the first instruction
+ // in the block does not have a result id.
+ for (auto inst_it = block.begin(); inst_it != block.end(); ++inst_it) {
+ if (inst_it->HasResultId()) {
+ // In the case that the instruction has a result id, we use the
+ // instruction as its own base, and clear the skip counts we have
+ // collected.
+ base = inst_it->result_id();
+ skip_count.clear();
+ }
+ const SpvOp opcode = inst_it->opcode();
+
+ // Invoke the provided function, which might apply a transformation.
+ maybe_apply_transformation(
+ function, &block, inst_it,
+ MakeInstructionDescriptor(
+ base, opcode,
+ skip_count.count(opcode) ? skip_count.at(opcode) : 0));
+
+ if (!inst_it->HasResultId()) {
+ skip_count[opcode] =
+ skip_count.count(opcode) ? skip_count.at(opcode) + 1 : 1;
+ }
+ }
+ }
+ }
+}
+
} // namespace fuzz
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass.h
index cd1b1944343..cf56e2407da 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass.h
@@ -15,9 +15,13 @@
#ifndef SOURCE_FUZZ_FUZZER_PASS_H_
#define SOURCE_FUZZ_FUZZER_PASS_H_
+#include <functional>
+#include <vector>
+
#include "source/fuzz/fact_manager.h"
#include "source/fuzz/fuzzer_context.h"
#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
+#include "source/opt/ir_context.h"
namespace spvtools {
namespace fuzz {
@@ -48,6 +52,43 @@ class FuzzerPass {
return transformations_;
}
+ // Returns all instructions that are *available* at |inst_it|, which is
+ // required to be inside block |block| of function |function| - that is, all
+ // instructions at global scope and all instructions that strictly dominate
+ // |inst_it|.
+ //
+ // Filters said instructions to return only those that satisfy the
+ // |instruction_is_relevant| predicate. This, for instance, could ignore all
+ // instructions that have a particular decoration.
+ std::vector<opt::Instruction*> FindAvailableInstructions(
+ const opt::Function& function, opt::BasicBlock* block,
+ opt::BasicBlock::iterator inst_it,
+ std::function<bool(opt::IRContext*, opt::Instruction*)>
+ instruction_is_relevant);
+
+ // A helper method that iterates through each instruction in each block, at
+ // all times tracking an instruction descriptor that allows the latest
+ // instruction to be located even if it has no result id.
+ //
+ // The code to manipulate the instruction descriptor is a bit fiddly, and the
+ // point of this method is to avoiding having to duplicate it in multiple
+ // transformation passes.
+ //
+ // The function |maybe_apply_transformation| is invoked for each instruction
+ // |inst_it| in block |block| of function |function| that is encountered. The
+ // |instruction_descriptor| parameter to the function object allows |inst_it|
+ // to be identified.
+ //
+ // The job of |maybe_apply_transformation| is to randomly decide whether to
+ // try to apply some transformation, and then - if selected - to attempt to
+ // apply it.
+ void MaybeAddTransformationBeforeEachInstruction(
+ std::function<
+ void(const opt::Function& function, opt::BasicBlock* block,
+ opt::BasicBlock::iterator inst_it,
+ const protobufs::InstructionDescriptor& instruction_descriptor)>
+ maybe_apply_transformation);
+
private:
opt::IRContext* ir_context_;
FactManager* fact_manager_;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_add_no_contraction_decorations.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_add_no_contraction_decorations.cpp
new file mode 100644
index 00000000000..2ab779c1bb2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_add_no_contraction_decorations.cpp
@@ -0,0 +1,61 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/fuzzer_pass_add_no_contraction_decorations.h"
+
+#include "source/fuzz/transformation_add_no_contraction_decoration.h"
+
+namespace spvtools {
+namespace fuzz {
+
+FuzzerPassAddNoContractionDecorations::FuzzerPassAddNoContractionDecorations(
+ opt::IRContext* ir_context, FactManager* fact_manager,
+ FuzzerContext* fuzzer_context,
+ protobufs::TransformationSequence* transformations)
+ : FuzzerPass(ir_context, fact_manager, fuzzer_context, transformations){};
+
+FuzzerPassAddNoContractionDecorations::
+ ~FuzzerPassAddNoContractionDecorations() = default;
+
+void FuzzerPassAddNoContractionDecorations::Apply() {
+ // Consider every instruction in every block in every function.
+ for (auto& function : *GetIRContext()->module()) {
+ for (auto& block : function) {
+ for (auto& inst : block) {
+ // Restrict attention to arithmetic instructions (as defined in the
+ // SPIR-V specification).
+ if (TransformationAddNoContractionDecoration::IsArithmetic(
+ inst.opcode())) {
+ // Randomly choose whether to apply the NoContraction decoration to
+ // this arithmetic instruction.
+ if (GetFuzzerContext()->ChoosePercentage(
+ GetFuzzerContext()
+ ->GetChanceOfAddingNoContractionDecoration())) {
+ TransformationAddNoContractionDecoration transformation(
+ inst.result_id());
+ assert(transformation.IsApplicable(GetIRContext(),
+ *GetFactManager()) &&
+ "Transformation should be applicable by construction.");
+ transformation.Apply(GetIRContext(), GetFactManager());
+ *GetTransformations()->add_transformation() =
+ transformation.ToMessage();
+ }
+ }
+ }
+ }
+ }
+}
+
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_add_no_contraction_decorations.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_add_no_contraction_decorations.h
new file mode 100644
index 00000000000..abe5bd7ad9c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_add_no_contraction_decorations.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_FUZZ_FUZZER_PASS_ADD_NO_CONTRACTION_DECORATIONS_
+#define SOURCE_FUZZ_FUZZER_PASS_ADD_NO_CONTRACTION_DECORATIONS_
+
+#include "source/fuzz/fuzzer_pass.h"
+
+namespace spvtools {
+namespace fuzz {
+
+// A pass that applies the NoContraction decoration to arithmetic instructions.
+class FuzzerPassAddNoContractionDecorations : public FuzzerPass {
+ public:
+ FuzzerPassAddNoContractionDecorations(
+ opt::IRContext* ir_context, FactManager* fact_manager,
+ FuzzerContext* fuzzer_context,
+ protobufs::TransformationSequence* transformations);
+
+ ~FuzzerPassAddNoContractionDecorations() override;
+
+ void Apply() override;
+};
+
+} // namespace fuzz
+} // namespace spvtools
+
+#endif // SOURCE_FUZZ_FUZZER_PASS_ADD_NO_CONTRACTION_DECORATIONS_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_add_useful_constructs.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_add_useful_constructs.cpp
index 6ac4ae97143..489a08443c7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_add_useful_constructs.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_add_useful_constructs.cpp
@@ -24,8 +24,6 @@
namespace spvtools {
namespace fuzz {
-using opt::IRContext;
-
FuzzerPassAddUsefulConstructs::FuzzerPassAddUsefulConstructs(
opt::IRContext* ir_context, FactManager* fact_manager,
FuzzerContext* fuzzer_context,
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_function_controls.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_function_controls.cpp
new file mode 100644
index 00000000000..ab5ecf6237d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_function_controls.cpp
@@ -0,0 +1,73 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/fuzzer_pass_adjust_function_controls.h"
+
+#include "source/fuzz/transformation_set_function_control.h"
+
+namespace spvtools {
+namespace fuzz {
+
+FuzzerPassAdjustFunctionControls::FuzzerPassAdjustFunctionControls(
+ opt::IRContext* ir_context, FactManager* fact_manager,
+ FuzzerContext* fuzzer_context,
+ protobufs::TransformationSequence* transformations)
+ : FuzzerPass(ir_context, fact_manager, fuzzer_context, transformations){};
+
+FuzzerPassAdjustFunctionControls::~FuzzerPassAdjustFunctionControls() = default;
+
+void FuzzerPassAdjustFunctionControls::Apply() {
+ // Consider every function in the module.
+ for (auto& function : *GetIRContext()->module()) {
+ // Randomly decide whether to adjust this function's controls.
+ if (GetFuzzerContext()->ChoosePercentage(
+ GetFuzzerContext()->GetChanceOfAdjustingFunctionControl())) {
+ // Grab the function control mask for the function in its present form.
+ uint32_t existing_function_control_mask =
+ function.DefInst().GetSingleWordInOperand(0);
+
+ // For the new mask, we first randomly select one of three basic masks:
+ // None, Inline or DontInline. These are always valid (and are mutually
+ // exclusive).
+ std::vector<uint32_t> basic_function_control_masks = {
+ SpvFunctionControlMaskNone, SpvFunctionControlInlineMask,
+ SpvFunctionControlDontInlineMask};
+ uint32_t new_function_control_mask =
+ basic_function_control_masks[GetFuzzerContext()->RandomIndex(
+ basic_function_control_masks)];
+
+ // We now consider the Pure and Const mask bits. If these are already
+ // set on the function then it's OK to keep them, but also interesting
+ // to consider dropping them, so we decide randomly in each case.
+ for (auto mask_bit :
+ {SpvFunctionControlPureMask, SpvFunctionControlConstMask}) {
+ if ((existing_function_control_mask & mask_bit) &&
+ GetFuzzerContext()->ChooseEven()) {
+ new_function_control_mask |= mask_bit;
+ }
+ }
+
+ // Create and add a transformation.
+ TransformationSetFunctionControl transformation(
+ function.DefInst().result_id(), new_function_control_mask);
+ assert(transformation.IsApplicable(GetIRContext(), *GetFactManager()) &&
+ "Transformation should be applicable by construction.");
+ transformation.Apply(GetIRContext(), GetFactManager());
+ *GetTransformations()->add_transformation() = transformation.ToMessage();
+ }
+ }
+}
+
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_function_controls.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_function_controls.h
new file mode 100644
index 00000000000..02d36004ee1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_function_controls.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_FUZZ_FUZZER_PASS_ADJUST_FUNCTION_CONTROLS_
+#define SOURCE_FUZZ_FUZZER_PASS_ADJUST_FUNCTION_CONTROLS_
+
+#include "source/fuzz/fuzzer_pass.h"
+
+namespace spvtools {
+namespace fuzz {
+
+// A pass that adjusts the function controls on OpFunction instructions.
+class FuzzerPassAdjustFunctionControls : public FuzzerPass {
+ public:
+ FuzzerPassAdjustFunctionControls(
+ opt::IRContext* ir_context, FactManager* fact_manager,
+ FuzzerContext* fuzzer_context,
+ protobufs::TransformationSequence* transformations);
+
+ ~FuzzerPassAdjustFunctionControls() override;
+
+ void Apply() override;
+};
+
+} // namespace fuzz
+} // namespace spvtools
+
+#endif // SOURCE_FUZZ_FUZZER_PASS_ADJUST_FUNCTION_CONTROLS_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_loop_controls.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_loop_controls.cpp
new file mode 100644
index 00000000000..65b8d95013f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_loop_controls.cpp
@@ -0,0 +1,121 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/fuzzer_pass_adjust_loop_controls.h"
+
+#include "source/fuzz/transformation_set_loop_control.h"
+
+namespace spvtools {
+namespace fuzz {
+
+FuzzerPassAdjustLoopControls::FuzzerPassAdjustLoopControls(
+ opt::IRContext* ir_context, FactManager* fact_manager,
+ FuzzerContext* fuzzer_context,
+ protobufs::TransformationSequence* transformations)
+ : FuzzerPass(ir_context, fact_manager, fuzzer_context, transformations){};
+
+FuzzerPassAdjustLoopControls::~FuzzerPassAdjustLoopControls() = default;
+
+void FuzzerPassAdjustLoopControls::Apply() {
+ // Consider every merge instruction in the module (via looking through all
+ // functions and blocks).
+ for (auto& function : *GetIRContext()->module()) {
+ for (auto& block : function) {
+ if (auto merge_inst = block.GetMergeInst()) {
+ // Ignore the instruction if it is not a loop merge.
+ if (merge_inst->opcode() != SpvOpLoopMerge) {
+ continue;
+ }
+
+ // Decide randomly whether to adjust this loop merge.
+ if (!GetFuzzerContext()->ChoosePercentage(
+ GetFuzzerContext()->GetChanceOfAdjustingLoopControl())) {
+ continue;
+ }
+
+ uint32_t existing_mask = merge_inst->GetSingleWordOperand(
+ TransformationSetLoopControl::kLoopControlMaskInOperandIndex);
+
+ // First, set the new mask to one of None, Unroll or DontUnroll.
+ std::vector<uint32_t> basic_masks = {SpvLoopControlMaskNone,
+ SpvLoopControlUnrollMask,
+ SpvLoopControlDontUnrollMask};
+ uint32_t new_mask =
+ basic_masks[GetFuzzerContext()->RandomIndex(basic_masks)];
+
+ // For the loop controls that depend on guarantees about what the loop
+ // does, check which of these were present in the existing mask and
+ // randomly decide whether to keep them. They are just hints, so
+ // removing them should not change the semantics of the module.
+ for (auto mask_bit :
+ {SpvLoopControlDependencyInfiniteMask,
+ SpvLoopControlDependencyLengthMask,
+ SpvLoopControlMinIterationsMask, SpvLoopControlMaxIterationsMask,
+ SpvLoopControlIterationMultipleMask}) {
+ if ((existing_mask & mask_bit) && GetFuzzerContext()->ChooseEven()) {
+ // The mask bits we are considering are not available in all SPIR-V
+ // versions. However, we only include a mask bit if it was present
+ // in the original loop control mask, and we work under the
+ // assumption that we are transforming a valid module, thus we don't
+ // need to actually check whether the SPIR-V version being used
+ // supports these loop control mask bits.
+ new_mask |= mask_bit;
+ }
+ }
+
+ // We use 0 for peel count and partial count in the case that we choose
+ // not to set these controls.
+ uint32_t peel_count = 0;
+ uint32_t partial_count = 0;
+
+ // PeelCount and PartialCount are not compatible with DontUnroll, so
+ // we check whether DontUnroll is set.
+ if (!(new_mask & SpvLoopControlDontUnrollMask)) {
+ // If PeelCount is supported by this SPIR-V version, randomly choose
+ // whether to set it. If it was set in the original mask and is not
+ // selected for setting here, that amounts to dropping it.
+ if (TransformationSetLoopControl::PeelCountIsSupported(
+ GetIRContext()) &&
+ GetFuzzerContext()->ChooseEven()) {
+ new_mask |= SpvLoopControlPeelCountMask;
+ // The peel count is chosen randomly - if PeelCount was already set
+ // this will overwrite whatever peel count was previously used.
+ peel_count = GetFuzzerContext()->GetRandomLoopControlPeelCount();
+ }
+ // Similar, but for PartialCount.
+ if (TransformationSetLoopControl::PartialCountIsSupported(
+ GetIRContext()) &&
+ GetFuzzerContext()->ChooseEven()) {
+ new_mask |= SpvLoopControlPartialCountMask;
+ partial_count =
+ GetFuzzerContext()->GetRandomLoopControlPartialCount();
+ }
+ }
+
+ // Apply the transformation and add it to the output transformation
+ // sequence.
+ TransformationSetLoopControl transformation(block.id(), new_mask,
+ peel_count, partial_count);
+ assert(transformation.IsApplicable(GetIRContext(), *GetFactManager()) &&
+ "Transformation should be applicable by construction.");
+ transformation.Apply(GetIRContext(), GetFactManager());
+ *GetTransformations()->add_transformation() =
+ transformation.ToMessage();
+ }
+ }
+ }
+}
+
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_relaxed_precision_decoration_opportunity_finder.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_loop_controls.h
index 673049cc879..e94560673e3 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_relaxed_precision_decoration_opportunity_finder.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_loop_controls.h
@@ -12,25 +12,28 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef SOURCE_REDUCE_REMOVE_RELAXED_PRECISION_OPPORTUNITY_FINDER_H_
-#define SOURCE_REDUCE_REMOVE_RELAXED_PRECISION_OPPORTUNITY_FINDER_H_
+#ifndef SOURCE_FUZZ_FUZZER_PASS_ADJUST_LOOP_CONTROLS_
+#define SOURCE_FUZZ_FUZZER_PASS_ADJUST_LOOP_CONTROLS_
-#include "source/reduce/reduction_opportunity_finder.h"
+#include "source/fuzz/fuzzer_pass.h"
namespace spvtools {
-namespace reduce {
+namespace fuzz {
-// A finder for opportunities to remove relaxed precision decorations.
-class RemoveRelaxedPrecisionDecorationOpportunityFinder
- : public ReductionOpportunityFinder {
+// A pass that adjusts the loop controls on OpLoopMerge instructions.
+class FuzzerPassAdjustLoopControls : public FuzzerPass {
public:
- std::vector<std::unique_ptr<ReductionOpportunity>> GetAvailableOpportunities(
- opt::IRContext* context) const override;
+ FuzzerPassAdjustLoopControls(
+ opt::IRContext* ir_context, FactManager* fact_manager,
+ FuzzerContext* fuzzer_context,
+ protobufs::TransformationSequence* transformations);
- std::string GetName() const override;
+ ~FuzzerPassAdjustLoopControls() override;
+
+ void Apply() override;
};
-} // namespace reduce
+} // namespace fuzz
} // namespace spvtools
-#endif // SOURCE_REDUCE_REMOVE_RELAXED_PRECISION_OPPORTUNITY_FINDER_H_
+#endif // SOURCE_FUZZ_FUZZER_PASS_ADJUST_LOOP_CONTROLS_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.cpp
new file mode 100644
index 00000000000..a9d4b3243bd
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.cpp
@@ -0,0 +1,113 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/fuzzer_pass_adjust_memory_operands_masks.h"
+
+#include "source/fuzz/instruction_descriptor.h"
+#include "source/fuzz/transformation_set_memory_operands_mask.h"
+
+namespace spvtools {
+namespace fuzz {
+
+FuzzerPassAdjustMemoryOperandsMasks::FuzzerPassAdjustMemoryOperandsMasks(
+ opt::IRContext* ir_context, FactManager* fact_manager,
+ FuzzerContext* fuzzer_context,
+ protobufs::TransformationSequence* transformations)
+ : FuzzerPass(ir_context, fact_manager, fuzzer_context, transformations) {}
+
+FuzzerPassAdjustMemoryOperandsMasks::~FuzzerPassAdjustMemoryOperandsMasks() =
+ default;
+
+void FuzzerPassAdjustMemoryOperandsMasks::Apply() {
+ // Consider every block in every function.
+ for (auto& function : *GetIRContext()->module()) {
+ for (auto& block : function) {
+ // Consider every instruction in this block, using an explicit iterator so
+ // that when we find an instruction of interest we can search backwards to
+ // create an id descriptor for it.
+ for (auto inst_it = block.cbegin(); inst_it != block.cend(); ++inst_it) {
+ if (!TransformationSetMemoryOperandsMask::IsMemoryAccess(*inst_it)) {
+ // We are only interested in memory access instructions.
+ continue;
+ }
+
+ std::vector<uint32_t> indices_of_available_masks_to_adjust;
+ // All memory instructions have at least one memory operands mask.
+ indices_of_available_masks_to_adjust.push_back(0);
+ // From SPIR-V 1.4 onwards, OpCopyMemory and OpCopyMemorySized have a
+ // second mask.
+ switch (inst_it->opcode()) {
+ case SpvOpCopyMemory:
+ case SpvOpCopyMemorySized:
+ if (TransformationSetMemoryOperandsMask::
+ MultipleMemoryOperandMasksAreSupported(GetIRContext())) {
+ indices_of_available_masks_to_adjust.push_back(1);
+ }
+ break;
+ default:
+ break;
+ }
+
+ // Consider the available masks
+ for (auto mask_index : indices_of_available_masks_to_adjust) {
+ // Randomly decide whether to adjust this mask.
+ if (!GetFuzzerContext()->ChoosePercentage(
+ GetFuzzerContext()
+ ->GetChanceOfAdjustingMemoryOperandsMask())) {
+ continue;
+ }
+ // Get the existing mask, using None if there was no mask present at
+ // all.
+ auto existing_mask_in_operand_index =
+ TransformationSetMemoryOperandsMask::GetInOperandIndexForMask(
+ *inst_it, mask_index);
+ auto existing_mask =
+ existing_mask_in_operand_index < inst_it->NumInOperands()
+ ? inst_it->GetSingleWordOperand(
+ existing_mask_in_operand_index)
+ : static_cast<uint32_t>(SpvMemoryAccessMaskNone);
+
+ // There are two things we can do to a mask:
+ // - add Volatile if not already present
+ // - toggle Nontemporal
+ // The following ensures that we do at least one of these
+ bool add_volatile = !(existing_mask & SpvMemoryAccessVolatileMask) &&
+ GetFuzzerContext()->ChooseEven();
+ bool toggle_nontemporal =
+ !add_volatile || GetFuzzerContext()->ChooseEven();
+
+ // These bitwise operations use '|' to add Volatile if desired, and
+ // '^' to toggle Nontemporal if desired.
+ uint32_t new_mask =
+ (existing_mask | (add_volatile ? SpvMemoryAccessVolatileMask
+ : SpvMemoryAccessMaskNone)) ^
+ (toggle_nontemporal ? SpvMemoryAccessNontemporalMask
+ : SpvMemoryAccessMaskNone);
+
+ TransformationSetMemoryOperandsMask transformation(
+ MakeInstructionDescriptor(block, inst_it), new_mask, mask_index);
+ assert(
+ transformation.IsApplicable(GetIRContext(), *GetFactManager()) &&
+ "Transformation should be applicable by construction.");
+ transformation.Apply(GetIRContext(), GetFactManager());
+ *GetTransformations()->add_transformation() =
+ transformation.ToMessage();
+ }
+ }
+ }
+ }
+}
+
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.h
new file mode 100644
index 00000000000..c3d71185ea3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_FUZZ_FUZZER_PASS_ADJUST_MEMORY_OPERANDS_MASKS_H_
+#define SOURCE_FUZZ_FUZZER_PASS_ADJUST_MEMORY_OPERANDS_MASKS_H_
+
+#include "source/fuzz/fuzzer_pass.h"
+
+namespace spvtools {
+namespace fuzz {
+
+// A fuzzer pass to adjust the memory operand masks in memory access
+// instructions.
+class FuzzerPassAdjustMemoryOperandsMasks : public FuzzerPass {
+ public:
+ FuzzerPassAdjustMemoryOperandsMasks(
+ opt::IRContext* ir_context, FactManager* fact_manager,
+ FuzzerContext* fuzzer_context,
+ protobufs::TransformationSequence* transformations);
+
+ ~FuzzerPassAdjustMemoryOperandsMasks();
+
+ void Apply() override;
+};
+
+} // namespace fuzz
+} // namespace spvtools
+
+#endif // SOURCE_FUZZ_FUZZER_PASS_ADJUST_MEMORY_OPERANDS_MASKS_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_selection_controls.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_selection_controls.cpp
new file mode 100644
index 00000000000..442fc496246
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_selection_controls.cpp
@@ -0,0 +1,76 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/fuzzer_pass_adjust_selection_controls.h"
+
+#include "source/fuzz/transformation_set_selection_control.h"
+
+namespace spvtools {
+namespace fuzz {
+
+FuzzerPassAdjustSelectionControls::FuzzerPassAdjustSelectionControls(
+ opt::IRContext* ir_context, FactManager* fact_manager,
+ FuzzerContext* fuzzer_context,
+ protobufs::TransformationSequence* transformations)
+ : FuzzerPass(ir_context, fact_manager, fuzzer_context, transformations){};
+
+FuzzerPassAdjustSelectionControls::~FuzzerPassAdjustSelectionControls() =
+ default;
+
+void FuzzerPassAdjustSelectionControls::Apply() {
+ // Consider every merge instruction in the module (via looking through all
+ // functions and blocks).
+ for (auto& function : *GetIRContext()->module()) {
+ for (auto& block : function) {
+ if (auto merge_inst = block.GetMergeInst()) {
+ // Ignore the instruction if it is not a selection merge.
+ if (merge_inst->opcode() != SpvOpSelectionMerge) {
+ continue;
+ }
+
+ // Choose randomly whether to change the selection control for this
+ // instruction.
+ if (!GetFuzzerContext()->ChoosePercentage(
+ GetFuzzerContext()->GetChanceOfAdjustingSelectionControl())) {
+ continue;
+ }
+
+ // The choices to change the selection control to are the set of valid
+ // controls, minus the current control.
+ std::vector<uint32_t> choices;
+ for (auto control :
+ {SpvSelectionControlMaskNone, SpvSelectionControlFlattenMask,
+ SpvSelectionControlDontFlattenMask}) {
+ if (control == merge_inst->GetSingleWordOperand(1)) {
+ continue;
+ }
+ choices.push_back(control);
+ }
+
+ // Apply the transformation and add it to the output transformation
+ // sequence.
+ TransformationSetSelectionControl transformation(
+ block.id(), choices[GetFuzzerContext()->RandomIndex(choices)]);
+ assert(transformation.IsApplicable(GetIRContext(), *GetFactManager()) &&
+ "Transformation should be applicable by construction.");
+ transformation.Apply(GetIRContext(), GetFactManager());
+ *GetTransformations()->add_transformation() =
+ transformation.ToMessage();
+ }
+ }
+ }
+}
+
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_selection_controls.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_selection_controls.h
new file mode 100644
index 00000000000..b5b255ce3e6
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_adjust_selection_controls.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_FUZZ_FUZZER_PASS_ADJUST_SELECTION_CONTROLS_
+#define SOURCE_FUZZ_FUZZER_PASS_ADJUST_SELECTION_CONTROLS_
+
+#include "source/fuzz/fuzzer_pass.h"
+
+namespace spvtools {
+namespace fuzz {
+
+// A pass that adjusts the selection controls on OpSelectionMerge instructions.
+class FuzzerPassAdjustSelectionControls : public FuzzerPass {
+ public:
+ FuzzerPassAdjustSelectionControls(
+ opt::IRContext* ir_context, FactManager* fact_manager,
+ FuzzerContext* fuzzer_context,
+ protobufs::TransformationSequence* transformations);
+
+ ~FuzzerPassAdjustSelectionControls() override;
+
+ void Apply() override;
+};
+
+} // namespace fuzz
+} // namespace spvtools
+
+#endif // SOURCE_FUZZ_FUZZER_PASS_ADJUST_SELECTION_CONTROLS_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_apply_id_synonyms.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_apply_id_synonyms.cpp
index 64131f9e545..3c7376dbf89 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_apply_id_synonyms.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_apply_id_synonyms.cpp
@@ -56,16 +56,13 @@ void FuzzerPassApplyIdSynonyms::Apply() {
std::vector<const protobufs::DataDescriptor*> synonyms_to_try;
for (auto& data_descriptor :
GetFactManager()->GetSynonymsForId(id_with_known_synonyms)) {
- synonyms_to_try.push_back(&data_descriptor);
+ synonyms_to_try.push_back(data_descriptor);
}
while (!synonyms_to_try.empty()) {
auto synonym_index =
GetFuzzerContext()->RandomIndex(synonyms_to_try);
auto synonym_to_try = synonyms_to_try[synonym_index];
synonyms_to_try.erase(synonyms_to_try.begin() + synonym_index);
- assert(synonym_to_try->index().empty() &&
- "Right now we only support id == id synonyms; supporting "
- "e.g. id == index-into-vector will come later");
if (!TransformationReplaceIdWithSynonym::
ReplacingUseWithSynonymIsOk(GetIRContext(), use_inst,
@@ -74,10 +71,24 @@ void FuzzerPassApplyIdSynonyms::Apply() {
continue;
}
+ // At present, we generate direct id synonyms (through
+ // OpCopyObject), which require no indices, and id synonyms that
+ // require a single index (through OpCompositeConstruct).
+ assert(synonym_to_try->index_size() <= 1);
+
+ // If an index is required, then we need to extract an element
+ // from a composite (e.g. through OpCompositeExtract), and this
+ // requires a fresh result id.
+ auto fresh_id_for_temporary =
+ synonym_to_try->index().empty()
+ ? 0
+ : GetFuzzerContext()->GetFreshId();
+
TransformationReplaceIdWithSynonym replace_id_transformation(
- transformation::MakeIdUseDescriptorFromUse(
- GetIRContext(), use_inst, use_in_operand_index),
- *synonym_to_try, 0);
+ MakeIdUseDescriptorFromUse(GetIRContext(), use_inst,
+ use_in_operand_index),
+ *synonym_to_try, fresh_id_for_temporary);
+
// The transformation should be applicable by construction.
assert(replace_id_transformation.IsApplicable(GetIRContext(),
*GetFactManager()));
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_construct_composites.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_construct_composites.cpp
new file mode 100644
index 00000000000..9eb56316c17
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_construct_composites.cpp
@@ -0,0 +1,363 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/fuzzer_pass_construct_composites.h"
+
+#include <cmath>
+#include <memory>
+
+#include "source/fuzz/fuzzer_util.h"
+#include "source/fuzz/transformation_composite_construct.h"
+#include "source/util/make_unique.h"
+
+namespace spvtools {
+namespace fuzz {
+
+FuzzerPassConstructComposites::FuzzerPassConstructComposites(
+ opt::IRContext* ir_context, FactManager* fact_manager,
+ FuzzerContext* fuzzer_context,
+ protobufs::TransformationSequence* transformations)
+ : FuzzerPass(ir_context, fact_manager, fuzzer_context, transformations) {}
+
+FuzzerPassConstructComposites::~FuzzerPassConstructComposites() = default;
+
+void FuzzerPassConstructComposites::Apply() {
+ // Gather up the ids of all composite types.
+ std::vector<uint32_t> composite_type_ids;
+ for (auto& inst : GetIRContext()->types_values()) {
+ if (fuzzerutil::IsCompositeType(
+ GetIRContext()->get_type_mgr()->GetType(inst.result_id()))) {
+ composite_type_ids.push_back(inst.result_id());
+ }
+ }
+
+ MaybeAddTransformationBeforeEachInstruction(
+ [this, &composite_type_ids](
+ const opt::Function& function, opt::BasicBlock* block,
+ opt::BasicBlock::iterator inst_it,
+ const protobufs::InstructionDescriptor& instruction_descriptor)
+ -> void {
+ // Check whether it is legitimate to insert a composite construction
+ // before the instruction.
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(
+ SpvOpCompositeConstruct, inst_it)) {
+ return;
+ }
+
+ // Randomly decide whether to try inserting an object copy here.
+ if (!GetFuzzerContext()->ChoosePercentage(
+ GetFuzzerContext()->GetChanceOfConstructingComposite())) {
+ return;
+ }
+
+ // For each instruction that is available at this program point (i.e. an
+ // instruction that is global or whose definition strictly dominates the
+ // program point) and suitable for making a synonym of, associate it
+ // with the id of its result type.
+ TypeIdToInstructions type_id_to_available_instructions;
+ for (auto instruction : FindAvailableInstructions(
+ function, block, inst_it, fuzzerutil::CanMakeSynonymOf)) {
+ RecordAvailableInstruction(instruction,
+ &type_id_to_available_instructions);
+ }
+
+ // At this point, |composite_type_ids| captures all the composite types
+ // we could try to create, while |type_id_to_available_instructions|
+ // captures all the available result ids we might use, organized by
+ // type.
+
+ // Now we try to find a composite that we can construct. We might not
+ // manage, if there is a paucity of available ingredients in the module
+ // (e.g. if our only available composite was a boolean vector and we had
+ // no instructions generating boolean result types available).
+ //
+ // If we succeed, |chosen_composite_type| will end up being non-zero,
+ // and |constructor_arguments| will end up giving us result ids suitable
+ // for constructing a composite of that type. Otherwise these variables
+ // will remain 0 and null respectively.
+ uint32_t chosen_composite_type = 0;
+ std::unique_ptr<std::vector<uint32_t>> constructor_arguments = nullptr;
+
+ // Initially, all composite type ids are available for us to try. Keep
+ // trying until we run out of options.
+ auto composites_to_try_constructing = composite_type_ids;
+ while (!composites_to_try_constructing.empty()) {
+ // Remove a composite type from the composite types left for us to
+ // try.
+ auto index =
+ GetFuzzerContext()->RandomIndex(composites_to_try_constructing);
+ auto next_composite_to_try_constructing =
+ composites_to_try_constructing[index];
+ composites_to_try_constructing.erase(
+ composites_to_try_constructing.begin() + index);
+
+ // Now try to construct a composite of this type, using an appropriate
+ // helper method depending on the kind of composite type.
+ auto composite_type = GetIRContext()->get_type_mgr()->GetType(
+ next_composite_to_try_constructing);
+ if (auto array_type = composite_type->AsArray()) {
+ constructor_arguments = TryConstructingArrayComposite(
+ *array_type, type_id_to_available_instructions);
+ } else if (auto matrix_type = composite_type->AsMatrix()) {
+ constructor_arguments = TryConstructingMatrixComposite(
+ *matrix_type, type_id_to_available_instructions);
+ } else if (auto struct_type = composite_type->AsStruct()) {
+ constructor_arguments = TryConstructingStructComposite(
+ *struct_type, type_id_to_available_instructions);
+ } else {
+ auto vector_type = composite_type->AsVector();
+ assert(vector_type &&
+ "The space of possible composite types should be covered by "
+ "the above cases.");
+ constructor_arguments = TryConstructingVectorComposite(
+ *vector_type, type_id_to_available_instructions);
+ }
+ if (constructor_arguments != nullptr) {
+ // We succeeded! Note the composite type we finally settled on, and
+ // exit from the loop.
+ chosen_composite_type = next_composite_to_try_constructing;
+ break;
+ }
+ }
+
+ if (!chosen_composite_type) {
+ // We did not manage to make a composite; return 0 to indicate that no
+ // instructions were added.
+ assert(constructor_arguments == nullptr);
+ return;
+ }
+ assert(constructor_arguments != nullptr);
+
+ // Make and apply a transformation.
+ TransformationCompositeConstruct transformation(
+ chosen_composite_type, *constructor_arguments,
+ instruction_descriptor, GetFuzzerContext()->GetFreshId());
+ assert(transformation.IsApplicable(GetIRContext(), *GetFactManager()) &&
+ "This transformation should be applicable by construction.");
+ transformation.Apply(GetIRContext(), GetFactManager());
+ *GetTransformations()->add_transformation() =
+ transformation.ToMessage();
+ // Indicate that one instruction was added.
+ });
+}
+
+void FuzzerPassConstructComposites::RecordAvailableInstruction(
+ opt::Instruction* inst,
+ TypeIdToInstructions* type_id_to_available_instructions) {
+ if (type_id_to_available_instructions->count(inst->type_id()) == 0) {
+ (*type_id_to_available_instructions)[inst->type_id()] = {};
+ }
+ type_id_to_available_instructions->at(inst->type_id()).push_back(inst);
+}
+
+std::unique_ptr<std::vector<uint32_t>>
+FuzzerPassConstructComposites::TryConstructingArrayComposite(
+ const opt::analysis::Array& array_type,
+ const TypeIdToInstructions& type_id_to_available_instructions) {
+ // At present we assume arrays have a constant size.
+ assert(array_type.length_info().words.size() == 2);
+ assert(array_type.length_info().words[0] ==
+ opt::analysis::Array::LengthInfo::kConstant);
+
+ auto result = MakeUnique<std::vector<uint32_t>>();
+
+ // Get the element type for the array.
+ auto element_type_id =
+ GetIRContext()->get_type_mgr()->GetId(array_type.element_type());
+
+ // Get all instructions at our disposal that compute something of this element
+ // type.
+ auto available_instructions =
+ type_id_to_available_instructions.find(element_type_id);
+
+ if (available_instructions == type_id_to_available_instructions.cend()) {
+ // If there are not any instructions available that compute the element type
+ // of the array then we are not in a position to construct a composite with
+ // this array type.
+ return nullptr;
+ }
+ for (uint32_t index = 0; index < array_type.length_info().words[1]; index++) {
+ result->push_back(available_instructions
+ ->second[GetFuzzerContext()->RandomIndex(
+ available_instructions->second)]
+ ->result_id());
+ }
+ return result;
+}
+
+std::unique_ptr<std::vector<uint32_t>>
+FuzzerPassConstructComposites::TryConstructingMatrixComposite(
+ const opt::analysis::Matrix& matrix_type,
+ const TypeIdToInstructions& type_id_to_available_instructions) {
+ auto result = MakeUnique<std::vector<uint32_t>>();
+
+ // Get the element type for the matrix.
+ auto element_type_id =
+ GetIRContext()->get_type_mgr()->GetId(matrix_type.element_type());
+
+ // Get all instructions at our disposal that compute something of this element
+ // type.
+ auto available_instructions =
+ type_id_to_available_instructions.find(element_type_id);
+
+ if (available_instructions == type_id_to_available_instructions.cend()) {
+ // If there are not any instructions available that compute the element type
+ // of the matrix then we are not in a position to construct a composite with
+ // this matrix type.
+ return nullptr;
+ }
+ for (uint32_t index = 0; index < matrix_type.element_count(); index++) {
+ result->push_back(available_instructions
+ ->second[GetFuzzerContext()->RandomIndex(
+ available_instructions->second)]
+ ->result_id());
+ }
+ return result;
+}
+
+std::unique_ptr<std::vector<uint32_t>>
+FuzzerPassConstructComposites::TryConstructingStructComposite(
+ const opt::analysis::Struct& struct_type,
+ const TypeIdToInstructions& type_id_to_available_instructions) {
+ auto result = MakeUnique<std::vector<uint32_t>>();
+ // Consider the type of each field of the struct.
+ for (auto element_type : struct_type.element_types()) {
+ auto element_type_id = GetIRContext()->get_type_mgr()->GetId(element_type);
+ // Find the instructions at our disposal that compute something of the field
+ // type.
+ auto available_instructions =
+ type_id_to_available_instructions.find(element_type_id);
+ if (available_instructions == type_id_to_available_instructions.cend()) {
+ // If there are no such instructions, we cannot construct a composite of
+ // this struct type.
+ return nullptr;
+ }
+ result->push_back(available_instructions
+ ->second[GetFuzzerContext()->RandomIndex(
+ available_instructions->second)]
+ ->result_id());
+ }
+ return result;
+}
+
+std::unique_ptr<std::vector<uint32_t>>
+FuzzerPassConstructComposites::TryConstructingVectorComposite(
+ const opt::analysis::Vector& vector_type,
+ const TypeIdToInstructions& type_id_to_available_instructions) {
+ // Get details of the type underlying the vector, and the width of the vector,
+ // for convenience.
+ auto element_type = vector_type.element_type();
+ auto element_count = vector_type.element_count();
+
+ // Collect a mapping, from type id to width, for scalar/vector types that are
+ // smaller in width than |vector_type|, but that have the same underlying
+ // type. For example, if |vector_type| is vec4, the mapping will be:
+ // { float -> 1, vec2 -> 2, vec3 -> 3 }
+ // The mapping will have missing entries if some of these types do not exist.
+
+ std::map<uint32_t, uint32_t> smaller_vector_type_id_to_width;
+ // Add the underlying type. This id must exist, in order for |vector_type| to
+ // exist.
+ auto scalar_type_id = GetIRContext()->get_type_mgr()->GetId(element_type);
+ smaller_vector_type_id_to_width[scalar_type_id] = 1;
+
+ // Now add every vector type with width at least 2, and less than the width of
+ // |vector_type|.
+ for (uint32_t width = 2; width < element_count; width++) {
+ opt::analysis::Vector smaller_vector_type(vector_type.element_type(),
+ width);
+ auto smaller_vector_type_id =
+ GetIRContext()->get_type_mgr()->GetId(&smaller_vector_type);
+ // We might find that there is no declared type of this smaller width.
+ // For example, a module can declare vec4 without having declared vec2 or
+ // vec3.
+ if (smaller_vector_type_id) {
+ smaller_vector_type_id_to_width[smaller_vector_type_id] = width;
+ }
+ }
+
+ // Now we know the types that are available to us, we set about populating a
+ // vector of the right length. We do this by deciding, with no order in mind,
+ // which instructions we will use to populate the vector, and subsequently
+ // randomly choosing an order. This is to avoid biasing construction of
+ // vectors with smaller vectors to the left and scalars to the right. That is
+ // a concern because, e.g. in the case of populating a vec4, if we populate
+ // the constructor instructions left-to-right, we can always choose a vec3 to
+ // construct the first three elements, but can only choose a vec3 to construct
+ // the last three elements if we chose a float to construct the first element
+ // (otherwise there will not be space left for a vec3).
+
+ uint32_t vector_slots_used = 0;
+ // The instructions we will use to construct the vector, in no particular
+ // order at this stage.
+ std::vector<opt::Instruction*> instructions_to_use;
+
+ while (vector_slots_used < vector_type.element_count()) {
+ std::vector<opt::Instruction*> instructions_to_choose_from;
+ for (auto& entry : smaller_vector_type_id_to_width) {
+ if (entry.second >
+ std::min(vector_type.element_count() - 1,
+ vector_type.element_count() - vector_slots_used)) {
+ continue;
+ }
+ auto available_instructions =
+ type_id_to_available_instructions.find(entry.first);
+ if (available_instructions == type_id_to_available_instructions.cend()) {
+ continue;
+ }
+ instructions_to_choose_from.insert(instructions_to_choose_from.end(),
+ available_instructions->second.begin(),
+ available_instructions->second.end());
+ }
+ if (instructions_to_choose_from.empty()) {
+ // We may get unlucky and find that there are not any instructions to
+ // choose from. In this case we give up constructing a composite of this
+ // vector type. It might be that we could construct the composite in
+ // another manner, so we could opt to retry a few times here, but it is
+ // simpler to just give up on the basis that this will not happen
+ // frequently.
+ return nullptr;
+ }
+ auto instruction_to_use =
+ instructions_to_choose_from[GetFuzzerContext()->RandomIndex(
+ instructions_to_choose_from)];
+ instructions_to_use.push_back(instruction_to_use);
+ auto chosen_type =
+ GetIRContext()->get_type_mgr()->GetType(instruction_to_use->type_id());
+ if (chosen_type->AsVector()) {
+ assert(chosen_type->AsVector()->element_type() == element_type);
+ assert(chosen_type->AsVector()->element_count() < element_count);
+ assert(chosen_type->AsVector()->element_count() <=
+ element_count - vector_slots_used);
+ vector_slots_used += chosen_type->AsVector()->element_count();
+ } else {
+ assert(chosen_type == element_type);
+ vector_slots_used += 1;
+ }
+ }
+ assert(vector_slots_used == vector_type.element_count());
+
+ auto result = MakeUnique<std::vector<uint32_t>>();
+ std::vector<uint32_t> operands;
+ while (!instructions_to_use.empty()) {
+ auto index = GetFuzzerContext()->RandomIndex(instructions_to_use);
+ result->push_back(instructions_to_use[index]->result_id());
+ instructions_to_use.erase(instructions_to_use.begin() + index);
+ }
+ assert(result->size() > 1);
+ return result;
+}
+
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_construct_composites.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_construct_composites.h
new file mode 100644
index 00000000000..99ef31ff961
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_construct_composites.h
@@ -0,0 +1,79 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_FUZZ_FUZZER_PASS_CONSTRUCT_COMPOSITES_H_
+#define SOURCE_FUZZ_FUZZER_PASS_CONSTRUCT_COMPOSITES_H_
+
+#include "source/fuzz/fuzzer_pass.h"
+
+#include <map>
+#include <vector>
+
+namespace spvtools {
+namespace fuzz {
+
+// A fuzzer pass for constructing composite objects from smaller objects.
+class FuzzerPassConstructComposites : public FuzzerPass {
+ public:
+ FuzzerPassConstructComposites(
+ opt::IRContext* ir_context, FactManager* fact_manager,
+ FuzzerContext* fuzzer_context,
+ protobufs::TransformationSequence* transformations);
+
+ ~FuzzerPassConstructComposites();
+
+ void Apply() override;
+
+ private:
+ // Used to map a type id to relevant instructions whose result type matches
+ // the type id.
+ typedef std::map<uint32_t, std::vector<opt::Instruction*>>
+ TypeIdToInstructions;
+
+ // Considers all instructions that are available at |inst| - instructions
+ // whose results could be packed into a composite - and updates
+ // |type_id_to_available_instructions| so that each such instruction is
+ // associated with its the id of its result type.
+ void RecordAvailableInstruction(
+ opt::Instruction* inst,
+ TypeIdToInstructions* type_id_to_available_instructions);
+
+ // Attempts to find suitable instruction result ids from the values of
+ // |type_id_to_available_instructions| that would allow a composite of type
+ // |array_type| to be constructed. Returns said ids if they can be found.
+ // Returns |nullptr| otherwise.
+ std::unique_ptr<std::vector<uint32_t>> TryConstructingArrayComposite(
+ const opt::analysis::Array& array_type,
+ const TypeIdToInstructions& type_id_to_available_instructions);
+
+ // Similar to TryConstructingArrayComposite, but for matrices.
+ std::unique_ptr<std::vector<uint32_t>> TryConstructingMatrixComposite(
+ const opt::analysis::Matrix& matrix_type,
+ const TypeIdToInstructions& type_id_to_available_instructions);
+
+ // Similar to TryConstructingArrayComposite, but for structs.
+ std::unique_ptr<std::vector<uint32_t>> TryConstructingStructComposite(
+ const opt::analysis::Struct& struct_type,
+ const TypeIdToInstructions& type_id_to_available_instructions);
+
+ // Similar to TryConstructingArrayComposite, but for vectors.
+ std::unique_ptr<std::vector<uint32_t>> TryConstructingVectorComposite(
+ const opt::analysis::Vector& vector_type,
+ const TypeIdToInstructions& type_id_to_available_instructions);
+};
+
+} // namespace fuzz
+} // namespace spvtools
+
+#endif // SOURCE_FUZZ_FUZZER_PASS_CONSTRUCT_COMPOSITES_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_copy_objects.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_copy_objects.cpp
index a1b118a886b..35b15a38a32 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_copy_objects.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_copy_objects.cpp
@@ -14,6 +14,7 @@
#include "source/fuzz/fuzzer_pass_copy_objects.h"
+#include "source/fuzz/fuzzer_util.h"
#include "source/fuzz/transformation_copy_object.h"
namespace spvtools {
@@ -28,120 +29,51 @@ FuzzerPassCopyObjects::FuzzerPassCopyObjects(
FuzzerPassCopyObjects::~FuzzerPassCopyObjects() = default;
void FuzzerPassCopyObjects::Apply() {
- // Consider every block in every function.
- for (auto& function : *GetIRContext()->module()) {
- for (auto& block : function) {
- // We now consider every instruction in the block, randomly deciding
- // whether to add an object copy before the instruction.
-
- // In order to insert an object copy instruction, we need to be able to
- // identify the instruction a copy should be inserted before. We do this
- // by tracking a base instruction, which must generate a result id, and an
- // offset (to allow us to identify instructions that do not generate
- // result ids).
-
- // The initial base instruction is the block label.
- uint32_t base = block.id();
- uint32_t offset = 0;
- // Consider every instruction in the block.
- for (auto inst_it = block.begin(); inst_it != block.end(); ++inst_it) {
- if (inst_it->HasResultId()) {
- // In the case that the instruction has a result id, we use the
- // instruction as its own base, with zero offset.
- base = inst_it->result_id();
- offset = 0;
- } else {
- // The instruction does not have a result id, so we need to identify
- // it via the latest instruction that did have a result id (base), and
- // an incremented offset.
- offset++;
- }
+ MaybeAddTransformationBeforeEachInstruction(
+ [this](const opt::Function& function, opt::BasicBlock* block,
+ opt::BasicBlock::iterator inst_it,
+ const protobufs::InstructionDescriptor& instruction_descriptor)
+ -> void {
+ assert(inst_it->opcode() ==
+ instruction_descriptor.target_instruction_opcode() &&
+ "The opcode of the instruction we might insert before must be "
+ "the same as the opcode in the descriptor for the instruction");
// Check whether it is legitimate to insert a copy before this
// instruction.
- if (!TransformationCopyObject::CanInsertCopyBefore(inst_it)) {
- continue;
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpCopyObject,
+ inst_it)) {
+ return;
}
// Randomly decide whether to try inserting an object copy here.
if (!GetFuzzerContext()->ChoosePercentage(
GetFuzzerContext()->GetChanceOfCopyingObject())) {
- continue;
- }
-
- // Populate list of potential instructions that can be copied.
- // TODO(afd) The following is (relatively) simple, but may end up being
- // prohibitively inefficient, as it walks the whole dominator tree for
- // every copy that is added.
- std::vector<opt::Instruction*> copyable_instructions;
-
- // Consider all global declarations
- for (auto& global : GetIRContext()->module()->types_values()) {
- if (TransformationCopyObject::IsCopyable(GetIRContext(), &global)) {
- copyable_instructions.push_back(&global);
- }
+ return;
}
- // Consider all previous instructions in this block
- for (auto prev_inst_it = block.begin(); prev_inst_it != inst_it;
- ++prev_inst_it) {
- if (TransformationCopyObject::IsCopyable(GetIRContext(),
- &*prev_inst_it)) {
- copyable_instructions.push_back(&*prev_inst_it);
- }
- }
-
- // Walk the dominator tree to consider all instructions from dominating
- // blocks
- auto dominator_analysis =
- GetIRContext()->GetDominatorAnalysis(&function);
- for (auto next_dominator =
- dominator_analysis->ImmediateDominator(&block);
- next_dominator != nullptr;
- next_dominator =
- dominator_analysis->ImmediateDominator(next_dominator)) {
- for (auto& dominating_inst : *next_dominator) {
- if (TransformationCopyObject::IsCopyable(GetIRContext(),
- &dominating_inst)) {
- copyable_instructions.push_back(&dominating_inst);
- }
- }
- }
+ std::vector<opt::Instruction*> relevant_instructions =
+ FindAvailableInstructions(function, block, inst_it,
+ fuzzerutil::CanMakeSynonymOf);
- // At this point, |copyable_instructions| contains all the instructions
+ // At this point, |relevant_instructions| contains all the instructions
// we might think of copying.
-
- if (!copyable_instructions.empty()) {
- // Choose a copyable instruction at random, and create and apply an
- // object copying transformation based on it.
- uint32_t index =
- GetFuzzerContext()->RandomIndex(copyable_instructions);
- TransformationCopyObject transformation(
- copyable_instructions[index]->result_id(), base, offset,
- GetFuzzerContext()->GetFreshId());
- assert(
- transformation.IsApplicable(GetIRContext(), *GetFactManager()) &&
- "This transformation should be applicable by construction.");
- transformation.Apply(GetIRContext(), GetFactManager());
- *GetTransformations()->add_transformation() =
- transformation.ToMessage();
-
- if (!inst_it->HasResultId()) {
- // We have inserted a new instruction before the current
- // instruction, and we are tracking the current id-less instruction
- // via an offset (offset) from a previous instruction (base) that
- // has an id. We increment |offset| to reflect the newly-inserted
- // instruction.
- //
- // This is slightly preferable to the alternative of setting |base|
- // to be the result id of the new instruction, since on replay we
- // might end up eliminating this copy but keeping a subsequent copy.
- offset++;
- }
+ if (relevant_instructions.empty()) {
+ return;
}
- }
- }
- }
+
+ // Choose a copyable instruction at random, and create and apply an
+ // object copying transformation based on it.
+ uint32_t index = GetFuzzerContext()->RandomIndex(relevant_instructions);
+ TransformationCopyObject transformation(
+ relevant_instructions[index]->result_id(), instruction_descriptor,
+ GetFuzzerContext()->GetFreshId());
+ assert(transformation.IsApplicable(GetIRContext(), *GetFactManager()) &&
+ "This transformation should be applicable by construction.");
+ transformation.Apply(GetIRContext(), GetFactManager());
+ *GetTransformations()->add_transformation() =
+ transformation.ToMessage();
+ });
}
} // namespace fuzz
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_obfuscate_constants.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_obfuscate_constants.cpp
index 484c9b8c20a..3df11aeecdc 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_obfuscate_constants.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_obfuscate_constants.cpp
@@ -16,6 +16,7 @@
#include <cmath>
+#include "source/fuzz/instruction_descriptor.h"
#include "source/fuzz/transformation_replace_boolean_constant_with_constant_binary.h"
#include "source/fuzz/transformation_replace_constant_with_uniform.h"
#include "source/opt/ir_context.h"
@@ -102,10 +103,11 @@ void FuzzerPassObfuscateConstants::ObfuscateBoolConstantViaConstantPair(
// We randomly decide, based on the current depth of obfuscation, whether
// to further obfuscate this operand.
if (GetFuzzerContext()->GoDeeperInConstantObfuscation(depth)) {
- auto in_operand_use = transformation::MakeIdUseDescriptor(
+ auto in_operand_use = MakeIdUseDescriptor(
binary_operator_instruction->GetSingleWordInOperand(index),
- binary_operator_instruction->opcode(), index,
- binary_operator_instruction->result_id(), 0);
+ MakeInstructionDescriptor(binary_operator_instruction->result_id(),
+ binary_operator_instruction->opcode(), 0),
+ index);
ObfuscateConstant(depth + 1, in_operand_use);
}
}
@@ -366,14 +368,17 @@ void FuzzerPassObfuscateConstants::MaybeAddConstantIdUse(
// it.
protobufs::IdUseDescriptor id_use_descriptor;
id_use_descriptor.set_id_of_interest(operand_id);
- id_use_descriptor.set_target_instruction_opcode(inst.opcode());
+ id_use_descriptor.mutable_enclosing_instruction()
+ ->set_target_instruction_opcode(inst.opcode());
+ id_use_descriptor.mutable_enclosing_instruction()
+ ->set_base_instruction_result_id(base_instruction_result_id);
+ id_use_descriptor.mutable_enclosing_instruction()
+ ->set_num_opcodes_to_ignore(
+ skipped_opcode_count.find(inst.opcode()) ==
+ skipped_opcode_count.end()
+ ? 0
+ : skipped_opcode_count.at(inst.opcode()));
id_use_descriptor.set_in_operand_index(in_operand_index);
- id_use_descriptor.set_base_instruction_result_id(
- base_instruction_result_id);
- id_use_descriptor.set_num_opcodes_to_ignore(
- skipped_opcode_count.find(inst.opcode()) == skipped_opcode_count.end()
- ? 0
- : skipped_opcode_count.at(inst.opcode()));
constant_uses->push_back(id_use_descriptor);
} break;
default:
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_split_blocks.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_split_blocks.cpp
index c0318e88752..6a2ea4dcc80 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_split_blocks.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_pass_split_blocks.cpp
@@ -14,9 +14,9 @@
#include "source/fuzz/fuzzer_pass_split_blocks.h"
-#include <utility>
#include <vector>
+#include "source/fuzz/instruction_descriptor.h"
#include "source/fuzz/transformation_split_block.h"
namespace spvtools {
@@ -49,40 +49,49 @@ void FuzzerPassSplitBlocks::Apply() {
// We are not going to try to split this block.
continue;
}
+
+ // TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/2964): consider
+ // taking a simpler approach to identifying the instruction before which
+ // to split a block.
+
// We are going to try to split this block. We now need to choose where
- // to split it. We do this by finding a base instruction that has a
- // result id, and an offset from that base instruction. We would like
- // offsets to be as small as possible and ideally 0 - we only need offsets
- // because not all instructions can be identified by a result id (e.g.
- // OpStore instructions cannot).
- std::vector<std::pair<uint32_t, uint32_t>> base_offset_pairs;
+ // to split it. We describe the instruction before which we would like to
+ // split a block via an InstructionDescriptor, details of which are
+ // commented in the protobufs definition file.
+ std::vector<protobufs::InstructionDescriptor> instruction_descriptors;
+
// The initial base instruction is the block label.
uint32_t base = block->id();
- uint32_t offset = 0;
+
+ // Counts the number of times we have seen each opcode since we reset the
+ // base instruction.
+ std::map<SpvOp, uint32_t> skip_count;
+
// Consider every instruction in the block. The label is excluded: it is
// only necessary to consider it as a base in case the first instruction
// in the block does not have a result id.
for (auto& inst : *block) {
if (inst.HasResultId()) {
// In the case that the instruction has a result id, we use the
- // instruction as its own base, with zero offset.
+ // instruction as its own base, and clear the skip counts we have
+ // collected.
base = inst.result_id();
- offset = 0;
- } else {
- // The instruction does not have a result id, so we need to identify
- // it via the latest instruction that did have a result id (base), and
- // an incremented offset.
- offset++;
+ skip_count.clear();
+ }
+ const SpvOp opcode = inst.opcode();
+ instruction_descriptors.emplace_back(MakeInstructionDescriptor(
+ base, opcode, skip_count.count(opcode) ? skip_count.at(opcode) : 0));
+ if (!inst.HasResultId()) {
+ skip_count[opcode] =
+ skip_count.count(opcode) ? skip_count.at(opcode) + 1 : 1;
}
- base_offset_pairs.emplace_back(base, offset);
}
// Having identified all the places we might be able to split the block,
// we choose one of them.
- auto base_offset =
- base_offset_pairs[GetFuzzerContext()->RandomIndex(base_offset_pairs)];
- auto transformation =
- TransformationSplitBlock(base_offset.first, base_offset.second,
- GetFuzzerContext()->GetFreshId());
+ auto transformation = TransformationSplitBlock(
+ instruction_descriptors[GetFuzzerContext()->RandomIndex(
+ instruction_descriptors)],
+ GetFuzzerContext()->GetFreshId());
// If the position we have chosen turns out to be a valid place to split
// the block, we apply the split. Otherwise the block just doesn't get
// split.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_util.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_util.cpp
index 2ffe8154e6d..feb9506edf8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_util.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_util.cpp
@@ -170,39 +170,14 @@ bool BlockIsInLoopContinueConstruct(opt::IRContext* context, uint32_t block_id,
return false;
}
-opt::BasicBlock::iterator GetIteratorForBaseInstructionAndOffset(
- opt::BasicBlock* block, const opt::Instruction* base_inst,
- uint32_t offset) {
- // The cases where |base_inst| is the block's label, vs. inside the block,
- // are dealt with separately.
- if (base_inst == block->GetLabelInst()) {
- // |base_inst| is the block's label.
- if (offset == 0) {
- // We cannot return an iterator to the block's label.
- return block->end();
- }
- // Conceptually, the first instruction in the block is [label + 1].
- // We thus start from 1 when applying the offset.
- auto inst_it = block->begin();
- for (uint32_t i = 1; i < offset && inst_it != block->end(); i++) {
- ++inst_it;
- }
- // This is either the desired instruction, or the end of the block.
- return inst_it;
- }
- // |base_inst| is inside the block.
+opt::BasicBlock::iterator GetIteratorForInstruction(
+ opt::BasicBlock* block, const opt::Instruction* inst) {
for (auto inst_it = block->begin(); inst_it != block->end(); ++inst_it) {
- if (base_inst == &*inst_it) {
- // We have found the base instruction; we now apply the offset.
- for (uint32_t i = 0; i < offset && inst_it != block->end(); i++) {
- ++inst_it;
- }
- // This is either the desired instruction, or the end of the block.
+ if (inst == &*inst_it) {
return inst_it;
}
}
- assert(false && "The base instruction was not found.");
- return nullptr;
+ return block->end();
}
bool NewEdgeRespectsUseDefDominance(opt::IRContext* context,
@@ -216,6 +191,13 @@ bool NewEdgeRespectsUseDefDominance(opt::IRContext* context,
return true;
}
+ // TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/2919): the
+ // solution below to determining whether a new edge respects dominance
+ // rules is incomplete. Test
+ // TransformationAddDeadContinueTest::DISABLED_Miscellaneous6 exposes the
+ // problem. In practice, this limitation does not bite too often, and the
+ // worst it does is leads to SPIR-V that spirv-val rejects.
+
// Let us assume that the module being manipulated is valid according to the
// rules of the SPIR-V language.
//
@@ -307,6 +289,95 @@ bool BlockIsReachableInItsFunction(opt::IRContext* context,
->Dominates(enclosing_function->entry().get(), bb);
}
+bool CanInsertOpcodeBeforeInstruction(
+ SpvOp opcode, const opt::BasicBlock::iterator& instruction_in_block) {
+ if (instruction_in_block->PreviousNode() &&
+ (instruction_in_block->PreviousNode()->opcode() == SpvOpLoopMerge ||
+ instruction_in_block->PreviousNode()->opcode() == SpvOpSelectionMerge)) {
+ // We cannot insert directly after a merge instruction.
+ return false;
+ }
+ if (opcode != SpvOpVariable &&
+ instruction_in_block->opcode() == SpvOpVariable) {
+ // We cannot insert a non-OpVariable instruction directly before a
+ // variable; variables in a function must be contiguous in the entry block.
+ return false;
+ }
+ // We cannot insert a non-OpPhi instruction directly before an OpPhi, because
+ // OpPhi instructions need to be contiguous at the start of a block.
+ return opcode == SpvOpPhi || instruction_in_block->opcode() != SpvOpPhi;
+}
+
+bool CanMakeSynonymOf(opt::IRContext* ir_context, opt::Instruction* inst) {
+ if (!inst->HasResultId()) {
+ // We can only make a synonym of an instruction that generates an id.
+ return false;
+ }
+ if (!inst->type_id()) {
+ // We can only make a synonym of an instruction that has a type.
+ return false;
+ }
+ // We do not make synonyms of objects that have decorations: if the synonym is
+ // not decorated analogously, using the original object vs. its synonymous
+ // form may not be equivalent.
+ return ir_context->get_decoration_mgr()
+ ->GetDecorationsFor(inst->result_id(), true)
+ .empty();
+}
+
+bool IsCompositeType(const opt::analysis::Type* type) {
+ return type && (type->AsArray() || type->AsMatrix() || type->AsStruct() ||
+ type->AsVector());
+}
+
+uint32_t WalkCompositeTypeIndices(
+ opt::IRContext* context, uint32_t base_object_type_id,
+ const google::protobuf::RepeatedField<google::protobuf::uint32>& indices) {
+ uint32_t sub_object_type_id = base_object_type_id;
+ for (auto index : indices) {
+ auto should_be_composite_type =
+ context->get_def_use_mgr()->GetDef(sub_object_type_id);
+ assert(should_be_composite_type && "The type should exist.");
+ if (SpvOpTypeStruct == should_be_composite_type->opcode()) {
+ if (index >= should_be_composite_type->NumInOperands()) {
+ return 0;
+ }
+ sub_object_type_id =
+ should_be_composite_type->GetSingleWordInOperand(index);
+ } else if (SpvOpTypeArray == should_be_composite_type->opcode()) {
+ auto array_length_constant =
+ context->get_constant_mgr()
+ ->GetConstantFromInst(context->get_def_use_mgr()->GetDef(
+ should_be_composite_type->GetSingleWordInOperand(1)))
+ ->AsIntConstant();
+ if (array_length_constant->words().size() != 1) {
+ return 0;
+ }
+ auto array_length = array_length_constant->GetU32();
+ if (index >= array_length) {
+ return 0;
+ }
+ sub_object_type_id = should_be_composite_type->GetSingleWordInOperand(0);
+ } else if (SpvOpTypeVector == should_be_composite_type->opcode()) {
+ auto vector_length = should_be_composite_type->GetSingleWordInOperand(1);
+ if (index >= vector_length) {
+ return 0;
+ }
+ sub_object_type_id = should_be_composite_type->GetSingleWordInOperand(0);
+ } else if (SpvOpTypeMatrix == should_be_composite_type->opcode()) {
+ auto matrix_column_count =
+ should_be_composite_type->GetSingleWordInOperand(1);
+ if (index >= matrix_column_count) {
+ return 0;
+ }
+ sub_object_type_id = should_be_composite_type->GetSingleWordInOperand(0);
+ } else {
+ return 0;
+ }
+ }
+ return sub_object_type_id;
+}
+
} // namespace fuzzerutil
} // namespace fuzz
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_util.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_util.h
index 7aebc285836..3599ff1e40c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_util.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/fuzzer_util.h
@@ -64,15 +64,10 @@ void AddUnreachableEdgeAndUpdateOpPhis(
bool BlockIsInLoopContinueConstruct(opt::IRContext* context, uint32_t block_id,
uint32_t maybe_loop_header_id);
-// Requires that |base_inst| is either the label instruction of |block| or an
-// instruction inside |block|.
-//
-// If the block contains a (non-label, non-terminator) instruction |offset|
-// instructions after |base_inst|, an iterator to this instruction is returned.
-//
+// If |block| contains |inst|, an iterator for |inst| is returned.
// Otherwise |block|->end() is returned.
-opt::BasicBlock::iterator GetIteratorForBaseInstructionAndOffset(
- opt::BasicBlock* block, const opt::Instruction* base_inst, uint32_t offset);
+opt::BasicBlock::iterator GetIteratorForInstruction(
+ opt::BasicBlock* block, const opt::Instruction* inst);
// The function determines whether adding an edge from |bb_from| to |bb_to| -
// is legitimate with respect to the SPIR-V rule that a definition must
@@ -87,6 +82,26 @@ bool NewEdgeRespectsUseDefDominance(opt::IRContext* context,
bool BlockIsReachableInItsFunction(opt::IRContext* context,
opt::BasicBlock* bb);
+// Determines whether it is OK to insert an instruction with opcode |opcode|
+// before |instruction_in_block|.
+bool CanInsertOpcodeBeforeInstruction(
+ SpvOp opcode, const opt::BasicBlock::iterator& instruction_in_block);
+
+// Determines whether it is OK to make a synonym of |inst|.
+bool CanMakeSynonymOf(opt::IRContext* ir_context, opt::Instruction* inst);
+
+// Determines whether the given type is a composite; that is: an array, matrix,
+// struct or vector.
+bool IsCompositeType(const opt::analysis::Type* type);
+
+// Given a type id, |base_object_type_id|, checks that the given sequence of
+// |indices| is suitable for indexing into this type. Returns the id of the
+// type of the final sub-object reached via the indices if they are valid, and
+// 0 otherwise.
+uint32_t WalkCompositeTypeIndices(
+ opt::IRContext* context, uint32_t base_object_type_id,
+ const google::protobuf::RepeatedField<google::protobuf::uint32>& indices);
+
} // namespace fuzzerutil
} // namespace fuzz
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/id_use_descriptor.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/id_use_descriptor.cpp
index 8693a7d1be3..105c31035cb 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/id_use_descriptor.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/id_use_descriptor.cpp
@@ -14,71 +14,41 @@
#include "source/fuzz/id_use_descriptor.h"
+#include "source/fuzz/instruction_descriptor.h"
+
namespace spvtools {
namespace fuzz {
-opt::Instruction* transformation::FindInstruction(
- const protobufs::IdUseDescriptor& descriptor,
- spvtools::opt::IRContext* context) {
- for (auto& function : *context->module()) {
- for (auto& block : function) {
- bool found_base = block.id() == descriptor.base_instruction_result_id();
- uint32_t num_ignored = 0;
- for (auto& instruction : block) {
- if (instruction.HasResultId() &&
- instruction.result_id() ==
- descriptor.base_instruction_result_id()) {
- assert(!found_base &&
- "It should not be possible to find the base instruction "
- "multiple times.");
- found_base = true;
- assert(num_ignored == 0 &&
- "The skipped instruction count should only be incremented "
- "after the instruction base has been found.");
- }
- if (found_base &&
- instruction.opcode() == descriptor.target_instruction_opcode()) {
- if (num_ignored == descriptor.num_opcodes_to_ignore()) {
- if (descriptor.in_operand_index() >= instruction.NumInOperands()) {
- return nullptr;
- }
- auto in_operand =
- instruction.GetInOperand(descriptor.in_operand_index());
- if (in_operand.type != SPV_OPERAND_TYPE_ID) {
- return nullptr;
- }
- if (in_operand.words[0] != descriptor.id_of_interest()) {
- return nullptr;
- }
- return &instruction;
- }
- num_ignored++;
- }
- }
- if (found_base) {
- // We found the base instruction, but did not find the target
- // instruction in the same block.
- return nullptr;
- }
- }
+opt::Instruction* FindInstructionContainingUse(
+ const protobufs::IdUseDescriptor& id_use_descriptor,
+ opt::IRContext* context) {
+ auto result =
+ FindInstruction(id_use_descriptor.enclosing_instruction(), context);
+ if (!result) {
+ return nullptr;
+ }
+ if (id_use_descriptor.in_operand_index() >= result->NumInOperands()) {
+ return nullptr;
}
- return nullptr;
+ if (result->GetSingleWordInOperand(id_use_descriptor.in_operand_index()) !=
+ id_use_descriptor.id_of_interest()) {
+ return nullptr;
+ }
+ return result;
}
-protobufs::IdUseDescriptor transformation::MakeIdUseDescriptor(
- uint32_t id_of_interest, SpvOp target_instruction_opcode,
- uint32_t in_operand_index, uint32_t base_instruction_result_id,
- uint32_t num_opcodes_to_ignore) {
+protobufs::IdUseDescriptor MakeIdUseDescriptor(
+ uint32_t id_of_interest,
+ const protobufs::InstructionDescriptor& enclosing_instruction,
+ uint32_t in_operand_index) {
protobufs::IdUseDescriptor result;
result.set_id_of_interest(id_of_interest);
- result.set_target_instruction_opcode(target_instruction_opcode);
+ *result.mutable_enclosing_instruction() = enclosing_instruction;
result.set_in_operand_index(in_operand_index);
- result.set_base_instruction_result_id(base_instruction_result_id);
- result.set_num_opcodes_to_ignore(num_opcodes_to_ignore);
return result;
}
-protobufs::IdUseDescriptor transformation::MakeIdUseDescriptorFromUse(
+protobufs::IdUseDescriptor MakeIdUseDescriptorFromUse(
opt::IRContext* context, opt::Instruction* inst,
uint32_t in_operand_index) {
auto in_operand = inst->GetInOperand(in_operand_index);
@@ -94,9 +64,11 @@ protobufs::IdUseDescriptor transformation::MakeIdUseDescriptorFromUse(
num_opcodes_to_ignore = 0;
}
if (&inst_in_block == inst) {
- return MakeIdUseDescriptor(id_of_interest, inst->opcode(),
- in_operand_index, base_instruction_result_id,
- num_opcodes_to_ignore);
+ return MakeIdUseDescriptor(
+ id_of_interest,
+ MakeInstructionDescriptor(base_instruction_result_id, inst->opcode(),
+ num_opcodes_to_ignore),
+ in_operand_index);
}
if (inst_in_block.opcode() == inst->opcode()) {
num_opcodes_to_ignore++;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/id_use_descriptor.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/id_use_descriptor.h
index 1657cb92307..d18bb668da8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/id_use_descriptor.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/id_use_descriptor.h
@@ -12,28 +12,28 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef SOURCE_FUZZ_ID_USE_LOCATOR_H_
-#define SOURCE_FUZZ_ID_USE_LOCATOR_H_
+#ifndef SOURCE_FUZZ_ID_USE_DESCRIPTOR_H_
+#define SOURCE_FUZZ_ID_USE_DESCRIPTOR_H_
#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
#include "source/opt/ir_context.h"
namespace spvtools {
namespace fuzz {
-namespace transformation {
-// Looks for an instruction in |context| such that the id use represented by
-// |descriptor| is one of the operands to said instruction. Returns |nullptr|
-// if no such instruction can be found.
-opt::Instruction* FindInstruction(const protobufs::IdUseDescriptor& descriptor,
- opt::IRContext* context);
+// Looks for an instruction in |context| that contains a use
+// identified by |id_use_descriptor|.
+// Returns |nullptr| if no such instruction can be found.
+opt::Instruction* FindInstructionContainingUse(
+ const protobufs::IdUseDescriptor& id_use_descriptor,
+ opt::IRContext* context);
// Creates an IdUseDescriptor protobuf message from the given components.
// See the protobuf definition for details of what these components mean.
protobufs::IdUseDescriptor MakeIdUseDescriptor(
- uint32_t id_of_interest, SpvOp target_instruction_opcode,
- uint32_t in_operand_index, uint32_t base_instruction_result_id,
- uint32_t num_opcodes_to_ignore);
+ uint32_t id_of_interest,
+ const protobufs::InstructionDescriptor& enclosing_instruction,
+ uint32_t in_operand_index);
// Given an id use, represented by the instruction |inst| that uses the id, and
// the input operand index |in_operand_index| associated with the usage, returns
@@ -41,8 +41,7 @@ protobufs::IdUseDescriptor MakeIdUseDescriptor(
protobufs::IdUseDescriptor MakeIdUseDescriptorFromUse(
opt::IRContext* context, opt::Instruction* inst, uint32_t in_operand_index);
-} // namespace transformation
} // namespace fuzz
} // namespace spvtools
-#endif // SOURCE_FUZZ_ID_USE_LOCATOR_H_
+#endif // SOURCE_FUZZ_ID_USE_DESCRIPTOR_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/instruction_descriptor.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/instruction_descriptor.cpp
new file mode 100644
index 00000000000..2b4217ab88d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/instruction_descriptor.cpp
@@ -0,0 +1,105 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/instruction_descriptor.h"
+
+namespace spvtools {
+namespace fuzz {
+
+opt::Instruction* FindInstruction(
+ const protobufs::InstructionDescriptor& instruction_descriptor,
+ spvtools::opt::IRContext* context) {
+ for (auto& function : *context->module()) {
+ for (auto& block : function) {
+ bool found_base =
+ block.id() == instruction_descriptor.base_instruction_result_id();
+ uint32_t num_ignored = 0;
+ for (auto& instruction : block) {
+ if (instruction.HasResultId() &&
+ instruction.result_id() ==
+ instruction_descriptor.base_instruction_result_id()) {
+ assert(!found_base &&
+ "It should not be possible to find the base instruction "
+ "multiple times.");
+ found_base = true;
+ assert(num_ignored == 0 &&
+ "The skipped instruction count should only be incremented "
+ "after the instruction base has been found.");
+ }
+ if (found_base &&
+ instruction.opcode() ==
+ instruction_descriptor.target_instruction_opcode()) {
+ if (num_ignored == instruction_descriptor.num_opcodes_to_ignore()) {
+ return &instruction;
+ }
+ num_ignored++;
+ }
+ }
+ if (found_base) {
+ // We found the base instruction, but did not find the target
+ // instruction in the same block.
+ return nullptr;
+ }
+ }
+ }
+ return nullptr;
+}
+
+protobufs::InstructionDescriptor MakeInstructionDescriptor(
+ uint32_t base_instruction_result_id, SpvOp target_instruction_opcode,
+ uint32_t num_opcodes_to_ignore) {
+ protobufs::InstructionDescriptor result;
+ result.set_base_instruction_result_id(base_instruction_result_id);
+ result.set_target_instruction_opcode(target_instruction_opcode);
+ result.set_num_opcodes_to_ignore(num_opcodes_to_ignore);
+ return result;
+}
+
+protobufs::InstructionDescriptor MakeInstructionDescriptor(
+ const opt::BasicBlock& block,
+ const opt::BasicBlock::const_iterator& inst_it) {
+ const SpvOp opcode =
+ inst_it->opcode(); // The opcode of the instruction being described.
+ uint32_t skip_count = 0; // The number of these opcodes we have skipped when
+ // searching backwards.
+
+ // Consider instructions in the block in reverse order, starting from
+ // |inst_it|.
+ for (opt::BasicBlock::const_iterator backwards_iterator = inst_it;;
+ --backwards_iterator) {
+ if (backwards_iterator->HasResultId()) {
+ // As soon as we find an instruction with a result id, we can return a
+ // descriptor for |inst_it|.
+ return MakeInstructionDescriptor(backwards_iterator->result_id(), opcode,
+ skip_count);
+ }
+ if (backwards_iterator != inst_it &&
+ backwards_iterator->opcode() == opcode) {
+ // We are skipping over an instruction with the same opcode as |inst_it|;
+ // we increase our skip count to reflect this.
+ skip_count++;
+ }
+ if (backwards_iterator == block.begin()) {
+ // We exit the loop when we reach the start of the block, but only after
+ // we have processed the first instruction in the block.
+ break;
+ }
+ }
+ // We did not find an instruction inside the block with a result id, so we use
+ // the block's label's id.
+ return MakeInstructionDescriptor(block.id(), opcode, skip_count);
+}
+
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/instruction_descriptor.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/instruction_descriptor.h
new file mode 100644
index 00000000000..c0febca358b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/instruction_descriptor.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_FUZZ_INSTRUCTION_DESCRIPTOR_H_
+#define SOURCE_FUZZ_INSTRUCTION_DESCRIPTOR_H_
+
+#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/ir_context.h"
+
+namespace spvtools {
+namespace fuzz {
+
+// Looks for an instruction in |context| corresponding to |descriptor|.
+// Returns |nullptr| if no such instruction can be found.
+opt::Instruction* FindInstruction(
+ const protobufs::InstructionDescriptor& instruction_descriptor,
+ opt::IRContext* context);
+
+// Creates an InstructionDescriptor protobuf message from the given
+// components. See the protobuf definition for details of what these
+// components mean.
+protobufs::InstructionDescriptor MakeInstructionDescriptor(
+ uint32_t base_instruction_result_id, SpvOp target_instruction_opcode,
+ uint32_t num_opcodes_to_ignore);
+
+// Returns an instruction descriptor that describing the instruction at
+// |inst_it|, which must be inside |block|. The descriptor will be with
+// respect to the first instruction at or before |inst_it| that has a result
+// id.
+protobufs::InstructionDescriptor MakeInstructionDescriptor(
+ const opt::BasicBlock& block,
+ const opt::BasicBlock::const_iterator& inst_it);
+
+} // namespace fuzz
+} // namespace spvtools
+
+#endif // SOURCE_FUZZ_INSTRUCTION_DESCRIPTOR_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/protobufs/spvtoolsfuzz.proto b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/protobufs/spvtoolsfuzz.proto
index 64ccd8efa88..b558ca8432b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/protobufs/spvtoolsfuzz.proto
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/protobufs/spvtoolsfuzz.proto
@@ -21,17 +21,37 @@ syntax = "proto3";
package spvtools.fuzz.protobufs;
+message InstructionDescriptor {
+
+ // Describes an instruction in some block of a function with respect to a
+ // base instruction.
+
+ // The id of an instruction after which the instruction being described is
+ // believed to be located. It might be the using instruction itself.
+ uint32 base_instruction_result_id = 1;
+
+ // The opcode for the instruction being described.
+ uint32 target_instruction_opcode = 2;
+
+ // The number of matching opcodes to skip over when searching from the base
+ // instruction to the instruction being described.
+ uint32 num_opcodes_to_ignore = 3;
+
+}
+
message IdUseDescriptor {
- // Describes a use of an id as an input operand to an instruction in some block
- // of a function.
+ // Describes a use of an id as an input operand to an instruction in some
+ // block of a function.
// Example:
// - id_of_interest = 42
- // - target_instruction_opcode = OpStore
+ // - enclosing_instruction = (
+ // base_instruction_result_id = 50,
+ // target_instruction_opcode = OpStore
+ // num_opcodes_to_ignore = 7
+ // )
// - in_operand_index = 1
- // - base_instruction_result_id = 50
- // - num_opcodes_to_ignore = 7
// represents a use of id 42 as input operand 1 to an OpStore instruction,
// such that the OpStore instruction can be found in the same basic block as
// the instruction with result id 50, and in particular is the 8th OpStore
@@ -41,19 +61,10 @@ message IdUseDescriptor {
// An id that we would like to be able to find a use of.
uint32 id_of_interest = 1;
- // The opcode for the instruction that uses the id.
- uint32 target_instruction_opcode = 2;
-
// The input operand index at which the use is expected.
- uint32 in_operand_index = 3;
-
- // The id of an instruction after which the instruction that contains the use
- // is believed to occur; it might be the using instruction itself.
- uint32 base_instruction_result_id = 4;
+ InstructionDescriptor enclosing_instruction = 2;
- // The number of matching opcodes to skip over when searching for the using
- // instruction from the base instruction.
- uint32 num_opcodes_to_ignore = 5;
+ uint32 in_operand_index = 3;
}
@@ -113,7 +124,7 @@ message Fact {
oneof fact {
// Order the fact options by numeric id (rather than alphabetically).
FactConstantUniform constant_uniform_fact = 1;
- FactIdSynonym id_synonym_fact = 2;
+ FactDataSynonym data_synonym_fact = 2;
}
}
@@ -135,19 +146,16 @@ message FactConstantUniform {
}
-message FactIdSynonym {
+message FactDataSynonym {
- // Records the fact that the data held in an id is guaranteed to be equal to
- // the data held in a data descriptor. spirv-fuzz can use this to replace
- // uses of the id with references to the data described by the data
- // descriptor.
+ // Records the fact that the data held in two data descriptors are guaranteed
+ // to be equal. spirv-fuzz can use this to replace uses of one piece of data
+ // with a known-to-be-equal piece of data.
- // An id
- uint32 id = 1;
+ // Data descriptors guaranteed to hold identical data.
+ DataDescriptor data1 = 1;
- // A data descriptor guaranteed to hold a value identical to that held by the
- // id
- DataDescriptor data_descriptor = 2;
+ DataDescriptor data2 = 2;
}
@@ -167,12 +175,20 @@ message Transformation {
TransformationAddTypeFloat add_type_float = 6;
TransformationAddTypeInt add_type_int = 7;
TransformationAddDeadBreak add_dead_break = 8;
- TransformationReplaceBooleanConstantWithConstantBinary replace_boolean_constant_with_constant_binary = 9;
+ TransformationReplaceBooleanConstantWithConstantBinary
+ replace_boolean_constant_with_constant_binary = 9;
TransformationAddTypePointer add_type_pointer = 10;
TransformationReplaceConstantWithUniform replace_constant_with_uniform = 11;
TransformationAddDeadContinue add_dead_continue = 12;
TransformationCopyObject copy_object = 13;
TransformationReplaceIdWithSynonym replace_id_with_synonym = 14;
+ TransformationSetSelectionControl set_selection_control = 15;
+ TransformationCompositeConstruct composite_construct = 16;
+ TransformationSetLoopControl set_loop_control = 17;
+ TransformationSetFunctionControl set_function_control = 18;
+ TransformationAddNoContractionDecoration add_no_contraction_decoration = 19;
+ TransformationSetMemoryOperandsMask set_memory_operands_mask = 20;
+ TransformationCompositeExtract composite_extract = 21;
// Add additional option using the next available number.
}
}
@@ -245,6 +261,15 @@ message TransformationAddDeadContinue {
}
+message TransformationAddNoContractionDecoration {
+
+ // Applies OpDecorate NoContraction to the given result id
+
+ // Result id to be decorated
+ uint32 result_id = 1;
+
+}
+
message TransformationAddTypeBoolean {
// Adds OpTypeBool to the module
@@ -297,6 +322,46 @@ message TransformationAddTypePointer {
}
+message TransformationCompositeConstruct {
+
+ // A transformation that introduces an OpCompositeConstruct instruction to
+ // make a composite object.
+
+ // Id of the type of the composite that is to be constructed
+ uint32 composite_type_id = 1;
+
+ // Ids of the objects that will form the components of the composite
+ repeated uint32 component = 2;
+
+ // A descriptor for an instruction in a block before which the new
+ // OpCompositeConstruct instruction should be inserted
+ InstructionDescriptor instruction_to_insert_before = 3;
+
+ // A fresh id for the composite object
+ uint32 fresh_id = 4;
+
+}
+
+message TransformationCompositeExtract {
+
+ // A transformation that adds an instruction to extract an element from a
+ // composite.
+
+ // A descriptor for an instruction in a block before which the new
+ // OpCompositeExtract instruction should be inserted
+ InstructionDescriptor instruction_to_insert_before = 1;
+
+ // Result id for the extract operation.
+ uint32 fresh_id = 2;
+
+ // Id of the composite from which data is to be extracted.
+ uint32 composite_id = 3;
+
+ // Indices that indicate which part of the composite should be extracted.
+ repeated uint32 index = 4;
+
+}
+
message TransformationCopyObject {
// A transformation that introduces an OpCopyObject instruction to make a
@@ -305,15 +370,12 @@ message TransformationCopyObject {
// Id of the object to be copied
uint32 object = 1;
- // The id of an instruction in a block
- uint32 base_instruction_id = 2;
-
- // An offset, such that OpCopyObject instruction should be inserted right
- // before the instruction |offset| instructions after |base_instruction_id|
- uint32 offset = 3;
+ // A descriptor for an instruction in a block before which the new
+ // OpCopyObject instruction should be inserted
+ InstructionDescriptor instruction_to_insert_before = 2;
// A fresh id for the copied object
- uint32 fresh_id = 4;
+ uint32 fresh_id = 3;
}
@@ -384,17 +446,85 @@ message TransformationReplaceIdWithSynonym {
uint32 fresh_id_for_temporary = 3;
}
+message TransformationSetFunctionControl {
+
+ // A transformation that sets the function control operand of an OpFunction
+ // instruction.
+
+ // The result id of an OpFunction instruction
+ uint32 function_id = 1;
+
+ // The value to which the 'function control' operand should be set.
+ uint32 function_control = 2;
+
+}
+
+message TransformationSetLoopControl {
+
+ // A transformation that sets the loop control operand of an OpLoopMerge
+ // instruction.
+
+ // The id of a basic block that should contain OpLoopMerge
+ uint32 block_id = 1;
+
+ // The value to which the 'loop control' operand should be set.
+ // This must be a legal loop control mask.
+ uint32 loop_control = 2;
+
+ // Provides a peel count value for the loop. Used if and only if the
+ // PeelCount bit is set. Must be zero if the PeelCount bit is not set (can
+ // still be zero if this bit is set).
+ uint32 peel_count = 3;
+
+ // Provides a partial count value for the loop. Used if and only if the
+ // PartialCount bit is set. Must be zero if the PartialCount bit is not set
+ // (can still be zero if this bit is set).
+ uint32 partial_count = 4;
+
+}
+
+message TransformationSetMemoryOperandsMask {
+
+ // A transformation that sets the memory operands mask of a memory access
+ // instruction.
+
+ // A descriptor for a memory access instruction, e.g. an OpLoad
+ InstructionDescriptor memory_access_instruction = 1;
+
+ // A mask of memory operands to be applied to the instruction. It must be the
+ // same as the original mask, except that Volatile can be added, and
+ // Nontemporal can be added or removed.
+ uint32 memory_operands_mask = 2;
+
+ // Some memory access instructions allow more than one mask to be specified;
+ // this field indicates which mask should be set
+ uint32 memory_operands_mask_index = 3;
+
+}
+
+message TransformationSetSelectionControl {
+
+ // A transformation that sets the selection control operand of an
+ // OpSelectionMerge instruction.
+
+ // The id of a basic block that should contain OpSelectionMerge
+ uint32 block_id = 1;
+
+ // The value to which the 'selection control' operand should be set.
+ // Although technically 'selection control' is a literal mask that can be
+ // some combination of 'None', 'Flatten' and 'DontFlatten', the combination
+ // 'Flatten | DontFlatten' does not make sense and is not allowed here.
+ uint32 selection_control = 2;
+
+}
+
message TransformationSplitBlock {
// A transformation that splits a basic block into two basic blocks
- // The result id of an instruction
- uint32 base_instruction_id = 1;
-
- // An offset, such that the block containing |base_instruction_id| should be
- // split right before the instruction |offset| instructions after
- // |base_instruction_id|
- uint32 offset = 2;
+ // A descriptor for an instruction such that the block containing the
+ // described instruction should be split right before the instruction.
+ InstructionDescriptor instruction_to_split_before = 1;
// An id that must not yet be used by the module to which this transformation
// is applied. Rather than having the transformation choose a suitable id on
@@ -404,6 +534,6 @@ message TransformationSplitBlock {
// transformation, and if we end up changing what that id is, due to removing
// earlier transformations, it may inhibit later transformations from
// applying.
- uint32 fresh_id = 3;
+ uint32 fresh_id = 2;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation.cpp
index 65966f35014..ddfb2a88e97 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation.cpp
@@ -16,21 +16,28 @@
#include <cassert>
+#include "source/fuzz/transformation_add_constant_boolean.h"
+#include "source/fuzz/transformation_add_constant_scalar.h"
+#include "source/fuzz/transformation_add_dead_break.h"
+#include "source/fuzz/transformation_add_dead_continue.h"
+#include "source/fuzz/transformation_add_no_contraction_decoration.h"
+#include "source/fuzz/transformation_add_type_boolean.h"
+#include "source/fuzz/transformation_add_type_float.h"
+#include "source/fuzz/transformation_add_type_int.h"
+#include "source/fuzz/transformation_add_type_pointer.h"
+#include "source/fuzz/transformation_composite_construct.h"
+#include "source/fuzz/transformation_composite_extract.h"
+#include "source/fuzz/transformation_copy_object.h"
+#include "source/fuzz/transformation_move_block_down.h"
+#include "source/fuzz/transformation_replace_boolean_constant_with_constant_binary.h"
+#include "source/fuzz/transformation_replace_constant_with_uniform.h"
+#include "source/fuzz/transformation_replace_id_with_synonym.h"
+#include "source/fuzz/transformation_set_function_control.h"
+#include "source/fuzz/transformation_set_loop_control.h"
+#include "source/fuzz/transformation_set_memory_operands_mask.h"
+#include "source/fuzz/transformation_set_selection_control.h"
+#include "source/fuzz/transformation_split_block.h"
#include "source/util/make_unique.h"
-#include "transformation_add_constant_boolean.h"
-#include "transformation_add_constant_scalar.h"
-#include "transformation_add_dead_break.h"
-#include "transformation_add_dead_continue.h"
-#include "transformation_add_type_boolean.h"
-#include "transformation_add_type_float.h"
-#include "transformation_add_type_int.h"
-#include "transformation_add_type_pointer.h"
-#include "transformation_copy_object.h"
-#include "transformation_move_block_down.h"
-#include "transformation_replace_boolean_constant_with_constant_binary.h"
-#include "transformation_replace_constant_with_uniform.h"
-#include "transformation_replace_id_with_synonym.h"
-#include "transformation_split_block.h"
namespace spvtools {
namespace fuzz {
@@ -51,6 +58,10 @@ std::unique_ptr<Transformation> Transformation::FromMessage(
case protobufs::Transformation::TransformationCase::kAddDeadContinue:
return MakeUnique<TransformationAddDeadContinue>(
message.add_dead_continue());
+ case protobufs::Transformation::TransformationCase::
+ kAddNoContractionDecoration:
+ return MakeUnique<TransformationAddNoContractionDecoration>(
+ message.add_no_contraction_decoration());
case protobufs::Transformation::TransformationCase::kAddTypeBoolean:
return MakeUnique<TransformationAddTypeBoolean>(
message.add_type_boolean());
@@ -61,6 +72,12 @@ std::unique_ptr<Transformation> Transformation::FromMessage(
case protobufs::Transformation::TransformationCase::kAddTypePointer:
return MakeUnique<TransformationAddTypePointer>(
message.add_type_pointer());
+ case protobufs::Transformation::TransformationCase::kCompositeConstruct:
+ return MakeUnique<TransformationCompositeConstruct>(
+ message.composite_construct());
+ case protobufs::Transformation::TransformationCase::kCompositeExtract:
+ return MakeUnique<TransformationCompositeExtract>(
+ message.composite_extract());
case protobufs::Transformation::TransformationCase::kCopyObject:
return MakeUnique<TransformationCopyObject>(message.copy_object());
case protobufs::Transformation::TransformationCase::kMoveBlockDown:
@@ -76,6 +93,18 @@ std::unique_ptr<Transformation> Transformation::FromMessage(
case protobufs::Transformation::TransformationCase::kReplaceIdWithSynonym:
return MakeUnique<TransformationReplaceIdWithSynonym>(
message.replace_id_with_synonym());
+ case protobufs::Transformation::TransformationCase::kSetFunctionControl:
+ return MakeUnique<TransformationSetFunctionControl>(
+ message.set_function_control());
+ case protobufs::Transformation::TransformationCase::kSetLoopControl:
+ return MakeUnique<TransformationSetLoopControl>(
+ message.set_loop_control());
+ case protobufs::Transformation::TransformationCase::kSetMemoryOperandsMask:
+ return MakeUnique<TransformationSetMemoryOperandsMask>(
+ message.set_memory_operands_mask());
+ case protobufs::Transformation::TransformationCase::kSetSelectionControl:
+ return MakeUnique<TransformationSetSelectionControl>(
+ message.set_selection_control());
case protobufs::Transformation::TransformationCase::kSplitBlock:
return MakeUnique<TransformationSplitBlock>(message.split_block());
case protobufs::Transformation::TRANSFORMATION_NOT_SET:
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_add_no_contraction_decoration.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_add_no_contraction_decoration.cpp
new file mode 100644
index 00000000000..7f22cc22c76
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_add_no_contraction_decoration.cpp
@@ -0,0 +1,110 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/transformation_add_no_contraction_decoration.h"
+
+#include "source/fuzz/fuzzer_util.h"
+
+namespace spvtools {
+namespace fuzz {
+
+TransformationAddNoContractionDecoration::
+ TransformationAddNoContractionDecoration(
+ const spvtools::fuzz::protobufs::
+ TransformationAddNoContractionDecoration& message)
+ : message_(message) {}
+
+TransformationAddNoContractionDecoration::
+ TransformationAddNoContractionDecoration(uint32_t result_id) {
+ message_.set_result_id(result_id);
+}
+
+bool TransformationAddNoContractionDecoration::IsApplicable(
+ opt::IRContext* context,
+ const spvtools::fuzz::FactManager& /*unused*/) const {
+ // |message_.result_id| must be the id of an instruction.
+ auto instr = context->get_def_use_mgr()->GetDef(message_.result_id());
+ if (!instr) {
+ return false;
+ }
+ // The instruction must be arithmetic.
+ return IsArithmetic(instr->opcode());
+}
+
+void TransformationAddNoContractionDecoration::Apply(
+ opt::IRContext* context, spvtools::fuzz::FactManager* /*unused*/) const {
+ // Add a NoContraction decoration targeting |message_.result_id|.
+ context->get_decoration_mgr()->AddDecoration(message_.result_id(),
+ SpvDecorationNoContraction);
+}
+
+protobufs::Transformation TransformationAddNoContractionDecoration::ToMessage()
+ const {
+ protobufs::Transformation result;
+ *result.mutable_add_no_contraction_decoration() = message_;
+ return result;
+}
+
+bool TransformationAddNoContractionDecoration::IsArithmetic(uint32_t opcode) {
+ switch (opcode) {
+ case SpvOpSNegate:
+ case SpvOpFNegate:
+ case SpvOpIAdd:
+ case SpvOpFAdd:
+ case SpvOpISub:
+ case SpvOpFSub:
+ case SpvOpIMul:
+ case SpvOpFMul:
+ case SpvOpUDiv:
+ case SpvOpSDiv:
+ case SpvOpFDiv:
+ case SpvOpUMod:
+ case SpvOpSRem:
+ case SpvOpSMod:
+ case SpvOpFRem:
+ case SpvOpFMod:
+ case SpvOpVectorTimesScalar:
+ case SpvOpMatrixTimesScalar:
+ case SpvOpVectorTimesMatrix:
+ case SpvOpMatrixTimesVector:
+ case SpvOpMatrixTimesMatrix:
+ case SpvOpOuterProduct:
+ case SpvOpDot:
+ case SpvOpIAddCarry:
+ case SpvOpISubBorrow:
+ case SpvOpUMulExtended:
+ case SpvOpSMulExtended:
+ case SpvOpAny:
+ case SpvOpAll:
+ case SpvOpIsNan:
+ case SpvOpIsInf:
+ case SpvOpIsFinite:
+ case SpvOpIsNormal:
+ case SpvOpSignBitSet:
+ case SpvOpLessOrGreater:
+ case SpvOpOrdered:
+ case SpvOpUnordered:
+ case SpvOpLogicalEqual:
+ case SpvOpLogicalNotEqual:
+ case SpvOpLogicalOr:
+ case SpvOpLogicalAnd:
+ case SpvOpLogicalNot:
+ return true;
+ default:
+ return false;
+ }
+}
+
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_add_no_contraction_decoration.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_add_no_contraction_decoration.h
new file mode 100644
index 00000000000..cec1b2cded2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_add_no_contraction_decoration.h
@@ -0,0 +1,58 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_FUZZ_TRANSFORMATION_ADD_NO_CONTRACTION_DECORATION_H_
+#define SOURCE_FUZZ_TRANSFORMATION_ADD_NO_CONTRACTION_DECORATION_H_
+
+#include "source/fuzz/fact_manager.h"
+#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
+#include "source/fuzz/transformation.h"
+#include "source/opt/ir_context.h"
+
+namespace spvtools {
+namespace fuzz {
+
+class TransformationAddNoContractionDecoration : public Transformation {
+ public:
+ explicit TransformationAddNoContractionDecoration(
+ const protobufs::TransformationAddNoContractionDecoration& message);
+
+ explicit TransformationAddNoContractionDecoration(uint32_t fresh_id);
+
+ // - |message_.result_id| must be the result id of an arithmetic instruction,
+ // as defined by the SPIR-V specification.
+ // - It does not matter whether this instruction is already annotated with the
+ // NoContraction decoration.
+ bool IsApplicable(opt::IRContext* context,
+ const FactManager& fact_manager) const override;
+
+ // Adds a decoration of the form:
+ // 'OpDecoration |message_.result_id| NoContraction'
+ // to the module.
+ void Apply(opt::IRContext* context, FactManager* fact_manager) const override;
+
+ protobufs::Transformation ToMessage() const override;
+
+ // Returns true if and only if |opcode| is the opcode of an arithmetic
+ // instruction, as defined by the SPIR-V specification.
+ static bool IsArithmetic(uint32_t opcode);
+
+ private:
+ protobufs::TransformationAddNoContractionDecoration message_;
+};
+
+} // namespace fuzz
+} // namespace spvtools
+
+#endif // SOURCE_FUZZ_TRANSFORMATION_ADD_NO_CONTRACTION_DECORATION_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_construct.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_construct.cpp
new file mode 100644
index 00000000000..7a3aff14585
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_construct.cpp
@@ -0,0 +1,305 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/transformation_composite_construct.h"
+
+#include "source/fuzz/data_descriptor.h"
+#include "source/fuzz/fuzzer_util.h"
+#include "source/fuzz/instruction_descriptor.h"
+#include "source/opt/instruction.h"
+
+namespace spvtools {
+namespace fuzz {
+
+TransformationCompositeConstruct::TransformationCompositeConstruct(
+ const protobufs::TransformationCompositeConstruct& message)
+ : message_(message) {}
+
+TransformationCompositeConstruct::TransformationCompositeConstruct(
+ uint32_t composite_type_id, std::vector<uint32_t> component,
+ const protobufs::InstructionDescriptor& instruction_to_insert_before,
+ uint32_t fresh_id) {
+ message_.set_composite_type_id(composite_type_id);
+ for (auto a_component : component) {
+ message_.add_component(a_component);
+ }
+ *message_.mutable_instruction_to_insert_before() =
+ instruction_to_insert_before;
+ message_.set_fresh_id(fresh_id);
+}
+
+bool TransformationCompositeConstruct::IsApplicable(
+ opt::IRContext* context, const FactManager& /*fact_manager*/) const {
+ if (!fuzzerutil::IsFreshId(context, message_.fresh_id())) {
+ // We require the id for the composite constructor to be unused.
+ return false;
+ }
+
+ auto insert_before =
+ FindInstruction(message_.instruction_to_insert_before(), context);
+ if (!insert_before) {
+ // The instruction before which the composite should be inserted was not
+ // found.
+ return false;
+ }
+
+ auto composite_type =
+ context->get_type_mgr()->GetType(message_.composite_type_id());
+
+ if (!fuzzerutil::IsCompositeType(composite_type)) {
+ // The type must actually be a composite.
+ return false;
+ }
+
+ // If the type is an array, matrix, struct or vector, the components need to
+ // be suitable for constructing something of that type.
+ if (composite_type->AsArray() && !ComponentsForArrayConstructionAreOK(
+ context, *composite_type->AsArray())) {
+ return false;
+ }
+ if (composite_type->AsMatrix() && !ComponentsForMatrixConstructionAreOK(
+ context, *composite_type->AsMatrix())) {
+ return false;
+ }
+ if (composite_type->AsStruct() && !ComponentsForStructConstructionAreOK(
+ context, *composite_type->AsStruct())) {
+ return false;
+ }
+ if (composite_type->AsVector() && !ComponentsForVectorConstructionAreOK(
+ context, *composite_type->AsVector())) {
+ return false;
+ }
+
+ // Now check whether every component being used to initialize the composite is
+ // available at the desired program point.
+ for (auto& component : message_.component()) {
+ auto component_inst = context->get_def_use_mgr()->GetDef(component);
+ if (!context->get_instr_block(component)) {
+ // The component does not have a block; that means it is in global scope,
+ // which is OK. (Whether the component actually corresponds to an
+ // instruction is checked above when determining whether types are
+ // suitable.)
+ continue;
+ }
+ // Check whether the component is available.
+ if (insert_before->HasResultId() &&
+ insert_before->result_id() == component) {
+ // This constitutes trying to use an id right before it is defined. The
+ // special case is needed due to an instruction always dominating itself.
+ return false;
+ }
+ if (!context
+ ->GetDominatorAnalysis(
+ context->get_instr_block(&*insert_before)->GetParent())
+ ->Dominates(component_inst, &*insert_before)) {
+ // The instruction defining the component must dominate the instruction we
+ // wish to insert the composite before.
+ return false;
+ }
+ }
+
+ return true;
+}
+
+void TransformationCompositeConstruct::Apply(opt::IRContext* context,
+ FactManager* fact_manager) const {
+ // Use the base and offset information from the transformation to determine
+ // where in the module a new instruction should be inserted.
+ auto insert_before_inst =
+ FindInstruction(message_.instruction_to_insert_before(), context);
+ auto destination_block = context->get_instr_block(insert_before_inst);
+ auto insert_before = fuzzerutil::GetIteratorForInstruction(
+ destination_block, insert_before_inst);
+
+ // Prepare the input operands for an OpCompositeConstruct instruction.
+ opt::Instruction::OperandList in_operands;
+ for (auto& component_id : message_.component()) {
+ in_operands.push_back({SPV_OPERAND_TYPE_ID, {component_id}});
+ }
+
+ // Insert an OpCompositeConstruct instruction.
+ insert_before.InsertBefore(MakeUnique<opt::Instruction>(
+ context, SpvOpCompositeConstruct, message_.composite_type_id(),
+ message_.fresh_id(), in_operands));
+
+ fuzzerutil::UpdateModuleIdBound(context, message_.fresh_id());
+ context->InvalidateAnalysesExceptFor(opt::IRContext::kAnalysisNone);
+
+ // Inform the fact manager that we now have new synonyms: every component of
+ // the composite is synonymous with the id used to construct that component,
+ // except in the case of a vector where a single vector id can span multiple
+ // components.
+ auto composite_type =
+ context->get_type_mgr()->GetType(message_.composite_type_id());
+ uint32_t index = 0;
+ for (auto component : message_.component()) {
+ auto component_type = context->get_type_mgr()->GetType(
+ context->get_def_use_mgr()->GetDef(component)->type_id());
+ if (composite_type->AsVector() && component_type->AsVector()) {
+ // The case where the composite being constructed is a vector and the
+ // component provided for construction is also a vector is special. It
+ // requires adding a synonym fact relating each element of the sub-vector
+ // to the corresponding element of the composite being constructed.
+ assert(component_type->AsVector()->element_type() ==
+ composite_type->AsVector()->element_type());
+ assert(component_type->AsVector()->element_count() <
+ composite_type->AsVector()->element_count());
+ for (uint32_t subvector_index = 0;
+ subvector_index < component_type->AsVector()->element_count();
+ subvector_index++) {
+ fact_manager->AddFactDataSynonym(
+ MakeDataDescriptor(component, {subvector_index}),
+ MakeDataDescriptor(message_.fresh_id(), {index}), context);
+ index++;
+ }
+ } else {
+ // The other cases are simple: the component is made directly synonymous
+ // with the element of the composite being constructed.
+ fact_manager->AddFactDataSynonym(
+ MakeDataDescriptor(component, {}),
+ MakeDataDescriptor(message_.fresh_id(), {index}), context);
+ index++;
+ }
+ }
+}
+
+bool TransformationCompositeConstruct::ComponentsForArrayConstructionAreOK(
+ opt::IRContext* context, const opt::analysis::Array& array_type) const {
+ if (array_type.length_info().words[0] !=
+ opt::analysis::Array::LengthInfo::kConstant) {
+ // We only handle constant-sized arrays.
+ return false;
+ }
+ if (array_type.length_info().words.size() != 2) {
+ // We only handle the case where the array size can be captured in a single
+ // word.
+ return false;
+ }
+ // Get the array size.
+ auto array_size = array_type.length_info().words[1];
+ if (static_cast<uint32_t>(message_.component().size()) != array_size) {
+ // The number of components must match the array size.
+ return false;
+ }
+ // Check that each component is the result id of an instruction whose type is
+ // the array's element type.
+ for (auto component_id : message_.component()) {
+ auto inst = context->get_def_use_mgr()->GetDef(component_id);
+ if (inst == nullptr || !inst->type_id()) {
+ // The component does not correspond to an instruction with a result
+ // type.
+ return false;
+ }
+ auto component_type = context->get_type_mgr()->GetType(inst->type_id());
+ assert(component_type);
+ if (component_type != array_type.element_type()) {
+ // The component's type does not match the array's element type.
+ return false;
+ }
+ }
+ return true;
+}
+
+bool TransformationCompositeConstruct::ComponentsForMatrixConstructionAreOK(
+ opt::IRContext* context, const opt::analysis::Matrix& matrix_type) const {
+ if (static_cast<uint32_t>(message_.component().size()) !=
+ matrix_type.element_count()) {
+ // The number of components must match the number of columns of the matrix.
+ return false;
+ }
+ // Check that each component is the result id of an instruction whose type is
+ // the matrix's column type.
+ for (auto component_id : message_.component()) {
+ auto inst = context->get_def_use_mgr()->GetDef(component_id);
+ if (inst == nullptr || !inst->type_id()) {
+ // The component does not correspond to an instruction with a result
+ // type.
+ return false;
+ }
+ auto component_type = context->get_type_mgr()->GetType(inst->type_id());
+ assert(component_type);
+ if (component_type != matrix_type.element_type()) {
+ // The component's type does not match the matrix's column type.
+ return false;
+ }
+ }
+ return true;
+}
+
+bool TransformationCompositeConstruct::ComponentsForStructConstructionAreOK(
+ opt::IRContext* context, const opt::analysis::Struct& struct_type) const {
+ if (static_cast<uint32_t>(message_.component().size()) !=
+ struct_type.element_types().size()) {
+ // The number of components must match the number of fields of the struct.
+ return false;
+ }
+ // Check that each component is the result id of an instruction those type
+ // matches the associated field type.
+ for (uint32_t field_index = 0;
+ field_index < struct_type.element_types().size(); field_index++) {
+ auto inst =
+ context->get_def_use_mgr()->GetDef(message_.component()[field_index]);
+ if (inst == nullptr || !inst->type_id()) {
+ // The component does not correspond to an instruction with a result
+ // type.
+ return false;
+ }
+ auto component_type = context->get_type_mgr()->GetType(inst->type_id());
+ assert(component_type);
+ if (component_type != struct_type.element_types()[field_index]) {
+ // The component's type does not match the corresponding field type.
+ return false;
+ }
+ }
+ return true;
+}
+
+bool TransformationCompositeConstruct::ComponentsForVectorConstructionAreOK(
+ opt::IRContext* context, const opt::analysis::Vector& vector_type) const {
+ uint32_t base_element_count = 0;
+ auto element_type = vector_type.element_type();
+ for (auto& component_id : message_.component()) {
+ auto inst = context->get_def_use_mgr()->GetDef(component_id);
+ if (inst == nullptr || !inst->type_id()) {
+ // The component does not correspond to an instruction with a result
+ // type.
+ return false;
+ }
+ auto component_type = context->get_type_mgr()->GetType(inst->type_id());
+ assert(component_type);
+ if (component_type == element_type) {
+ base_element_count++;
+ } else if (component_type->AsVector() &&
+ component_type->AsVector()->element_type() == element_type) {
+ base_element_count += component_type->AsVector()->element_count();
+ } else {
+ // The component was not appropriate; e.g. no type corresponding to the
+ // given id was found, or the type that was found was not compatible
+ // with the vector being constructed.
+ return false;
+ }
+ }
+ // The number of components provided (when vector components are flattened
+ // out) needs to match the length of the vector being constructed.
+ return base_element_count == vector_type.element_count();
+}
+
+protobufs::Transformation TransformationCompositeConstruct::ToMessage() const {
+ protobufs::Transformation result;
+ *result.mutable_composite_construct() = message_;
+ return result;
+}
+
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_construct.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_construct.h
new file mode 100644
index 00000000000..5369c4c8993
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_construct.h
@@ -0,0 +1,88 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_FUZZ_TRANSFORMATION_COMPOSITE_CONSTRUCT_H_
+#define SOURCE_FUZZ_TRANSFORMATION_COMPOSITE_CONSTRUCT_H_
+
+#include "source/fuzz/fact_manager.h"
+#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
+#include "source/fuzz/transformation.h"
+#include "source/opt/ir_context.h"
+
+namespace spvtools {
+namespace fuzz {
+
+class TransformationCompositeConstruct : public Transformation {
+ public:
+ explicit TransformationCompositeConstruct(
+ const protobufs::TransformationCompositeConstruct& message);
+
+ TransformationCompositeConstruct(
+ uint32_t composite_type_id, std::vector<uint32_t> component,
+ const protobufs::InstructionDescriptor& instruction_to_insert_before,
+ uint32_t fresh_id);
+
+ // - |message_.fresh_id| must not be used by the module.
+ // - |message_.composite_type_id| must be the id of a composite type
+ // - The elements of |message_.component| must be result ids that are
+ // suitable for constructing an element of the given composite type, in
+ // order
+ // - The elements of |message_.component| must not be the target of any
+ // decorations.
+ // - |message_.base_instruction_id| must be the result id of an instruction
+ // 'base' in some block 'blk'.
+ // - 'blk' must contain an instruction 'inst' located |message_.offset|
+ // instructions after 'base' (if |message_.offset| = 0 then 'inst' =
+ // 'base').
+ // - It must be legal to insert an OpCompositeConstruct instruction directly
+ // before 'inst'.
+ // - Each element of |message_.component| must be available directly before
+ // 'inst'.
+ bool IsApplicable(opt::IRContext* context,
+ const FactManager& fact_manager) const override;
+
+ // Inserts a new OpCompositeConstruct instruction, with id
+ // |message_.fresh_id|, directly before the instruction identified by
+ // |message_.base_instruction_id| and |message_.offset|. The instruction
+ // creates a composite of type |message_.composite_type_id| using the ids of
+ // |message_.component|.
+ void Apply(opt::IRContext* context, FactManager* fact_manager) const override;
+
+ protobufs::Transformation ToMessage() const override;
+
+ private:
+ // Helper to decide whether the components of the transformation are suitable
+ // for constructing an array of the given type.
+ bool ComponentsForArrayConstructionAreOK(
+ opt::IRContext* context, const opt::analysis::Array& array_type) const;
+
+ // Similar, but for matrices.
+ bool ComponentsForMatrixConstructionAreOK(
+ opt::IRContext* context, const opt::analysis::Matrix& matrix_type) const;
+
+ // Similar, but for structs.
+ bool ComponentsForStructConstructionAreOK(
+ opt::IRContext* context, const opt::analysis::Struct& struct_type) const;
+
+ // Similar, but for vectors.
+ bool ComponentsForVectorConstructionAreOK(
+ opt::IRContext* context, const opt::analysis::Vector& vector_type) const;
+
+ protobufs::TransformationCompositeConstruct message_;
+};
+
+} // namespace fuzz
+} // namespace spvtools
+
+#endif // SOURCE_FUZZ_TRANSFORMATION_COMPOSITE_CONSTRUCT_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_extract.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_extract.cpp
new file mode 100644
index 00000000000..8c706bb2290
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_extract.cpp
@@ -0,0 +1,123 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/transformation_composite_extract.h"
+
+#include <vector>
+
+#include "source/fuzz/data_descriptor.h"
+#include "source/fuzz/fuzzer_util.h"
+#include "source/fuzz/instruction_descriptor.h"
+
+namespace spvtools {
+namespace fuzz {
+
+TransformationCompositeExtract::TransformationCompositeExtract(
+ const spvtools::fuzz::protobufs::TransformationCompositeExtract& message)
+ : message_(message) {}
+
+TransformationCompositeExtract::TransformationCompositeExtract(
+ const protobufs::InstructionDescriptor& instruction_to_insert_before,
+ uint32_t fresh_id, uint32_t composite_id, std::vector<uint32_t>&& index) {
+ *message_.mutable_instruction_to_insert_before() =
+ instruction_to_insert_before;
+ message_.set_fresh_id(fresh_id);
+ message_.set_composite_id(composite_id);
+ for (auto an_index : index) {
+ message_.add_index(an_index);
+ }
+}
+
+bool TransformationCompositeExtract::IsApplicable(
+ opt::IRContext* context,
+ const spvtools::fuzz::FactManager& /*unused*/) const {
+ if (!fuzzerutil::IsFreshId(context, message_.fresh_id())) {
+ return false;
+ }
+ auto instruction_to_insert_before =
+ FindInstruction(message_.instruction_to_insert_before(), context);
+ if (!instruction_to_insert_before) {
+ return false;
+ }
+ auto composite_instruction =
+ context->get_def_use_mgr()->GetDef(message_.composite_id());
+ if (!composite_instruction) {
+ return false;
+ }
+ if (auto block = context->get_instr_block(composite_instruction)) {
+ if (composite_instruction == instruction_to_insert_before ||
+ !context->GetDominatorAnalysis(block->GetParent())
+ ->Dominates(composite_instruction, instruction_to_insert_before)) {
+ return false;
+ }
+ }
+ assert(composite_instruction->type_id() &&
+ "An instruction in a block cannot have a result id but no type id.");
+
+ auto composite_type =
+ context->get_type_mgr()->GetType(composite_instruction->type_id());
+ if (!composite_type) {
+ return false;
+ }
+
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(
+ SpvOpCompositeExtract, instruction_to_insert_before)) {
+ return false;
+ }
+
+ return fuzzerutil::WalkCompositeTypeIndices(
+ context, composite_instruction->type_id(), message_.index()) != 0;
+}
+
+void TransformationCompositeExtract::Apply(
+ opt::IRContext* context, spvtools::fuzz::FactManager* fact_manager) const {
+ opt::Instruction::OperandList extract_operands;
+ extract_operands.push_back({SPV_OPERAND_TYPE_ID, {message_.composite_id()}});
+ for (auto an_index : message_.index()) {
+ extract_operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, {an_index}});
+ }
+ auto composite_instruction =
+ context->get_def_use_mgr()->GetDef(message_.composite_id());
+ auto extracted_type = fuzzerutil::WalkCompositeTypeIndices(
+ context, composite_instruction->type_id(), message_.index());
+
+ FindInstruction(message_.instruction_to_insert_before(), context)
+ ->InsertBefore(MakeUnique<opt::Instruction>(
+ context, SpvOpCompositeExtract, extracted_type, message_.fresh_id(),
+ extract_operands));
+
+ fuzzerutil::UpdateModuleIdBound(context, message_.fresh_id());
+
+ // Add the fact that the id storing the extracted element is synonymous with
+ // the index into the structure.
+ std::vector<uint32_t> indices;
+ for (auto an_index : message_.index()) {
+ indices.push_back(an_index);
+ }
+ protobufs::DataDescriptor data_descriptor_for_extracted_element =
+ MakeDataDescriptor(message_.composite_id(), std::move(indices));
+ protobufs::DataDescriptor data_descriptor_for_result_id =
+ MakeDataDescriptor(message_.fresh_id(), {});
+ fact_manager->AddFactDataSynonym(data_descriptor_for_extracted_element,
+ data_descriptor_for_result_id, context);
+}
+
+protobufs::Transformation TransformationCompositeExtract::ToMessage() const {
+ protobufs::Transformation result;
+ *result.mutable_composite_extract() = message_;
+ return result;
+}
+
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_extract.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_extract.h
new file mode 100644
index 00000000000..c4c9278ccd4
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_composite_extract.h
@@ -0,0 +1,63 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_FUZZ_TRANSFORMATION_COMPOSITE_EXTRACT_H_
+#define SOURCE_FUZZ_TRANSFORMATION_COMPOSITE_EXTRACT_H_
+
+#include "source/fuzz/fact_manager.h"
+#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
+#include "source/fuzz/transformation.h"
+#include "source/opt/ir_context.h"
+
+namespace spvtools {
+namespace fuzz {
+
+class TransformationCompositeExtract : public Transformation {
+ public:
+ explicit TransformationCompositeExtract(
+ const protobufs::TransformationCompositeExtract& message);
+
+ TransformationCompositeExtract(
+ const protobufs::InstructionDescriptor& instruction_to_insert_before,
+ uint32_t fresh_id, uint32_t composite_id, std::vector<uint32_t>&& index);
+
+ // - |message_.fresh_id| must be available
+ // - |message_.instruction_to_insert_before| must identify an instruction
+ // before which it is valid to place an OpCompositeExtract
+ // - |message_.composite_id| must be the id of an instruction that defines
+ // a composite object, and this id must be available at the instruction
+ // identified by |message_.instruction_to_insert_before|
+ // - |message_.index| must be a suitable set of indices for
+ // |message_.composite_id|, i.e. it must be possible to follow this chain
+ // of indices to reach a sub-object of |message_.composite_id|
+ bool IsApplicable(opt::IRContext* context,
+ const FactManager& fact_manager) const override;
+
+ // Adds an OpCompositeConstruct instruction before the instruction identified
+ // by |message_.instruction_to_insert_before|, that extracts from
+ // |message_.composite_id| via indices |message_.index| into
+ // |message_.fresh_id|. Generates a data synonym fact relating
+ // |message_.fresh_id| to the extracted element.
+ void Apply(opt::IRContext* context, FactManager* fact_manager) const override;
+
+ protobufs::Transformation ToMessage() const override;
+
+ private:
+ protobufs::TransformationCompositeExtract message_;
+};
+
+} // namespace fuzz
+} // namespace spvtools
+
+#endif // SOURCE_FUZZ_TRANSFORMATION_COMPOSITE_EXTRACT_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_copy_object.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_copy_object.cpp
index cfd97aeb812..af1e81c37e9 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_copy_object.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_copy_object.cpp
@@ -14,7 +14,9 @@
#include "source/fuzz/transformation_copy_object.h"
+#include "source/fuzz/data_descriptor.h"
#include "source/fuzz/fuzzer_util.h"
+#include "source/fuzz/instruction_descriptor.h"
#include "source/opt/instruction.h"
#include "source/util/make_unique.h"
@@ -25,13 +27,13 @@ TransformationCopyObject::TransformationCopyObject(
const protobufs::TransformationCopyObject& message)
: message_(message) {}
-TransformationCopyObject::TransformationCopyObject(uint32_t object,
- uint32_t base_instruction_id,
- uint32_t offset,
- uint32_t fresh_id) {
+TransformationCopyObject::TransformationCopyObject(
+ uint32_t object,
+ const protobufs::InstructionDescriptor& instruction_to_insert_before,
+ uint32_t fresh_id) {
message_.set_object(object);
- message_.set_base_instruction_id(base_instruction_id);
- message_.set_offset(offset);
+ *message_.mutable_instruction_to_insert_before() =
+ instruction_to_insert_before;
message_.set_fresh_id(fresh_id);
}
@@ -46,32 +48,19 @@ bool TransformationCopyObject::IsApplicable(
if (!object_inst) {
return false;
}
- if (!IsCopyable(context, object_inst)) {
- return false;
- }
-
- auto base_instruction =
- context->get_def_use_mgr()->GetDef(message_.base_instruction_id());
- if (!base_instruction) {
- // The given id to insert after is not defined.
+ if (!fuzzerutil::CanMakeSynonymOf(context, object_inst)) {
return false;
}
- auto destination_block = context->get_instr_block(base_instruction);
- if (!destination_block) {
- // The given id to insert after is not in a block.
+ auto insert_before =
+ FindInstruction(message_.instruction_to_insert_before(), context);
+ if (!insert_before) {
+ // The instruction before which the copy should be inserted was not found.
return false;
}
- auto insert_before = fuzzerutil::GetIteratorForBaseInstructionAndOffset(
- destination_block, base_instruction, message_.offset());
-
- if (insert_before == destination_block->end()) {
- // The offset was inappropriate.
- return false;
- }
-
- if (!CanInsertCopyBefore(insert_before)) {
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpCopyObject,
+ insert_before)) {
return false;
}
@@ -85,28 +74,22 @@ bool TransformationCopyObject::IsApplicable(
// insert it before the object's defining instruction.
return !context->get_instr_block(object_inst) ||
(object_inst != &*insert_before &&
- context->GetDominatorAnalysis(destination_block->GetParent())
+ context
+ ->GetDominatorAnalysis(
+ context->get_instr_block(insert_before)->GetParent())
->Dominates(object_inst, &*insert_before));
}
void TransformationCopyObject::Apply(opt::IRContext* context,
FactManager* fact_manager) const {
- // - A new instruction,
- // %|message_.fresh_id| = OpCopyObject %ty %|message_.object|
- // is added directly before the instruction at |message_.insert_after_id| +
- // |message_|.offset, where %ty is the type of |message_.object|.
- // - The fact that |message_.fresh_id| and |message_.object| are synonyms
- // is added to the fact manager.
- // The id of the object to be copied must exist
auto object_inst = context->get_def_use_mgr()->GetDef(message_.object());
assert(object_inst && "The object to be copied must exist.");
- auto base_instruction =
- context->get_def_use_mgr()->GetDef(message_.base_instruction_id());
- assert(base_instruction && "The base instruction must exist.");
- auto destination_block = context->get_instr_block(base_instruction);
+ auto insert_before_inst =
+ FindInstruction(message_.instruction_to_insert_before(), context);
+ auto destination_block = context->get_instr_block(insert_before_inst);
assert(destination_block && "The base instruction must be in a block.");
- auto insert_before = fuzzerutil::GetIteratorForBaseInstructionAndOffset(
- destination_block, base_instruction, message_.offset());
+ auto insert_before = fuzzerutil::GetIteratorForInstruction(
+ destination_block, insert_before_inst);
assert(insert_before != destination_block->end() &&
"There must be an instruction before which the copy can be inserted.");
@@ -119,11 +102,9 @@ void TransformationCopyObject::Apply(opt::IRContext* context,
fuzzerutil::UpdateModuleIdBound(context, message_.fresh_id());
context->InvalidateAnalysesExceptFor(opt::IRContext::Analysis::kAnalysisNone);
- protobufs::Fact fact;
- fact.mutable_id_synonym_fact()->set_id(message_.object());
- fact.mutable_id_synonym_fact()->mutable_data_descriptor()->set_object(
- message_.fresh_id());
- fact_manager->AddFact(fact, context);
+ fact_manager->AddFactDataSynonym(MakeDataDescriptor(message_.object(), {}),
+ MakeDataDescriptor(message_.fresh_id(), {}),
+ context);
}
protobufs::Transformation TransformationCopyObject::ToMessage() const {
@@ -132,43 +113,5 @@ protobufs::Transformation TransformationCopyObject::ToMessage() const {
return result;
}
-bool TransformationCopyObject::IsCopyable(opt::IRContext* ir_context,
- opt::Instruction* inst) {
- if (!inst->HasResultId()) {
- // We can only apply OpCopyObject to instructions that generate ids.
- return false;
- }
- if (!inst->type_id()) {
- // We can only apply OpCopyObject to instructions that have types.
- return false;
- }
- // We do not copy objects that have decorations: if the copy is not
- // decorated analogously, using the original object vs. its copy may not be
- // equivalent.
- // TODO(afd): it would be possible to make the copy but not add an id
- // synonym.
- return ir_context->get_decoration_mgr()
- ->GetDecorationsFor(inst->result_id(), true)
- .empty();
-}
-
-bool TransformationCopyObject::CanInsertCopyBefore(
- const opt::BasicBlock::iterator& instruction_in_block) {
- if (instruction_in_block->PreviousNode() &&
- (instruction_in_block->PreviousNode()->opcode() == SpvOpLoopMerge ||
- instruction_in_block->PreviousNode()->opcode() == SpvOpSelectionMerge)) {
- // We cannot insert a copy directly after a merge instruction.
- return false;
- }
- if (instruction_in_block->opcode() == SpvOpVariable) {
- // We cannot insert a copy directly before a variable; variables in a
- // function must be contiguous in the entry block.
- return false;
- }
- // We cannot insert a copy directly before OpPhi, because OpPhi instructions
- // need to be contiguous at the start of a block.
- return instruction_in_block->opcode() != SpvOpPhi;
-}
-
} // namespace fuzz
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_copy_object.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_copy_object.h
index 20e58749b45..3a75ac9d9ba 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_copy_object.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_copy_object.h
@@ -28,8 +28,10 @@ class TransformationCopyObject : public Transformation {
explicit TransformationCopyObject(
const protobufs::TransformationCopyObject& message);
- TransformationCopyObject(uint32_t object, uint32_t base_instruction_id,
- uint32_t offset, uint32_t fresh_id);
+ TransformationCopyObject(
+ uint32_t object,
+ const protobufs::InstructionDescriptor& instruction_to_insert_before,
+ uint32_t fresh_id);
// - |message_.fresh_id| must not be used by the module.
// - |message_.object| must be a result id that is a legitimate operand for
@@ -37,14 +39,14 @@ class TransformationCopyObject : public Transformation {
// has a result type
// - |message_.object| must not be the target of any decoration.
// TODO(afd): consider copying decorations along with objects.
- // - |message_.insert_after_id| must be the result id of an instruction
+ // - |message_.base_instruction_id| must be the result id of an instruction
// 'base' in some block 'blk'.
// - 'blk' must contain an instruction 'inst' located |message_.offset|
// instructions after 'base' (if |message_.offset| = 0 then 'inst' =
// 'base').
// - It must be legal to insert an OpCopyObject instruction directly
// before 'inst'.
- // - |message_object| must be available directly before 'inst'.
+ // - |message_.object| must be available directly before 'inst'.
bool IsApplicable(opt::IRContext* context,
const FactManager& fact_manager) const override;
@@ -58,14 +60,6 @@ class TransformationCopyObject : public Transformation {
protobufs::Transformation ToMessage() const override;
- // Determines whether it is OK to make a copy of |inst|.
- static bool IsCopyable(opt::IRContext* ir_context, opt::Instruction* inst);
-
- // Determines whether it is OK to insert a copy instruction before the given
- // instruction.
- static bool CanInsertCopyBefore(
- const opt::BasicBlock::iterator& instruction_in_block);
-
private:
protobufs::TransformationCopyObject message_;
};
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_boolean_constant_with_constant_binary.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_boolean_constant_with_constant_binary.cpp
index 0326814659e..b097767fbaf 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_boolean_constant_with_constant_binary.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_boolean_constant_with_constant_binary.cpp
@@ -238,7 +238,7 @@ bool TransformationReplaceBooleanConstantWithConstantBinary::IsApplicable(
// The id use descriptor must identify some instruction
auto instruction =
- transformation::FindInstruction(message_.id_use_descriptor(), context);
+ FindInstructionContainingUse(message_.id_use_descriptor(), context);
if (instruction == nullptr) {
return false;
}
@@ -268,7 +268,7 @@ TransformationReplaceBooleanConstantWithConstantBinary::ApplyWithResult(
message_.fresh_id_for_binary_operation(), operands);
opt::Instruction* result = binary_instruction.get();
auto instruction_containing_constant_use =
- transformation::FindInstruction(message_.id_use_descriptor(), context);
+ FindInstructionContainingUse(message_.id_use_descriptor(), context);
// We want to insert the new instruction before the instruction that contains
// the use of the boolean, but we need to go backwards one more instruction if
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_constant_with_uniform.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_constant_with_uniform.cpp
index 48334ba9615..405776ec039 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_constant_with_uniform.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_constant_with_uniform.cpp
@@ -149,7 +149,7 @@ bool TransformationReplaceConstantWithUniform::IsApplicable(
// The id use descriptor must identify some instruction with respect to the
// module.
auto instruction_using_constant =
- transformation::FindInstruction(message_.id_use_descriptor(), context);
+ FindInstructionContainingUse(message_.id_use_descriptor(), context);
if (!instruction_using_constant) {
return false;
}
@@ -188,7 +188,7 @@ void TransformationReplaceConstantWithUniform::Apply(
spvtools::fuzz::FactManager* /*unused*/) const {
// Get the instruction that contains the id use we wish to replace.
auto instruction_containing_constant_use =
- transformation::FindInstruction(message_.id_use_descriptor(), context);
+ FindInstructionContainingUse(message_.id_use_descriptor(), context);
assert(instruction_containing_constant_use &&
"Precondition requires that the id use can be found.");
assert(instruction_containing_constant_use->GetSingleWordInOperand(
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_id_with_synonym.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_id_with_synonym.cpp
index 0f28540b399..0e8b89124a3 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_id_with_synonym.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_replace_id_with_synonym.cpp
@@ -20,6 +20,7 @@
#include "source/fuzz/fuzzer_util.h"
#include "source/fuzz/id_use_descriptor.h"
#include "source/opt/types.h"
+#include "source/util/make_unique.h"
namespace spvtools {
namespace fuzz {
@@ -33,9 +34,7 @@ TransformationReplaceIdWithSynonym::TransformationReplaceIdWithSynonym(
protobufs::IdUseDescriptor id_use_descriptor,
protobufs::DataDescriptor data_descriptor,
uint32_t fresh_id_for_temporary) {
- assert(fresh_id_for_temporary == 0 && data_descriptor.index().size() == 0 &&
- "At present we do not support making an id that is synonymous with an "
- "index into a composite.");
+ assert((fresh_id_for_temporary == 0) == (data_descriptor.index().empty()));
*message_.mutable_id_use_descriptor() = std::move(id_use_descriptor);
*message_.mutable_data_descriptor() = std::move(data_descriptor);
message_.set_fresh_id_for_temporary(fresh_id_for_temporary);
@@ -47,26 +46,30 @@ bool TransformationReplaceIdWithSynonym::IsApplicable(
auto id_of_interest = message_.id_use_descriptor().id_of_interest();
// Does the fact manager know about the synonym?
- if (fact_manager.GetIdsForWhichSynonymsAreKnown().count(id_of_interest) ==
- 0) {
+ auto ids_with_known_synonyms = fact_manager.GetIdsForWhichSynonymsAreKnown();
+ if (std::find(ids_with_known_synonyms.begin(), ids_with_known_synonyms.end(),
+ id_of_interest) == ids_with_known_synonyms.end()) {
return false;
}
auto available_synonyms = fact_manager.GetSynonymsForId(id_of_interest);
if (std::find_if(available_synonyms.begin(), available_synonyms.end(),
- [this](protobufs::DataDescriptor dd) -> bool {
- return DataDescriptorEquals()(&dd,
+ [this](const protobufs::DataDescriptor* dd) -> bool {
+ return DataDescriptorEquals()(dd,
&message_.data_descriptor());
}) == available_synonyms.end()) {
return false;
}
+ // Does the id use descriptor in the transformation identify an instruction?
auto use_instruction =
- transformation::FindInstruction(message_.id_use_descriptor(), context);
+ FindInstructionContainingUse(message_.id_use_descriptor(), context);
if (!use_instruction) {
return false;
}
+ // Is it legitimate to replace the use identified by the id use descriptor
+ // with a synonym?
if (!ReplacingUseWithSynonymIsOk(
context, use_instruction,
message_.id_use_descriptor().in_operand_index(),
@@ -74,8 +77,23 @@ bool TransformationReplaceIdWithSynonym::IsApplicable(
return false;
}
- assert(message_.fresh_id_for_temporary() == 0);
- assert(message_.data_descriptor().index().empty());
+ if (message_.fresh_id_for_temporary() == 0) {
+ if (!message_.data_descriptor().index().empty()) {
+ // If we have no id to use as a temporary variable, we should not have any
+ // indices to extract from.
+ return false;
+ }
+ } else {
+ if (!fuzzerutil::IsFreshId(context, message_.fresh_id_for_temporary())) {
+ // The id to be used as a temporary needs to be fresh.
+ return false;
+ }
+ if (message_.data_descriptor().index_size() != 1) {
+ // At present we support just a single index to allow extracting directly
+ // from a composite.
+ return false;
+ }
+ }
return true;
}
@@ -83,12 +101,79 @@ bool TransformationReplaceIdWithSynonym::IsApplicable(
void TransformationReplaceIdWithSynonym::Apply(
spvtools::opt::IRContext* context,
spvtools::fuzz::FactManager* /*unused*/) const {
- assert(message_.data_descriptor().index().empty());
auto instruction_to_change =
- transformation::FindInstruction(message_.id_use_descriptor(), context);
+ FindInstructionContainingUse(message_.id_use_descriptor(), context);
+
+ // Ultimately we are going to replace the id use identified in the
+ // transformation with |replacement_id|, which will either be the synonym's
+ // id, or the id of a temporary used to extract the synonym from a composite.
+ uint32_t replacement_id;
+
+ if (message_.fresh_id_for_temporary()) {
+ // The transformation having a temporary variable means that we need to
+ // extract the synonym from a composite.
+
+ uint32_t type_id_of_id_to_be_replaced =
+ context->get_def_use_mgr()
+ ->GetDef(message_.id_use_descriptor().id_of_interest())
+ ->type_id();
+ opt::analysis::Type* type_of_id_to_be_replaced =
+ context->get_type_mgr()->GetType(type_id_of_id_to_be_replaced);
+ opt::analysis::Type* type_of_composite = context->get_type_mgr()->GetType(
+ context->get_def_use_mgr()
+ ->GetDef(message_.data_descriptor().object())
+ ->type_id());
+
+ // Intuitively we want to make an OpCompositeExtract instruction, to get the
+ // synonym out of the composite. But in the case of a vector, the synonym
+ // might involve multiple vector indices; e.g. the y and z components of a
+ // vec4 might be synonymous with a vec2, and in that case OpCompositeExtract
+ // doesn't give us what we want; we need to use OpVectorShuffle instead.
+ std::unique_ptr<opt::Instruction> new_instruction;
+ if (type_of_composite->AsVector() &&
+ type_of_composite->AsVector()->element_type() !=
+ type_of_id_to_be_replaced) {
+ // We need to extract a vector from inside a vector, so we will need to
+ // use OpVectorShuffle.
+
+ assert(type_of_id_to_be_replaced->AsVector());
+ assert(type_of_id_to_be_replaced->AsVector()->element_type() ==
+ type_of_composite->AsVector()->element_type());
+ opt::Instruction::OperandList shuffle_operands = {
+ {SPV_OPERAND_TYPE_ID, {message_.data_descriptor().object()}},
+ {SPV_OPERAND_TYPE_ID, {message_.data_descriptor().object()}}};
+ for (uint32_t i = 0;
+ i < type_of_id_to_be_replaced->AsVector()->element_count(); i++) {
+ shuffle_operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER,
+ {message_.data_descriptor().index(0) + i}});
+ }
+ new_instruction = MakeUnique<opt::Instruction>(
+ context, SpvOpVectorShuffle, type_id_of_id_to_be_replaced,
+ message_.fresh_id_for_temporary(), shuffle_operands);
+ } else {
+ // We are either extracting from a non-vector, or extracting a scalar from
+ // a vector, so we can use OpCompositeExtract.
+ opt::Instruction::OperandList extract_operands = {
+ {SPV_OPERAND_TYPE_ID, {message_.data_descriptor().object()}},
+ {SPV_OPERAND_TYPE_LITERAL_INTEGER,
+ {message_.data_descriptor().index(0)}}};
+ new_instruction = MakeUnique<opt::Instruction>(
+ context, SpvOpCompositeExtract, type_id_of_id_to_be_replaced,
+ message_.fresh_id_for_temporary(), extract_operands);
+ }
+ instruction_to_change->InsertBefore(std::move(new_instruction));
+
+ // The replacement id is the temporary variable we used to extract the
+ // synonym from a composite.
+ replacement_id = message_.fresh_id_for_temporary();
+ fuzzerutil::UpdateModuleIdBound(context, replacement_id);
+ } else {
+ // The replacement id is the synonym's id.
+ replacement_id = message_.data_descriptor().object();
+ }
+
instruction_to_change->SetInOperand(
- message_.id_use_descriptor().in_operand_index(),
- {message_.data_descriptor().object()});
+ message_.id_use_descriptor().in_operand_index(), {replacement_id});
context->InvalidateAnalysesExceptFor(opt::IRContext::Analysis::kAnalysisNone);
}
@@ -191,22 +276,27 @@ bool TransformationReplaceIdWithSynonym::ReplacingUseWithSynonymIsOk(
// We now need to check that replacing the use with the synonym will respect
// dominance rules - i.e. the synonym needs to dominate the use.
- auto dominator_analysis = context->GetDominatorAnalysis(
- context->get_instr_block(use_instruction)->GetParent());
- if (use_instruction->opcode() == SpvOpPhi) {
- // In the case where the use is an operand to OpPhi, it is actually the
- // *parent* block associated with the operand that must be dominated by the
- // synonym.
- auto parent_block =
- use_instruction->GetSingleWordInOperand(use_in_operand_index + 1);
- if (!dominator_analysis->Dominates(
- context->get_instr_block(defining_instruction)->id(),
- parent_block)) {
+ // This is only relevant if the defining instruction is in a block; if it is
+ // not in a block then it is at global scope, and so replacing the use with it
+ // is fine.
+ if (context->get_instr_block(defining_instruction)) {
+ auto dominator_analysis = context->GetDominatorAnalysis(
+ context->get_instr_block(use_instruction)->GetParent());
+ if (use_instruction->opcode() == SpvOpPhi) {
+ // In the case where the use is an operand to OpPhi, it is actually the
+ // *parent* block associated with the operand that must be dominated by
+ // the synonym.
+ auto parent_block =
+ use_instruction->GetSingleWordInOperand(use_in_operand_index + 1);
+ if (!dominator_analysis->Dominates(
+ context->get_instr_block(defining_instruction)->id(),
+ parent_block)) {
+ return false;
+ }
+ } else if (!dominator_analysis->Dominates(defining_instruction,
+ use_instruction)) {
return false;
}
- } else if (!dominator_analysis->Dominates(defining_instruction,
- use_instruction)) {
- return false;
}
return true;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_function_control.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_function_control.cpp
new file mode 100644
index 00000000000..d2b61f198a3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_function_control.cpp
@@ -0,0 +1,100 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/transformation_set_function_control.h"
+
+namespace spvtools {
+namespace fuzz {
+
+TransformationSetFunctionControl::TransformationSetFunctionControl(
+ const spvtools::fuzz::protobufs::TransformationSetFunctionControl& message)
+ : message_(message) {}
+
+TransformationSetFunctionControl::TransformationSetFunctionControl(
+ uint32_t function_id, uint32_t function_control) {
+ message_.set_function_id(function_id);
+ message_.set_function_control(function_control);
+}
+
+bool TransformationSetFunctionControl::IsApplicable(
+ opt::IRContext* context, const FactManager& /*unused*/) const {
+ opt::Instruction* function_def_instruction =
+ FindFunctionDefInstruction(context);
+ if (!function_def_instruction) {
+ // The given function id does not correspond to any function.
+ return false;
+ }
+ uint32_t existing_function_control_mask =
+ function_def_instruction->GetSingleWordInOperand(0);
+
+ // Check (via an assertion) that function control mask doesn't have any bad
+ // bits set.
+ uint32_t acceptable_function_control_bits =
+ SpvFunctionControlInlineMask | SpvFunctionControlDontInlineMask |
+ SpvFunctionControlPureMask | SpvFunctionControlConstMask;
+ // The following is to keep release-mode compilers happy as this variable is
+ // only used in an assertion.
+ (void)(acceptable_function_control_bits);
+ assert(!(message_.function_control() & ~acceptable_function_control_bits) &&
+ "Nonsensical loop control bits were found.");
+
+ // Check (via an assertion) that function control mask does not have both
+ // Inline and DontInline bits set.
+ assert(!((message_.function_control() & SpvFunctionControlInlineMask) &&
+ (message_.function_control() & SpvFunctionControlDontInlineMask)) &&
+ "It is not OK to set both the 'Inline' and 'DontInline' bits of a "
+ "function control mask");
+
+ // Check that Const and Pure are only present if they were present on the
+ // original function
+ for (auto mask_bit :
+ {SpvFunctionControlPureMask, SpvFunctionControlConstMask}) {
+ if ((message_.function_control() & mask_bit) &&
+ !(existing_function_control_mask & mask_bit)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+void TransformationSetFunctionControl::Apply(opt::IRContext* context,
+ FactManager* /*unused*/) const {
+ opt::Instruction* function_def_instruction =
+ FindFunctionDefInstruction(context);
+ function_def_instruction->SetInOperand(0, {message_.function_control()});
+}
+
+protobufs::Transformation TransformationSetFunctionControl::ToMessage() const {
+ protobufs::Transformation result;
+ *result.mutable_set_function_control() = message_;
+ return result;
+}
+
+opt::Instruction* TransformationSetFunctionControl ::FindFunctionDefInstruction(
+ opt::IRContext* context) const {
+ // Look through all functions for a function whose defining instruction's
+ // result id matches |message_.function_id|, returning the defining
+ // instruction if found.
+ for (auto& function : *context->module()) {
+ if (function.DefInst().result_id() == message_.function_id()) {
+ return &function.DefInst();
+ }
+ }
+ // A nullptr result indicates that no match was found.
+ return nullptr;
+}
+
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_function_control.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_function_control.h
new file mode 100644
index 00000000000..0526bb9c525
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_function_control.h
@@ -0,0 +1,58 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_FUZZ_TRANSFORMATION_SET_FUNCTION_CONTROL_H_
+#define SOURCE_FUZZ_TRANSFORMATION_SET_FUNCTION_CONTROL_H_
+
+#include "source/fuzz/fact_manager.h"
+#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
+#include "source/fuzz/transformation.h"
+#include "source/opt/ir_context.h"
+
+namespace spvtools {
+namespace fuzz {
+
+class TransformationSetFunctionControl : public Transformation {
+ public:
+ explicit TransformationSetFunctionControl(
+ const protobufs::TransformationSetFunctionControl& message);
+
+ TransformationSetFunctionControl(uint32_t function_id,
+ uint32_t function_control);
+
+ // - |message_.function_id| must be the result id of an OpFunction
+ // instruction.
+ // - |message_.function_control| must be a function control mask that sets
+ // at most one of 'Inline' or 'DontInline', and that may not contain 'Pure'
+ // (respectively 'Const') unless the existing function control mask contains
+ // 'Pure' (respectively 'Const').
+ bool IsApplicable(opt::IRContext* context,
+ const FactManager& fact_manager) const override;
+
+ // The function control operand of instruction |message_.function_id| is
+ // over-written with |message_.function_control|.
+ void Apply(opt::IRContext* context, FactManager* fact_manager) const override;
+
+ protobufs::Transformation ToMessage() const override;
+
+ private:
+ opt::Instruction* FindFunctionDefInstruction(opt::IRContext* context) const;
+
+ protobufs::TransformationSetFunctionControl message_;
+};
+
+} // namespace fuzz
+} // namespace spvtools
+
+#endif // SOURCE_FUZZ_TRANSFORMATION_SET_FUNCTION_CONTROL_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_loop_control.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_loop_control.cpp
new file mode 100644
index 00000000000..9062f174a27
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_loop_control.cpp
@@ -0,0 +1,216 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/transformation_set_loop_control.h"
+
+namespace spvtools {
+namespace fuzz {
+
+TransformationSetLoopControl::TransformationSetLoopControl(
+ const spvtools::fuzz::protobufs::TransformationSetLoopControl& message)
+ : message_(message) {}
+
+TransformationSetLoopControl::TransformationSetLoopControl(
+ uint32_t block_id, uint32_t loop_control, uint32_t peel_count,
+ uint32_t partial_count) {
+ message_.set_block_id(block_id);
+ message_.set_loop_control(loop_control);
+ message_.set_peel_count(peel_count);
+ message_.set_partial_count(partial_count);
+}
+
+bool TransformationSetLoopControl::IsApplicable(
+ opt::IRContext* context, const FactManager& /*unused*/) const {
+ // |message_.block_id| must identify a block that ends with OpLoopMerge.
+ auto block = context->get_instr_block(message_.block_id());
+ if (!block) {
+ return false;
+ }
+ auto merge_inst = block->GetMergeInst();
+ if (!merge_inst || merge_inst->opcode() != SpvOpLoopMerge) {
+ return false;
+ }
+
+ // We sanity-check that the transformation does not try to set any meaningless
+ // bits of the loop control mask.
+ uint32_t all_loop_control_mask_bits_set =
+ SpvLoopControlUnrollMask | SpvLoopControlDontUnrollMask |
+ SpvLoopControlDependencyInfiniteMask |
+ SpvLoopControlDependencyLengthMask | SpvLoopControlMinIterationsMask |
+ SpvLoopControlMaxIterationsMask | SpvLoopControlIterationMultipleMask |
+ SpvLoopControlPeelCountMask | SpvLoopControlPartialCountMask;
+
+ // The variable is only used in an assertion; the following keeps release-mode
+ // compilers happy.
+ (void)(all_loop_control_mask_bits_set);
+
+ // No additional bits should be set.
+ assert(!(message_.loop_control() & ~all_loop_control_mask_bits_set));
+
+ // Grab the loop control mask currently associated with the OpLoopMerge
+ // instruction.
+ auto existing_loop_control_mask =
+ merge_inst->GetSingleWordInOperand(kLoopControlMaskInOperandIndex);
+
+ // Check that there is no attempt to set one of the loop controls that
+ // requires guarantees to hold.
+ for (SpvLoopControlMask mask :
+ {SpvLoopControlDependencyInfiniteMask,
+ SpvLoopControlDependencyLengthMask, SpvLoopControlMinIterationsMask,
+ SpvLoopControlMaxIterationsMask, SpvLoopControlIterationMultipleMask}) {
+ // We have a problem if this loop control bit was not set in the original
+ // loop control mask but is set by the transformation.
+ if (LoopControlBitIsAddedByTransformation(mask,
+ existing_loop_control_mask)) {
+ return false;
+ }
+ }
+
+ if ((message_.loop_control() &
+ (SpvLoopControlPeelCountMask | SpvLoopControlPartialCountMask)) &&
+ !(PeelCountIsSupported(context) && PartialCountIsSupported(context))) {
+ // At least one of PeelCount or PartialCount is used, but the SPIR-V version
+ // in question does not support these loop controls.
+ return false;
+ }
+
+ if (message_.peel_count() > 0 &&
+ !(message_.loop_control() & SpvLoopControlPeelCountMask)) {
+ // Peel count provided, but peel count mask bit not set.
+ return false;
+ }
+
+ if (message_.partial_count() > 0 &&
+ !(message_.loop_control() & SpvLoopControlPartialCountMask)) {
+ // Partial count provided, but partial count mask bit not set.
+ return false;
+ }
+
+ // We must not set both 'don't unroll' and one of 'peel count' or 'partial
+ // count'.
+ return !((message_.loop_control() & SpvLoopControlDontUnrollMask) &&
+ (message_.loop_control() &
+ (SpvLoopControlPeelCountMask | SpvLoopControlPartialCountMask)));
+}
+
+void TransformationSetLoopControl::Apply(opt::IRContext* context,
+ FactManager* /*unused*/) const {
+ // Grab the loop merge instruction and its associated loop control mask.
+ auto merge_inst =
+ context->get_instr_block(message_.block_id())->GetMergeInst();
+ auto existing_loop_control_mask =
+ merge_inst->GetSingleWordInOperand(kLoopControlMaskInOperandIndex);
+
+ // We are going to replace the OpLoopMerge's operands with this list.
+ opt::Instruction::OperandList new_operands;
+ // We add the existing merge block and continue target ids.
+ new_operands.push_back(merge_inst->GetInOperand(0));
+ new_operands.push_back(merge_inst->GetInOperand(1));
+ // We use the loop control mask from the transformation.
+ new_operands.push_back(
+ {SPV_OPERAND_TYPE_LOOP_CONTROL, {message_.loop_control()}});
+
+ // It remains to determine what literals to provide, in association with
+ // the new loop control mask.
+ //
+ // For the loop controls that require guarantees to hold about the number
+ // of loop iterations, we need to keep, from the original OpLoopMerge, any
+ // literals associated with loop control bits that are still set.
+
+ uint32_t literal_index = 0; // Indexes into the literals from the original
+ // instruction.
+ for (SpvLoopControlMask mask :
+ {SpvLoopControlDependencyLengthMask, SpvLoopControlMinIterationsMask,
+ SpvLoopControlMaxIterationsMask, SpvLoopControlIterationMultipleMask}) {
+ // Check whether the bit was set in the original loop control mask.
+ if (existing_loop_control_mask & mask) {
+ // Check whether the bit is set in the new loop control mask.
+ if (message_.loop_control() & mask) {
+ // Add the associated literal to our sequence of replacement operands.
+ new_operands.push_back(
+ {SPV_OPERAND_TYPE_LITERAL_INTEGER,
+ {merge_inst->GetSingleWordInOperand(
+ kLoopControlFirstLiteralInOperandIndex + literal_index)}});
+ }
+ // Increment our index into the original loop control mask's literals,
+ // whether or not the bit was set in the new mask.
+ literal_index++;
+ }
+ }
+
+ // If PeelCount is set in the new mask, |message_.peel_count| provides the
+ // associated peel count.
+ if (message_.loop_control() & SpvLoopControlPeelCountMask) {
+ new_operands.push_back(
+ {SPV_OPERAND_TYPE_LITERAL_INTEGER, {message_.peel_count()}});
+ }
+
+ // Similar, but for PartialCount.
+ if (message_.loop_control() & SpvLoopControlPartialCountMask) {
+ new_operands.push_back(
+ {SPV_OPERAND_TYPE_LITERAL_INTEGER, {message_.partial_count()}});
+ }
+
+ // Replace the input operands of the OpLoopMerge with the new operands we have
+ // accumulated.
+ merge_inst->SetInOperands(std::move(new_operands));
+}
+
+protobufs::Transformation TransformationSetLoopControl::ToMessage() const {
+ protobufs::Transformation result;
+ *result.mutable_set_loop_control() = message_;
+ return result;
+}
+
+bool TransformationSetLoopControl::LoopControlBitIsAddedByTransformation(
+ SpvLoopControlMask loop_control_single_bit_mask,
+ uint32_t existing_loop_control_mask) const {
+ return !(loop_control_single_bit_mask & existing_loop_control_mask) &&
+ (loop_control_single_bit_mask & message_.loop_control());
+}
+
+bool TransformationSetLoopControl::PartialCountIsSupported(
+ opt::IRContext* context) {
+ // TODO(afd): We capture the universal environments for which this loop
+ // control is definitely not supported. The check should be refined on
+ // demand for other target environments.
+ switch (context->grammar().target_env()) {
+ case SPV_ENV_UNIVERSAL_1_0:
+ case SPV_ENV_UNIVERSAL_1_1:
+ case SPV_ENV_UNIVERSAL_1_2:
+ case SPV_ENV_UNIVERSAL_1_3:
+ return false;
+ default:
+ return true;
+ }
+}
+
+bool TransformationSetLoopControl::PeelCountIsSupported(
+ opt::IRContext* context) {
+ // TODO(afd): We capture the universal environments for which this loop
+ // control is definitely not supported. The check should be refined on
+ // demand for other target environments.
+ switch (context->grammar().target_env()) {
+ case SPV_ENV_UNIVERSAL_1_0:
+ case SPV_ENV_UNIVERSAL_1_1:
+ case SPV_ENV_UNIVERSAL_1_2:
+ case SPV_ENV_UNIVERSAL_1_3:
+ return false;
+ default:
+ return true;
+ }
+}
+
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_loop_control.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_loop_control.h
new file mode 100644
index 00000000000..28b148cad20
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_loop_control.h
@@ -0,0 +1,79 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_FUZZ_TRANSFORMATION_SET_LOOP_CONTROL_H_
+#define SOURCE_FUZZ_TRANSFORMATION_SET_LOOP_CONTROL_H_
+
+#include "source/fuzz/fact_manager.h"
+#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
+#include "source/fuzz/transformation.h"
+#include "source/opt/ir_context.h"
+
+namespace spvtools {
+namespace fuzz {
+
+class TransformationSetLoopControl : public Transformation {
+ public:
+ const static uint32_t kLoopControlMaskInOperandIndex = 2;
+ const static uint32_t kLoopControlFirstLiteralInOperandIndex = 3;
+
+ explicit TransformationSetLoopControl(
+ const protobufs::TransformationSetLoopControl& message);
+
+ TransformationSetLoopControl(uint32_t block_id, uint32_t loop_control,
+ uint32_t peel_count, uint32_t partial_count);
+
+ // - |message_.block_id| must be a block containing an OpLoopMerge
+ // instruction.
+ // - |message_.loop_control| must be a legal loop control mask that
+ // only uses controls available in the SPIR-V version associated with
+ // |context|, and must not add loop controls that are only valid in the
+ // presence of guarantees about what the loop does (e.g. MinIterations).
+ // - |message_.peel_count| (respectively |message_.partial_count|) must be
+ // zero PeelCount (respectively PartialCount) is set in
+ // |message_.loop_control|.
+ bool IsApplicable(opt::IRContext* context,
+ const FactManager& fact_manager) const override;
+
+ // - The loop control operand of the OpLoopMergeInstruction in
+ // |message_.block_id| is overwritten with |message_.loop_control|.
+ // - The literals associated with the loop control are updated to reflect any
+ // controls with associated literals that have been removed (e.g.
+ // MinIterations), and any that have been added (PeelCount and/or
+ // PartialCount).
+ void Apply(opt::IRContext* context, FactManager* fact_manager) const override;
+
+ protobufs::Transformation ToMessage() const override;
+
+ // Does the version of SPIR-V being used support the PartialCount loop
+ // control?
+ static bool PartialCountIsSupported(opt::IRContext* context);
+
+ // Does the version of SPIR-V being used support the PeelCount loop control?
+ static bool PeelCountIsSupported(opt::IRContext* context);
+
+ private:
+ // Returns true if and only if |loop_single_bit_mask| is *not* set in
+ // |existing_loop_control| but *is* set in |message_.loop_control|.
+ bool LoopControlBitIsAddedByTransformation(
+ SpvLoopControlMask loop_control_single_bit_mask,
+ uint32_t existing_loop_control_mask) const;
+
+ protobufs::TransformationSetLoopControl message_;
+};
+
+} // namespace fuzz
+} // namespace spvtools
+
+#endif // SOURCE_FUZZ_TRANSFORMATION_SET_LOOP_CONTROL_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_memory_operands_mask.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_memory_operands_mask.cpp
new file mode 100644
index 00000000000..a14e1a60986
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_memory_operands_mask.cpp
@@ -0,0 +1,201 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/transformation_set_memory_operands_mask.h"
+
+#include "source/fuzz/instruction_descriptor.h"
+
+namespace spvtools {
+namespace fuzz {
+
+namespace {
+
+const uint32_t kOpLoadMemoryOperandsMaskIndex = 1;
+const uint32_t kOpStoreMemoryOperandsMaskIndex = 2;
+const uint32_t kOpCopyMemoryFirstMemoryOperandsMaskIndex = 2;
+const uint32_t kOpCopyMemorySizedFirstMemoryOperandsMaskIndex = 3;
+
+} // namespace
+
+TransformationSetMemoryOperandsMask::TransformationSetMemoryOperandsMask(
+ const spvtools::fuzz::protobufs::TransformationSetMemoryOperandsMask&
+ message)
+ : message_(message) {}
+
+TransformationSetMemoryOperandsMask::TransformationSetMemoryOperandsMask(
+ const protobufs::InstructionDescriptor& memory_access_instruction,
+ uint32_t memory_operands_mask, uint32_t memory_operands_mask_index) {
+ *message_.mutable_memory_access_instruction() = memory_access_instruction;
+ message_.set_memory_operands_mask(memory_operands_mask);
+ message_.set_memory_operands_mask_index(memory_operands_mask_index);
+}
+
+bool TransformationSetMemoryOperandsMask::IsApplicable(
+ opt::IRContext* context,
+ const spvtools::fuzz::FactManager& /*unused*/) const {
+ if (message_.memory_operands_mask_index() != 0) {
+ // The following conditions should never be violated, even if
+ // transformations end up being replayed in a different way to the manner in
+ // which they were applied during fuzzing, hence why these are assertions
+ // rather than applicability checks.
+ assert(message_.memory_operands_mask_index() == 1);
+ assert(message_.memory_access_instruction().target_instruction_opcode() ==
+ SpvOpCopyMemory ||
+ message_.memory_access_instruction().target_instruction_opcode() ==
+ SpvOpCopyMemorySized);
+ assert(MultipleMemoryOperandMasksAreSupported(context));
+ }
+
+ auto instruction =
+ FindInstruction(message_.memory_access_instruction(), context);
+ if (!instruction) {
+ return false;
+ }
+ if (!IsMemoryAccess(*instruction)) {
+ return false;
+ }
+
+ auto original_mask_in_operand_index = GetInOperandIndexForMask(
+ *instruction, message_.memory_operands_mask_index());
+ assert(original_mask_in_operand_index != 0 &&
+ "The given mask index is not valid.");
+ uint32_t original_mask =
+ original_mask_in_operand_index < instruction->NumInOperands()
+ ? instruction->GetSingleWordInOperand(original_mask_in_operand_index)
+ : static_cast<uint32_t>(SpvMemoryAccessMaskNone);
+ uint32_t new_mask = message_.memory_operands_mask();
+
+ // Volatile must not be removed
+ if ((original_mask & SpvMemoryAccessVolatileMask) &&
+ !(new_mask & SpvMemoryAccessVolatileMask)) {
+ return false;
+ }
+
+ // Nontemporal can be added or removed, and no other flag is allowed to
+ // change. We do this by checking that the masks are equal once we set
+ // their Volatile and Nontemporal flags to the same value (this works
+ // because valid manipulation of Volatile is checked above, and the manner
+ // in which Nontemporal is manipulated does not matter).
+ return (original_mask | SpvMemoryAccessVolatileMask |
+ SpvMemoryAccessNontemporalMask) ==
+ (new_mask | SpvMemoryAccessVolatileMask |
+ SpvMemoryAccessNontemporalMask);
+}
+
+void TransformationSetMemoryOperandsMask::Apply(
+ opt::IRContext* context, spvtools::fuzz::FactManager* /*unused*/) const {
+ auto instruction =
+ FindInstruction(message_.memory_access_instruction(), context);
+ auto original_mask_in_operand_index = GetInOperandIndexForMask(
+ *instruction, message_.memory_operands_mask_index());
+ // Either add a new operand, if no mask operand was already present, or
+ // replace an existing mask operand.
+ if (original_mask_in_operand_index >= instruction->NumInOperands()) {
+ instruction->AddOperand(
+ {SPV_OPERAND_TYPE_MEMORY_ACCESS, {message_.memory_operands_mask()}});
+
+ } else {
+ instruction->SetInOperand(original_mask_in_operand_index,
+ {message_.memory_operands_mask()});
+ }
+}
+
+protobufs::Transformation TransformationSetMemoryOperandsMask::ToMessage()
+ const {
+ protobufs::Transformation result;
+ *result.mutable_set_memory_operands_mask() = message_;
+ return result;
+}
+
+bool TransformationSetMemoryOperandsMask::IsMemoryAccess(
+ const opt::Instruction& instruction) {
+ switch (instruction.opcode()) {
+ case SpvOpLoad:
+ case SpvOpStore:
+ case SpvOpCopyMemory:
+ case SpvOpCopyMemorySized:
+ return true;
+ default:
+ return false;
+ }
+}
+
+uint32_t TransformationSetMemoryOperandsMask::GetInOperandIndexForMask(
+ const opt::Instruction& instruction, uint32_t mask_index) {
+ // Get the input operand index associated with the first memory operands mask
+ // for the instruction.
+ uint32_t first_mask_in_operand_index = 0;
+ switch (instruction.opcode()) {
+ case SpvOpLoad:
+ first_mask_in_operand_index = kOpLoadMemoryOperandsMaskIndex;
+ break;
+ case SpvOpStore:
+ first_mask_in_operand_index = kOpStoreMemoryOperandsMaskIndex;
+ break;
+ case SpvOpCopyMemory:
+ first_mask_in_operand_index = kOpCopyMemoryFirstMemoryOperandsMaskIndex;
+ break;
+ case SpvOpCopyMemorySized:
+ first_mask_in_operand_index =
+ kOpCopyMemorySizedFirstMemoryOperandsMaskIndex;
+ break;
+ default:
+ assert(false && "Unknown memory instruction.");
+ break;
+ }
+ // If we are looking for the input operand index of the first mask, return it.
+ if (mask_index == 0) {
+ return first_mask_in_operand_index;
+ }
+ assert(mask_index == 1 && "Memory operands mask index must be 0 or 1.");
+
+ // We are looking for the input operand index of the second mask. This is a
+ // little complicated because, depending on the contents of the first mask,
+ // there may be some input operands separating the two masks.
+ uint32_t first_mask =
+ instruction.GetSingleWordInOperand(first_mask_in_operand_index);
+
+ // Consider each bit that might have an associated extra input operand, and
+ // count how many there are expected to be.
+ uint32_t first_mask_extra_operand_count = 0;
+ for (auto mask_bit :
+ {SpvMemoryAccessAlignedMask, SpvMemoryAccessMakePointerAvailableMask,
+ SpvMemoryAccessMakePointerAvailableKHRMask,
+ SpvMemoryAccessMakePointerVisibleMask,
+ SpvMemoryAccessMakePointerVisibleKHRMask}) {
+ if (first_mask & mask_bit) {
+ first_mask_extra_operand_count++;
+ }
+ }
+ return first_mask_in_operand_index + first_mask_extra_operand_count + 1;
+}
+
+bool TransformationSetMemoryOperandsMask::
+ MultipleMemoryOperandMasksAreSupported(opt::IRContext* context) {
+ // TODO(afd): We capture the universal environments for which this loop
+ // control is definitely not supported. The check should be refined on
+ // demand for other target environments.
+ switch (context->grammar().target_env()) {
+ case SPV_ENV_UNIVERSAL_1_0:
+ case SPV_ENV_UNIVERSAL_1_1:
+ case SPV_ENV_UNIVERSAL_1_2:
+ case SPV_ENV_UNIVERSAL_1_3:
+ return false;
+ default:
+ return true;
+ }
+}
+
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_memory_operands_mask.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_memory_operands_mask.h
new file mode 100644
index 00000000000..20ae1457879
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_memory_operands_mask.h
@@ -0,0 +1,76 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_FUZZ_TRANSFORMATION_SET_MEMORY_OPERANDS_MASK_H_
+#define SOURCE_FUZZ_TRANSFORMATION_SET_MEMORY_OPERANDS_MASK_H_
+
+#include "source/fuzz/fact_manager.h"
+#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
+#include "source/fuzz/transformation.h"
+#include "source/opt/ir_context.h"
+
+namespace spvtools {
+namespace fuzz {
+
+class TransformationSetMemoryOperandsMask : public Transformation {
+ public:
+ explicit TransformationSetMemoryOperandsMask(
+ const protobufs::TransformationSetMemoryOperandsMask& message);
+
+ TransformationSetMemoryOperandsMask(
+ const protobufs::InstructionDescriptor& memory_access_instruction,
+ uint32_t memory_operands_mask, uint32_t memory_operands_mask_index);
+
+ // - |message_.memory_access_instruction| must describe a memory access
+ // instruction.
+ // - |message_.memory_operands_mask_index| must be suitable for this memory
+ // access instruction, e.g. it must be 0 in the case of OpLoad, and may be
+ // 1 in the case of OpCopyMemory if the SPIR-V version is 1.4 or higher.
+ // - |message_.memory_operands_mask| must be identical to the original memory
+ // operands mask, except that Volatile may be added, and Nontemporal may be
+ // toggled.
+ bool IsApplicable(opt::IRContext* context,
+ const FactManager& fact_manager) const override;
+
+ // Replaces the operands mask identified by
+ // |message_.memory_operands_mask_index| in the instruction described by
+ // |message_.memory_access_instruction| with |message_.memory_operands_mask|,
+ // creating an input operand for the mask if no such operand was present.
+ void Apply(opt::IRContext* context, FactManager* fact_manager) const override;
+
+ protobufs::Transformation ToMessage() const override;
+
+ // Helper function that determines whether |instruction| is a memory
+ // instruction (e.g. OpLoad).
+ static bool IsMemoryAccess(const opt::Instruction& instruction);
+
+ // Does the version of SPIR-V being used support multiple memory operand
+ // masks on relevant memory access instructions?
+ static bool MultipleMemoryOperandMasksAreSupported(opt::IRContext* context);
+
+ // Helper function to get the input operand index associated with mask number
+ // |mask_index|. This is a bit tricky if there are multiple masks, because the
+ // index associated with the second mask depends on whether the first mask
+ // includes any flags such as Aligned that have corresponding operands.
+ static uint32_t GetInOperandIndexForMask(const opt::Instruction& instruction,
+ uint32_t mask_index);
+
+ private:
+ protobufs::TransformationSetMemoryOperandsMask message_;
+};
+
+} // namespace fuzz
+} // namespace spvtools
+
+#endif // SOURCE_FUZZ_TRANSFORMATION_SET_MEMORY_OPERANDS_MASK_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_selection_control.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_selection_control.cpp
new file mode 100644
index 00000000000..ebabdef2097
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_selection_control.cpp
@@ -0,0 +1,60 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/transformation_set_selection_control.h"
+
+namespace spvtools {
+namespace fuzz {
+
+TransformationSetSelectionControl::TransformationSetSelectionControl(
+ const spvtools::fuzz::protobufs::TransformationSetSelectionControl& message)
+ : message_(message) {}
+
+TransformationSetSelectionControl::TransformationSetSelectionControl(
+ uint32_t block_id, uint32_t selection_control) {
+ message_.set_block_id(block_id);
+ message_.set_selection_control(selection_control);
+}
+
+bool TransformationSetSelectionControl::IsApplicable(
+ opt::IRContext* context, const FactManager& /*unused*/) const {
+ assert((message_.selection_control() == SpvSelectionControlMaskNone ||
+ message_.selection_control() == SpvSelectionControlFlattenMask ||
+ message_.selection_control() == SpvSelectionControlDontFlattenMask) &&
+ "Selection control should never be set to something other than "
+ "'None', 'Flatten' or 'DontFlatten'");
+ if (auto block = context->get_instr_block(message_.block_id())) {
+ if (auto merge_inst = block->GetMergeInst()) {
+ return merge_inst->opcode() == SpvOpSelectionMerge;
+ }
+ }
+ // Either the block did not exit, or did not end with OpSelectionMerge.
+ return false;
+}
+
+void TransformationSetSelectionControl::Apply(opt::IRContext* context,
+ FactManager* /*unused*/) const {
+ context->get_instr_block(message_.block_id())
+ ->GetMergeInst()
+ ->SetInOperand(1, {message_.selection_control()});
+}
+
+protobufs::Transformation TransformationSetSelectionControl::ToMessage() const {
+ protobufs::Transformation result;
+ *result.mutable_set_selection_control() = message_;
+ return result;
+}
+
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_selection_control.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_selection_control.h
new file mode 100644
index 00000000000..19e0c3cfd8f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_set_selection_control.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_FUZZ_TRANSFORMATION_SET_SELECTION_CONTROL_H_
+#define SOURCE_FUZZ_TRANSFORMATION_SET_SELECTION_CONTROL_H_
+
+#include "source/fuzz/fact_manager.h"
+#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
+#include "source/fuzz/transformation.h"
+#include "source/opt/ir_context.h"
+
+namespace spvtools {
+namespace fuzz {
+
+class TransformationSetSelectionControl : public Transformation {
+ public:
+ explicit TransformationSetSelectionControl(
+ const protobufs::TransformationSetSelectionControl& message);
+
+ TransformationSetSelectionControl(uint32_t block_id,
+ uint32_t selection_control);
+
+ // - |message_.block_id| must be a block containing an OpSelectionMerge
+ // instruction.
+ // - |message_.selection_control| must be one of None, Flatten or
+ // DontFlatten.
+ bool IsApplicable(opt::IRContext* context,
+ const FactManager& fact_manager) const override;
+
+ // - The selection control operand of the OpSelectionMergeInstruction in
+ // |message_.block_id| is overwritten with |message_.selection_control|.
+ void Apply(opt::IRContext* context, FactManager* fact_manager) const override;
+
+ protobufs::Transformation ToMessage() const override;
+
+ private:
+ protobufs::TransformationSetSelectionControl message_;
+};
+
+} // namespace fuzz
+} // namespace spvtools
+
+#endif // SOURCE_FUZZ_TRANSFORMATION_SET_SELECTION_CONTROL_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_split_block.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_split_block.cpp
index a2da371c60f..9f6da7c3869 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_split_block.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_split_block.cpp
@@ -17,6 +17,7 @@
#include <utility>
#include "source/fuzz/fuzzer_util.h"
+#include "source/fuzz/instruction_descriptor.h"
#include "source/util/make_unique.h"
namespace spvtools {
@@ -26,11 +27,10 @@ TransformationSplitBlock::TransformationSplitBlock(
const spvtools::fuzz::protobufs::TransformationSplitBlock& message)
: message_(message) {}
-TransformationSplitBlock::TransformationSplitBlock(uint32_t base_instruction_id,
- uint32_t offset,
- uint32_t fresh_id) {
- message_.set_base_instruction_id(base_instruction_id);
- message_.set_offset(offset);
+TransformationSplitBlock::TransformationSplitBlock(
+ const protobufs::InstructionDescriptor& instruction_to_split_before,
+ uint32_t fresh_id) {
+ *message_.mutable_instruction_to_split_before() = instruction_to_split_before;
message_.set_fresh_id(fresh_id);
}
@@ -40,31 +40,28 @@ bool TransformationSplitBlock::IsApplicable(
// We require the id for the new block to be unused.
return false;
}
- auto base_instruction =
- context->get_def_use_mgr()->GetDef(message_.base_instruction_id());
- if (!base_instruction) {
+ auto instruction_to_split_before =
+ FindInstruction(message_.instruction_to_split_before(), context);
+ if (!instruction_to_split_before) {
// The instruction describing the block we should split does not exist.
return false;
}
- auto block_containing_base_instruction =
- context->get_instr_block(base_instruction);
- if (!block_containing_base_instruction) {
- // The instruction describing the block we should split is not contained in
- // a block.
- return false;
- }
+ auto block_to_split = context->get_instr_block(instruction_to_split_before);
+ assert(block_to_split &&
+ "We should not have managed to find the "
+ "instruction if it was not contained in a block.");
- if (block_containing_base_instruction->IsLoopHeader()) {
+ if (block_to_split->IsLoopHeader()) {
// We cannot split a loop header block: back-edges would become invalid.
return false;
}
- auto split_before = fuzzerutil::GetIteratorForBaseInstructionAndOffset(
- block_containing_base_instruction, base_instruction, message_.offset());
- if (split_before == block_containing_base_instruction->end()) {
- // The offset was inappropriate.
- return false;
- }
+ auto split_before = fuzzerutil::GetIteratorForInstruction(
+ block_to_split, instruction_to_split_before);
+ assert(split_before != block_to_split->end() &&
+ "At this point we know the"
+ " block split point exists.");
+
if (split_before->PreviousNode() &&
split_before->PreviousNode()->opcode() == SpvOpSelectionMerge) {
// We cannot split directly after a selection merge: this would separate
@@ -84,44 +81,39 @@ bool TransformationSplitBlock::IsApplicable(
void TransformationSplitBlock::Apply(opt::IRContext* context,
FactManager* /*unused*/) const {
- auto base_instruction =
- context->get_def_use_mgr()->GetDef(message_.base_instruction_id());
- assert(base_instruction && "Base instruction must exist");
- auto block_containing_base_instruction =
- context->get_instr_block(base_instruction);
- assert(block_containing_base_instruction &&
- "Base instruction must be in a block");
- auto split_before = fuzzerutil::GetIteratorForBaseInstructionAndOffset(
- block_containing_base_instruction, base_instruction, message_.offset());
- assert(split_before != block_containing_base_instruction->end() &&
+ opt::Instruction* instruction_to_split_before =
+ FindInstruction(message_.instruction_to_split_before(), context);
+ opt::BasicBlock* block_to_split =
+ context->get_instr_block(instruction_to_split_before);
+ auto split_before = fuzzerutil::GetIteratorForInstruction(
+ block_to_split, instruction_to_split_before);
+ assert(split_before != block_to_split->end() &&
"If the transformation is applicable, we should have an "
"instruction to split on.");
+
// We need to make sure the module's id bound is large enough to add the
// fresh id.
fuzzerutil::UpdateModuleIdBound(context, message_.fresh_id());
// Split the block.
- auto new_bb = block_containing_base_instruction->SplitBasicBlock(
- context, message_.fresh_id(), split_before);
+ auto new_bb = block_to_split->SplitBasicBlock(context, message_.fresh_id(),
+ split_before);
// The split does not automatically add a branch between the two parts of
// the original block, so we add one.
- block_containing_base_instruction->AddInstruction(
- MakeUnique<opt::Instruction>(
- context, SpvOpBranch, 0, 0,
- std::initializer_list<opt::Operand>{
- opt::Operand(spv_operand_type_t::SPV_OPERAND_TYPE_ID,
- {message_.fresh_id()})}));
+ block_to_split->AddInstruction(MakeUnique<opt::Instruction>(
+ context, SpvOpBranch, 0, 0,
+ std::initializer_list<opt::Operand>{opt::Operand(
+ spv_operand_type_t::SPV_OPERAND_TYPE_ID, {message_.fresh_id()})}));
// If we split before OpPhi instructions, we need to update their
// predecessor operand so that the block they used to be inside is now the
// predecessor.
- new_bb->ForEachPhiInst(
- [block_containing_base_instruction](opt::Instruction* phi_inst) {
- // The following assertion is a sanity check. It is guaranteed to hold
- // if IsApplicable holds.
- assert(phi_inst->NumInOperands() == 2 &&
- "We can only split a block before an OpPhi if block has exactly "
- "one predecessor.");
- phi_inst->SetInOperand(1, {block_containing_base_instruction->id()});
- });
+ new_bb->ForEachPhiInst([block_to_split](opt::Instruction* phi_inst) {
+ // The following assertion is a sanity check. It is guaranteed to hold
+ // if IsApplicable holds.
+ assert(phi_inst->NumInOperands() == 2 &&
+ "We can only split a block before an OpPhi if block has exactly "
+ "one predecessor.");
+ phi_inst->SetInOperand(1, {block_to_split->id()});
+ });
// Invalidate all analyses
context->InvalidateAnalysesExceptFor(opt::IRContext::Analysis::kAnalysisNone);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_split_block.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_split_block.h
index 4a7095ac094..63dc7f52b59 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_split_block.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/fuzz/transformation_split_block.h
@@ -28,8 +28,9 @@ class TransformationSplitBlock : public Transformation {
explicit TransformationSplitBlock(
const protobufs::TransformationSplitBlock& message);
- TransformationSplitBlock(uint32_t base_instruction_id, uint32_t offset,
- uint32_t fresh_id);
+ TransformationSplitBlock(
+ const protobufs::InstructionDescriptor& instruction_to_split_before,
+ uint32_t fresh_id);
// - |message_.base_instruction_id| must be the result id of an instruction
// 'base' in some block 'blk'.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/link/CMakeLists.txt b/3rdparty/bgfx/3rdparty/spirv-tools/source/link/CMakeLists.txt
index b8c4332b846..d3083192c57 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/link/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/link/CMakeLists.txt
@@ -19,8 +19,6 @@ spvtools_default_compile_options(SPIRV-Tools-link)
target_include_directories(SPIRV-Tools-link
PUBLIC
$<BUILD_INTERFACE:${spirv-tools_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/include>
- PUBLIC
$<BUILD_INTERFACE:${SPIRV_HEADER_INCLUDE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${spirv-tools_BINARY_DIR}
@@ -37,5 +35,12 @@ if(ENABLE_SPIRV_TOOLS_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
- install(EXPORT SPIRV-Tools-linkTargets DESTINATION lib/cmake)
+ export(EXPORT SPIRV-Tools-linkTargets FILE SPIRV-Tools-linkTargets.cmake)
+
+ spvtools_config_package_dir(SPIRV-Tools-link PACKAGE_DIR)
+ install(EXPORT SPIRV-Tools-linkTargets FILE SPIRV-Tools-linkTargets.cmake
+ DESTINATION ${PACKAGE_DIR})
+
+ spvtools_generate_config_file(SPIRV-Tools-link)
+ install(FILES ${CMAKE_BINARY_DIR}/SPIRV-Tools-linkConfig.cmake DESTINATION ${PACKAGE_DIR})
endif(ENABLE_SPIRV_TOOLS_INSTALL)
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/CMakeLists.txt b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/CMakeLists.txt
index bc680c6ea39..0f719cb9083 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/CMakeLists.txt
@@ -235,8 +235,6 @@ spvtools_default_compile_options(SPIRV-Tools-opt)
target_include_directories(SPIRV-Tools-opt
PUBLIC
$<BUILD_INTERFACE:${spirv-tools_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/include>
- PUBLIC
$<BUILD_INTERFACE:${SPIRV_HEADER_INCLUDE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${spirv-tools_BINARY_DIR}
@@ -253,5 +251,12 @@ if(ENABLE_SPIRV_TOOLS_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
- install(EXPORT SPIRV-Tools-optTargets DESTINATION lib/cmake)
+ export(EXPORT SPIRV-Tools-optTargets FILE SPIRV-Tools-optTargets.cmake)
+
+ spvtools_config_package_dir(SPIRV-Tools-opt PACKAGE_DIR)
+ install(EXPORT SPIRV-Tools-optTargets FILE SPIRV-Tools-optTargets.cmake
+ DESTINATION ${PACKAGE_DIR})
+
+ spvtools_generate_config_file(SPIRV-Tools-opt)
+ install(FILES ${CMAKE_BINARY_DIR}/SPIRV-Tools-optConfig.cmake DESTINATION ${PACKAGE_DIR})
endif(ENABLE_SPIRV_TOOLS_INSTALL)
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold.cpp
index 94f5e73fd3d..6550fb4fdb4 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold.cpp
@@ -56,6 +56,10 @@ uint32_t InstructionFolder::UnaryOperate(SpvOp opcode, uint32_t operand) const {
return ~operand;
case SpvOp::SpvOpLogicalNot:
return !static_cast<bool>(operand);
+ case SpvOp::SpvOpUConvert:
+ return operand;
+ case SpvOp::SpvOpSConvert:
+ return operand;
default:
assert(false &&
"Unsupported unary operation for OpSpecConstantOp instruction");
@@ -596,6 +600,8 @@ bool InstructionFolder::IsFoldableOpcode(SpvOp opcode) const {
case SpvOp::SpvOpSMod:
case SpvOp::SpvOpSNegate:
case SpvOp::SpvOpSRem:
+ case SpvOp::SpvOpSConvert:
+ case SpvOp::SpvOpUConvert:
case SpvOp::SpvOpUDiv:
case SpvOp::SpvOpUGreaterThan:
case SpvOp::SpvOpUGreaterThanEqual:
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp
index 56d0137f3f4..8ab717ea8a8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp
@@ -316,6 +316,59 @@ bool IsValidTypeForComponentWiseOperation(const analysis::Type* type) {
}
return false;
}
+
+// Encodes the integer |value| of in a word vector format appropriate for
+// representing this value as a operands for a constant definition. Performs
+// zero-extension/sign-extension/truncation when needed, based on the signess of
+// the given target type.
+//
+// Note: type |type| argument must be either Integer or Bool.
+utils::SmallVector<uint32_t, 2> EncodeIntegerAsWords(const analysis::Type& type,
+ uint32_t value) {
+ const uint32_t all_ones = ~0;
+ uint32_t bit_width = 0;
+ uint32_t pad_value = 0;
+ bool result_type_signed = false;
+ if (auto* int_ty = type.AsInteger()) {
+ bit_width = int_ty->width();
+ result_type_signed = int_ty->IsSigned();
+ if (result_type_signed && static_cast<int32_t>(value) < 0) {
+ pad_value = all_ones;
+ }
+ } else if (type.AsBool()) {
+ bit_width = 1;
+ } else {
+ assert(false && "type must be Integer or Bool");
+ }
+
+ assert(bit_width > 0);
+ uint32_t first_word = value;
+ const uint32_t bits_per_word = 32;
+
+ // Truncate first_word if the |type| has width less than uint32.
+ if (bit_width < bits_per_word) {
+ const uint32_t num_high_bits_to_mask = bits_per_word - bit_width;
+ const bool is_negative_after_truncation =
+ result_type_signed &&
+ utils::IsBitAtPositionSet(first_word, bit_width - 1);
+
+ if (is_negative_after_truncation) {
+ // Truncate and sign-extend |first_word|. No padding words will be
+ // added and |pad_value| can be left as-is.
+ first_word = utils::SetHighBits(first_word, num_high_bits_to_mask);
+ } else {
+ first_word = utils::ClearHighBits(first_word, num_high_bits_to_mask);
+ }
+ }
+
+ utils::SmallVector<uint32_t, 2> words = {first_word};
+ for (uint32_t current_bit = bits_per_word; current_bit < bit_width;
+ current_bit += bits_per_word) {
+ words.push_back(pad_value);
+ }
+
+ return words;
+}
} // namespace
Instruction* FoldSpecConstantOpAndCompositePass::DoComponentWiseOperation(
@@ -345,10 +398,10 @@ Instruction* FoldSpecConstantOpAndCompositePass::DoComponentWiseOperation(
if (result_type->AsInteger() || result_type->AsBool()) {
// Scalar operation
- uint32_t result_val =
+ const uint32_t result_val =
context()->get_instruction_folder().FoldScalars(spec_opcode, operands);
- auto result_const =
- context()->get_constant_mgr()->GetConstant(result_type, {result_val});
+ auto result_const = context()->get_constant_mgr()->GetConstant(
+ result_type, EncodeIntegerAsWords(*result_type, result_val));
return context()->get_constant_mgr()->BuildInstructionAndAddToModule(
result_const, pos);
} else if (result_type->AsVector()) {
@@ -360,9 +413,9 @@ Instruction* FoldSpecConstantOpAndCompositePass::DoComponentWiseOperation(
context()->get_instruction_folder().FoldVectors(spec_opcode, num_dims,
operands);
std::vector<const analysis::Constant*> result_vector_components;
- for (uint32_t r : result_vec) {
- if (auto rc =
- context()->get_constant_mgr()->GetConstant(element_type, {r})) {
+ for (const uint32_t r : result_vec) {
+ if (auto rc = context()->get_constant_mgr()->GetConstant(
+ element_type, EncodeIntegerAsWords(*element_type, r))) {
result_vector_components.push_back(rc);
if (!context()->get_constant_mgr()->BuildInstructionAndAddToModule(
rc, pos)) {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/folding_rules.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/folding_rules.cpp
index d2d029d73e5..eea723820e7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/folding_rules.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/folding_rules.cpp
@@ -18,6 +18,7 @@
#include <memory>
#include <utility>
+#include "ir_builder.h"
#include "source/latest_version_glsl_std_450_header.h"
#include "source/opt/ir_context.h"
@@ -1239,6 +1240,117 @@ FoldingRule MergeSubSubArithmetic() {
};
}
+// Helper function for MergeGenericAddSubArithmetic. If |addend| and
+// subtrahend of |sub| is the same, merge to copy of minuend of |sub|.
+bool MergeGenericAddendSub(uint32_t addend, uint32_t sub, Instruction* inst) {
+ IRContext* context = inst->context();
+ analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr();
+ Instruction* sub_inst = def_use_mgr->GetDef(sub);
+ if (sub_inst->opcode() != SpvOpFSub && sub_inst->opcode() != SpvOpISub)
+ return false;
+ if (sub_inst->opcode() == SpvOpFSub &&
+ !sub_inst->IsFloatingPointFoldingAllowed())
+ return false;
+ if (addend != sub_inst->GetSingleWordInOperand(1)) return false;
+ inst->SetOpcode(SpvOpCopyObject);
+ inst->SetInOperands(
+ {{SPV_OPERAND_TYPE_ID, {sub_inst->GetSingleWordInOperand(0)}}});
+ context->UpdateDefUse(inst);
+ return true;
+}
+
+// Folds addition of a subtraction where the subtrahend is equal to the
+// other addend. Return a copy of the minuend. Accepts generic (const and
+// non-const) operands.
+// Cases:
+// (a - b) + b = a
+// b + (a - b) = a
+FoldingRule MergeGenericAddSubArithmetic() {
+ return [](IRContext* context, Instruction* inst,
+ const std::vector<const analysis::Constant*>&) {
+ assert(inst->opcode() == SpvOpFAdd || inst->opcode() == SpvOpIAdd);
+ const analysis::Type* type =
+ context->get_type_mgr()->GetType(inst->type_id());
+ bool uses_float = HasFloatingPoint(type);
+ if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false;
+
+ uint32_t width = ElementWidth(type);
+ if (width != 32 && width != 64) return false;
+
+ uint32_t add_op0 = inst->GetSingleWordInOperand(0);
+ uint32_t add_op1 = inst->GetSingleWordInOperand(1);
+ if (MergeGenericAddendSub(add_op0, add_op1, inst)) return true;
+ return MergeGenericAddendSub(add_op1, add_op0, inst);
+ };
+}
+
+// Helper function for FactorAddMuls. If |factor0_0| is the same as |factor1_0|,
+// generate |factor0_0| * (|factor0_1| + |factor1_1|).
+bool FactorAddMulsOpnds(uint32_t factor0_0, uint32_t factor0_1,
+ uint32_t factor1_0, uint32_t factor1_1,
+ Instruction* inst) {
+ IRContext* context = inst->context();
+ if (factor0_0 != factor1_0) return false;
+ InstructionBuilder ir_builder(
+ context, inst,
+ IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
+ Instruction* new_add_inst = ir_builder.AddBinaryOp(
+ inst->type_id(), inst->opcode(), factor0_1, factor1_1);
+ inst->SetOpcode(inst->opcode() == SpvOpFAdd ? SpvOpFMul : SpvOpIMul);
+ inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {factor0_0}},
+ {SPV_OPERAND_TYPE_ID, {new_add_inst->result_id()}}});
+ context->UpdateDefUse(inst);
+ return true;
+}
+
+// Perform the following factoring identity, handling all operand order
+// combinations: (a * b) + (a * c) = a * (b + c)
+FoldingRule FactorAddMuls() {
+ return [](IRContext* context, Instruction* inst,
+ const std::vector<const analysis::Constant*>&) {
+ assert(inst->opcode() == SpvOpFAdd || inst->opcode() == SpvOpIAdd);
+ const analysis::Type* type =
+ context->get_type_mgr()->GetType(inst->type_id());
+ bool uses_float = HasFloatingPoint(type);
+ if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false;
+
+ analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr();
+ uint32_t add_op0 = inst->GetSingleWordInOperand(0);
+ Instruction* add_op0_inst = def_use_mgr->GetDef(add_op0);
+ if (add_op0_inst->opcode() != SpvOpFMul &&
+ add_op0_inst->opcode() != SpvOpIMul)
+ return false;
+ uint32_t add_op1 = inst->GetSingleWordInOperand(1);
+ Instruction* add_op1_inst = def_use_mgr->GetDef(add_op1);
+ if (add_op1_inst->opcode() != SpvOpFMul &&
+ add_op1_inst->opcode() != SpvOpIMul)
+ return false;
+
+ // Only perform this optimization if both of the muls only have one use.
+ // Otherwise this is a deoptimization in size and performance.
+ if (def_use_mgr->NumUses(add_op0_inst) > 1) return false;
+ if (def_use_mgr->NumUses(add_op1_inst) > 1) return false;
+
+ if (add_op0_inst->opcode() == SpvOpFMul &&
+ (!add_op0_inst->IsFloatingPointFoldingAllowed() ||
+ !add_op1_inst->IsFloatingPointFoldingAllowed()))
+ return false;
+
+ for (int i = 0; i < 2; i++) {
+ for (int j = 0; j < 2; j++) {
+ // Check if operand i in add_op0_inst matches operand j in add_op1_inst.
+ if (FactorAddMulsOpnds(add_op0_inst->GetSingleWordInOperand(i),
+ add_op0_inst->GetSingleWordInOperand(1 - i),
+ add_op1_inst->GetSingleWordInOperand(j),
+ add_op1_inst->GetSingleWordInOperand(1 - j),
+ inst))
+ return true;
+ }
+ }
+ return false;
+ };
+}
+
FoldingRule IntMultipleBy1() {
return [](IRContext*, Instruction* inst,
const std::vector<const analysis::Constant*>& constants) {
@@ -1407,20 +1519,6 @@ FoldingRule CompositeExtractFeedingConstruct() {
};
}
-// Folds an OpCompositeExtract instruction with no indexes into an OpCopyObject.
-bool ExtractWithNoIndexes(IRContext*, Instruction* inst,
- const std::vector<const analysis::Constant*>&) {
- assert(inst->opcode() == SpvOpCompositeExtract &&
- "Wrong opcode. Should be OpCompositeExtract.");
-
- if (inst->NumInOperands() > 1) {
- return false;
- }
-
- inst->SetOpcode(SpvOpCopyObject);
- return true;
-}
-
FoldingRule InsertFeedingExtract() {
return [](IRContext* context, Instruction* inst,
const std::vector<const analysis::Constant*>&) {
@@ -2227,7 +2325,6 @@ void FoldingRules::AddFoldingRules() {
// Take that into consideration.
rules_[SpvOpCompositeConstruct].push_back(CompositeExtractFeedingConstruct());
- rules_[SpvOpCompositeExtract].push_back(ExtractWithNoIndexes);
rules_[SpvOpCompositeExtract].push_back(InsertFeedingExtract());
rules_[SpvOpCompositeExtract].push_back(CompositeConstructFeedingExtract());
rules_[SpvOpCompositeExtract].push_back(VectorShuffleFeedingExtract());
@@ -2241,6 +2338,8 @@ void FoldingRules::AddFoldingRules() {
rules_[SpvOpFAdd].push_back(MergeAddNegateArithmetic());
rules_[SpvOpFAdd].push_back(MergeAddAddArithmetic());
rules_[SpvOpFAdd].push_back(MergeAddSubArithmetic());
+ rules_[SpvOpFAdd].push_back(MergeGenericAddSubArithmetic());
+ rules_[SpvOpFAdd].push_back(FactorAddMuls());
rules_[SpvOpFDiv].push_back(RedundantFDiv());
rules_[SpvOpFDiv].push_back(ReciprocalFDiv());
@@ -2266,6 +2365,8 @@ void FoldingRules::AddFoldingRules() {
rules_[SpvOpIAdd].push_back(MergeAddNegateArithmetic());
rules_[SpvOpIAdd].push_back(MergeAddAddArithmetic());
rules_[SpvOpIAdd].push_back(MergeAddSubArithmetic());
+ rules_[SpvOpIAdd].push_back(MergeGenericAddSubArithmetic());
+ rules_[SpvOpIAdd].push_back(FactorAddMuls());
rules_[SpvOpIMul].push_back(IntMultipleBy1());
rules_[SpvOpIMul].push_back(MergeMulMulArithmetic());
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp
index dd60e8c624c..e309d3a4e46 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp
@@ -160,7 +160,6 @@
namespace spvtools {
namespace opt {
-using opt::BasicBlock;
using opt::Instruction;
using opt::Operand;
using spvtools::MakeUnique;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.h
index 215cbf12bac..b21154e5c3c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.h
@@ -81,8 +81,8 @@ class GraphicsRobustAccessPass : public Pass {
// sign extension or zero extension. The new instruction is inserted
// immediately before |before_inst|, and is analyzed for definitions and uses.
// Returns the newly inserted instruction. Assumes the |value| is an integer
- // scalar of a narrower type than |bitwidth| bits.
- Instruction* WidenInteger(bool sign_extend, uint32_t bitwidth,
+ // scalar of a narrower type than |bit_width| bits.
+ Instruction* WidenInteger(bool sign_extend, uint32_t bit_width,
Instruction* value, Instruction* before_inst);
// Returns a new instruction that invokes the UClamp GLSL.std.450 extended
@@ -109,7 +109,8 @@ class GraphicsRobustAccessPass : public Pass {
// the module is modified. Returns a status code to indicate success
// or failure. If assumptions are not met, returns an error status code
// and emits a diagnostic.
- spv_result_t ClampCoordinateForImageTexelPointer(opt::Instruction* itp);
+ spv_result_t ClampCoordinateForImageTexelPointer(
+ opt::Instruction* image_texel_pointer);
// Gets the instruction that defines the given id.
opt::Instruction* GetDef(uint32_t id) {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.cpp
index 246cdbb4e61..2a3e7f06e9b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.cpp
@@ -325,29 +325,36 @@ void InstrumentPass::CloneSameBlockOps(
std::unordered_map<uint32_t, uint32_t>* same_blk_post,
std::unordered_map<uint32_t, Instruction*>* same_blk_pre,
BasicBlock* block_ptr) {
- (*inst)->ForEachInId(
- [&same_blk_post, &same_blk_pre, &block_ptr, this](uint32_t* iid) {
- const auto map_itr = (*same_blk_post).find(*iid);
- if (map_itr == (*same_blk_post).end()) {
- const auto map_itr2 = (*same_blk_pre).find(*iid);
- if (map_itr2 != (*same_blk_pre).end()) {
- // Clone pre-call same-block ops, map result id.
- const Instruction* in_inst = map_itr2->second;
- std::unique_ptr<Instruction> sb_inst(in_inst->Clone(context()));
- CloneSameBlockOps(&sb_inst, same_blk_post, same_blk_pre, block_ptr);
- const uint32_t rid = sb_inst->result_id();
- const uint32_t nid = this->TakeNextId();
- get_decoration_mgr()->CloneDecorations(rid, nid);
- sb_inst->SetResultId(nid);
- (*same_blk_post)[rid] = nid;
- *iid = nid;
- block_ptr->AddInstruction(std::move(sb_inst));
- }
- } else {
- // Reset same-block op operand.
- *iid = map_itr->second;
- }
- });
+ bool changed = false;
+ (*inst)->ForEachInId([&same_blk_post, &same_blk_pre, &block_ptr, &changed,
+ this](uint32_t* iid) {
+ const auto map_itr = (*same_blk_post).find(*iid);
+ if (map_itr == (*same_blk_post).end()) {
+ const auto map_itr2 = (*same_blk_pre).find(*iid);
+ if (map_itr2 != (*same_blk_pre).end()) {
+ // Clone pre-call same-block ops, map result id.
+ const Instruction* in_inst = map_itr2->second;
+ std::unique_ptr<Instruction> sb_inst(in_inst->Clone(context()));
+ const uint32_t rid = sb_inst->result_id();
+ const uint32_t nid = this->TakeNextId();
+ get_decoration_mgr()->CloneDecorations(rid, nid);
+ sb_inst->SetResultId(nid);
+ get_def_use_mgr()->AnalyzeInstDefUse(&*sb_inst);
+ (*same_blk_post)[rid] = nid;
+ *iid = nid;
+ changed = true;
+ CloneSameBlockOps(&sb_inst, same_blk_post, same_blk_pre, block_ptr);
+ block_ptr->AddInstruction(std::move(sb_inst));
+ }
+ } else {
+ // Reset same-block op operand if necessary
+ if (*iid != map_itr->second) {
+ *iid = map_itr->second;
+ changed = true;
+ }
+ }
+ });
+ if (changed) get_def_use_mgr()->AnalyzeInstUse(&**inst);
}
void InstrumentPass::UpdateSucceedingPhis(
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.cpp
index 1c747b7a3a6..d940180da0b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.cpp
@@ -94,6 +94,14 @@ void IRContext::InvalidateAnalyses(IRContext::Analysis analyses_to_invalidate) {
if (analyses_to_invalidate & kAnalysisTypes) {
analyses_to_invalidate |= kAnalysisConstants;
}
+
+ // The dominator analysis hold the psuedo entry and exit nodes from the CFG.
+ // Also if the CFG change the dominators many changed as well, so the
+ // dominator analysis should be invalidated as well.
+ if (analyses_to_invalidate & kAnalysisCFG) {
+ analyses_to_invalidate |= kAnalysisDominatorAnalysis;
+ }
+
if (analyses_to_invalidate & kAnalysisDefUse) {
def_use_mgr_.reset(nullptr);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/optimizer.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/optimizer.cpp
index 1e7df99170a..ece1abec3ec 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/optimizer.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/optimizer.cpp
@@ -560,20 +560,26 @@ bool Optimizer::Run(const uint32_t* original_binary,
return false;
}
- optimized_binary->clear();
- context->module()->ToBinary(optimized_binary, /* skip_nop = */ true);
-
#ifndef NDEBUG
if (status == opt::Pass::Status::SuccessWithoutChange) {
- auto changed = optimized_binary->size() != original_binary_size ||
- memcmp(optimized_binary->data(), original_binary,
- original_binary_size) != 0;
- assert(!changed &&
- "Binary unexpectedly changed despite optimizer saying there was no "
- "change");
+ std::vector<uint32_t> optimized_binary_with_nop;
+ context->module()->ToBinary(&optimized_binary_with_nop,
+ /* skip_nop = */ false);
+ assert(optimized_binary_with_nop.size() == original_binary_size &&
+ "Binary size unexpectedly changed despite the optimizer saying "
+ "there was no change");
+ assert(memcmp(optimized_binary_with_nop.data(), original_binary,
+ original_binary_size) == 0 &&
+ "Binary content unexpectedly changed despite the optimizer saying "
+ "there was no change");
}
#endif // !NDEBUG
+ // Note that |original_binary| and |optimized_binary| may share the same
+ // buffer and the below will invalidate |original_binary|.
+ optimized_binary->clear();
+ context->module()->ToBinary(optimized_binary, /* skip_nop = */ true);
+
return true;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.cpp
index 7b0887c5561..001f35437a0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.cpp
@@ -32,6 +32,18 @@ Pass::Status SimplificationPass::Process() {
return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange);
}
+void SimplificationPass::AddNewOperands(
+ Instruction* folded_inst, std::unordered_set<Instruction*>* inst_seen,
+ std::vector<Instruction*>* work_list) {
+ analysis::DefUseManager* def_use_mgr = get_def_use_mgr();
+ folded_inst->ForEachInId(
+ [&inst_seen, &def_use_mgr, &work_list](uint32_t* iid) {
+ Instruction* iid_inst = def_use_mgr->GetDef(*iid);
+ if (!inst_seen->insert(iid_inst).second) return;
+ work_list->push_back(iid_inst);
+ });
+}
+
bool SimplificationPass::SimplifyFunction(Function* function) {
bool modified = false;
// Phase 1: Traverse all instructions in dominance order.
@@ -44,13 +56,15 @@ bool SimplificationPass::SimplifyFunction(Function* function) {
std::unordered_set<Instruction*> process_phis;
std::unordered_set<Instruction*> inst_to_kill;
std::unordered_set<Instruction*> in_work_list;
+ std::unordered_set<Instruction*> inst_seen;
const InstructionFolder& folder = context()->get_instruction_folder();
cfg()->ForEachBlockInReversePostOrder(
function->entry().get(),
[&modified, &process_phis, &work_list, &in_work_list, &inst_to_kill,
- &folder, this](BasicBlock* bb) {
+ &folder, &inst_seen, this](BasicBlock* bb) {
for (Instruction* inst = &*bb->begin(); inst; inst = inst->NextNode()) {
+ inst_seen.insert(inst);
if (inst->opcode() == SpvOpPhi) {
process_phis.insert(inst);
}
@@ -70,6 +84,9 @@ bool SimplificationPass::SimplifyFunction(Function* function) {
work_list.push_back(use);
}
});
+
+ AddNewOperands(inst, &inst_seen, &work_list);
+
if (inst->opcode() == SpvOpCopyObject) {
context()->ReplaceAllUsesWithPredicate(
inst->result_id(), inst->GetSingleWordInOperand(0),
@@ -97,6 +114,7 @@ bool SimplificationPass::SimplifyFunction(Function* function) {
for (size_t i = 0; i < work_list.size(); ++i) {
Instruction* inst = work_list[i];
in_work_list.erase(inst);
+ inst_seen.insert(inst);
bool is_foldable_copy =
inst->opcode() == SpvOpCopyObject &&
@@ -114,6 +132,8 @@ bool SimplificationPass::SimplifyFunction(Function* function) {
}
});
+ AddNewOperands(inst, &inst_seen, &work_list);
+
if (inst->opcode() == SpvOpCopyObject) {
context()->ReplaceAllUsesWithPredicate(
inst->result_id(), inst->GetSingleWordInOperand(0),
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.h
index bcb88bfcd3f..149874b0944 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.h
@@ -42,6 +42,14 @@ class SimplificationPass : public Pass {
// instruction in |function| until nothing else in the function can be
// simplified.
bool SimplifyFunction(Function* function);
+
+ // FactorAddMul can create |folded_inst| Mul of new Add. If Mul, push any Add
+ // operand not in |seen_inst| into |worklist|. This is heavily restricted to
+ // improve compile time but can be expanded for future simplifications which
+ // simiarly create new operations.
+ void AddNewOperands(Instruction* folded_inst,
+ std::unordered_set<Instruction*>* inst_seen,
+ std::vector<Instruction*>* work_list);
};
} // namespace opt
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp
index d3494819430..166b8281f60 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp
@@ -409,6 +409,22 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) {
{static_cast<uint32_t>(
type->AsForwardPointer()->storage_class())}}});
break;
+ case Type::kCooperativeMatrixNV: {
+ auto coop_mat = type->AsCooperativeMatrixNV();
+ uint32_t const component_type =
+ GetTypeInstruction(coop_mat->component_type());
+ if (component_type == 0) {
+ return 0;
+ }
+ typeInst = MakeUnique<Instruction>(
+ context(), SpvOpTypeCooperativeMatrixNV, 0, id,
+ std::initializer_list<Operand>{
+ {SPV_OPERAND_TYPE_ID, {component_type}},
+ {SPV_OPERAND_TYPE_SCOPE_ID, {coop_mat->scope_id()}},
+ {SPV_OPERAND_TYPE_ID, {coop_mat->rows_id()}},
+ {SPV_OPERAND_TYPE_ID, {coop_mat->columns_id()}}});
+ break;
+ }
default:
assert(false && "Unexpected type");
break;
@@ -604,6 +620,14 @@ Type* TypeManager::RebuildType(const Type& type) {
}
break;
}
+ case Type::kCooperativeMatrixNV: {
+ const CooperativeMatrixNV* cm_type = type.AsCooperativeMatrixNV();
+ const Type* component_type = cm_type->component_type();
+ rebuilt_ty = MakeUnique<CooperativeMatrixNV>(
+ RebuildType(*component_type), cm_type->scope_id(), cm_type->rows_id(),
+ cm_type->columns_id());
+ break;
+ }
default:
assert(false && "Unhandled type");
return nullptr;
@@ -832,6 +856,12 @@ Type* TypeManager::RecordIfTypeDefinition(const Instruction& inst) {
case SpvOpTypeAccelerationStructureNV:
type = new AccelerationStructureNV();
break;
+ case SpvOpTypeCooperativeMatrixNV:
+ type = new CooperativeMatrixNV(GetType(inst.GetSingleWordInOperand(0)),
+ inst.GetSingleWordInOperand(1),
+ inst.GetSingleWordInOperand(2),
+ inst.GetSingleWordInOperand(3));
+ break;
default:
SPIRV_UNIMPLEMENTED(consumer_, "unhandled type");
break;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.cpp
index 4f7150fc3c6..17f8fe920fa 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.cpp
@@ -127,6 +127,7 @@ std::unique_ptr<Type> Type::Clone() const {
DeclareKindCase(PipeStorage);
DeclareKindCase(NamedBarrier);
DeclareKindCase(AccelerationStructureNV);
+ DeclareKindCase(CooperativeMatrixNV);
#undef DeclareKindCase
default:
assert(false && "Unhandled type");
@@ -171,6 +172,7 @@ bool Type::operator==(const Type& other) const {
DeclareKindCase(PipeStorage);
DeclareKindCase(NamedBarrier);
DeclareKindCase(AccelerationStructureNV);
+ DeclareKindCase(CooperativeMatrixNV);
#undef DeclareKindCase
default:
assert(false && "Unhandled type");
@@ -220,6 +222,7 @@ void Type::GetHashWords(std::vector<uint32_t>* words,
DeclareKindCase(PipeStorage);
DeclareKindCase(NamedBarrier);
DeclareKindCase(AccelerationStructureNV);
+ DeclareKindCase(CooperativeMatrixNV);
#undef DeclareKindCase
default:
assert(false && "Unhandled type");
@@ -654,6 +657,44 @@ void ForwardPointer::GetExtraHashWords(
if (pointer_) pointer_->GetHashWords(words, seen);
}
+CooperativeMatrixNV::CooperativeMatrixNV(const Type* type, const uint32_t scope,
+ const uint32_t rows,
+ const uint32_t columns)
+ : Type(kCooperativeMatrixNV),
+ component_type_(type),
+ scope_id_(scope),
+ rows_id_(rows),
+ columns_id_(columns) {
+ assert(type != nullptr);
+ assert(scope != 0);
+ assert(rows != 0);
+ assert(columns != 0);
+}
+
+std::string CooperativeMatrixNV::str() const {
+ std::ostringstream oss;
+ oss << "<" << component_type_->str() << ", " << scope_id_ << ", " << rows_id_
+ << ", " << columns_id_ << ">";
+ return oss.str();
+}
+
+void CooperativeMatrixNV::GetExtraHashWords(
+ std::vector<uint32_t>* words, std::unordered_set<const Type*>* pSet) const {
+ component_type_->GetHashWords(words, pSet);
+ words->push_back(scope_id_);
+ words->push_back(rows_id_);
+ words->push_back(columns_id_);
+}
+
+bool CooperativeMatrixNV::IsSameImpl(const Type* that,
+ IsSameCache* seen) const {
+ const CooperativeMatrixNV* mt = that->AsCooperativeMatrixNV();
+ if (!mt) return false;
+ return component_type_->IsSameImpl(mt->component_type_, seen) &&
+ scope_id_ == mt->scope_id_ && rows_id_ == mt->rows_id_ &&
+ columns_id_ == mt->columns_id_ && HasSameDecorations(that);
+}
+
} // namespace analysis
} // namespace opt
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.h
index 57920df962c..69071ea1776 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.h
@@ -58,6 +58,7 @@ class ForwardPointer;
class PipeStorage;
class NamedBarrier;
class AccelerationStructureNV;
+class CooperativeMatrixNV;
// Abstract class for a SPIR-V type. It has a bunch of As<sublcass>() methods,
// which is used as a way to probe the actual <subclass>.
@@ -93,6 +94,7 @@ class Type {
kPipeStorage,
kNamedBarrier,
kAccelerationStructureNV,
+ kCooperativeMatrixNV
};
Type(Kind k) : kind_(k) {}
@@ -196,6 +198,7 @@ class Type {
DeclareCastMethod(PipeStorage)
DeclareCastMethod(NamedBarrier)
DeclareCastMethod(AccelerationStructureNV)
+ DeclareCastMethod(CooperativeMatrixNV)
#undef DeclareCastMethod
protected:
@@ -597,6 +600,36 @@ class ForwardPointer : public Type {
const Pointer* pointer_;
};
+class CooperativeMatrixNV : public Type {
+ public:
+ CooperativeMatrixNV(const Type* type, const uint32_t scope,
+ const uint32_t rows, const uint32_t columns);
+ CooperativeMatrixNV(const CooperativeMatrixNV&) = default;
+
+ std::string str() const override;
+
+ CooperativeMatrixNV* AsCooperativeMatrixNV() override { return this; }
+ const CooperativeMatrixNV* AsCooperativeMatrixNV() const override {
+ return this;
+ }
+
+ void GetExtraHashWords(std::vector<uint32_t>*,
+ std::unordered_set<const Type*>*) const override;
+
+ const Type* component_type() const { return component_type_; }
+ uint32_t scope_id() const { return scope_id_; }
+ uint32_t rows_id() const { return rows_id_; }
+ uint32_t columns_id() const { return columns_id_; }
+
+ private:
+ bool IsSameImpl(const Type* that, IsSameCache*) const override;
+
+ const Type* component_type_;
+ const uint32_t scope_id_;
+ const uint32_t rows_id_;
+ const uint32_t columns_id_;
+};
+
#define DefineParameterlessType(type, name) \
class type : public Type { \
public: \
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/print.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/print.cpp
index f75e2d45735..1d9829dfcaa 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/print.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/print.cpp
@@ -15,7 +15,7 @@
#include "source/print.h"
#if defined(SPIRV_ANDROID) || defined(SPIRV_LINUX) || defined(SPIRV_MAC) || \
- defined(SPIRV_FREEBSD)
+ defined(SPIRV_IOS) || defined(SPIRV_FREEBSD) || defined(SPIRV_EMSCRIPTEN)
namespace spvtools {
clr::reset::operator const char*() { return "\x1b[0m"; }
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/CMakeLists.txt b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/CMakeLists.txt
index 35acf3fd44d..51e9b1d0ffd 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/CMakeLists.txt
@@ -29,8 +29,6 @@ set(SPIRV_TOOLS_REDUCE_SOURCES
remove_instruction_reduction_opportunity.h
remove_function_reduction_opportunity.h
remove_function_reduction_opportunity_finder.h
- remove_opname_instruction_reduction_opportunity_finder.h
- remove_relaxed_precision_decoration_opportunity_finder.h
remove_selection_reduction_opportunity.h
remove_selection_reduction_opportunity_finder.h
remove_unreferenced_instruction_reduction_opportunity_finder.h
@@ -57,11 +55,9 @@ set(SPIRV_TOOLS_REDUCE_SOURCES
remove_function_reduction_opportunity.cpp
remove_function_reduction_opportunity_finder.cpp
remove_instruction_reduction_opportunity.cpp
- remove_relaxed_precision_decoration_opportunity_finder.cpp
remove_selection_reduction_opportunity.cpp
remove_selection_reduction_opportunity_finder.cpp
remove_unreferenced_instruction_reduction_opportunity_finder.cpp
- remove_opname_instruction_reduction_opportunity_finder.cpp
structured_loop_to_selection_reduction_opportunity.cpp
structured_loop_to_selection_reduction_opportunity_finder.cpp
conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp
@@ -83,8 +79,6 @@ spvtools_default_compile_options(SPIRV-Tools-reduce)
target_include_directories(SPIRV-Tools-reduce
PUBLIC
$<BUILD_INTERFACE:${spirv-tools_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/include>
- PUBLIC
$<BUILD_INTERFACE:${SPIRV_HEADER_INCLUDE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${spirv-tools_BINARY_DIR}
@@ -102,5 +96,12 @@ if(ENABLE_SPIRV_TOOLS_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
- install(EXPORT SPIRV-Tools-reduceTargets DESTINATION lib/cmake)
+ export(EXPORT SPIRV-Tools-reduceTargets FILE SPIRV-Tools-reduceTarget.cmake)
+
+ spvtools_config_package_dir(SPIRV-Tools-reduce PACKAGE_DIR)
+ install(EXPORT SPIRV-Tools-reduceTargets FILE SPIRV-Tools-reduceTarget.cmake
+ DESTINATION ${PACKAGE_DIR})
+
+ spvtools_generate_config_file(SPIRV-Tools-reduce)
+ install(FILES ${CMAKE_BINARY_DIR}/SPIRV-Tools-reduceConfig.cmake DESTINATION ${PACKAGE_DIR})
endif(ENABLE_SPIRV_TOOLS_INSTALL)
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp
index 2feca4acc62..0bd93b9b41e 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp
@@ -73,7 +73,7 @@ ConditionalBranchToSimpleConditionalBranchOpportunityFinder::
result.push_back(
MakeUnique<
ConditionalBranchToSimpleConditionalBranchReductionOpportunity>(
- block.terminator(), redirect_to_true));
+ context, block.terminator(), redirect_to_true));
}
}
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.cpp
index 92c621e08fd..d744773bda0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.cpp
@@ -19,12 +19,15 @@
namespace spvtools {
namespace reduce {
+using opt::IRContext;
using opt::Instruction;
ConditionalBranchToSimpleConditionalBranchReductionOpportunity::
ConditionalBranchToSimpleConditionalBranchReductionOpportunity(
- Instruction* conditional_branch_instruction, bool redirect_to_true)
- : conditional_branch_instruction_(conditional_branch_instruction),
+ IRContext* context, Instruction* conditional_branch_instruction,
+ bool redirect_to_true)
+ : context_(context),
+ conditional_branch_instruction_(conditional_branch_instruction),
redirect_to_true_(redirect_to_true) {}
bool ConditionalBranchToSimpleConditionalBranchReductionOpportunity::
@@ -43,11 +46,24 @@ void ConditionalBranchToSimpleConditionalBranchReductionOpportunity::Apply() {
uint32_t operand_to_copy =
redirect_to_true_ ? kTrueBranchOperandIndex : kFalseBranchOperandIndex;
+ auto old_successor_block_id =
+ conditional_branch_instruction_->GetSingleWordInOperand(
+ operand_to_modify);
+
// Do the branch redirection.
conditional_branch_instruction_->SetInOperand(
operand_to_modify,
{conditional_branch_instruction_->GetSingleWordInOperand(
operand_to_copy)});
+
+ // The old successor block may have phi instructions; these will need to
+ // respect the change in edges.
+ AdaptPhiInstructionsForRemovedEdge(
+ context_->get_instr_block(conditional_branch_instruction_)->id(),
+ context_->cfg()->block(old_successor_block_id));
+
+ // We have changed the CFG.
+ context_->InvalidateAnalysesExceptFor(IRContext::Analysis::kAnalysisNone);
}
} // namespace reduce
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.h
index 421906b4476..1f9cb6d18ce 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.h
@@ -31,7 +31,8 @@ class ConditionalBranchToSimpleConditionalBranchReductionOpportunity
// to the true target; otherwise, the true target will be changed to also
// point to the false target.
explicit ConditionalBranchToSimpleConditionalBranchReductionOpportunity(
- opt::Instruction* conditional_branch_instruction, bool redirect_to_true);
+ opt::IRContext* context, opt::Instruction* conditional_branch_instruction,
+ bool redirect_to_true);
bool PreconditionHolds() override;
@@ -39,6 +40,7 @@ class ConditionalBranchToSimpleConditionalBranchReductionOpportunity
void Apply() override;
private:
+ opt::IRContext* context_;
opt::Instruction* conditional_branch_instruction_;
// If true, the false target will be changed to point to the true target;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reducer.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reducer.cpp
index ebb5d471ed2..bda41ce9459 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reducer.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reducer.cpp
@@ -24,8 +24,6 @@
#include "source/reduce/operand_to_undef_reduction_opportunity_finder.h"
#include "source/reduce/remove_block_reduction_opportunity_finder.h"
#include "source/reduce/remove_function_reduction_opportunity_finder.h"
-#include "source/reduce/remove_opname_instruction_reduction_opportunity_finder.h"
-#include "source/reduce/remove_relaxed_precision_decoration_opportunity_finder.h"
#include "source/reduce/remove_selection_reduction_opportunity_finder.h"
#include "source/reduce/remove_unreferenced_instruction_reduction_opportunity_finder.h"
#include "source/reduce/simple_conditional_branch_to_branch_opportunity_finder.h"
@@ -35,41 +33,32 @@
namespace spvtools {
namespace reduce {
-struct Reducer::Impl {
- explicit Impl(spv_target_env env) : target_env(env) {}
-
- bool ReachedStepLimit(uint32_t current_step,
- spv_const_reducer_options options);
-
- const spv_target_env target_env; // Target environment.
- MessageConsumer consumer; // Message consumer.
- InterestingnessFunction interestingness_function;
- std::vector<std::unique_ptr<ReductionPass>> passes;
-};
-
-Reducer::Reducer(spv_target_env env) : impl_(MakeUnique<Impl>(env)) {}
+Reducer::Reducer(spv_target_env target_env) : target_env_(target_env) {}
Reducer::~Reducer() = default;
void Reducer::SetMessageConsumer(MessageConsumer c) {
- for (auto& pass : impl_->passes) {
+ for (auto& pass : passes_) {
pass->SetMessageConsumer(c);
}
- impl_->consumer = std::move(c);
+ for (auto& pass : cleanup_passes_) {
+ pass->SetMessageConsumer(c);
+ }
+ consumer_ = std::move(c);
}
void Reducer::SetInterestingnessFunction(
Reducer::InterestingnessFunction interestingness_function) {
- impl_->interestingness_function = std::move(interestingness_function);
+ interestingness_function_ = std::move(interestingness_function);
}
Reducer::ReductionResultStatus Reducer::Run(
std::vector<uint32_t>&& binary_in, std::vector<uint32_t>* binary_out,
spv_const_reducer_options options,
- spv_validator_options validator_options) const {
+ spv_validator_options validator_options) {
std::vector<uint32_t> current_binary(std::move(binary_in));
- spvtools::SpirvTools tools(impl_->target_env);
+ spvtools::SpirvTools tools(target_env_);
assert(tools.IsValid() && "Failed to create SPIRV-Tools interface");
// Keeps track of how many reduction attempts have been tried. Reduction
@@ -79,32 +68,108 @@ Reducer::ReductionResultStatus Reducer::Run(
// Initial state should be valid.
if (!tools.Validate(&current_binary[0], current_binary.size(),
validator_options)) {
- impl_->consumer(SPV_MSG_INFO, nullptr, {},
- "Initial binary is invalid; stopping.");
+ consumer_(SPV_MSG_INFO, nullptr, {},
+ "Initial binary is invalid; stopping.");
return Reducer::ReductionResultStatus::kInitialStateInvalid;
}
// Initial state should be interesting.
- if (!impl_->interestingness_function(current_binary, reductions_applied)) {
- impl_->consumer(SPV_MSG_INFO, nullptr, {},
- "Initial state was not interesting; stopping.");
+ if (!interestingness_function_(current_binary, reductions_applied)) {
+ consumer_(SPV_MSG_INFO, nullptr, {},
+ "Initial state was not interesting; stopping.");
return Reducer::ReductionResultStatus::kInitialStateNotInteresting;
}
+ Reducer::ReductionResultStatus result =
+ RunPasses(&passes_, options, validator_options, tools, &current_binary,
+ &reductions_applied);
+
+ if (result == Reducer::ReductionResultStatus::kComplete) {
+ // Cleanup passes.
+ result = RunPasses(&cleanup_passes_, options, validator_options, tools,
+ &current_binary, &reductions_applied);
+ }
+
+ if (result == Reducer::ReductionResultStatus::kComplete) {
+ consumer_(SPV_MSG_INFO, nullptr, {}, "No more to reduce; stopping.");
+ }
+
+ // Even if the reduction has failed by this point (e.g. due to producing an
+ // invalid binary), we still update the output binary for better debugging.
+ *binary_out = std::move(current_binary);
+
+ return result;
+}
+
+void Reducer::AddDefaultReductionPasses() {
+ AddReductionPass(
+ spvtools::MakeUnique<
+ RemoveUnreferencedInstructionReductionOpportunityFinder>(false));
+ AddReductionPass(
+ spvtools::MakeUnique<OperandToUndefReductionOpportunityFinder>());
+ AddReductionPass(
+ spvtools::MakeUnique<OperandToConstReductionOpportunityFinder>());
+ AddReductionPass(
+ spvtools::MakeUnique<OperandToDominatingIdReductionOpportunityFinder>());
+ AddReductionPass(spvtools::MakeUnique<
+ StructuredLoopToSelectionReductionOpportunityFinder>());
+ AddReductionPass(
+ spvtools::MakeUnique<MergeBlocksReductionOpportunityFinder>());
+ AddReductionPass(
+ spvtools::MakeUnique<RemoveFunctionReductionOpportunityFinder>());
+ AddReductionPass(
+ spvtools::MakeUnique<RemoveBlockReductionOpportunityFinder>());
+ AddReductionPass(
+ spvtools::MakeUnique<RemoveSelectionReductionOpportunityFinder>());
+ AddReductionPass(
+ spvtools::MakeUnique<
+ ConditionalBranchToSimpleConditionalBranchOpportunityFinder>());
+ AddReductionPass(
+ spvtools::MakeUnique<SimpleConditionalBranchToBranchOpportunityFinder>());
+
+ // Cleanup passes.
+
+ AddCleanupReductionPass(
+ spvtools::MakeUnique<
+ RemoveUnreferencedInstructionReductionOpportunityFinder>(true));
+}
+
+void Reducer::AddReductionPass(
+ std::unique_ptr<ReductionOpportunityFinder>&& finder) {
+ passes_.push_back(
+ spvtools::MakeUnique<ReductionPass>(target_env_, std::move(finder)));
+}
+
+void Reducer::AddCleanupReductionPass(
+ std::unique_ptr<ReductionOpportunityFinder>&& finder) {
+ cleanup_passes_.push_back(
+ spvtools::MakeUnique<ReductionPass>(target_env_, std::move(finder)));
+}
+
+bool Reducer::ReachedStepLimit(uint32_t current_step,
+ spv_const_reducer_options options) {
+ return current_step >= options->step_limit;
+}
+
+Reducer::ReductionResultStatus Reducer::RunPasses(
+ std::vector<std::unique_ptr<ReductionPass>>* passes,
+ spv_const_reducer_options options, spv_validator_options validator_options,
+ const SpirvTools& tools, std::vector<uint32_t>* current_binary,
+ uint32_t* const reductions_applied) {
// Determines whether, on completing one round of reduction passes, it is
// worthwhile trying a further round.
bool another_round_worthwhile = true;
// Apply round after round of reduction passes until we hit the reduction
// step limit, or deem that another round is not going to be worthwhile.
- while (!impl_->ReachedStepLimit(reductions_applied, options) &&
+ while (!ReachedStepLimit(*reductions_applied, options) &&
another_round_worthwhile) {
// At the start of a round of reduction passes, assume another round will
// not be worthwhile unless we find evidence to the contrary.
another_round_worthwhile = false;
- // Iterate through the available passes
- for (auto& pass : impl_->passes) {
+ // Iterate through the available passes.
+ for (auto& pass : *passes) {
// If this pass hasn't reached its minimum granularity then it's
// worth eventually doing another round of reductions, in order to
// try this pass at a finer granularity.
@@ -112,14 +177,14 @@ Reducer::ReductionResultStatus Reducer::Run(
// Keep applying this pass at its current granularity until it stops
// working or we hit the reduction step limit.
- impl_->consumer(SPV_MSG_INFO, nullptr, {},
- ("Trying pass " + pass->GetName() + ".").c_str());
+ consumer_(SPV_MSG_INFO, nullptr, {},
+ ("Trying pass " + pass->GetName() + ".").c_str());
do {
- auto maybe_result = pass->TryApplyReduction(current_binary);
+ auto maybe_result = pass->TryApplyReduction(*current_binary);
if (maybe_result.empty()) {
// For this round, the pass has no more opportunities (chunks) to
// apply, so move on to the next pass.
- impl_->consumer(
+ consumer_(
SPV_MSG_INFO, nullptr, {},
("Pass " + pass->GetName() + " did not make a reduction step.")
.c_str());
@@ -127,91 +192,50 @@ Reducer::ReductionResultStatus Reducer::Run(
}
bool interesting = false;
std::stringstream stringstream;
- reductions_applied++;
+ (*reductions_applied)++;
stringstream << "Pass " << pass->GetName() << " made reduction step "
- << reductions_applied << ".";
- impl_->consumer(SPV_MSG_INFO, nullptr, {},
- (stringstream.str().c_str()));
+ << *reductions_applied << ".";
+ consumer_(SPV_MSG_INFO, nullptr, {}, (stringstream.str().c_str()));
if (!tools.Validate(&maybe_result[0], maybe_result.size(),
validator_options)) {
// The reduction step went wrong and an invalid binary was produced.
// By design, this shouldn't happen; this is a safeguard to stop an
// invalid binary from being regarded as interesting.
- impl_->consumer(SPV_MSG_INFO, nullptr, {},
- "Reduction step produced an invalid binary.");
+ consumer_(SPV_MSG_INFO, nullptr, {},
+ "Reduction step produced an invalid binary.");
if (options->fail_on_validation_error) {
+ // In this mode, we fail, so we update the current binary so it is
+ // output for debugging.
+ *current_binary = std::move(maybe_result);
return Reducer::ReductionResultStatus::kStateInvalid;
}
- } else if (impl_->interestingness_function(maybe_result,
- reductions_applied)) {
+ } else if (interestingness_function_(maybe_result,
+ *reductions_applied)) {
// Success! The binary produced by this reduction step is
// interesting, so make it the binary of interest henceforth, and
// note that it's worth doing another round of reduction passes.
- impl_->consumer(SPV_MSG_INFO, nullptr, {},
- "Reduction step succeeded.");
- current_binary = std::move(maybe_result);
+ consumer_(SPV_MSG_INFO, nullptr, {}, "Reduction step succeeded.");
+ *current_binary = std::move(maybe_result);
interesting = true;
another_round_worthwhile = true;
}
// We must call this before the next call to TryApplyReduction.
pass->NotifyInteresting(interesting);
// Bail out if the reduction step limit has been reached.
- } while (!impl_->ReachedStepLimit(reductions_applied, options));
+ } while (!ReachedStepLimit(*reductions_applied, options));
}
}
- *binary_out = std::move(current_binary);
-
// Report whether reduction completed, or bailed out early due to reaching
// the step limit.
- if (impl_->ReachedStepLimit(reductions_applied, options)) {
- impl_->consumer(SPV_MSG_INFO, nullptr, {},
- "Reached reduction step limit; stopping.");
+ if (ReachedStepLimit(*reductions_applied, options)) {
+ consumer_(SPV_MSG_INFO, nullptr, {},
+ "Reached reduction step limit; stopping.");
return Reducer::ReductionResultStatus::kReachedStepLimit;
}
- impl_->consumer(SPV_MSG_INFO, nullptr, {}, "No more to reduce; stopping.");
- return Reducer::ReductionResultStatus::kComplete;
-}
-void Reducer::AddDefaultReductionPasses() {
- AddReductionPass(spvtools::MakeUnique<
- RemoveOpNameInstructionReductionOpportunityFinder>());
- AddReductionPass(spvtools::MakeUnique<
- RemoveRelaxedPrecisionDecorationOpportunityFinder>());
- AddReductionPass(
- spvtools::MakeUnique<OperandToUndefReductionOpportunityFinder>());
- AddReductionPass(
- spvtools::MakeUnique<OperandToConstReductionOpportunityFinder>());
- AddReductionPass(
- spvtools::MakeUnique<OperandToDominatingIdReductionOpportunityFinder>());
- AddReductionPass(spvtools::MakeUnique<
- RemoveUnreferencedInstructionReductionOpportunityFinder>());
- AddReductionPass(spvtools::MakeUnique<
- StructuredLoopToSelectionReductionOpportunityFinder>());
- AddReductionPass(
- spvtools::MakeUnique<MergeBlocksReductionOpportunityFinder>());
- AddReductionPass(
- spvtools::MakeUnique<RemoveFunctionReductionOpportunityFinder>());
- AddReductionPass(
- spvtools::MakeUnique<RemoveBlockReductionOpportunityFinder>());
- AddReductionPass(
- spvtools::MakeUnique<RemoveSelectionReductionOpportunityFinder>());
- AddReductionPass(
- spvtools::MakeUnique<
- ConditionalBranchToSimpleConditionalBranchOpportunityFinder>());
- AddReductionPass(
- spvtools::MakeUnique<SimpleConditionalBranchToBranchOpportunityFinder>());
-}
-
-void Reducer::AddReductionPass(
- std::unique_ptr<ReductionOpportunityFinder>&& finder) {
- impl_->passes.push_back(spvtools::MakeUnique<ReductionPass>(
- impl_->target_env, std::move(finder)));
-}
-
-bool Reducer::Impl::ReachedStepLimit(uint32_t current_step,
- spv_const_reducer_options options) {
- return current_step >= options->step_limit;
+ // The passes completed successfully, although we may still run more passes.
+ return Reducer::ReductionResultStatus::kComplete;
}
} // namespace reduce
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reducer.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reducer.h
index a9b28c3817f..864ce757097 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reducer.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reducer.h
@@ -50,7 +50,7 @@ class Reducer {
using InterestingnessFunction =
std::function<bool(const std::vector<uint32_t>&, uint32_t)>;
- // Constructs an instance with the given target |env|, which is used to
+ // Constructs an instance with the given target |target_env|, which is used to
// decode the binary to be reduced later.
//
// The constructed instance will have an empty message consumer, which just
@@ -59,7 +59,7 @@ class Reducer {
//
// The constructed instance also needs to have an interestingness function
// set and some reduction passes added to it in order to be useful.
- explicit Reducer(spv_target_env env);
+ explicit Reducer(spv_target_env target_env);
// Disables copy/move constructor/assignment operations.
Reducer(const Reducer&) = delete;
@@ -86,17 +86,34 @@ class Reducer {
// that will be iterated over.
void AddReductionPass(std::unique_ptr<ReductionOpportunityFinder>&& finder);
+ // Adds a cleanup reduction pass based on the given finder to the sequence of
+ // passes that will run after other passes.
+ void AddCleanupReductionPass(
+ std::unique_ptr<ReductionOpportunityFinder>&& finder);
+
// Reduces the given SPIR-V module |binary_out|.
// The reduced binary ends up in |binary_out|.
// A status is returned.
ReductionResultStatus Run(std::vector<uint32_t>&& binary_in,
std::vector<uint32_t>* binary_out,
spv_const_reducer_options options,
- spv_validator_options validator_options) const;
+ spv_validator_options validator_options);
private:
- struct Impl; // Opaque struct for holding internal data.
- std::unique_ptr<Impl> impl_; // Unique pointer to internal data.
+ static bool ReachedStepLimit(uint32_t current_step,
+ spv_const_reducer_options options);
+
+ ReductionResultStatus RunPasses(
+ std::vector<std::unique_ptr<ReductionPass>>* passes,
+ spv_const_reducer_options options,
+ spv_validator_options validator_options, const SpirvTools& tools,
+ std::vector<uint32_t>* current_binary, uint32_t* reductions_applied);
+
+ const spv_target_env target_env_;
+ MessageConsumer consumer_;
+ InterestingnessFunction interestingness_function_;
+ std::vector<std::unique_ptr<ReductionPass>> passes_;
+ std::vector<std::unique_ptr<ReductionPass>> cleanup_passes_;
};
} // namespace reduce
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reduction_util.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reduction_util.cpp
index 2b2b7e610f5..6f128dcb3af 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reduction_util.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reduction_util.cpp
@@ -44,5 +44,22 @@ uint32_t FindOrCreateGlobalUndef(IRContext* context, uint32_t type_id) {
return undef_id;
}
+void AdaptPhiInstructionsForRemovedEdge(uint32_t from_id,
+ opt::BasicBlock* to_block) {
+ to_block->ForEachPhiInst([&from_id](Instruction* phi_inst) {
+ Instruction::OperandList new_in_operands;
+ // Go through the OpPhi's input operands in (variable, parent) pairs.
+ for (uint32_t index = 0; index < phi_inst->NumInOperands(); index += 2) {
+ // Keep all pairs where the parent is not the block from which the edge
+ // is being removed.
+ if (phi_inst->GetInOperand(index + 1).words[0] != from_id) {
+ new_in_operands.push_back(phi_inst->GetInOperand(index));
+ new_in_operands.push_back(phi_inst->GetInOperand(index + 1));
+ }
+ }
+ phi_inst->SetInOperands(std::move(new_in_operands));
+ });
+}
+
} // namespace reduce
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reduction_util.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reduction_util.h
index b8ffb6e4676..7e7e153ab15 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reduction_util.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/reduction_util.h
@@ -30,6 +30,11 @@ extern const uint32_t kFalseBranchOperandIndex;
// adding one if it does not exist.
uint32_t FindOrCreateGlobalUndef(opt::IRContext* context, uint32_t type_id);
+// Removes any components of |to_block|'s phi instructions relating to
+// |from_id|.
+void AdaptPhiInstructionsForRemovedEdge(uint32_t from_id,
+ opt::BasicBlock* to_block);
+
} // namespace reduce
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_opname_instruction_reduction_opportunity_finder.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_opname_instruction_reduction_opportunity_finder.cpp
deleted file mode 100644
index f687d716fc9..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_opname_instruction_reduction_opportunity_finder.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2018 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "source/reduce/remove_opname_instruction_reduction_opportunity_finder.h"
-
-#include "source/opcode.h"
-#include "source/opt/instruction.h"
-#include "source/reduce/remove_instruction_reduction_opportunity.h"
-
-namespace spvtools {
-namespace reduce {
-
-using opt::IRContext;
-
-std::vector<std::unique_ptr<ReductionOpportunity>>
-RemoveOpNameInstructionReductionOpportunityFinder::GetAvailableOpportunities(
- IRContext* context) const {
- std::vector<std::unique_ptr<ReductionOpportunity>> result;
-
- for (auto& inst : context->module()->debugs2()) {
- if (inst.opcode() == SpvOpName || inst.opcode() == SpvOpMemberName) {
- result.push_back(
- MakeUnique<RemoveInstructionReductionOpportunity>(&inst));
- }
- }
- return result;
-}
-
-std::string RemoveOpNameInstructionReductionOpportunityFinder::GetName() const {
- return "RemoveOpNameInstructionReductionOpportunityFinder";
-}
-
-} // namespace reduce
-} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_opname_instruction_reduction_opportunity_finder.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_opname_instruction_reduction_opportunity_finder.h
deleted file mode 100644
index 8b9fd6f0258..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_opname_instruction_reduction_opportunity_finder.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2018 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef SOURCE_REDUCE_REMOVE_OPNAME_INSTRUCTION_REDUCTION_OPPORTUNITY_FINDER_H_
-#define SOURCE_REDUCE_REMOVE_OPNAME_INSTRUCTION_REDUCTION_OPPORTUNITY_FINDER_H_
-
-#include "source/reduce/reduction_opportunity_finder.h"
-
-namespace spvtools {
-namespace reduce {
-
-// A finder for opportunities to remove OpName instructions. As well as making
-// the module smaller, removing an OpName instruction may create opportunities
-// for subsequently removing the instructions that create the ids to which the
-// OpName applies.
-class RemoveOpNameInstructionReductionOpportunityFinder
- : public ReductionOpportunityFinder {
- public:
- RemoveOpNameInstructionReductionOpportunityFinder() = default;
-
- ~RemoveOpNameInstructionReductionOpportunityFinder() override = default;
-
- std::string GetName() const final;
-
- std::vector<std::unique_ptr<ReductionOpportunity>> GetAvailableOpportunities(
- opt::IRContext* context) const final;
-
- private:
-};
-
-} // namespace reduce
-} // namespace spvtools
-
-#endif // SOURCE_REDUCE_REMOVE_OPNAME_INSTRUCTION_REDUCTION_OPPORTUNITY_FINDER_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_relaxed_precision_decoration_opportunity_finder.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_relaxed_precision_decoration_opportunity_finder.cpp
deleted file mode 100644
index 352cefb68bb..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_relaxed_precision_decoration_opportunity_finder.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2018 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "source/reduce/remove_relaxed_precision_decoration_opportunity_finder.h"
-
-#include "source/reduce/remove_instruction_reduction_opportunity.h"
-
-namespace spvtools {
-namespace reduce {
-
-std::vector<std::unique_ptr<ReductionOpportunity>>
-RemoveRelaxedPrecisionDecorationOpportunityFinder::GetAvailableOpportunities(
- opt::IRContext* context) const {
- std::vector<std::unique_ptr<ReductionOpportunity>> result;
-
- // Consider all annotation instructions
- for (auto& inst : context->module()->annotations()) {
- // We are interested in removing instructions of the form:
- // SpvOpDecorate %id RelaxedPrecision
- // and
- // SpvOpMemberDecorate %id member RelaxedPrecision
- if ((inst.opcode() == SpvOpDecorate &&
- inst.GetSingleWordInOperand(1) == SpvDecorationRelaxedPrecision) ||
- (inst.opcode() == SpvOpMemberDecorate &&
- inst.GetSingleWordInOperand(2) == SpvDecorationRelaxedPrecision)) {
- result.push_back(
- MakeUnique<RemoveInstructionReductionOpportunity>(&inst));
- }
- }
- return result;
-}
-
-std::string RemoveRelaxedPrecisionDecorationOpportunityFinder::GetName() const {
- return "RemoveRelaxedPrecisionDecorationOpportunityFinder";
-}
-
-} // namespace reduce
-} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unreferenced_instruction_reduction_opportunity_finder.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unreferenced_instruction_reduction_opportunity_finder.cpp
index dabee50cd4f..da61c8dba66 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unreferenced_instruction_reduction_opportunity_finder.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unreferenced_instruction_reduction_opportunity_finder.cpp
@@ -21,28 +21,109 @@
namespace spvtools {
namespace reduce {
+RemoveUnreferencedInstructionReductionOpportunityFinder::
+ RemoveUnreferencedInstructionReductionOpportunityFinder(
+ bool remove_constants_and_undefs)
+ : remove_constants_and_undefs_(remove_constants_and_undefs) {}
+
std::vector<std::unique_ptr<ReductionOpportunity>>
RemoveUnreferencedInstructionReductionOpportunityFinder::
GetAvailableOpportunities(opt::IRContext* context) const {
std::vector<std::unique_ptr<ReductionOpportunity>> result;
+ for (auto& inst : context->module()->debugs1()) {
+ if (context->get_def_use_mgr()->NumUses(&inst) > 0) {
+ continue;
+ }
+ result.push_back(MakeUnique<RemoveInstructionReductionOpportunity>(&inst));
+ }
+
+ for (auto& inst : context->module()->debugs2()) {
+ if (context->get_def_use_mgr()->NumUses(&inst) > 0) {
+ continue;
+ }
+ result.push_back(MakeUnique<RemoveInstructionReductionOpportunity>(&inst));
+ }
+
+ for (auto& inst : context->module()->debugs3()) {
+ if (context->get_def_use_mgr()->NumUses(&inst) > 0) {
+ continue;
+ }
+ result.push_back(MakeUnique<RemoveInstructionReductionOpportunity>(&inst));
+ }
+
+ for (auto& inst : context->module()->types_values()) {
+ if (context->get_def_use_mgr()->NumUsers(&inst) > 0) {
+ continue;
+ }
+ if (!remove_constants_and_undefs_ &&
+ spvOpcodeIsConstantOrUndef(inst.opcode())) {
+ continue;
+ }
+ result.push_back(MakeUnique<RemoveInstructionReductionOpportunity>(&inst));
+ }
+
+ for (auto& inst : context->module()->annotations()) {
+ if (context->get_def_use_mgr()->NumUsers(&inst) > 0) {
+ continue;
+ }
+
+ uint32_t decoration = SpvDecorationMax;
+ switch (inst.opcode()) {
+ case SpvOpDecorate:
+ case SpvOpDecorateId:
+ case SpvOpDecorateString:
+ decoration = inst.GetSingleWordInOperand(1u);
+ break;
+ case SpvOpMemberDecorate:
+ case SpvOpMemberDecorateString:
+ decoration = inst.GetSingleWordInOperand(2u);
+ break;
+ default:
+ break;
+ }
+
+ // We conservatively only remove specific decorations that we believe will
+ // not change the shader interface, will not make the shader invalid, will
+ // actually be found in practice, etc.
+
+ switch (decoration) {
+ case SpvDecorationRelaxedPrecision:
+ case SpvDecorationNoSignedWrap:
+ case SpvDecorationNoContraction:
+ case SpvDecorationNoUnsignedWrap:
+ case SpvDecorationUserSemantic:
+ break;
+ default:
+ // Give up.
+ continue;
+ }
+
+ result.push_back(MakeUnique<RemoveInstructionReductionOpportunity>(&inst));
+ }
+
for (auto& function : *context->module()) {
for (auto& block : function) {
for (auto& inst : block) {
if (context->get_def_use_mgr()->NumUses(&inst) > 0) {
continue;
}
+ if (!remove_constants_and_undefs_ &&
+ spvOpcodeIsConstantOrUndef(inst.opcode())) {
+ continue;
+ }
if (spvOpcodeIsBlockTerminator(inst.opcode()) ||
inst.opcode() == SpvOpSelectionMerge ||
inst.opcode() == SpvOpLoopMerge) {
- // In this reduction pass we do not want to affect static control
- // flow.
+ // In this reduction pass we do not want to affect static
+ // control flow.
continue;
}
- // Given that we're in a block, we should only get here if the
- // instruction is not directly related to control flow; i.e., it's
- // some straightforward instruction with an unused result, like an
- // arithmetic operation or function call.
+ // Given that we're in a block, we should only get here if
+ // the instruction is not directly related to control flow;
+ // i.e., it's some straightforward instruction with an
+ // unused result, like an arithmetic operation or function
+ // call.
result.push_back(
MakeUnique<RemoveInstructionReductionOpportunity>(&inst));
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unreferenced_instruction_reduction_opportunity_finder.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unreferenced_instruction_reduction_opportunity_finder.h
index 30f460bc1e8..bc4f137f130 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unreferenced_instruction_reduction_opportunity_finder.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unreferenced_instruction_reduction_opportunity_finder.h
@@ -28,7 +28,8 @@ namespace reduce {
class RemoveUnreferencedInstructionReductionOpportunityFinder
: public ReductionOpportunityFinder {
public:
- RemoveUnreferencedInstructionReductionOpportunityFinder() = default;
+ explicit RemoveUnreferencedInstructionReductionOpportunityFinder(
+ bool remove_constants_and_undefs);
~RemoveUnreferencedInstructionReductionOpportunityFinder() override = default;
@@ -38,6 +39,7 @@ class RemoveUnreferencedInstructionReductionOpportunityFinder
opt::IRContext* context) const final;
private:
+ bool remove_constants_and_undefs_;
};
} // namespace reduce
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp
index afc1298dbcc..88ea38e7faa 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.cpp
@@ -168,23 +168,6 @@ void StructuredLoopToSelectionReductionOpportunity::RedirectEdge(
}
void StructuredLoopToSelectionReductionOpportunity::
- AdaptPhiInstructionsForRemovedEdge(uint32_t from_id, BasicBlock* to_block) {
- to_block->ForEachPhiInst([&from_id](Instruction* phi_inst) {
- Instruction::OperandList new_in_operands;
- // Go through the OpPhi's input operands in (variable, parent) pairs.
- for (uint32_t index = 0; index < phi_inst->NumInOperands(); index += 2) {
- // Keep all pairs where the parent is not the block from which the edge
- // is being removed.
- if (phi_inst->GetInOperand(index + 1).words[0] != from_id) {
- new_in_operands.push_back(phi_inst->GetInOperand(index));
- new_in_operands.push_back(phi_inst->GetInOperand(index + 1));
- }
- }
- phi_inst->SetInOperands(std::move(new_in_operands));
- });
-}
-
-void StructuredLoopToSelectionReductionOpportunity::
AdaptPhiInstructionsForAddedEdge(uint32_t from_id, BasicBlock* to_block) {
to_block->ForEachPhiInst([this, &from_id](Instruction* phi_inst) {
// Add to the phi operand an (undef, from_id) pair to reflect the added
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.h
index f6c065b872f..564811f1024 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_loop_to_selection_reduction_opportunity.h
@@ -62,11 +62,6 @@ class StructuredLoopToSelectionReductionOpportunity
void RedirectEdge(uint32_t source_id, uint32_t original_target_id,
uint32_t new_target_id);
- // Removes any components of |to_block|'s phi instructions relating to
- // |from_id|.
- void AdaptPhiInstructionsForRemovedEdge(uint32_t from_id,
- opt::BasicBlock* to_block);
-
// Adds components to |to_block|'s phi instructions to account for a new
// incoming edge from |from_id|.
void AdaptPhiInstructionsForAddedEdge(uint32_t from_id,
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/text.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/text.cpp
index 5b51845c74c..d88d4f7f6d2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/text.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/text.cpp
@@ -810,7 +810,8 @@ spv_result_t spvTextToBinaryWithOptions(const spv_const_context context,
}
void spvTextDestroy(spv_text text) {
- if (!text) return;
- delete[] text->str;
- delete text;
+ if (text) {
+ if (text->str) delete[] text->str;
+ delete text;
+ }
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/bitutils.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/bitutils.h
index 17d61df90ab..9ced2f9621c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/bitutils.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/bitutils.h
@@ -15,8 +15,10 @@
#ifndef SOURCE_UTIL_BITUTILS_H_
#define SOURCE_UTIL_BITUTILS_H_
+#include <cassert>
#include <cstdint>
#include <cstring>
+#include <type_traits>
namespace spvtools {
namespace utils {
@@ -31,6 +33,14 @@ Dest BitwiseCast(Src source) {
return dest;
}
+// Calculates the bit width of the integer type |T|.
+template <typename T>
+struct IntegerBitWidth {
+ static_assert(std::is_integral<T>::value, "Integer type required");
+ static const size_t kBitsPerByte = 8;
+ static const size_t get = sizeof(T) * kBitsPerByte;
+};
+
// SetBits<T, First, Num> returns an integer of type <T> with bits set
// for position <First> through <First + Num - 1>, counting from the least
// significant bit. In particular when Num == 0, no positions are set to 1.
@@ -38,7 +48,7 @@ Dest BitwiseCast(Src source) {
// a bit that will not fit in the underlying type is set.
template <typename T, size_t First = 0, size_t Num = 0>
struct SetBits {
- static_assert(First < sizeof(T) * 8,
+ static_assert(First < IntegerBitWidth<T>::get,
"Tried to set a bit that is shifted too far.");
const static T get = (T(1) << First) | SetBits<T, First + 1, Num - 1>::get;
};
@@ -49,6 +59,11 @@ struct SetBits<T, Last, 0> {
};
// This is all compile-time so we can put our tests right here.
+static_assert(IntegerBitWidth<uint32_t>::get == 32, "IntegerBitWidth mismatch");
+static_assert(IntegerBitWidth<int32_t>::get == 32, "IntegerBitWidth mismatch");
+static_assert(IntegerBitWidth<uint64_t>::get == 64, "IntegerBitWidth mismatch");
+static_assert(IntegerBitWidth<uint8_t>::get == 8, "IntegerBitWidth mismatch");
+
static_assert(SetBits<uint32_t, 0, 0>::get == uint32_t(0x00000000),
"SetBits failed");
static_assert(SetBits<uint32_t, 0, 1>::get == uint32_t(0x00000001),
@@ -90,6 +105,82 @@ size_t CountSetBits(T word) {
return count;
}
+// Checks if the bit at the |position| is set to '1'.
+// Bits zero-indexed starting at the least significant bit.
+// |position| must be within the bit width of |T|.
+template <typename T>
+bool IsBitAtPositionSet(T word, size_t position) {
+ static_assert(std::is_integral<T>::value, "Integer type required");
+ static_assert(std::is_unsigned<T>::value, "Unsigned type required");
+ assert(position < IntegerBitWidth<T>::get &&
+ "position must be less than the bit width");
+ return word & T(T(1) << position);
+}
+
+// Returns a value obtained by setting a range of adjacent bits of |word| to
+// |value|. Affected bits are within the range:
+// [first_position, first_position + num_bits_to_mutate),
+// assuming zero-based indexing starting at the least
+// significant bit. Bits to mutate must be within the bit width of |T|.
+template <typename T>
+T MutateBits(T word, size_t first_position, size_t num_bits_to_mutate,
+ bool value) {
+ static_assert(std::is_integral<T>::value, "Integer type required");
+ static_assert(std::is_unsigned<T>::value, "Unsigned type required");
+ static const size_t word_bit_width = IntegerBitWidth<T>::get;
+ assert(first_position < word_bit_width &&
+ "Mutated bits must be within bit width");
+ assert(first_position + num_bits_to_mutate <= word_bit_width &&
+ "Mutated bits must be within bit width");
+ if (num_bits_to_mutate == 0) {
+ return word;
+ }
+
+ const T all_ones = ~T(0);
+ const size_t num_unaffected_low_bits = first_position;
+ const T unaffected_low_mask =
+ T(T(all_ones >> num_unaffected_low_bits) << num_unaffected_low_bits);
+
+ const size_t num_unaffected_high_bits =
+ word_bit_width - (first_position + num_bits_to_mutate);
+ const T unaffected_high_mask =
+ T(T(all_ones << num_unaffected_high_bits) >> num_unaffected_high_bits);
+
+ const T mutation_mask = unaffected_low_mask & unaffected_high_mask;
+ if (value) {
+ return word | mutation_mask;
+ }
+ return word & T(~mutation_mask);
+}
+
+// Returns a value obtained by setting the |num_bits_to_set| highest bits to
+// '1'. |num_bits_to_set| must be not be greater than the bit width of |T|.
+template <typename T>
+T SetHighBits(T word, size_t num_bits_to_set) {
+ if (num_bits_to_set == 0) {
+ return word;
+ }
+ const size_t word_bit_width = IntegerBitWidth<T>::get;
+ assert(num_bits_to_set <= word_bit_width &&
+ "Can't set more bits than bit width");
+ return MutateBits(word, word_bit_width - num_bits_to_set, num_bits_to_set,
+ true);
+}
+
+// Returns a value obtained by setting the |num_bits_to_set| highest bits to
+// '0'. |num_bits_to_set| must be not be greater than the bit width of |T|.
+template <typename T>
+T ClearHighBits(T word, size_t num_bits_to_set) {
+ if (num_bits_to_set == 0) {
+ return word;
+ }
+ const size_t word_bit_width = IntegerBitWidth<T>::get;
+ assert(num_bits_to_set <= word_bit_width &&
+ "Can't clear more bits than bit width");
+ return MutateBits(word, word_bit_width - num_bits_to_set, num_bits_to_set,
+ false);
+}
+
} // namespace utils
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_cfg.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_cfg.cpp
index 8d8839e2fbe..4801fc58a29 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_cfg.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_cfg.cpp
@@ -590,9 +590,68 @@ spv_result_t StructuredSwitchChecks(ValidationState_t& _, Function* function,
return SPV_SUCCESS;
}
+// Validates that all CFG divergences (i.e. conditional branch or switch) are
+// structured correctly. Either divergence is preceded by a merge instruction
+// or the divergence introduces at most one unseen label.
+spv_result_t ValidateStructuredSelections(
+ ValidationState_t& _, const std::vector<const BasicBlock*>& postorder) {
+ std::unordered_set<uint32_t> seen;
+ for (auto iter = postorder.rbegin(); iter != postorder.rend(); ++iter) {
+ const auto* block = *iter;
+ const auto* terminator = block->terminator();
+ if (!terminator) continue;
+ const auto index = terminator - &_.ordered_instructions()[0];
+ auto* merge = &_.ordered_instructions()[index - 1];
+ // Marks merges and continues as seen.
+ if (merge->opcode() == SpvOpSelectionMerge) {
+ seen.insert(merge->GetOperandAs<uint32_t>(0));
+ } else if (merge->opcode() == SpvOpLoopMerge) {
+ seen.insert(merge->GetOperandAs<uint32_t>(0));
+ seen.insert(merge->GetOperandAs<uint32_t>(1));
+ } else {
+ // Only track the pointer if it is a merge instruction.
+ merge = nullptr;
+ }
+
+ // Skip unreachable blocks.
+ if (!block->reachable()) continue;
+
+ if (terminator->opcode() == SpvOpBranchConditional) {
+ const auto true_label = terminator->GetOperandAs<uint32_t>(1);
+ const auto false_label = terminator->GetOperandAs<uint32_t>(2);
+ // Mark the upcoming blocks as seen now, but only error out if this block
+ // was missing a merge instruction and both labels hadn't been seen
+ // previously.
+ const bool both_unseen =
+ seen.insert(true_label).second && seen.insert(false_label).second;
+ if (!merge && both_unseen) {
+ return _.diag(SPV_ERROR_INVALID_CFG, terminator)
+ << "Selection must be structured";
+ }
+ } else if (terminator->opcode() == SpvOpSwitch) {
+ uint32_t count = 0;
+ // Mark the targets as seen now, but only error out if this block was
+ // missing a merge instruction and there were multiple unseen labels.
+ for (uint32_t i = 1; i < terminator->operands().size(); i += 2) {
+ const auto target = terminator->GetOperandAs<uint32_t>(i);
+ if (seen.insert(target).second) {
+ count++;
+ }
+ }
+ if (!merge && count > 1) {
+ return _.diag(SPV_ERROR_INVALID_CFG, terminator)
+ << "Selection must be structured";
+ }
+ }
+ }
+
+ return SPV_SUCCESS;
+}
+
spv_result_t StructuredControlFlowChecks(
ValidationState_t& _, Function* function,
- const std::vector<std::pair<uint32_t, uint32_t>>& back_edges) {
+ const std::vector<std::pair<uint32_t, uint32_t>>& back_edges,
+ const std::vector<const BasicBlock*>& postorder) {
/// Check all backedges target only loop headers and have exactly one
/// back-edge branching to it
@@ -709,6 +768,10 @@ spv_result_t StructuredControlFlowChecks(
}
}
+ if (auto error = ValidateStructuredSelections(_, postorder)) {
+ return error;
+ }
+
return SPV_SUCCESS;
}
@@ -931,7 +994,8 @@ spv_result_t PerformCfgChecks(ValidationState_t& _) {
/// Structured control flow checks are only required for shader capabilities
if (_.HasCapability(SpvCapabilityShader)) {
- if (auto error = StructuredControlFlowChecks(_, &function, back_edges))
+ if (auto error =
+ StructuredControlFlowChecks(_, &function, back_edges, postorder))
return error;
}
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_composites.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_composites.cpp
index 9b7f592bfc5..eb8a3244a43 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_composites.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_composites.cpp
@@ -30,8 +30,8 @@ namespace {
// OpCompositeInsert instruction. The function traverses the hierarchy of
// nested data structures (structs, arrays, vectors, matrices) as directed by
// the sequence of indices in the instruction. May return error if traversal
-// fails (encountered non-composite, out of bounds, nesting too deep).
-// Returns the type of Composite operand if the instruction has no indices.
+// fails (encountered non-composite, out of bounds, no indices, nesting too
+// deep).
spv_result_t GetExtractInsertValueType(ValidationState_t& _,
const Instruction* inst,
uint32_t* member_type) {
@@ -40,10 +40,15 @@ spv_result_t GetExtractInsertValueType(ValidationState_t& _,
uint32_t word_index = opcode == SpvOpCompositeExtract ? 4 : 5;
const uint32_t num_words = static_cast<uint32_t>(inst->words().size());
const uint32_t composite_id_index = word_index - 1;
-
const uint32_t num_indices = num_words - word_index;
const uint32_t kCompositeExtractInsertMaxNumIndices = 255;
- if (num_indices > kCompositeExtractInsertMaxNumIndices) {
+
+ if (num_indices == 0) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected at least one index to Op"
+ << spvOpcodeString(inst->opcode()) << ", zero found";
+
+ } else if (num_indices > kCompositeExtractInsertMaxNumIndices) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "The number of indexes in Op" << spvOpcodeString(opcode)
<< " may not exceed " << kCompositeExtractInsertMaxNumIndices
@@ -386,20 +391,20 @@ spv_result_t ValidateCompositeExtract(ValidationState_t& _,
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Cannot extract from a composite of 8- or 16-bit types";
}
+
return SPV_SUCCESS;
}
spv_result_t ValidateCompositeInsert(ValidationState_t& _,
const Instruction* inst) {
- const SpvOp opcode = inst->opcode();
const uint32_t object_type = _.GetOperandTypeId(inst, 2);
const uint32_t composite_type = _.GetOperandTypeId(inst, 3);
const uint32_t result_type = inst->type_id();
if (result_type != composite_type) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "The Result Type must be the same as Composite type in Op"
- << spvOpcodeString(opcode) << " yielding Result Id " << result_type
- << ".";
+ << spvOpcodeString(inst->opcode()) << " yielding Result Id "
+ << result_type << ".";
}
uint32_t member_type = 0;
@@ -421,6 +426,7 @@ spv_result_t ValidateCompositeInsert(ValidationState_t& _,
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Cannot insert into a composite of 8- or 16-bit types";
}
+
return SPV_SUCCESS;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_derivatives.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_derivatives.cpp
index b3f046ab7b6..067cc964ce2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_derivatives.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_derivatives.cpp
@@ -46,6 +46,10 @@ spv_result_t DerivativesPass(ValidationState_t& _, const Instruction* inst) {
<< "Expected Result Type to be float scalar or vector type: "
<< spvOpcodeString(opcode);
}
+ if (!_.ContainsSizedIntOrFloatType(result_type, SpvOpTypeFloat, 32)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Result type component width must be 32 bits";
+ }
const uint32_t p_type = _.GetOperandTypeId(inst, 2);
if (p_type != result_type) {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_misc.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_misc.cpp
index 7542f32c5be..883893d57fc 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_misc.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_misc.cpp
@@ -42,10 +42,13 @@ spv_result_t ValidateUndef(ValidationState_t& _, const Instruction* inst) {
spv_result_t ValidateShaderClock(ValidationState_t& _,
const Instruction* inst) {
+// #2952: disabled until scope discussion is resolved.
+#if 0
const uint32_t execution_scope = inst->word(3);
if (auto error = ValidateExecutionScope(_, inst, execution_scope)) {
return error;
}
+#endif
// Result Type must be a 64 - bit unsigned integer type or
// a vector of two - components of 32 -
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/binary_header_get_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/binary_header_get_test.cpp
index dcaf9928a98..f8f6bdbd808 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/binary_header_get_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/binary_header_get_test.cpp
@@ -51,7 +51,8 @@ TEST_F(BinaryHeaderGet, Default) {
ASSERT_EQ(SPV_SUCCESS, spvBinaryHeaderGet(&const_bin, endian, &header));
ASSERT_EQ(static_cast<uint32_t>(SpvMagicNumber), header.magic);
- ASSERT_EQ(0x00010400u, header.version);
+ // Expect SPIRV-Headers updated to SPIR-V 1.5.
+ ASSERT_EQ(0x00010500u, header.version);
ASSERT_EQ(static_cast<uint32_t>(SPV_GENERATOR_CODEPLAY), header.generator);
ASSERT_EQ(1u, header.bound);
ASSERT_EQ(0u, header.schema);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/CMakeLists.txt b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/CMakeLists.txt
index 1d9a8fd6b87..cfa89f94d18 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/CMakeLists.txt
@@ -17,22 +17,30 @@ if (${SPIRV_BUILD_FUZZER})
set(SOURCES
fuzz_test_util.h
+ equivalence_relation_test.cpp
fact_manager_test.cpp
fuzz_test_util.cpp
fuzzer_pass_add_useful_constructs_test.cpp
+ instruction_descriptor_test.cpp
transformation_add_constant_boolean_test.cpp
transformation_add_constant_scalar_test.cpp
transformation_add_dead_break_test.cpp
transformation_add_dead_continue_test.cpp
+ transformation_add_no_contraction_decoration_test.cpp
transformation_add_type_boolean_test.cpp
transformation_add_type_float_test.cpp
transformation_add_type_int_test.cpp
transformation_add_type_pointer_test.cpp
+ transformation_composite_construct_test.cpp
+ transformation_composite_extract_test.cpp
transformation_copy_object_test.cpp
transformation_move_block_down_test.cpp
transformation_replace_boolean_constant_with_constant_binary_test.cpp
transformation_replace_constant_with_uniform_test.cpp
- transformation_replace_id_with_synonym_test.cpp
+ transformation_set_function_control_test.cpp
+ transformation_set_loop_control_test.cpp
+ transformation_set_memory_operands_mask_test.cpp
+ transformation_set_selection_control_test.cpp
transformation_split_block_test.cpp
uniform_buffer_element_descriptor_test.cpp)
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/equivalence_relation_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/equivalence_relation_test.cpp
new file mode 100644
index 00000000000..a4f4ad4b23d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/equivalence_relation_test.cpp
@@ -0,0 +1,123 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <set>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "source/fuzz/equivalence_relation.h"
+
+namespace spvtools {
+namespace fuzz {
+namespace {
+
+struct UInt32Equals {
+ bool operator()(const uint32_t* first, const uint32_t* second) const {
+ return *first == *second;
+ }
+};
+
+struct UInt32Hash {
+ size_t operator()(const uint32_t* element) const {
+ return static_cast<size_t>(*element);
+ }
+};
+
+std::vector<uint32_t> ToUIntVector(
+ const std::vector<const uint32_t*>& pointers) {
+ std::vector<uint32_t> result;
+ for (auto pointer : pointers) {
+ result.push_back(*pointer);
+ }
+ return result;
+}
+
+TEST(EquivalenceRelationTest, BasicTest) {
+ EquivalenceRelation<uint32_t, UInt32Hash, UInt32Equals> relation;
+ ASSERT_TRUE(relation.GetAllKnownValues().empty());
+
+ for (uint32_t element = 2; element < 80; element += 2) {
+ relation.MakeEquivalent(0, element);
+ relation.MakeEquivalent(element - 1, element + 1);
+ }
+
+ for (uint32_t element = 82; element < 100; element += 2) {
+ relation.MakeEquivalent(80, element);
+ relation.MakeEquivalent(element - 1, element + 1);
+ }
+
+ relation.MakeEquivalent(78, 80);
+
+ std::vector<uint32_t> class1;
+ for (uint32_t element = 0; element < 98; element += 2) {
+ ASSERT_TRUE(relation.IsEquivalent(0, element));
+ ASSERT_TRUE(relation.IsEquivalent(element, element + 2));
+ class1.push_back(element);
+ }
+ class1.push_back(98);
+
+ ASSERT_THAT(ToUIntVector(relation.GetEquivalenceClass(0)),
+ testing::WhenSorted(class1));
+ ASSERT_THAT(ToUIntVector(relation.GetEquivalenceClass(4)),
+ testing::WhenSorted(class1));
+ ASSERT_THAT(ToUIntVector(relation.GetEquivalenceClass(40)),
+ testing::WhenSorted(class1));
+
+ std::vector<uint32_t> class2;
+ for (uint32_t element = 1; element < 79; element += 2) {
+ ASSERT_TRUE(relation.IsEquivalent(1, element));
+ ASSERT_TRUE(relation.IsEquivalent(element, element + 2));
+ class2.push_back(element);
+ }
+ class2.push_back(79);
+ ASSERT_THAT(ToUIntVector(relation.GetEquivalenceClass(1)),
+ testing::WhenSorted(class2));
+ ASSERT_THAT(ToUIntVector(relation.GetEquivalenceClass(11)),
+ testing::WhenSorted(class2));
+ ASSERT_THAT(ToUIntVector(relation.GetEquivalenceClass(31)),
+ testing::WhenSorted(class2));
+
+ std::vector<uint32_t> class3;
+ for (uint32_t element = 81; element < 99; element += 2) {
+ ASSERT_TRUE(relation.IsEquivalent(81, element));
+ ASSERT_TRUE(relation.IsEquivalent(element, element + 2));
+ class3.push_back(element);
+ }
+ class3.push_back(99);
+ ASSERT_THAT(ToUIntVector(relation.GetEquivalenceClass(81)),
+ testing::WhenSorted(class3));
+ ASSERT_THAT(ToUIntVector(relation.GetEquivalenceClass(91)),
+ testing::WhenSorted(class3));
+ ASSERT_THAT(ToUIntVector(relation.GetEquivalenceClass(99)),
+ testing::WhenSorted(class3));
+
+ bool first = true;
+ std::vector<const uint32_t*> previous_class;
+ for (auto representative : relation.GetEquivalenceClassRepresentatives()) {
+ std::vector<const uint32_t*> current_class =
+ relation.GetEquivalenceClass(*representative);
+ ASSERT_TRUE(std::find(current_class.begin(), current_class.end(),
+ representative) != current_class.end());
+ if (!first) {
+ ASSERT_TRUE(std::find(previous_class.begin(), previous_class.end(),
+ representative) == previous_class.end());
+ }
+ previous_class = current_class;
+ first = false;
+ }
+}
+
+} // namespace
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/fuzzer_replayer_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/fuzzer_replayer_test.cpp
index 5fb71b0c524..22a26fc6b06 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/fuzzer_replayer_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/fuzzer_replayer_test.cpp
@@ -21,6 +21,28 @@ namespace spvtools {
namespace fuzz {
namespace {
+const uint32_t kNumFuzzerRuns = 20;
+
+void AddConstantUniformFact(protobufs::FactSequence* facts,
+ uint32_t descriptor_set, uint32_t binding,
+ std::vector<uint32_t>&& indices, uint32_t value) {
+ protobufs::FactConstantUniform fact;
+ *fact.mutable_uniform_buffer_element_descriptor() =
+ MakeUniformBufferElementDescriptor(descriptor_set, binding,
+ std::move(indices));
+ *fact.mutable_constant_word()->Add() = value;
+ protobufs::Fact temp;
+ *temp.mutable_constant_uniform_fact() = fact;
+ *facts->mutable_fact()->Add() = temp;
+}
+
+// Reinterpret the bits of |value| as a 32-bit unsigned int
+uint32_t FloatBitsAsUint(float value) {
+ uint32_t result;
+ memcpy(&result, &value, sizeof(float));
+ return result;
+}
+
// Assembles the given |shader| text, and then runs the fuzzer |num_runs|
// times, using successive seeds starting from |initial_seed|. Checks that
// the binary produced after each fuzzer run is valid, and that replaying
@@ -29,7 +51,7 @@ namespace {
void RunFuzzerAndReplayer(const std::string& shader,
const protobufs::FactSequence& initial_facts,
uint32_t initial_seed, uint32_t num_runs) {
- const auto env = SPV_ENV_UNIVERSAL_1_3;
+ const auto env = SPV_ENV_UNIVERSAL_1_5;
std::vector<uint32_t> binary_in;
SpirvTools t(env);
@@ -240,9 +262,9 @@ TEST(FuzzerReplayerTest, Miscellaneous1) {
OpFunctionEnd
)";
- // Do 5 fuzzer runs, starting from an initial seed of 0 (seed value chosen
+ // Do some fuzzer runs, starting from an initial seed of 0 (seed value chosen
// arbitrarily).
- RunFuzzerAndReplayer(shader, protobufs::FactSequence(), 0, 5);
+ RunFuzzerAndReplayer(shader, protobufs::FactSequence(), 0, kNumFuzzerRuns);
}
TEST(FuzzerReplayerTest, Miscellaneous2) {
@@ -303,7 +325,7 @@ TEST(FuzzerReplayerTest, Miscellaneous2) {
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main" %16 %139
+ OpEntryPoint Fragment %4 "main" %16 %139 %25 %68
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 310
OpName %4 "main"
@@ -485,9 +507,9 @@ TEST(FuzzerReplayerTest, Miscellaneous2) {
OpFunctionEnd
)";
- // Do 5 fuzzer runs, starting from an initial seed of 10 (seed value chosen
+ // Do some fuzzer runs, starting from an initial seed of 10 (seed value chosen
// arbitrarily).
- RunFuzzerAndReplayer(shader, protobufs::FactSequence(), 10, 5);
+ RunFuzzerAndReplayer(shader, protobufs::FactSequence(), 10, kNumFuzzerRuns);
}
TEST(FuzzerReplayerTest, Miscellaneous3) {
@@ -603,7 +625,7 @@ TEST(FuzzerReplayerTest, Miscellaneous3) {
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main" %68 %100
+ OpEntryPoint Fragment %4 "main" %68 %100 %24
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 310
OpName %4 "main"
@@ -951,28 +973,657 @@ TEST(FuzzerReplayerTest, Miscellaneous3) {
// Add the facts "resolution.x == 250" and "resolution.y == 100".
protobufs::FactSequence facts;
- {
- protobufs::FactConstantUniform resolution_x_eq_250;
- *resolution_x_eq_250.mutable_uniform_buffer_element_descriptor() =
- MakeUniformBufferElementDescriptor(0, 0, {0, 0});
- *resolution_x_eq_250.mutable_constant_word()->Add() = 250;
- protobufs::Fact temp;
- *temp.mutable_constant_uniform_fact() = resolution_x_eq_250;
- *facts.mutable_fact()->Add() = temp;
- }
- {
- protobufs::FactConstantUniform resolution_y_eq_100;
- *resolution_y_eq_100.mutable_uniform_buffer_element_descriptor() =
- MakeUniformBufferElementDescriptor(0, 0, {0, 1});
- *resolution_y_eq_100.mutable_constant_word()->Add() = 100;
- protobufs::Fact temp;
- *temp.mutable_constant_uniform_fact() = resolution_y_eq_100;
- *facts.mutable_fact()->Add() = temp;
- }
+ AddConstantUniformFact(&facts, 0, 0, {0, 0}, 250);
+ AddConstantUniformFact(&facts, 0, 0, {0, 1}, 100);
+
+ // Do some fuzzer runs, starting from an initial seed of 94 (seed value chosen
+ // arbitrarily).
+ RunFuzzerAndReplayer(shader, facts, 94, kNumFuzzerRuns);
+}
+
+TEST(FuzzerReplayerTest, Miscellaneous4) {
+ // The SPIR-V comes from the 'matrices_smart_loops' GLSL shader that ships
+ // with GraphicsFuzz.
+
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %327 %363 %65 %70 %80 %90 %99 %108 %117 %126 %135 %144 %333
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "matrix_number"
+ OpName %12 "cols"
+ OpName %23 "rows"
+ OpName %31 "c"
+ OpName %41 "r"
+ OpName %65 "m22"
+ OpName %68 "buf0"
+ OpMemberName %68 0 "one"
+ OpName %70 ""
+ OpName %80 "m23"
+ OpName %90 "m24"
+ OpName %99 "m32"
+ OpName %108 "m33"
+ OpName %117 "m34"
+ OpName %126 "m42"
+ OpName %135 "m43"
+ OpName %144 "m44"
+ OpName %164 "sum_index"
+ OpName %165 "cols"
+ OpName %173 "rows"
+ OpName %184 "sums"
+ OpName %189 "c"
+ OpName %198 "r"
+ OpName %325 "region_x"
+ OpName %327 "gl_FragCoord"
+ OpName %331 "buf1"
+ OpMemberName %331 0 "resolution"
+ OpName %333 ""
+ OpName %340 "region_y"
+ OpName %348 "overall_region"
+ OpName %363 "_GLF_color"
+ OpDecorate %8 RelaxedPrecision
+ OpDecorate %12 RelaxedPrecision
+ OpDecorate %19 RelaxedPrecision
+ OpDecorate %23 RelaxedPrecision
+ OpDecorate %29 RelaxedPrecision
+ OpDecorate %31 RelaxedPrecision
+ OpDecorate %38 RelaxedPrecision
+ OpDecorate %39 RelaxedPrecision
+ OpDecorate %41 RelaxedPrecision
+ OpDecorate %47 RelaxedPrecision
+ OpDecorate %48 RelaxedPrecision
+ OpDecorate %50 RelaxedPrecision
+ OpDecorate %66 RelaxedPrecision
+ OpDecorate %67 RelaxedPrecision
+ OpMemberDecorate %68 0 Offset 0
+ OpDecorate %68 Block
+ OpDecorate %70 DescriptorSet 0
+ OpDecorate %70 Binding 0
+ OpDecorate %81 RelaxedPrecision
+ OpDecorate %82 RelaxedPrecision
+ OpDecorate %91 RelaxedPrecision
+ OpDecorate %92 RelaxedPrecision
+ OpDecorate %100 RelaxedPrecision
+ OpDecorate %101 RelaxedPrecision
+ OpDecorate %109 RelaxedPrecision
+ OpDecorate %110 RelaxedPrecision
+ OpDecorate %118 RelaxedPrecision
+ OpDecorate %119 RelaxedPrecision
+ OpDecorate %127 RelaxedPrecision
+ OpDecorate %128 RelaxedPrecision
+ OpDecorate %136 RelaxedPrecision
+ OpDecorate %137 RelaxedPrecision
+ OpDecorate %145 RelaxedPrecision
+ OpDecorate %146 RelaxedPrecision
+ OpDecorate %152 RelaxedPrecision
+ OpDecorate %154 RelaxedPrecision
+ OpDecorate %155 RelaxedPrecision
+ OpDecorate %156 RelaxedPrecision
+ OpDecorate %157 RelaxedPrecision
+ OpDecorate %159 RelaxedPrecision
+ OpDecorate %160 RelaxedPrecision
+ OpDecorate %161 RelaxedPrecision
+ OpDecorate %162 RelaxedPrecision
+ OpDecorate %163 RelaxedPrecision
+ OpDecorate %164 RelaxedPrecision
+ OpDecorate %165 RelaxedPrecision
+ OpDecorate %171 RelaxedPrecision
+ OpDecorate %173 RelaxedPrecision
+ OpDecorate %179 RelaxedPrecision
+ OpDecorate %185 RelaxedPrecision
+ OpDecorate %189 RelaxedPrecision
+ OpDecorate %195 RelaxedPrecision
+ OpDecorate %196 RelaxedPrecision
+ OpDecorate %198 RelaxedPrecision
+ OpDecorate %204 RelaxedPrecision
+ OpDecorate %205 RelaxedPrecision
+ OpDecorate %207 RelaxedPrecision
+ OpDecorate %218 RelaxedPrecision
+ OpDecorate %219 RelaxedPrecision
+ OpDecorate %220 RelaxedPrecision
+ OpDecorate %228 RelaxedPrecision
+ OpDecorate %229 RelaxedPrecision
+ OpDecorate %230 RelaxedPrecision
+ OpDecorate %238 RelaxedPrecision
+ OpDecorate %239 RelaxedPrecision
+ OpDecorate %240 RelaxedPrecision
+ OpDecorate %248 RelaxedPrecision
+ OpDecorate %249 RelaxedPrecision
+ OpDecorate %250 RelaxedPrecision
+ OpDecorate %258 RelaxedPrecision
+ OpDecorate %259 RelaxedPrecision
+ OpDecorate %260 RelaxedPrecision
+ OpDecorate %268 RelaxedPrecision
+ OpDecorate %269 RelaxedPrecision
+ OpDecorate %270 RelaxedPrecision
+ OpDecorate %278 RelaxedPrecision
+ OpDecorate %279 RelaxedPrecision
+ OpDecorate %280 RelaxedPrecision
+ OpDecorate %288 RelaxedPrecision
+ OpDecorate %289 RelaxedPrecision
+ OpDecorate %290 RelaxedPrecision
+ OpDecorate %298 RelaxedPrecision
+ OpDecorate %299 RelaxedPrecision
+ OpDecorate %300 RelaxedPrecision
+ OpDecorate %309 RelaxedPrecision
+ OpDecorate %310 RelaxedPrecision
+ OpDecorate %311 RelaxedPrecision
+ OpDecorate %312 RelaxedPrecision
+ OpDecorate %313 RelaxedPrecision
+ OpDecorate %319 RelaxedPrecision
+ OpDecorate %320 RelaxedPrecision
+ OpDecorate %321 RelaxedPrecision
+ OpDecorate %322 RelaxedPrecision
+ OpDecorate %323 RelaxedPrecision
+ OpDecorate %324 RelaxedPrecision
+ OpDecorate %325 RelaxedPrecision
+ OpDecorate %327 BuiltIn FragCoord
+ OpMemberDecorate %331 0 Offset 0
+ OpDecorate %331 Block
+ OpDecorate %333 DescriptorSet 0
+ OpDecorate %333 Binding 1
+ OpDecorate %339 RelaxedPrecision
+ OpDecorate %340 RelaxedPrecision
+ OpDecorate %347 RelaxedPrecision
+ OpDecorate %348 RelaxedPrecision
+ OpDecorate %349 RelaxedPrecision
+ OpDecorate %351 RelaxedPrecision
+ OpDecorate %352 RelaxedPrecision
+ OpDecorate %353 RelaxedPrecision
+ OpDecorate %354 RelaxedPrecision
+ OpDecorate %356 RelaxedPrecision
+ OpDecorate %363 Location 0
+ OpDecorate %364 RelaxedPrecision
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 0
+ %7 = OpTypePointer Function %6
+ %9 = OpConstant %6 0
+ %10 = OpTypeInt 32 1
+ %11 = OpTypePointer Function %10
+ %13 = OpConstant %10 2
+ %20 = OpConstant %10 4
+ %21 = OpTypeBool
+ %32 = OpConstant %10 0
+ %61 = OpTypeFloat 32
+ %62 = OpTypeVector %61 2
+ %63 = OpTypeMatrix %62 2
+ %64 = OpTypePointer Private %63
+ %65 = OpVariable %64 Private
+ %68 = OpTypeStruct %61
+ %69 = OpTypePointer Uniform %68
+ %70 = OpVariable %69 Uniform
+ %71 = OpTypePointer Uniform %61
+ %74 = OpTypePointer Private %61
+ %77 = OpTypeVector %61 3
+ %78 = OpTypeMatrix %77 2
+ %79 = OpTypePointer Private %78
+ %80 = OpVariable %79 Private
+ %87 = OpTypeVector %61 4
+ %88 = OpTypeMatrix %87 2
+ %89 = OpTypePointer Private %88
+ %90 = OpVariable %89 Private
+ %97 = OpTypeMatrix %62 3
+ %98 = OpTypePointer Private %97
+ %99 = OpVariable %98 Private
+ %106 = OpTypeMatrix %77 3
+ %107 = OpTypePointer Private %106
+ %108 = OpVariable %107 Private
+ %115 = OpTypeMatrix %87 3
+ %116 = OpTypePointer Private %115
+ %117 = OpVariable %116 Private
+ %124 = OpTypeMatrix %62 4
+ %125 = OpTypePointer Private %124
+ %126 = OpVariable %125 Private
+ %133 = OpTypeMatrix %77 4
+ %134 = OpTypePointer Private %133
+ %135 = OpVariable %134 Private
+ %142 = OpTypeMatrix %87 4
+ %143 = OpTypePointer Private %142
+ %144 = OpVariable %143 Private
+ %153 = OpConstant %10 1
+ %158 = OpConstant %6 1
+ %181 = OpConstant %6 9
+ %182 = OpTypeArray %61 %181
+ %183 = OpTypePointer Function %182
+ %186 = OpConstant %61 0
+ %187 = OpTypePointer Function %61
+ %314 = OpConstant %61 16
+ %326 = OpTypePointer Input %87
+ %327 = OpVariable %326 Input
+ %328 = OpTypePointer Input %61
+ %331 = OpTypeStruct %62
+ %332 = OpTypePointer Uniform %331
+ %333 = OpVariable %332 Uniform
+ %336 = OpConstant %61 3
+ %350 = OpConstant %10 3
+ %357 = OpConstant %10 9
+ %362 = OpTypePointer Output %87
+ %363 = OpVariable %362 Output
+ %368 = OpConstant %61 1
+ %374 = OpConstantComposite %87 %186 %186 %186 %368
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %12 = OpVariable %11 Function
+ %23 = OpVariable %11 Function
+ %31 = OpVariable %11 Function
+ %41 = OpVariable %11 Function
+ %164 = OpVariable %11 Function
+ %165 = OpVariable %11 Function
+ %173 = OpVariable %11 Function
+ %184 = OpVariable %183 Function
+ %189 = OpVariable %11 Function
+ %198 = OpVariable %11 Function
+ %325 = OpVariable %11 Function
+ %340 = OpVariable %11 Function
+ %348 = OpVariable %11 Function
+ OpStore %8 %9
+ OpStore %12 %13
+ OpBranch %14
+ %14 = OpLabel
+ OpLoopMerge %16 %17 None
+ OpBranch %18
+ %18 = OpLabel
+ %19 = OpLoad %10 %12
+ %22 = OpSLessThanEqual %21 %19 %20
+ OpBranchConditional %22 %15 %16
+ %15 = OpLabel
+ OpStore %23 %13
+ OpBranch %24
+ %24 = OpLabel
+ OpLoopMerge %26 %27 None
+ OpBranch %28
+ %28 = OpLabel
+ %29 = OpLoad %10 %23
+ %30 = OpSLessThanEqual %21 %29 %20
+ OpBranchConditional %30 %25 %26
+ %25 = OpLabel
+ OpStore %31 %32
+ OpBranch %33
+ %33 = OpLabel
+ OpLoopMerge %35 %36 None
+ OpBranch %37
+ %37 = OpLabel
+ %38 = OpLoad %10 %31
+ %39 = OpLoad %10 %12
+ %40 = OpSLessThan %21 %38 %39
+ OpBranchConditional %40 %34 %35
+ %34 = OpLabel
+ OpStore %41 %32
+ OpBranch %42
+ %42 = OpLabel
+ OpLoopMerge %44 %45 None
+ OpBranch %46
+ %46 = OpLabel
+ %47 = OpLoad %10 %41
+ %48 = OpLoad %10 %23
+ %49 = OpSLessThan %21 %47 %48
+ OpBranchConditional %49 %43 %44
+ %43 = OpLabel
+ %50 = OpLoad %6 %8
+ OpSelectionMerge %60 None
+ OpSwitch %50 %60 0 %51 1 %52 2 %53 3 %54 4 %55 5 %56 6 %57 7 %58 8 %59
+ %51 = OpLabel
+ %66 = OpLoad %10 %31
+ %67 = OpLoad %10 %41
+ %72 = OpAccessChain %71 %70 %32
+ %73 = OpLoad %61 %72
+ %75 = OpAccessChain %74 %65 %66 %67
+ OpStore %75 %73
+ OpBranch %60
+ %52 = OpLabel
+ %81 = OpLoad %10 %31
+ %82 = OpLoad %10 %41
+ %83 = OpAccessChain %71 %70 %32
+ %84 = OpLoad %61 %83
+ %85 = OpAccessChain %74 %80 %81 %82
+ OpStore %85 %84
+ OpBranch %60
+ %53 = OpLabel
+ %91 = OpLoad %10 %31
+ %92 = OpLoad %10 %41
+ %93 = OpAccessChain %71 %70 %32
+ %94 = OpLoad %61 %93
+ %95 = OpAccessChain %74 %90 %91 %92
+ OpStore %95 %94
+ OpBranch %60
+ %54 = OpLabel
+ %100 = OpLoad %10 %31
+ %101 = OpLoad %10 %41
+ %102 = OpAccessChain %71 %70 %32
+ %103 = OpLoad %61 %102
+ %104 = OpAccessChain %74 %99 %100 %101
+ OpStore %104 %103
+ OpBranch %60
+ %55 = OpLabel
+ %109 = OpLoad %10 %31
+ %110 = OpLoad %10 %41
+ %111 = OpAccessChain %71 %70 %32
+ %112 = OpLoad %61 %111
+ %113 = OpAccessChain %74 %108 %109 %110
+ OpStore %113 %112
+ OpBranch %60
+ %56 = OpLabel
+ %118 = OpLoad %10 %31
+ %119 = OpLoad %10 %41
+ %120 = OpAccessChain %71 %70 %32
+ %121 = OpLoad %61 %120
+ %122 = OpAccessChain %74 %117 %118 %119
+ OpStore %122 %121
+ OpBranch %60
+ %57 = OpLabel
+ %127 = OpLoad %10 %31
+ %128 = OpLoad %10 %41
+ %129 = OpAccessChain %71 %70 %32
+ %130 = OpLoad %61 %129
+ %131 = OpAccessChain %74 %126 %127 %128
+ OpStore %131 %130
+ OpBranch %60
+ %58 = OpLabel
+ %136 = OpLoad %10 %31
+ %137 = OpLoad %10 %41
+ %138 = OpAccessChain %71 %70 %32
+ %139 = OpLoad %61 %138
+ %140 = OpAccessChain %74 %135 %136 %137
+ OpStore %140 %139
+ OpBranch %60
+ %59 = OpLabel
+ %145 = OpLoad %10 %31
+ %146 = OpLoad %10 %41
+ %147 = OpAccessChain %71 %70 %32
+ %148 = OpLoad %61 %147
+ %149 = OpAccessChain %74 %144 %145 %146
+ OpStore %149 %148
+ OpBranch %60
+ %60 = OpLabel
+ OpBranch %45
+ %45 = OpLabel
+ %152 = OpLoad %10 %41
+ %154 = OpIAdd %10 %152 %153
+ OpStore %41 %154
+ OpBranch %42
+ %44 = OpLabel
+ OpBranch %36
+ %36 = OpLabel
+ %155 = OpLoad %10 %31
+ %156 = OpIAdd %10 %155 %153
+ OpStore %31 %156
+ OpBranch %33
+ %35 = OpLabel
+ %157 = OpLoad %6 %8
+ %159 = OpIAdd %6 %157 %158
+ OpStore %8 %159
+ OpBranch %27
+ %27 = OpLabel
+ %160 = OpLoad %10 %23
+ %161 = OpIAdd %10 %160 %153
+ OpStore %23 %161
+ OpBranch %24
+ %26 = OpLabel
+ OpBranch %17
+ %17 = OpLabel
+ %162 = OpLoad %10 %12
+ %163 = OpIAdd %10 %162 %153
+ OpStore %12 %163
+ OpBranch %14
+ %16 = OpLabel
+ OpStore %164 %32
+ OpStore %165 %13
+ OpBranch %166
+ %166 = OpLabel
+ OpLoopMerge %168 %169 None
+ OpBranch %170
+ %170 = OpLabel
+ %171 = OpLoad %10 %165
+ %172 = OpSLessThanEqual %21 %171 %20
+ OpBranchConditional %172 %167 %168
+ %167 = OpLabel
+ OpStore %173 %13
+ OpBranch %174
+ %174 = OpLabel
+ OpLoopMerge %176 %177 None
+ OpBranch %178
+ %178 = OpLabel
+ %179 = OpLoad %10 %173
+ %180 = OpSLessThanEqual %21 %179 %20
+ OpBranchConditional %180 %175 %176
+ %175 = OpLabel
+ %185 = OpLoad %10 %164
+ %188 = OpAccessChain %187 %184 %185
+ OpStore %188 %186
+ OpStore %189 %32
+ OpBranch %190
+ %190 = OpLabel
+ OpLoopMerge %192 %193 None
+ OpBranch %194
+ %194 = OpLabel
+ %195 = OpLoad %10 %189
+ %196 = OpLoad %10 %165
+ %197 = OpSLessThan %21 %195 %196
+ OpBranchConditional %197 %191 %192
+ %191 = OpLabel
+ OpStore %198 %32
+ OpBranch %199
+ %199 = OpLabel
+ OpLoopMerge %201 %202 None
+ OpBranch %203
+ %203 = OpLabel
+ %204 = OpLoad %10 %198
+ %205 = OpLoad %10 %173
+ %206 = OpSLessThan %21 %204 %205
+ OpBranchConditional %206 %200 %201
+ %200 = OpLabel
+ %207 = OpLoad %10 %164
+ OpSelectionMerge %217 None
+ OpSwitch %207 %217 0 %208 1 %209 2 %210 3 %211 4 %212 5 %213 6 %214 7 %215 8 %216
+ %208 = OpLabel
+ %218 = OpLoad %10 %164
+ %219 = OpLoad %10 %189
+ %220 = OpLoad %10 %198
+ %221 = OpAccessChain %74 %65 %219 %220
+ %222 = OpLoad %61 %221
+ %223 = OpAccessChain %187 %184 %218
+ %224 = OpLoad %61 %223
+ %225 = OpFAdd %61 %224 %222
+ %226 = OpAccessChain %187 %184 %218
+ OpStore %226 %225
+ OpBranch %217
+ %209 = OpLabel
+ %228 = OpLoad %10 %164
+ %229 = OpLoad %10 %189
+ %230 = OpLoad %10 %198
+ %231 = OpAccessChain %74 %80 %229 %230
+ %232 = OpLoad %61 %231
+ %233 = OpAccessChain %187 %184 %228
+ %234 = OpLoad %61 %233
+ %235 = OpFAdd %61 %234 %232
+ %236 = OpAccessChain %187 %184 %228
+ OpStore %236 %235
+ OpBranch %217
+ %210 = OpLabel
+ %238 = OpLoad %10 %164
+ %239 = OpLoad %10 %189
+ %240 = OpLoad %10 %198
+ %241 = OpAccessChain %74 %90 %239 %240
+ %242 = OpLoad %61 %241
+ %243 = OpAccessChain %187 %184 %238
+ %244 = OpLoad %61 %243
+ %245 = OpFAdd %61 %244 %242
+ %246 = OpAccessChain %187 %184 %238
+ OpStore %246 %245
+ OpBranch %217
+ %211 = OpLabel
+ %248 = OpLoad %10 %164
+ %249 = OpLoad %10 %189
+ %250 = OpLoad %10 %198
+ %251 = OpAccessChain %74 %99 %249 %250
+ %252 = OpLoad %61 %251
+ %253 = OpAccessChain %187 %184 %248
+ %254 = OpLoad %61 %253
+ %255 = OpFAdd %61 %254 %252
+ %256 = OpAccessChain %187 %184 %248
+ OpStore %256 %255
+ OpBranch %217
+ %212 = OpLabel
+ %258 = OpLoad %10 %164
+ %259 = OpLoad %10 %189
+ %260 = OpLoad %10 %198
+ %261 = OpAccessChain %74 %108 %259 %260
+ %262 = OpLoad %61 %261
+ %263 = OpAccessChain %187 %184 %258
+ %264 = OpLoad %61 %263
+ %265 = OpFAdd %61 %264 %262
+ %266 = OpAccessChain %187 %184 %258
+ OpStore %266 %265
+ OpBranch %217
+ %213 = OpLabel
+ %268 = OpLoad %10 %164
+ %269 = OpLoad %10 %189
+ %270 = OpLoad %10 %198
+ %271 = OpAccessChain %74 %117 %269 %270
+ %272 = OpLoad %61 %271
+ %273 = OpAccessChain %187 %184 %268
+ %274 = OpLoad %61 %273
+ %275 = OpFAdd %61 %274 %272
+ %276 = OpAccessChain %187 %184 %268
+ OpStore %276 %275
+ OpBranch %217
+ %214 = OpLabel
+ %278 = OpLoad %10 %164
+ %279 = OpLoad %10 %189
+ %280 = OpLoad %10 %198
+ %281 = OpAccessChain %74 %126 %279 %280
+ %282 = OpLoad %61 %281
+ %283 = OpAccessChain %187 %184 %278
+ %284 = OpLoad %61 %283
+ %285 = OpFAdd %61 %284 %282
+ %286 = OpAccessChain %187 %184 %278
+ OpStore %286 %285
+ OpBranch %217
+ %215 = OpLabel
+ %288 = OpLoad %10 %164
+ %289 = OpLoad %10 %189
+ %290 = OpLoad %10 %198
+ %291 = OpAccessChain %74 %135 %289 %290
+ %292 = OpLoad %61 %291
+ %293 = OpAccessChain %187 %184 %288
+ %294 = OpLoad %61 %293
+ %295 = OpFAdd %61 %294 %292
+ %296 = OpAccessChain %187 %184 %288
+ OpStore %296 %295
+ OpBranch %217
+ %216 = OpLabel
+ %298 = OpLoad %10 %164
+ %299 = OpLoad %10 %189
+ %300 = OpLoad %10 %198
+ %301 = OpAccessChain %74 %144 %299 %300
+ %302 = OpLoad %61 %301
+ %303 = OpAccessChain %187 %184 %298
+ %304 = OpLoad %61 %303
+ %305 = OpFAdd %61 %304 %302
+ %306 = OpAccessChain %187 %184 %298
+ OpStore %306 %305
+ OpBranch %217
+ %217 = OpLabel
+ OpBranch %202
+ %202 = OpLabel
+ %309 = OpLoad %10 %198
+ %310 = OpIAdd %10 %309 %153
+ OpStore %198 %310
+ OpBranch %199
+ %201 = OpLabel
+ OpBranch %193
+ %193 = OpLabel
+ %311 = OpLoad %10 %189
+ %312 = OpIAdd %10 %311 %153
+ OpStore %189 %312
+ OpBranch %190
+ %192 = OpLabel
+ %313 = OpLoad %10 %164
+ %315 = OpAccessChain %187 %184 %313
+ %316 = OpLoad %61 %315
+ %317 = OpFDiv %61 %316 %314
+ %318 = OpAccessChain %187 %184 %313
+ OpStore %318 %317
+ %319 = OpLoad %10 %164
+ %320 = OpIAdd %10 %319 %153
+ OpStore %164 %320
+ OpBranch %177
+ %177 = OpLabel
+ %321 = OpLoad %10 %173
+ %322 = OpIAdd %10 %321 %153
+ OpStore %173 %322
+ OpBranch %174
+ %176 = OpLabel
+ OpBranch %169
+ %169 = OpLabel
+ %323 = OpLoad %10 %165
+ %324 = OpIAdd %10 %323 %153
+ OpStore %165 %324
+ OpBranch %166
+ %168 = OpLabel
+ %329 = OpAccessChain %328 %327 %9
+ %330 = OpLoad %61 %329
+ %334 = OpAccessChain %71 %333 %32 %9
+ %335 = OpLoad %61 %334
+ %337 = OpFDiv %61 %335 %336
+ %338 = OpFDiv %61 %330 %337
+ %339 = OpConvertFToS %10 %338
+ OpStore %325 %339
+ %341 = OpAccessChain %328 %327 %158
+ %342 = OpLoad %61 %341
+ %343 = OpAccessChain %71 %333 %32 %9
+ %344 = OpLoad %61 %343
+ %345 = OpFDiv %61 %344 %336
+ %346 = OpFDiv %61 %342 %345
+ %347 = OpConvertFToS %10 %346
+ OpStore %340 %347
+ %349 = OpLoad %10 %340
+ %351 = OpIMul %10 %349 %350
+ %352 = OpLoad %10 %325
+ %353 = OpIAdd %10 %351 %352
+ OpStore %348 %353
+ %354 = OpLoad %10 %348
+ %355 = OpSGreaterThan %21 %354 %32
+ %356 = OpLoad %10 %348
+ %358 = OpSLessThan %21 %356 %357
+ %359 = OpLogicalAnd %21 %355 %358
+ OpSelectionMerge %361 None
+ OpBranchConditional %359 %360 %373
+ %360 = OpLabel
+ %364 = OpLoad %10 %348
+ %365 = OpAccessChain %187 %184 %364
+ %366 = OpLoad %61 %365
+ %367 = OpCompositeConstruct %77 %366 %366 %366
+ %369 = OpCompositeExtract %61 %367 0
+ %370 = OpCompositeExtract %61 %367 1
+ %371 = OpCompositeExtract %61 %367 2
+ %372 = OpCompositeConstruct %87 %369 %370 %371 %368
+ OpStore %363 %372
+ OpBranch %361
+ %373 = OpLabel
+ OpStore %363 %374
+ OpBranch %361
+ %361 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ // Add the facts:
+ // - "one == 1.0"
+ // - "resolution.y == 256.0",
+ protobufs::FactSequence facts;
+ AddConstantUniformFact(&facts, 0, 0, {0}, FloatBitsAsUint(1.0));
+ AddConstantUniformFact(&facts, 0, 1, {0, 0}, FloatBitsAsUint(256.0));
+ AddConstantUniformFact(&facts, 0, 1, {0, 1}, FloatBitsAsUint(256.0));
- // Do 5 fuzzer runs, starting from an initial seed of 94 (seed value chosen
+ // Do some fuzzer runs, starting from an initial seed of 14 (seed value chosen
// arbitrarily).
- RunFuzzerAndReplayer(shader, facts, 94, 5);
+ RunFuzzerAndReplayer(shader, facts, 14, kNumFuzzerRuns);
}
} // namespace
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/fuzzer_shrinker_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/fuzzer_shrinker_test.cpp
index 84608f39f64..648507031af 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/fuzzer_shrinker_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/fuzzer_shrinker_test.cpp
@@ -154,7 +154,7 @@ void RunAndCheckShrinker(
void RunFuzzerAndShrinker(const std::string& shader,
const protobufs::FactSequence& initial_facts,
uint32_t seed) {
- const auto env = SPV_ENV_UNIVERSAL_1_3;
+ const auto env = SPV_ENV_UNIVERSAL_1_5;
std::vector<uint32_t> binary_in;
SpirvTools t(env);
@@ -434,7 +434,7 @@ TEST(FuzzerShrinkerTest, Miscellaneous2) {
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main" %16 %139
+ OpEntryPoint Fragment %4 "main" %16 %139 %25 %68
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 310
OpName %4 "main"
@@ -732,7 +732,7 @@ TEST(FuzzerShrinkerTest, Miscellaneous3) {
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main" %68 %100
+ OpEntryPoint Fragment %4 "main" %68 %100 %24
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 310
OpName %4 "main"
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/instruction_descriptor_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/instruction_descriptor_test.cpp
new file mode 100644
index 00000000000..5165cfb07a2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/instruction_descriptor_test.cpp
@@ -0,0 +1,69 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/instruction_descriptor.h"
+#include "test/fuzz/fuzz_test_util.h"
+
+namespace spvtools {
+namespace fuzz {
+namespace {
+
+TEST(InstructionDescriptorTest, BasicTest) {
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 0
+ %7 = OpTypePointer Function %6
+ %9 = OpConstant %6 0
+ %10 = OpTypeInt 32 1
+ %11 = OpTypePointer Function %10
+ %13 = OpConstant %10 2
+ %32 = OpConstant %10 0
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %164 = OpVariable %11 Function
+ %165 = OpVariable %11 Function
+ OpBranch %16
+ %16 = OpLabel
+ OpStore %164 %32
+ OpStore %165 %13
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_4;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ for (auto& function : *context->module()) {
+ for (auto& block : function) {
+ for (auto inst_it = block.cbegin(); inst_it != block.cend(); ++inst_it) {
+ ASSERT_EQ(&*inst_it,
+ FindInstruction(MakeInstructionDescriptor(block, inst_it),
+ context.get()));
+ }
+ }
+ }
+}
+
+} // namespace
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_add_dead_continue_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_add_dead_continue_test.cpp
index a15ea531c92..8173e726994 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_add_dead_continue_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_add_dead_continue_test.cpp
@@ -1626,6 +1626,52 @@ TEST(TransformationAddDeadContinueTest, Miscellaneous5) {
ASSERT_FALSE(bad_transformation.IsApplicable(context.get(), fact_manager));
}
+TEST(TransformationAddDeadContinueTest, DISABLED_Miscellaneous6) {
+ // A miscellaneous test that exposing a known bug in spirv-fuzz.
+
+ // TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/2919): re-enable
+ // this test as an when the known issue is fixed.
+
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeBool
+ %9 = OpConstantTrue %6
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ OpBranch %10
+ %10 = OpLabel
+ OpLoopMerge %13 %12 None
+ OpBranchConditional %9 %13 %11
+ %11 = OpLabel
+ %20 = OpCopyObject %6 %9
+ OpBranch %12
+ %12 = OpLabel
+ OpBranchConditional %9 %10 %13
+ %13 = OpLabel
+ %21 = OpCopyObject %6 %20
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_3;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ FactManager fact_manager;
+
+ auto bad_transformation = TransformationAddDeadContinue(10, true, {});
+
+ ASSERT_FALSE(bad_transformation.IsApplicable(context.get(), fact_manager));
+}
+
} // namespace
} // namespace fuzz
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_add_no_contraction_decoration_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_add_no_contraction_decoration_test.cpp
new file mode 100644
index 00000000000..b1a87ead37c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_add_no_contraction_decoration_test.cpp
@@ -0,0 +1,194 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/transformation_add_no_contraction_decoration.h"
+#include "test/fuzz/fuzz_test_util.h"
+
+namespace spvtools {
+namespace fuzz {
+namespace {
+
+TEST(TransformationAddNoContractionDecorationTest, BasicScenarios) {
+ // This is a simple transformation and this test handles the main cases.
+
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "x"
+ OpName %10 "y"
+ OpName %14 "i"
+ OpDecorate %32 NoContraction
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypePointer Function %6
+ %9 = OpConstant %6 0
+ %11 = OpConstant %6 2
+ %12 = OpTypeInt 32 1
+ %13 = OpTypePointer Function %12
+ %15 = OpConstant %12 0
+ %22 = OpConstant %12 10
+ %23 = OpTypeBool
+ %31 = OpConstant %6 3.5999999
+ %38 = OpConstant %12 1
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %10 = OpVariable %7 Function
+ %14 = OpVariable %13 Function
+ OpStore %8 %9
+ OpStore %10 %11
+ OpStore %14 %15
+ OpBranch %16
+ %16 = OpLabel
+ OpLoopMerge %18 %19 None
+ OpBranch %20
+ %20 = OpLabel
+ %21 = OpLoad %12 %14
+ %24 = OpSLessThan %23 %21 %22
+ OpBranchConditional %24 %17 %18
+ %17 = OpLabel
+ %25 = OpLoad %6 %10
+ %26 = OpLoad %6 %10
+ %27 = OpFMul %6 %25 %26
+ %28 = OpLoad %6 %8
+ %29 = OpFAdd %6 %28 %27
+ OpStore %8 %29
+ %30 = OpLoad %6 %10
+ %32 = OpFDiv %6 %30 %31
+ OpStore %10 %32
+ %33 = OpLoad %12 %14
+ %34 = OpConvertSToF %6 %33
+ %35 = OpLoad %6 %8
+ %36 = OpFAdd %6 %35 %34
+ OpStore %8 %36
+ OpBranch %19
+ %19 = OpLabel
+ %37 = OpLoad %12 %14
+ %39 = OpIAdd %12 %37 %38
+ OpStore %14 %39
+ OpBranch %16
+ %18 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_4;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ FactManager fact_manager;
+
+ // Invalid: 200 is not an id
+ ASSERT_FALSE(TransformationAddNoContractionDecoration(200).IsApplicable(
+ context.get(), fact_manager));
+ // Invalid: 17 is a block id
+ ASSERT_FALSE(TransformationAddNoContractionDecoration(17).IsApplicable(
+ context.get(), fact_manager));
+ // Invalid: 24 is not arithmetic
+ ASSERT_FALSE(TransformationAddNoContractionDecoration(24).IsApplicable(
+ context.get(), fact_manager));
+
+ // It is valid to add NoContraction to each of these ids (and it's fine to
+ // have duplicates of the decoration, in the case of 32).
+ for (uint32_t result_id : {32u, 32u, 27u, 29u, 39u}) {
+ TransformationAddNoContractionDecoration transformation(result_id);
+ ASSERT_TRUE(transformation.IsApplicable(context.get(), fact_manager));
+ transformation.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ }
+
+ std::string after_transformation = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "x"
+ OpName %10 "y"
+ OpName %14 "i"
+ OpDecorate %32 NoContraction
+ OpDecorate %32 NoContraction
+ OpDecorate %32 NoContraction
+ OpDecorate %27 NoContraction
+ OpDecorate %29 NoContraction
+ OpDecorate %39 NoContraction
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypePointer Function %6
+ %9 = OpConstant %6 0
+ %11 = OpConstant %6 2
+ %12 = OpTypeInt 32 1
+ %13 = OpTypePointer Function %12
+ %15 = OpConstant %12 0
+ %22 = OpConstant %12 10
+ %23 = OpTypeBool
+ %31 = OpConstant %6 3.5999999
+ %38 = OpConstant %12 1
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %10 = OpVariable %7 Function
+ %14 = OpVariable %13 Function
+ OpStore %8 %9
+ OpStore %10 %11
+ OpStore %14 %15
+ OpBranch %16
+ %16 = OpLabel
+ OpLoopMerge %18 %19 None
+ OpBranch %20
+ %20 = OpLabel
+ %21 = OpLoad %12 %14
+ %24 = OpSLessThan %23 %21 %22
+ OpBranchConditional %24 %17 %18
+ %17 = OpLabel
+ %25 = OpLoad %6 %10
+ %26 = OpLoad %6 %10
+ %27 = OpFMul %6 %25 %26
+ %28 = OpLoad %6 %8
+ %29 = OpFAdd %6 %28 %27
+ OpStore %8 %29
+ %30 = OpLoad %6 %10
+ %32 = OpFDiv %6 %30 %31
+ OpStore %10 %32
+ %33 = OpLoad %12 %14
+ %34 = OpConvertSToF %6 %33
+ %35 = OpLoad %6 %8
+ %36 = OpFAdd %6 %35 %34
+ OpStore %8 %36
+ OpBranch %19
+ %19 = OpLabel
+ %37 = OpLoad %12 %14
+ %39 = OpIAdd %12 %37 %38
+ OpStore %14 %39
+ OpBranch %16
+ %18 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ ASSERT_TRUE(IsEqual(env, after_transformation, context.get()));
+}
+
+} // namespace
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_composite_construct_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_composite_construct_test.cpp
new file mode 100644
index 00000000000..b73bb3ddb1d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_composite_construct_test.cpp
@@ -0,0 +1,1335 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/transformation_composite_construct.h"
+#include "source/fuzz/data_descriptor.h"
+#include "source/fuzz/instruction_descriptor.h"
+#include "test/fuzz/fuzz_test_util.h"
+
+namespace spvtools {
+namespace fuzz {
+namespace {
+
+TEST(TransformationCompositeConstructTest, ConstructArrays) {
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %11 "floats"
+ OpName %22 "x"
+ OpName %39 "vecs"
+ OpName %49 "bools"
+ OpName %60 "many_uvec3s"
+ OpDecorate %60 RelaxedPrecision
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeInt 32 0
+ %8 = OpConstant %7 2
+ %9 = OpTypeArray %6 %8
+ %10 = OpTypePointer Function %9
+ %12 = OpTypeInt 32 1
+ %13 = OpConstant %12 0
+ %14 = OpConstant %6 1
+ %15 = OpTypePointer Function %6
+ %17 = OpConstant %12 1
+ %18 = OpConstant %6 2
+ %20 = OpTypeVector %6 2
+ %21 = OpTypePointer Function %20
+ %32 = OpTypeBool
+ %36 = OpConstant %7 3
+ %37 = OpTypeArray %20 %36
+ %38 = OpTypePointer Private %37
+ %39 = OpVariable %38 Private
+ %40 = OpConstant %6 3
+ %41 = OpConstantComposite %20 %40 %40
+ %42 = OpTypePointer Private %20
+ %44 = OpConstant %12 2
+ %47 = OpTypeArray %32 %36
+ %48 = OpTypePointer Function %47
+ %50 = OpConstantTrue %32
+ %51 = OpTypePointer Function %32
+ %56 = OpTypeVector %7 3
+ %57 = OpTypeArray %56 %8
+ %58 = OpTypeArray %57 %8
+ %59 = OpTypePointer Function %58
+ %61 = OpConstant %7 4
+ %62 = OpConstantComposite %56 %61 %61 %61
+ %63 = OpTypePointer Function %56
+ %65 = OpConstant %7 5
+ %66 = OpConstantComposite %56 %65 %65 %65
+ %67 = OpConstant %7 6
+ %68 = OpConstantComposite %56 %67 %67 %67
+ %69 = OpConstantComposite %57 %66 %68
+ %100 = OpUndef %57
+ %70 = OpTypePointer Function %57
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %11 = OpVariable %10 Function
+ %22 = OpVariable %21 Function
+ %49 = OpVariable %48 Function
+ %60 = OpVariable %59 Function
+ %16 = OpAccessChain %15 %11 %13
+ OpStore %16 %14
+ %19 = OpAccessChain %15 %11 %17
+ OpStore %19 %18
+ %23 = OpAccessChain %15 %11 %13
+ %24 = OpLoad %6 %23
+ %25 = OpAccessChain %15 %11 %17
+ %26 = OpLoad %6 %25
+ %27 = OpCompositeConstruct %20 %24 %26
+ OpStore %22 %27
+ %28 = OpAccessChain %15 %11 %13
+ %29 = OpLoad %6 %28
+ %30 = OpAccessChain %15 %11 %17
+ %31 = OpLoad %6 %30
+ %33 = OpFOrdGreaterThan %32 %29 %31
+ OpSelectionMerge %35 None
+ OpBranchConditional %33 %34 %35
+ %34 = OpLabel
+ %43 = OpAccessChain %42 %39 %17
+ OpStore %43 %41
+ %45 = OpLoad %20 %22
+ %46 = OpAccessChain %42 %39 %44
+ OpStore %46 %45
+ OpBranch %35
+ %35 = OpLabel
+ %52 = OpAccessChain %51 %49 %13
+ OpStore %52 %50
+ %53 = OpAccessChain %51 %49 %13
+ %54 = OpLoad %32 %53
+ %55 = OpAccessChain %51 %49 %17
+ OpStore %55 %54
+ %64 = OpAccessChain %63 %60 %13 %13
+ OpStore %64 %62
+ %71 = OpAccessChain %70 %60 %17
+ OpStore %71 %69
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_3;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ FactManager fact_manager;
+
+ // Make a vec2[3]
+ TransformationCompositeConstruct make_vec2_array_length_3(
+ 37, {41, 45, 27}, MakeInstructionDescriptor(46, SpvOpAccessChain, 0),
+ 200);
+ // Bad: there are too many components
+ TransformationCompositeConstruct make_vec2_array_length_3_bad(
+ 37, {41, 45, 27, 27}, MakeInstructionDescriptor(46, SpvOpAccessChain, 0),
+ 200);
+ ASSERT_TRUE(
+ make_vec2_array_length_3.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ make_vec2_array_length_3_bad.IsApplicable(context.get(), fact_manager));
+ make_vec2_array_length_3.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(41, {}),
+ MakeDataDescriptor(200, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(45, {}),
+ MakeDataDescriptor(200, {1})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(27, {}),
+ MakeDataDescriptor(200, {2})));
+
+ // Make a float[2]
+ TransformationCompositeConstruct make_float_array_length_2(
+ 9, {24, 40}, MakeInstructionDescriptor(71, SpvOpStore, 0), 201);
+ // Bad: %41 does not have type float
+ TransformationCompositeConstruct make_float_array_length_2_bad(
+ 9, {41, 40}, MakeInstructionDescriptor(71, SpvOpStore, 0), 201);
+ ASSERT_TRUE(
+ make_float_array_length_2.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ make_float_array_length_2_bad.IsApplicable(context.get(), fact_manager));
+ make_float_array_length_2.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(24, {}),
+ MakeDataDescriptor(201, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(40, {}),
+ MakeDataDescriptor(201, {1})));
+
+ // Make a bool[3]
+ TransformationCompositeConstruct make_bool_array_length_3(
+ 47, {33, 50, 50}, MakeInstructionDescriptor(33, SpvOpSelectionMerge, 0),
+ 202);
+ // Bad: %54 is not available at the desired program point.
+ TransformationCompositeConstruct make_bool_array_length_3_bad(
+ 47, {33, 54, 50}, MakeInstructionDescriptor(33, SpvOpSelectionMerge, 0),
+ 202);
+ ASSERT_TRUE(
+ make_bool_array_length_3.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ make_bool_array_length_3_bad.IsApplicable(context.get(), fact_manager));
+ make_bool_array_length_3.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(33, {}),
+ MakeDataDescriptor(202, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(50, {}),
+ MakeDataDescriptor(202, {1})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(50, {}),
+ MakeDataDescriptor(202, {2})));
+
+ // make a uvec3[2][2]
+ TransformationCompositeConstruct make_uvec3_array_length_2_2(
+ 58, {69, 100}, MakeInstructionDescriptor(64, SpvOpStore, 0), 203);
+ // Bad: Skip count 100 is too large.
+ TransformationCompositeConstruct make_uvec3_array_length_2_2_bad(
+ 58, {33, 54}, MakeInstructionDescriptor(64, SpvOpStore, 100), 203);
+ ASSERT_TRUE(
+ make_uvec3_array_length_2_2.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_uvec3_array_length_2_2_bad.IsApplicable(context.get(),
+ fact_manager));
+ make_uvec3_array_length_2_2.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(69, {}),
+ MakeDataDescriptor(203, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(100, {}),
+ MakeDataDescriptor(203, {1})));
+
+ std::string after_transformation = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %11 "floats"
+ OpName %22 "x"
+ OpName %39 "vecs"
+ OpName %49 "bools"
+ OpName %60 "many_uvec3s"
+ OpDecorate %60 RelaxedPrecision
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeInt 32 0
+ %8 = OpConstant %7 2
+ %9 = OpTypeArray %6 %8
+ %10 = OpTypePointer Function %9
+ %12 = OpTypeInt 32 1
+ %13 = OpConstant %12 0
+ %14 = OpConstant %6 1
+ %15 = OpTypePointer Function %6
+ %17 = OpConstant %12 1
+ %18 = OpConstant %6 2
+ %20 = OpTypeVector %6 2
+ %21 = OpTypePointer Function %20
+ %32 = OpTypeBool
+ %36 = OpConstant %7 3
+ %37 = OpTypeArray %20 %36
+ %38 = OpTypePointer Private %37
+ %39 = OpVariable %38 Private
+ %40 = OpConstant %6 3
+ %41 = OpConstantComposite %20 %40 %40
+ %42 = OpTypePointer Private %20
+ %44 = OpConstant %12 2
+ %47 = OpTypeArray %32 %36
+ %48 = OpTypePointer Function %47
+ %50 = OpConstantTrue %32
+ %51 = OpTypePointer Function %32
+ %56 = OpTypeVector %7 3
+ %57 = OpTypeArray %56 %8
+ %58 = OpTypeArray %57 %8
+ %59 = OpTypePointer Function %58
+ %61 = OpConstant %7 4
+ %62 = OpConstantComposite %56 %61 %61 %61
+ %63 = OpTypePointer Function %56
+ %65 = OpConstant %7 5
+ %66 = OpConstantComposite %56 %65 %65 %65
+ %67 = OpConstant %7 6
+ %68 = OpConstantComposite %56 %67 %67 %67
+ %69 = OpConstantComposite %57 %66 %68
+ %100 = OpUndef %57
+ %70 = OpTypePointer Function %57
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %11 = OpVariable %10 Function
+ %22 = OpVariable %21 Function
+ %49 = OpVariable %48 Function
+ %60 = OpVariable %59 Function
+ %16 = OpAccessChain %15 %11 %13
+ OpStore %16 %14
+ %19 = OpAccessChain %15 %11 %17
+ OpStore %19 %18
+ %23 = OpAccessChain %15 %11 %13
+ %24 = OpLoad %6 %23
+ %25 = OpAccessChain %15 %11 %17
+ %26 = OpLoad %6 %25
+ %27 = OpCompositeConstruct %20 %24 %26
+ OpStore %22 %27
+ %28 = OpAccessChain %15 %11 %13
+ %29 = OpLoad %6 %28
+ %30 = OpAccessChain %15 %11 %17
+ %31 = OpLoad %6 %30
+ %33 = OpFOrdGreaterThan %32 %29 %31
+ %202 = OpCompositeConstruct %47 %33 %50 %50
+ OpSelectionMerge %35 None
+ OpBranchConditional %33 %34 %35
+ %34 = OpLabel
+ %43 = OpAccessChain %42 %39 %17
+ OpStore %43 %41
+ %45 = OpLoad %20 %22
+ %200 = OpCompositeConstruct %37 %41 %45 %27
+ %46 = OpAccessChain %42 %39 %44
+ OpStore %46 %45
+ OpBranch %35
+ %35 = OpLabel
+ %52 = OpAccessChain %51 %49 %13
+ OpStore %52 %50
+ %53 = OpAccessChain %51 %49 %13
+ %54 = OpLoad %32 %53
+ %55 = OpAccessChain %51 %49 %17
+ OpStore %55 %54
+ %64 = OpAccessChain %63 %60 %13 %13
+ %203 = OpCompositeConstruct %58 %69 %100
+ OpStore %64 %62
+ %71 = OpAccessChain %70 %60 %17
+ %201 = OpCompositeConstruct %9 %24 %40
+ OpStore %71 %69
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ ASSERT_TRUE(IsEqual(env, after_transformation, context.get()));
+}
+
+TEST(TransformationCompositeConstructTest, ConstructMatrices) {
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %9 "v1"
+ OpName %12 "v2"
+ OpName %14 "v3"
+ OpName %19 "v4"
+ OpName %26 "v5"
+ OpName %29 "v6"
+ OpName %34 "m34"
+ OpName %37 "m43"
+ OpName %43 "vecs"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 3
+ %8 = OpTypePointer Function %7
+ %10 = OpConstant %6 1
+ %11 = OpConstantComposite %7 %10 %10 %10
+ %17 = OpTypeVector %6 4
+ %18 = OpTypePointer Function %17
+ %21 = OpConstant %6 2
+ %32 = OpTypeMatrix %17 3
+ %33 = OpTypePointer Private %32
+ %34 = OpVariable %33 Private
+ %35 = OpTypeMatrix %7 4
+ %36 = OpTypePointer Private %35
+ %37 = OpVariable %36 Private
+ %38 = OpTypeVector %6 2
+ %39 = OpTypeInt 32 0
+ %40 = OpConstant %39 3
+ %41 = OpTypeArray %38 %40
+ %42 = OpTypePointer Private %41
+ %43 = OpVariable %42 Private
+ %100 = OpUndef %7
+ %101 = OpUndef %17
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %9 = OpVariable %8 Function
+ %12 = OpVariable %8 Function
+ %14 = OpVariable %8 Function
+ %19 = OpVariable %18 Function
+ %26 = OpVariable %18 Function
+ %29 = OpVariable %18 Function
+ OpStore %9 %11
+ %13 = OpLoad %7 %9
+ OpStore %12 %13
+ %15 = OpLoad %7 %12
+ %16 = OpVectorShuffle %7 %15 %15 2 1 0
+ OpStore %14 %16
+ %20 = OpLoad %7 %14
+ %22 = OpCompositeExtract %6 %20 0
+ %23 = OpCompositeExtract %6 %20 1
+ %24 = OpCompositeExtract %6 %20 2
+ %25 = OpCompositeConstruct %17 %22 %23 %24 %21
+ OpStore %19 %25
+ %27 = OpLoad %17 %19
+ %28 = OpVectorShuffle %17 %27 %27 3 2 1 0
+ OpStore %26 %28
+ %30 = OpLoad %7 %9
+ %31 = OpVectorShuffle %17 %30 %30 0 0 1 1
+ OpStore %29 %31
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_3;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ FactManager fact_manager;
+
+ // make a mat3x4
+ TransformationCompositeConstruct make_mat34(
+ 32, {25, 28, 31}, MakeInstructionDescriptor(31, SpvOpReturn, 0), 200);
+ // Bad: %35 is mat4x3, not mat3x4.
+ TransformationCompositeConstruct make_mat34_bad(
+ 35, {25, 28, 31}, MakeInstructionDescriptor(31, SpvOpReturn, 0), 200);
+ ASSERT_TRUE(make_mat34.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_mat34_bad.IsApplicable(context.get(), fact_manager));
+ make_mat34.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(25, {}),
+ MakeDataDescriptor(200, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(28, {}),
+ MakeDataDescriptor(200, {1})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(31, {}),
+ MakeDataDescriptor(200, {2})));
+
+ // make a mat4x3
+ TransformationCompositeConstruct make_mat43(
+ 35, {11, 13, 16, 100}, MakeInstructionDescriptor(31, SpvOpStore, 0), 201);
+ // Bad: %25 does not match the matrix's column type.
+ TransformationCompositeConstruct make_mat43_bad(
+ 35, {25, 13, 16, 100}, MakeInstructionDescriptor(31, SpvOpStore, 0), 201);
+ ASSERT_TRUE(make_mat43.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_mat43_bad.IsApplicable(context.get(), fact_manager));
+ make_mat43.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(11, {}),
+ MakeDataDescriptor(201, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(13, {}),
+ MakeDataDescriptor(201, {1})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(16, {}),
+ MakeDataDescriptor(201, {2})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(100, {}),
+ MakeDataDescriptor(201, {3})));
+
+ std::string after_transformation = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %9 "v1"
+ OpName %12 "v2"
+ OpName %14 "v3"
+ OpName %19 "v4"
+ OpName %26 "v5"
+ OpName %29 "v6"
+ OpName %34 "m34"
+ OpName %37 "m43"
+ OpName %43 "vecs"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 3
+ %8 = OpTypePointer Function %7
+ %10 = OpConstant %6 1
+ %11 = OpConstantComposite %7 %10 %10 %10
+ %17 = OpTypeVector %6 4
+ %18 = OpTypePointer Function %17
+ %21 = OpConstant %6 2
+ %32 = OpTypeMatrix %17 3
+ %33 = OpTypePointer Private %32
+ %34 = OpVariable %33 Private
+ %35 = OpTypeMatrix %7 4
+ %36 = OpTypePointer Private %35
+ %37 = OpVariable %36 Private
+ %38 = OpTypeVector %6 2
+ %39 = OpTypeInt 32 0
+ %40 = OpConstant %39 3
+ %41 = OpTypeArray %38 %40
+ %42 = OpTypePointer Private %41
+ %43 = OpVariable %42 Private
+ %100 = OpUndef %7
+ %101 = OpUndef %17
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %9 = OpVariable %8 Function
+ %12 = OpVariable %8 Function
+ %14 = OpVariable %8 Function
+ %19 = OpVariable %18 Function
+ %26 = OpVariable %18 Function
+ %29 = OpVariable %18 Function
+ OpStore %9 %11
+ %13 = OpLoad %7 %9
+ OpStore %12 %13
+ %15 = OpLoad %7 %12
+ %16 = OpVectorShuffle %7 %15 %15 2 1 0
+ OpStore %14 %16
+ %20 = OpLoad %7 %14
+ %22 = OpCompositeExtract %6 %20 0
+ %23 = OpCompositeExtract %6 %20 1
+ %24 = OpCompositeExtract %6 %20 2
+ %25 = OpCompositeConstruct %17 %22 %23 %24 %21
+ OpStore %19 %25
+ %27 = OpLoad %17 %19
+ %28 = OpVectorShuffle %17 %27 %27 3 2 1 0
+ OpStore %26 %28
+ %30 = OpLoad %7 %9
+ %31 = OpVectorShuffle %17 %30 %30 0 0 1 1
+ %201 = OpCompositeConstruct %35 %11 %13 %16 %100
+ OpStore %29 %31
+ %200 = OpCompositeConstruct %32 %25 %28 %31
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ ASSERT_TRUE(IsEqual(env, after_transformation, context.get()));
+}
+
+TEST(TransformationCompositeConstructTest, ConstructStructs) {
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %9 "Inner"
+ OpMemberName %9 0 "a"
+ OpMemberName %9 1 "b"
+ OpName %11 "i1"
+ OpName %22 "i2"
+ OpName %33 "Outer"
+ OpMemberName %33 0 "c"
+ OpMemberName %33 1 "d"
+ OpMemberName %33 2 "e"
+ OpName %35 "o"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 2
+ %8 = OpTypeInt 32 1
+ %9 = OpTypeStruct %7 %8
+ %10 = OpTypePointer Function %9
+ %12 = OpConstant %8 0
+ %13 = OpConstant %6 2
+ %14 = OpTypeInt 32 0
+ %15 = OpConstant %14 0
+ %16 = OpTypePointer Function %6
+ %18 = OpConstant %8 1
+ %19 = OpConstant %8 3
+ %20 = OpTypePointer Function %8
+ %23 = OpTypePointer Function %7
+ %31 = OpConstant %14 2
+ %32 = OpTypeArray %9 %31
+ %33 = OpTypeStruct %32 %9 %6
+ %34 = OpTypePointer Function %33
+ %36 = OpConstant %6 1
+ %37 = OpConstantComposite %7 %36 %13
+ %38 = OpConstant %8 2
+ %39 = OpConstantComposite %9 %37 %38
+ %40 = OpConstant %6 3
+ %41 = OpConstant %6 4
+ %42 = OpConstantComposite %7 %40 %41
+ %56 = OpConstant %6 5
+ %100 = OpUndef %9
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %11 = OpVariable %10 Function
+ %22 = OpVariable %10 Function
+ %35 = OpVariable %34 Function
+ %17 = OpAccessChain %16 %11 %12 %15
+ OpStore %17 %13
+ %21 = OpAccessChain %20 %11 %18
+ OpStore %21 %19
+ %24 = OpAccessChain %23 %11 %12
+ %25 = OpLoad %7 %24
+ %26 = OpAccessChain %23 %22 %12
+ OpStore %26 %25
+ %27 = OpAccessChain %20 %11 %18
+ %28 = OpLoad %8 %27
+ %29 = OpIAdd %8 %28 %18
+ %30 = OpAccessChain %20 %22 %18
+ OpStore %30 %29
+ %43 = OpAccessChain %20 %11 %18
+ %44 = OpLoad %8 %43
+ %45 = OpCompositeConstruct %9 %42 %44
+ %46 = OpCompositeConstruct %32 %39 %45
+ %47 = OpLoad %9 %22
+ %48 = OpCompositeConstruct %33 %46 %47 %40
+ OpStore %35 %48
+ %49 = OpLoad %9 %11
+ %50 = OpAccessChain %10 %35 %12 %12
+ OpStore %50 %49
+ %51 = OpLoad %9 %22
+ %52 = OpAccessChain %10 %35 %12 %18
+ OpStore %52 %51
+ %53 = OpAccessChain %10 %35 %12 %12
+ %54 = OpLoad %9 %53
+ %55 = OpAccessChain %10 %35 %18
+ OpStore %55 %54
+ %57 = OpAccessChain %16 %35 %38
+ OpStore %57 %56
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_3;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ FactManager fact_manager;
+
+ // make an Inner
+ TransformationCompositeConstruct make_inner(
+ 9, {25, 19}, MakeInstructionDescriptor(57, SpvOpAccessChain, 0), 200);
+ // Bad: Too few fields to make the struct.
+ TransformationCompositeConstruct make_inner_bad(
+ 9, {25}, MakeInstructionDescriptor(57, SpvOpAccessChain, 0), 200);
+ ASSERT_TRUE(make_inner.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_inner_bad.IsApplicable(context.get(), fact_manager));
+ make_inner.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(25, {}),
+ MakeDataDescriptor(200, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(19, {}),
+ MakeDataDescriptor(200, {1})));
+
+ // make an Outer
+ TransformationCompositeConstruct make_outer(
+ 33, {46, 200, 56}, MakeInstructionDescriptor(200, SpvOpAccessChain, 0),
+ 201);
+ // Bad: %200 is not available at the desired program point.
+ TransformationCompositeConstruct make_outer_bad(
+ 33, {46, 200, 56},
+ MakeInstructionDescriptor(200, SpvOpCompositeConstruct, 0), 201);
+ ASSERT_TRUE(make_outer.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_outer_bad.IsApplicable(context.get(), fact_manager));
+ make_outer.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(46, {}),
+ MakeDataDescriptor(201, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(200, {}),
+ MakeDataDescriptor(201, {1})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(56, {}),
+ MakeDataDescriptor(201, {2})));
+
+ std::string after_transformation = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %9 "Inner"
+ OpMemberName %9 0 "a"
+ OpMemberName %9 1 "b"
+ OpName %11 "i1"
+ OpName %22 "i2"
+ OpName %33 "Outer"
+ OpMemberName %33 0 "c"
+ OpMemberName %33 1 "d"
+ OpMemberName %33 2 "e"
+ OpName %35 "o"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 2
+ %8 = OpTypeInt 32 1
+ %9 = OpTypeStruct %7 %8
+ %10 = OpTypePointer Function %9
+ %12 = OpConstant %8 0
+ %13 = OpConstant %6 2
+ %14 = OpTypeInt 32 0
+ %15 = OpConstant %14 0
+ %16 = OpTypePointer Function %6
+ %18 = OpConstant %8 1
+ %19 = OpConstant %8 3
+ %20 = OpTypePointer Function %8
+ %23 = OpTypePointer Function %7
+ %31 = OpConstant %14 2
+ %32 = OpTypeArray %9 %31
+ %33 = OpTypeStruct %32 %9 %6
+ %34 = OpTypePointer Function %33
+ %36 = OpConstant %6 1
+ %37 = OpConstantComposite %7 %36 %13
+ %38 = OpConstant %8 2
+ %39 = OpConstantComposite %9 %37 %38
+ %40 = OpConstant %6 3
+ %41 = OpConstant %6 4
+ %42 = OpConstantComposite %7 %40 %41
+ %56 = OpConstant %6 5
+ %100 = OpUndef %9
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %11 = OpVariable %10 Function
+ %22 = OpVariable %10 Function
+ %35 = OpVariable %34 Function
+ %17 = OpAccessChain %16 %11 %12 %15
+ OpStore %17 %13
+ %21 = OpAccessChain %20 %11 %18
+ OpStore %21 %19
+ %24 = OpAccessChain %23 %11 %12
+ %25 = OpLoad %7 %24
+ %26 = OpAccessChain %23 %22 %12
+ OpStore %26 %25
+ %27 = OpAccessChain %20 %11 %18
+ %28 = OpLoad %8 %27
+ %29 = OpIAdd %8 %28 %18
+ %30 = OpAccessChain %20 %22 %18
+ OpStore %30 %29
+ %43 = OpAccessChain %20 %11 %18
+ %44 = OpLoad %8 %43
+ %45 = OpCompositeConstruct %9 %42 %44
+ %46 = OpCompositeConstruct %32 %39 %45
+ %47 = OpLoad %9 %22
+ %48 = OpCompositeConstruct %33 %46 %47 %40
+ OpStore %35 %48
+ %49 = OpLoad %9 %11
+ %50 = OpAccessChain %10 %35 %12 %12
+ OpStore %50 %49
+ %51 = OpLoad %9 %22
+ %52 = OpAccessChain %10 %35 %12 %18
+ OpStore %52 %51
+ %53 = OpAccessChain %10 %35 %12 %12
+ %54 = OpLoad %9 %53
+ %55 = OpAccessChain %10 %35 %18
+ OpStore %55 %54
+ %200 = OpCompositeConstruct %9 %25 %19
+ %201 = OpCompositeConstruct %33 %46 %200 %56
+ %57 = OpAccessChain %16 %35 %38
+ OpStore %57 %56
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ ASSERT_TRUE(IsEqual(env, after_transformation, context.get()));
+}
+
+TEST(TransformationCompositeConstructTest, ConstructVectors) {
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %9 "v2"
+ OpName %27 "v3"
+ OpName %46 "v4"
+ OpName %53 "iv2"
+ OpName %61 "uv3"
+ OpName %72 "bv4"
+ OpName %88 "uv2"
+ OpName %95 "bv3"
+ OpName %104 "bv2"
+ OpName %116 "iv3"
+ OpName %124 "iv4"
+ OpName %133 "uv4"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 2
+ %8 = OpTypePointer Function %7
+ %10 = OpConstant %6 1
+ %11 = OpConstant %6 2
+ %12 = OpConstantComposite %7 %10 %11
+ %13 = OpTypeInt 32 0
+ %14 = OpConstant %13 0
+ %15 = OpTypePointer Function %6
+ %18 = OpConstant %13 1
+ %21 = OpTypeBool
+ %25 = OpTypeVector %6 3
+ %26 = OpTypePointer Function %25
+ %33 = OpConstant %6 3
+ %34 = OpConstant %6 -0.756802499
+ %38 = OpConstant %13 2
+ %44 = OpTypeVector %6 4
+ %45 = OpTypePointer Function %44
+ %50 = OpTypeInt 32 1
+ %51 = OpTypeVector %50 2
+ %52 = OpTypePointer Function %51
+ %57 = OpTypePointer Function %50
+ %59 = OpTypeVector %13 3
+ %60 = OpTypePointer Function %59
+ %65 = OpConstant %13 3
+ %67 = OpTypePointer Function %13
+ %70 = OpTypeVector %21 4
+ %71 = OpTypePointer Function %70
+ %73 = OpConstantTrue %21
+ %74 = OpTypePointer Function %21
+ %86 = OpTypeVector %13 2
+ %87 = OpTypePointer Function %86
+ %93 = OpTypeVector %21 3
+ %94 = OpTypePointer Function %93
+ %102 = OpTypeVector %21 2
+ %103 = OpTypePointer Function %102
+ %111 = OpConstantFalse %21
+ %114 = OpTypeVector %50 3
+ %115 = OpTypePointer Function %114
+ %117 = OpConstant %50 3
+ %122 = OpTypeVector %50 4
+ %123 = OpTypePointer Function %122
+ %131 = OpTypeVector %13 4
+ %132 = OpTypePointer Function %131
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %9 = OpVariable %8 Function
+ %27 = OpVariable %26 Function
+ %46 = OpVariable %45 Function
+ %53 = OpVariable %52 Function
+ %61 = OpVariable %60 Function
+ %72 = OpVariable %71 Function
+ %88 = OpVariable %87 Function
+ %95 = OpVariable %94 Function
+ %104 = OpVariable %103 Function
+ %116 = OpVariable %115 Function
+ %124 = OpVariable %123 Function
+ %133 = OpVariable %132 Function
+ OpStore %9 %12
+ %16 = OpAccessChain %15 %9 %14
+ %17 = OpLoad %6 %16
+ %19 = OpAccessChain %15 %9 %18
+ %20 = OpLoad %6 %19
+ %22 = OpFOrdGreaterThan %21 %17 %20
+ OpSelectionMerge %24 None
+ OpBranchConditional %22 %23 %101
+ %23 = OpLabel
+ %28 = OpAccessChain %15 %9 %14
+ %29 = OpLoad %6 %28
+ %30 = OpAccessChain %15 %9 %18
+ %31 = OpLoad %6 %30
+ %32 = OpFAdd %6 %29 %31
+ %35 = OpCompositeConstruct %25 %32 %33 %34
+ OpStore %27 %35
+ %36 = OpAccessChain %15 %27 %14
+ %37 = OpLoad %6 %36
+ %39 = OpAccessChain %15 %27 %38
+ %40 = OpLoad %6 %39
+ %41 = OpFOrdLessThan %21 %37 %40
+ OpSelectionMerge %43 None
+ OpBranchConditional %41 %42 %69
+ %42 = OpLabel
+ %47 = OpAccessChain %15 %9 %18
+ %48 = OpLoad %6 %47
+ %49 = OpAccessChain %15 %46 %14
+ OpStore %49 %48
+ %54 = OpAccessChain %15 %27 %38
+ %55 = OpLoad %6 %54
+ %56 = OpConvertFToS %50 %55
+ %58 = OpAccessChain %57 %53 %14
+ OpStore %58 %56
+ %62 = OpAccessChain %15 %46 %14
+ %63 = OpLoad %6 %62
+ %64 = OpConvertFToU %13 %63
+ %66 = OpIAdd %13 %64 %65
+ %68 = OpAccessChain %67 %61 %14
+ OpStore %68 %66
+ OpBranch %43
+ %69 = OpLabel
+ %75 = OpAccessChain %74 %72 %14
+ OpStore %75 %73
+ %76 = OpAccessChain %74 %72 %14
+ %77 = OpLoad %21 %76
+ %78 = OpLogicalNot %21 %77
+ %79 = OpAccessChain %74 %72 %18
+ OpStore %79 %78
+ %80 = OpAccessChain %74 %72 %14
+ %81 = OpLoad %21 %80
+ %82 = OpAccessChain %74 %72 %18
+ %83 = OpLoad %21 %82
+ %84 = OpLogicalAnd %21 %81 %83
+ %85 = OpAccessChain %74 %72 %38
+ OpStore %85 %84
+ %89 = OpAccessChain %67 %88 %14
+ %90 = OpLoad %13 %89
+ %91 = OpINotEqual %21 %90 %14
+ %92 = OpAccessChain %74 %72 %65
+ OpStore %92 %91
+ OpBranch %43
+ %43 = OpLabel
+ %96 = OpLoad %70 %72
+ %97 = OpCompositeExtract %21 %96 0
+ %98 = OpCompositeExtract %21 %96 1
+ %99 = OpCompositeExtract %21 %96 2
+ %100 = OpCompositeConstruct %93 %97 %98 %99
+ OpStore %95 %100
+ OpBranch %24
+ %101 = OpLabel
+ %105 = OpAccessChain %67 %88 %14
+ %106 = OpLoad %13 %105
+ %107 = OpINotEqual %21 %106 %14
+ %108 = OpCompositeConstruct %102 %107 %107
+ OpStore %104 %108
+ OpBranch %24
+ %24 = OpLabel
+ %109 = OpAccessChain %74 %104 %18
+ %110 = OpLoad %21 %109
+ %112 = OpLogicalOr %21 %110 %111
+ %113 = OpAccessChain %74 %104 %14
+ OpStore %113 %112
+ %118 = OpAccessChain %57 %116 %14
+ OpStore %118 %117
+ %119 = OpAccessChain %57 %116 %14
+ %120 = OpLoad %50 %119
+ %121 = OpAccessChain %57 %53 %18
+ OpStore %121 %120
+ %125 = OpAccessChain %57 %116 %14
+ %126 = OpLoad %50 %125
+ %127 = OpAccessChain %57 %53 %18
+ %128 = OpLoad %50 %127
+ %129 = OpIAdd %50 %126 %128
+ %130 = OpAccessChain %57 %124 %65
+ OpStore %130 %129
+ %134 = OpAccessChain %57 %116 %14
+ %135 = OpLoad %50 %134
+ %136 = OpBitcast %13 %135
+ %137 = OpAccessChain %67 %133 %14
+ OpStore %137 %136
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_3;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ FactManager fact_manager;
+
+ TransformationCompositeConstruct make_vec2(
+ 7, {17, 11}, MakeInstructionDescriptor(100, SpvOpStore, 0), 200);
+ // Bad: not enough data for a vec2
+ TransformationCompositeConstruct make_vec2_bad(
+ 7, {11}, MakeInstructionDescriptor(100, SpvOpStore, 0), 200);
+ ASSERT_TRUE(make_vec2.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_vec2_bad.IsApplicable(context.get(), fact_manager));
+ make_vec2.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(17, {}),
+ MakeDataDescriptor(200, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(11, {}),
+ MakeDataDescriptor(200, {1})));
+
+ TransformationCompositeConstruct make_vec3(
+ 25, {12, 32}, MakeInstructionDescriptor(35, SpvOpCompositeConstruct, 0),
+ 201);
+ // Bad: too much data for a vec3
+ TransformationCompositeConstruct make_vec3_bad(
+ 25, {12, 32, 32},
+ MakeInstructionDescriptor(35, SpvOpCompositeConstruct, 0), 201);
+ ASSERT_TRUE(make_vec3.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_vec3_bad.IsApplicable(context.get(), fact_manager));
+ make_vec3.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(12, {0}),
+ MakeDataDescriptor(201, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(12, {1}),
+ MakeDataDescriptor(201, {1})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(32, {}),
+ MakeDataDescriptor(201, {2})));
+
+ TransformationCompositeConstruct make_vec4(
+ 44, {32, 32, 10, 11}, MakeInstructionDescriptor(75, SpvOpAccessChain, 0),
+ 202);
+ // Bad: id 48 is not available at the insertion points
+ TransformationCompositeConstruct make_vec4_bad(
+ 44, {48, 32, 10, 11}, MakeInstructionDescriptor(75, SpvOpAccessChain, 0),
+ 202);
+ ASSERT_TRUE(make_vec4.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_vec4_bad.IsApplicable(context.get(), fact_manager));
+ make_vec4.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(32, {}),
+ MakeDataDescriptor(202, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(32, {}),
+ MakeDataDescriptor(202, {1})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(10, {}),
+ MakeDataDescriptor(202, {2})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(11, {}),
+ MakeDataDescriptor(202, {3})));
+
+ TransformationCompositeConstruct make_ivec2(
+ 51, {126, 120}, MakeInstructionDescriptor(128, SpvOpLoad, 0), 203);
+ // Bad: if 128 is not available at the instruction that defines 128
+ TransformationCompositeConstruct make_ivec2_bad(
+ 51, {128, 120}, MakeInstructionDescriptor(128, SpvOpLoad, 0), 203);
+ ASSERT_TRUE(make_ivec2.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_ivec2_bad.IsApplicable(context.get(), fact_manager));
+ make_ivec2.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(126, {}),
+ MakeDataDescriptor(203, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(120, {}),
+ MakeDataDescriptor(203, {1})));
+
+ TransformationCompositeConstruct make_ivec3(
+ 114, {56, 117, 56}, MakeInstructionDescriptor(66, SpvOpAccessChain, 0),
+ 204);
+ // Bad because 1300 is not an id
+ TransformationCompositeConstruct make_ivec3_bad(
+ 114, {56, 117, 1300}, MakeInstructionDescriptor(66, SpvOpAccessChain, 0),
+ 204);
+ ASSERT_TRUE(make_ivec3.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_ivec3_bad.IsApplicable(context.get(), fact_manager));
+ make_ivec3.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(56, {}),
+ MakeDataDescriptor(204, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(117, {}),
+ MakeDataDescriptor(204, {1})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(56, {}),
+ MakeDataDescriptor(204, {2})));
+
+ TransformationCompositeConstruct make_ivec4(
+ 122, {56, 117, 117, 117}, MakeInstructionDescriptor(66, SpvOpIAdd, 0),
+ 205);
+ // Bad because 86 is the wrong type.
+ TransformationCompositeConstruct make_ivec4_bad(
+ 86, {56, 117, 117, 117}, MakeInstructionDescriptor(66, SpvOpIAdd, 0),
+ 205);
+ ASSERT_TRUE(make_ivec4.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_ivec4_bad.IsApplicable(context.get(), fact_manager));
+ make_ivec4.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(56, {}),
+ MakeDataDescriptor(205, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(117, {}),
+ MakeDataDescriptor(205, {1})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(117, {}),
+ MakeDataDescriptor(205, {2})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(117, {}),
+ MakeDataDescriptor(205, {3})));
+
+ TransformationCompositeConstruct make_uvec2(
+ 86, {18, 38}, MakeInstructionDescriptor(133, SpvOpAccessChain, 0), 206);
+ TransformationCompositeConstruct make_uvec2_bad(
+ 86, {18, 38}, MakeInstructionDescriptor(133, SpvOpAccessChain, 200), 206);
+ ASSERT_TRUE(make_uvec2.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_uvec2_bad.IsApplicable(context.get(), fact_manager));
+ make_uvec2.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(18, {}),
+ MakeDataDescriptor(206, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(38, {}),
+ MakeDataDescriptor(206, {1})));
+
+ TransformationCompositeConstruct make_uvec3(
+ 59, {14, 18, 136}, MakeInstructionDescriptor(137, SpvOpReturn, 0), 207);
+ // Bad because 1300 is not an id
+ TransformationCompositeConstruct make_uvec3_bad(
+ 59, {14, 18, 1300}, MakeInstructionDescriptor(137, SpvOpReturn, 0), 207);
+ ASSERT_TRUE(make_uvec3.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_uvec3_bad.IsApplicable(context.get(), fact_manager));
+ make_uvec3.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(14, {}),
+ MakeDataDescriptor(207, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(18, {}),
+ MakeDataDescriptor(207, {1})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(136, {}),
+ MakeDataDescriptor(207, {2})));
+
+ TransformationCompositeConstruct make_uvec4(
+ 131, {14, 18, 136, 136},
+ MakeInstructionDescriptor(137, SpvOpAccessChain, 0), 208);
+ // Bad because 86 is the wrong type.
+ TransformationCompositeConstruct make_uvec4_bad(
+ 86, {14, 18, 136, 136},
+ MakeInstructionDescriptor(137, SpvOpAccessChain, 0), 208);
+ ASSERT_TRUE(make_uvec4.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_uvec4_bad.IsApplicable(context.get(), fact_manager));
+ make_uvec4.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(14, {}),
+ MakeDataDescriptor(208, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(18, {}),
+ MakeDataDescriptor(208, {1})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(136, {}),
+ MakeDataDescriptor(208, {2})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(136, {}),
+ MakeDataDescriptor(208, {3})));
+
+ TransformationCompositeConstruct make_bvec2(
+ 102,
+ {
+ 111,
+ 41,
+ },
+ MakeInstructionDescriptor(75, SpvOpAccessChain, 0), 209);
+ // Bad because 0 is not a valid base instruction id
+ TransformationCompositeConstruct make_bvec2_bad(
+ 102,
+ {
+ 111,
+ 41,
+ },
+ MakeInstructionDescriptor(0, SpvOpExtInstImport, 0), 209);
+ ASSERT_TRUE(make_bvec2.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_bvec2_bad.IsApplicable(context.get(), fact_manager));
+ make_bvec2.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(111, {}),
+ MakeDataDescriptor(209, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(41, {}),
+ MakeDataDescriptor(209, {1})));
+
+ TransformationCompositeConstruct make_bvec3(
+ 93, {108, 73}, MakeInstructionDescriptor(108, SpvOpStore, 0), 210);
+ // Bad because there are too many components for a bvec3
+ TransformationCompositeConstruct make_bvec3_bad(
+ 93, {108, 108}, MakeInstructionDescriptor(108, SpvOpStore, 0), 210);
+ ASSERT_TRUE(make_bvec3.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_bvec3_bad.IsApplicable(context.get(), fact_manager));
+ make_bvec3.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(108, {0}),
+ MakeDataDescriptor(210, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(108, {1}),
+ MakeDataDescriptor(210, {1})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(73, {}),
+ MakeDataDescriptor(210, {2})));
+
+ TransformationCompositeConstruct make_bvec4(
+ 70, {108, 108}, MakeInstructionDescriptor(108, SpvOpBranch, 0), 211);
+ // Bad because 21 is a type, not a result id
+ TransformationCompositeConstruct make_bvec4_bad(
+ 70, {21, 108}, MakeInstructionDescriptor(108, SpvOpBranch, 0), 211);
+ ASSERT_TRUE(make_bvec4.IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(make_bvec4_bad.IsApplicable(context.get(), fact_manager));
+ make_bvec4.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(108, {0}),
+ MakeDataDescriptor(211, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(108, {1}),
+ MakeDataDescriptor(211, {1})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(108, {0}),
+ MakeDataDescriptor(211, {2})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(108, {1}),
+ MakeDataDescriptor(211, {3})));
+
+ std::string after_transformation = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %9 "v2"
+ OpName %27 "v3"
+ OpName %46 "v4"
+ OpName %53 "iv2"
+ OpName %61 "uv3"
+ OpName %72 "bv4"
+ OpName %88 "uv2"
+ OpName %95 "bv3"
+ OpName %104 "bv2"
+ OpName %116 "iv3"
+ OpName %124 "iv4"
+ OpName %133 "uv4"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 2
+ %8 = OpTypePointer Function %7
+ %10 = OpConstant %6 1
+ %11 = OpConstant %6 2
+ %12 = OpConstantComposite %7 %10 %11
+ %13 = OpTypeInt 32 0
+ %14 = OpConstant %13 0
+ %15 = OpTypePointer Function %6
+ %18 = OpConstant %13 1
+ %21 = OpTypeBool
+ %25 = OpTypeVector %6 3
+ %26 = OpTypePointer Function %25
+ %33 = OpConstant %6 3
+ %34 = OpConstant %6 -0.756802499
+ %38 = OpConstant %13 2
+ %44 = OpTypeVector %6 4
+ %45 = OpTypePointer Function %44
+ %50 = OpTypeInt 32 1
+ %51 = OpTypeVector %50 2
+ %52 = OpTypePointer Function %51
+ %57 = OpTypePointer Function %50
+ %59 = OpTypeVector %13 3
+ %60 = OpTypePointer Function %59
+ %65 = OpConstant %13 3
+ %67 = OpTypePointer Function %13
+ %70 = OpTypeVector %21 4
+ %71 = OpTypePointer Function %70
+ %73 = OpConstantTrue %21
+ %74 = OpTypePointer Function %21
+ %86 = OpTypeVector %13 2
+ %87 = OpTypePointer Function %86
+ %93 = OpTypeVector %21 3
+ %94 = OpTypePointer Function %93
+ %102 = OpTypeVector %21 2
+ %103 = OpTypePointer Function %102
+ %111 = OpConstantFalse %21
+ %114 = OpTypeVector %50 3
+ %115 = OpTypePointer Function %114
+ %117 = OpConstant %50 3
+ %122 = OpTypeVector %50 4
+ %123 = OpTypePointer Function %122
+ %131 = OpTypeVector %13 4
+ %132 = OpTypePointer Function %131
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %9 = OpVariable %8 Function
+ %27 = OpVariable %26 Function
+ %46 = OpVariable %45 Function
+ %53 = OpVariable %52 Function
+ %61 = OpVariable %60 Function
+ %72 = OpVariable %71 Function
+ %88 = OpVariable %87 Function
+ %95 = OpVariable %94 Function
+ %104 = OpVariable %103 Function
+ %116 = OpVariable %115 Function
+ %124 = OpVariable %123 Function
+ %133 = OpVariable %132 Function
+ OpStore %9 %12
+ %206 = OpCompositeConstruct %86 %18 %38
+ %16 = OpAccessChain %15 %9 %14
+ %17 = OpLoad %6 %16
+ %19 = OpAccessChain %15 %9 %18
+ %20 = OpLoad %6 %19
+ %22 = OpFOrdGreaterThan %21 %17 %20
+ OpSelectionMerge %24 None
+ OpBranchConditional %22 %23 %101
+ %23 = OpLabel
+ %28 = OpAccessChain %15 %9 %14
+ %29 = OpLoad %6 %28
+ %30 = OpAccessChain %15 %9 %18
+ %31 = OpLoad %6 %30
+ %32 = OpFAdd %6 %29 %31
+ %201 = OpCompositeConstruct %25 %12 %32
+ %35 = OpCompositeConstruct %25 %32 %33 %34
+ OpStore %27 %35
+ %36 = OpAccessChain %15 %27 %14
+ %37 = OpLoad %6 %36
+ %39 = OpAccessChain %15 %27 %38
+ %40 = OpLoad %6 %39
+ %41 = OpFOrdLessThan %21 %37 %40
+ OpSelectionMerge %43 None
+ OpBranchConditional %41 %42 %69
+ %42 = OpLabel
+ %47 = OpAccessChain %15 %9 %18
+ %48 = OpLoad %6 %47
+ %49 = OpAccessChain %15 %46 %14
+ OpStore %49 %48
+ %54 = OpAccessChain %15 %27 %38
+ %55 = OpLoad %6 %54
+ %56 = OpConvertFToS %50 %55
+ %58 = OpAccessChain %57 %53 %14
+ OpStore %58 %56
+ %62 = OpAccessChain %15 %46 %14
+ %63 = OpLoad %6 %62
+ %64 = OpConvertFToU %13 %63
+ %205 = OpCompositeConstruct %122 %56 %117 %117 %117
+ %66 = OpIAdd %13 %64 %65
+ %204 = OpCompositeConstruct %114 %56 %117 %56
+ %68 = OpAccessChain %67 %61 %14
+ OpStore %68 %66
+ OpBranch %43
+ %69 = OpLabel
+ %202 = OpCompositeConstruct %44 %32 %32 %10 %11
+ %209 = OpCompositeConstruct %102 %111 %41
+ %75 = OpAccessChain %74 %72 %14
+ OpStore %75 %73
+ %76 = OpAccessChain %74 %72 %14
+ %77 = OpLoad %21 %76
+ %78 = OpLogicalNot %21 %77
+ %79 = OpAccessChain %74 %72 %18
+ OpStore %79 %78
+ %80 = OpAccessChain %74 %72 %14
+ %81 = OpLoad %21 %80
+ %82 = OpAccessChain %74 %72 %18
+ %83 = OpLoad %21 %82
+ %84 = OpLogicalAnd %21 %81 %83
+ %85 = OpAccessChain %74 %72 %38
+ OpStore %85 %84
+ %89 = OpAccessChain %67 %88 %14
+ %90 = OpLoad %13 %89
+ %91 = OpINotEqual %21 %90 %14
+ %92 = OpAccessChain %74 %72 %65
+ OpStore %92 %91
+ OpBranch %43
+ %43 = OpLabel
+ %96 = OpLoad %70 %72
+ %97 = OpCompositeExtract %21 %96 0
+ %98 = OpCompositeExtract %21 %96 1
+ %99 = OpCompositeExtract %21 %96 2
+ %100 = OpCompositeConstruct %93 %97 %98 %99
+ %200 = OpCompositeConstruct %7 %17 %11
+ OpStore %95 %100
+ OpBranch %24
+ %101 = OpLabel
+ %105 = OpAccessChain %67 %88 %14
+ %106 = OpLoad %13 %105
+ %107 = OpINotEqual %21 %106 %14
+ %108 = OpCompositeConstruct %102 %107 %107
+ %210 = OpCompositeConstruct %93 %108 %73
+ OpStore %104 %108
+ %211 = OpCompositeConstruct %70 %108 %108
+ OpBranch %24
+ %24 = OpLabel
+ %109 = OpAccessChain %74 %104 %18
+ %110 = OpLoad %21 %109
+ %112 = OpLogicalOr %21 %110 %111
+ %113 = OpAccessChain %74 %104 %14
+ OpStore %113 %112
+ %118 = OpAccessChain %57 %116 %14
+ OpStore %118 %117
+ %119 = OpAccessChain %57 %116 %14
+ %120 = OpLoad %50 %119
+ %121 = OpAccessChain %57 %53 %18
+ OpStore %121 %120
+ %125 = OpAccessChain %57 %116 %14
+ %126 = OpLoad %50 %125
+ %127 = OpAccessChain %57 %53 %18
+ %203 = OpCompositeConstruct %51 %126 %120
+ %128 = OpLoad %50 %127
+ %129 = OpIAdd %50 %126 %128
+ %130 = OpAccessChain %57 %124 %65
+ OpStore %130 %129
+ %134 = OpAccessChain %57 %116 %14
+ %135 = OpLoad %50 %134
+ %136 = OpBitcast %13 %135
+ %208 = OpCompositeConstruct %131 %14 %18 %136 %136
+ %137 = OpAccessChain %67 %133 %14
+ OpStore %137 %136
+ %207 = OpCompositeConstruct %59 %14 %18 %136
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ ASSERT_TRUE(IsEqual(env, after_transformation, context.get()));
+}
+
+} // namespace
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_composite_extract_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_composite_extract_test.cpp
new file mode 100644
index 00000000000..172ce8e4021
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_composite_extract_test.cpp
@@ -0,0 +1,392 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/transformation_composite_extract.h"
+#include "source/fuzz/instruction_descriptor.h"
+#include "test/fuzz/fuzz_test_util.h"
+
+namespace spvtools {
+namespace fuzz {
+namespace {
+
+TEST(TransformationCompositeExtractTest, BasicTest) {
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %10 "b"
+ OpName %17 "FunnyPoint"
+ OpMemberName %17 0 "x"
+ OpMemberName %17 1 "y"
+ OpMemberName %17 2 "z"
+ OpName %19 "p"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %12 = OpTypeBool
+ %16 = OpTypeFloat 32
+ %17 = OpTypeStruct %16 %16 %6
+ %81 = OpTypeStruct %17 %16
+ %18 = OpTypePointer Function %17
+ %20 = OpConstant %6 0
+ %23 = OpTypePointer Function %16
+ %26 = OpConstant %6 1
+ %30 = OpConstant %6 2
+ %80 = OpUndef %16
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %10 = OpVariable %7 Function
+ %19 = OpVariable %18 Function
+ %9 = OpLoad %6 %8
+ %11 = OpLoad %6 %10
+ %100 = OpCompositeConstruct %17 %80 %80 %26
+ %104 = OpCompositeConstruct %81 %100 %80
+ %13 = OpIEqual %12 %9 %11
+ OpSelectionMerge %15 None
+ OpBranchConditional %13 %14 %25
+ %14 = OpLabel
+ %21 = OpLoad %6 %8
+ %22 = OpConvertSToF %16 %21
+ %101 = OpCompositeConstruct %17 %22 %80 %30
+ %24 = OpAccessChain %23 %19 %20
+ OpStore %24 %22
+ OpBranch %15
+ %25 = OpLabel
+ %27 = OpLoad %6 %10
+ %28 = OpConvertSToF %16 %27
+ %102 = OpCompositeConstruct %17 %80 %28 %27
+ %29 = OpAccessChain %23 %19 %26
+ OpStore %29 %28
+ OpBranch %15
+ %15 = OpLabel
+ %31 = OpAccessChain %23 %19 %20
+ %32 = OpLoad %16 %31
+ %33 = OpAccessChain %23 %19 %26
+ %34 = OpLoad %16 %33
+ %103 = OpCompositeConstruct %17 %34 %32 %9
+ %35 = OpFAdd %16 %32 %34
+ %36 = OpConvertFToS %6 %35
+ %37 = OpAccessChain %7 %19 %30
+ OpStore %37 %36
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_4;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ FactManager fact_manager;
+
+ // Instruction does not exist.
+ ASSERT_FALSE(TransformationCompositeExtract(
+ MakeInstructionDescriptor(36, SpvOpIAdd, 0), 200, 101, {0})
+ .IsApplicable(context.get(), fact_manager));
+
+ // Id for composite is not a composite.
+ ASSERT_FALSE(TransformationCompositeExtract(
+ MakeInstructionDescriptor(36, SpvOpIAdd, 0), 200, 27, {})
+ .IsApplicable(context.get(), fact_manager));
+
+ // Composite does not dominate instruction being inserted before.
+ ASSERT_FALSE(
+ TransformationCompositeExtract(
+ MakeInstructionDescriptor(37, SpvOpAccessChain, 0), 200, 101, {0})
+ .IsApplicable(context.get(), fact_manager));
+
+ // Too many indices for extraction from struct composite.
+ ASSERT_FALSE(
+ TransformationCompositeExtract(
+ MakeInstructionDescriptor(24, SpvOpAccessChain, 0), 200, 101, {0, 0})
+ .IsApplicable(context.get(), fact_manager));
+
+ // Too many indices for extraction from struct composite.
+ ASSERT_FALSE(
+ TransformationCompositeExtract(
+ MakeInstructionDescriptor(13, SpvOpIEqual, 0), 200, 104, {0, 0, 0})
+ .IsApplicable(context.get(), fact_manager));
+
+ // Out of bounds index for extraction from struct composite.
+ ASSERT_FALSE(
+ TransformationCompositeExtract(
+ MakeInstructionDescriptor(13, SpvOpIEqual, 0), 200, 104, {0, 3})
+ .IsApplicable(context.get(), fact_manager));
+
+ // Result id already used.
+ ASSERT_FALSE(TransformationCompositeExtract(
+ MakeInstructionDescriptor(35, SpvOpFAdd, 0), 80, 103, {0})
+ .IsApplicable(context.get(), fact_manager));
+
+ TransformationCompositeExtract transformation_1(
+ MakeInstructionDescriptor(36, SpvOpConvertFToS, 0), 201, 100, {2});
+ ASSERT_TRUE(transformation_1.IsApplicable(context.get(), fact_manager));
+ transformation_1.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ TransformationCompositeExtract transformation_2(
+ MakeInstructionDescriptor(37, SpvOpAccessChain, 0), 202, 104, {0, 2});
+ ASSERT_TRUE(transformation_2.IsApplicable(context.get(), fact_manager));
+ transformation_2.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ TransformationCompositeExtract transformation_3(
+ MakeInstructionDescriptor(29, SpvOpAccessChain, 0), 203, 104, {0});
+ ASSERT_TRUE(transformation_3.IsApplicable(context.get(), fact_manager));
+ transformation_3.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ TransformationCompositeExtract transformation_4(
+ MakeInstructionDescriptor(24, SpvOpStore, 0), 204, 101, {0});
+ ASSERT_TRUE(transformation_4.IsApplicable(context.get(), fact_manager));
+ transformation_4.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ TransformationCompositeExtract transformation_5(
+ MakeInstructionDescriptor(29, SpvOpBranch, 0), 205, 102, {2});
+ ASSERT_TRUE(transformation_5.IsApplicable(context.get(), fact_manager));
+ transformation_5.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ TransformationCompositeExtract transformation_6(
+ MakeInstructionDescriptor(37, SpvOpReturn, 0), 206, 103, {1});
+ ASSERT_TRUE(transformation_6.IsApplicable(context.get(), fact_manager));
+ transformation_6.Apply(context.get(), &fact_manager);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(201, {}),
+ MakeDataDescriptor(100, {2})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(202, {}),
+ MakeDataDescriptor(104, {0, 2})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(203, {}),
+ MakeDataDescriptor(104, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(204, {}),
+ MakeDataDescriptor(101, {0})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(205, {}),
+ MakeDataDescriptor(102, {2})));
+ ASSERT_TRUE(fact_manager.IsSynonymous(MakeDataDescriptor(206, {}),
+ MakeDataDescriptor(103, {1})));
+
+ std::string after_transformation = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %10 "b"
+ OpName %17 "FunnyPoint"
+ OpMemberName %17 0 "x"
+ OpMemberName %17 1 "y"
+ OpMemberName %17 2 "z"
+ OpName %19 "p"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %12 = OpTypeBool
+ %16 = OpTypeFloat 32
+ %17 = OpTypeStruct %16 %16 %6
+ %81 = OpTypeStruct %17 %16
+ %18 = OpTypePointer Function %17
+ %20 = OpConstant %6 0
+ %23 = OpTypePointer Function %16
+ %26 = OpConstant %6 1
+ %30 = OpConstant %6 2
+ %80 = OpUndef %16
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %10 = OpVariable %7 Function
+ %19 = OpVariable %18 Function
+ %9 = OpLoad %6 %8
+ %11 = OpLoad %6 %10
+ %100 = OpCompositeConstruct %17 %80 %80 %26
+ %104 = OpCompositeConstruct %81 %100 %80
+ %13 = OpIEqual %12 %9 %11
+ OpSelectionMerge %15 None
+ OpBranchConditional %13 %14 %25
+ %14 = OpLabel
+ %21 = OpLoad %6 %8
+ %22 = OpConvertSToF %16 %21
+ %101 = OpCompositeConstruct %17 %22 %80 %30
+ %24 = OpAccessChain %23 %19 %20
+ %204 = OpCompositeExtract %16 %101 0
+ OpStore %24 %22
+ OpBranch %15
+ %25 = OpLabel
+ %27 = OpLoad %6 %10
+ %28 = OpConvertSToF %16 %27
+ %102 = OpCompositeConstruct %17 %80 %28 %27
+ %203 = OpCompositeExtract %17 %104 0
+ %29 = OpAccessChain %23 %19 %26
+ OpStore %29 %28
+ %205 = OpCompositeExtract %6 %102 2
+ OpBranch %15
+ %15 = OpLabel
+ %31 = OpAccessChain %23 %19 %20
+ %32 = OpLoad %16 %31
+ %33 = OpAccessChain %23 %19 %26
+ %34 = OpLoad %16 %33
+ %103 = OpCompositeConstruct %17 %34 %32 %9
+ %35 = OpFAdd %16 %32 %34
+ %201 = OpCompositeExtract %6 %100 2
+ %36 = OpConvertFToS %6 %35
+ %202 = OpCompositeExtract %6 %104 0 2
+ %37 = OpAccessChain %7 %19 %30
+ OpStore %37 %36
+ %206 = OpCompositeExtract %16 %103 1
+ OpReturn
+ OpFunctionEnd
+ )";
+ ASSERT_TRUE(IsEqual(env, after_transformation, context.get()));
+}
+
+TEST(TransformationCompositeExtractTest, IllegalInsertionPoints) {
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %51 %27
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %25 "buf"
+ OpMemberName %25 0 "value"
+ OpName %27 ""
+ OpName %51 "color"
+ OpMemberDecorate %25 0 Offset 0
+ OpDecorate %25 Block
+ OpDecorate %27 DescriptorSet 0
+ OpDecorate %27 Binding 0
+ OpDecorate %51 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 4
+ %10 = OpConstant %6 0.300000012
+ %11 = OpConstant %6 0.400000006
+ %12 = OpConstant %6 0.5
+ %13 = OpConstant %6 1
+ %14 = OpConstantComposite %7 %10 %11 %12 %13
+ %15 = OpTypeInt 32 1
+ %18 = OpConstant %15 0
+ %25 = OpTypeStruct %6
+ %26 = OpTypePointer Uniform %25
+ %27 = OpVariable %26 Uniform
+ %28 = OpTypePointer Uniform %6
+ %32 = OpTypeBool
+ %103 = OpConstantTrue %32
+ %34 = OpConstant %6 0.100000001
+ %48 = OpConstant %15 1
+ %50 = OpTypePointer Output %7
+ %51 = OpVariable %50 Output
+ %100 = OpTypePointer Function %6
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %101 = OpVariable %100 Function
+ %102 = OpVariable %100 Function
+ OpBranch %19
+ %19 = OpLabel
+ %60 = OpPhi %7 %14 %5 %58 %20
+ %59 = OpPhi %15 %18 %5 %49 %20
+ %29 = OpAccessChain %28 %27 %18
+ %30 = OpLoad %6 %29
+ %31 = OpConvertFToS %15 %30
+ %33 = OpSLessThan %32 %59 %31
+ OpLoopMerge %21 %20 None
+ OpBranchConditional %33 %20 %21
+ %20 = OpLabel
+ %39 = OpCompositeExtract %6 %60 0
+ %40 = OpFAdd %6 %39 %34
+ %55 = OpCompositeInsert %7 %40 %60 0
+ %44 = OpCompositeExtract %6 %60 1
+ %45 = OpFSub %6 %44 %34
+ %58 = OpCompositeInsert %7 %45 %55 1
+ %49 = OpIAdd %15 %59 %48
+ OpBranch %19
+ %21 = OpLabel
+ OpStore %51 %60
+ OpSelectionMerge %105 None
+ OpBranchConditional %103 %104 %105
+ %104 = OpLabel
+ OpBranch %105
+ %105 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_4;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ FactManager fact_manager;
+
+ // Cannot insert before the OpVariables of a function.
+ ASSERT_FALSE(
+ TransformationCompositeExtract(
+ MakeInstructionDescriptor(101, SpvOpVariable, 0), 200, 14, {0})
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationCompositeExtract(
+ MakeInstructionDescriptor(101, SpvOpVariable, 1), 200, 14, {1})
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationCompositeExtract(
+ MakeInstructionDescriptor(102, SpvOpVariable, 0), 200, 14, {1})
+ .IsApplicable(context.get(), fact_manager));
+ // OK to insert right after the OpVariables.
+ ASSERT_FALSE(TransformationCompositeExtract(
+ MakeInstructionDescriptor(102, SpvOpBranch, 1), 200, 14, {1})
+ .IsApplicable(context.get(), fact_manager));
+
+ // Cannot insert before the OpPhis of a block.
+ ASSERT_FALSE(TransformationCompositeExtract(
+ MakeInstructionDescriptor(60, SpvOpPhi, 0), 200, 14, {2})
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationCompositeExtract(
+ MakeInstructionDescriptor(59, SpvOpPhi, 0), 200, 14, {3})
+ .IsApplicable(context.get(), fact_manager));
+ // OK to insert after the OpPhis.
+ ASSERT_TRUE(
+ TransformationCompositeExtract(
+ MakeInstructionDescriptor(59, SpvOpAccessChain, 0), 200, 14, {3})
+ .IsApplicable(context.get(), fact_manager));
+
+ // Cannot insert before OpLoopMerge
+ ASSERT_FALSE(TransformationCompositeExtract(
+ MakeInstructionDescriptor(33, SpvOpBranchConditional, 0),
+ 200, 14, {3})
+ .IsApplicable(context.get(), fact_manager));
+
+ // Cannot insert before OpSelectionMerge
+ ASSERT_FALSE(TransformationCompositeExtract(
+ MakeInstructionDescriptor(21, SpvOpBranchConditional, 0),
+ 200, 14, {2})
+ .IsApplicable(context.get(), fact_manager));
+}
+
+} // namespace
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_copy_object_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_copy_object_test.cpp
index 0c214c8598d..cc3511333d2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_copy_object_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_copy_object_test.cpp
@@ -12,8 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "source/fuzz/transformation_copy_object.h"
+#include <algorithm>
+#include <set>
+#include <unordered_set>
+
#include "source/fuzz/data_descriptor.h"
+#include "source/fuzz/instruction_descriptor.h"
+#include "source/fuzz/transformation_copy_object.h"
#include "test/fuzz/fuzz_test_util.h"
namespace spvtools {
@@ -49,56 +54,74 @@ TEST(TransformationCopyObjectTest, CopyBooleanConstants) {
ASSERT_EQ(0, fact_manager.GetIdsForWhichSynonymsAreKnown().size());
- TransformationCopyObject copy_true(7, 5, 1, 100);
- ASSERT_TRUE(copy_true.IsApplicable(context.get(), fact_manager));
- copy_true.Apply(context.get(), &fact_manager);
-
- const std::set<uint32_t>& ids_for_which_synonyms_are_known =
- fact_manager.GetIdsForWhichSynonymsAreKnown();
- ASSERT_EQ(1, ids_for_which_synonyms_are_known.size());
- ASSERT_TRUE(ids_for_which_synonyms_are_known.find(7) !=
- ids_for_which_synonyms_are_known.end());
- ASSERT_EQ(1, fact_manager.GetSynonymsForId(7).size());
- protobufs::DataDescriptor descriptor_100 = MakeDataDescriptor(100, {});
- ASSERT_TRUE(DataDescriptorEquals()(&descriptor_100,
- &fact_manager.GetSynonymsForId(7)[0]));
-
- TransformationCopyObject copy_false(8, 100, 1, 101);
- ASSERT_TRUE(copy_false.IsApplicable(context.get(), fact_manager));
- copy_false.Apply(context.get(), &fact_manager);
- ASSERT_EQ(2, ids_for_which_synonyms_are_known.size());
- ASSERT_TRUE(ids_for_which_synonyms_are_known.find(8) !=
- ids_for_which_synonyms_are_known.end());
- ASSERT_EQ(1, fact_manager.GetSynonymsForId(8).size());
- protobufs::DataDescriptor descriptor_101 = MakeDataDescriptor(101, {});
- ASSERT_TRUE(DataDescriptorEquals()(&descriptor_101,
- &fact_manager.GetSynonymsForId(8)[0]));
-
- TransformationCopyObject copy_false_again(101, 5, 3, 102);
- ASSERT_TRUE(copy_false_again.IsApplicable(context.get(), fact_manager));
- copy_false_again.Apply(context.get(), &fact_manager);
- ASSERT_EQ(3, ids_for_which_synonyms_are_known.size());
- ASSERT_TRUE(ids_for_which_synonyms_are_known.find(101) !=
- ids_for_which_synonyms_are_known.end());
- ASSERT_EQ(1, fact_manager.GetSynonymsForId(101).size());
- protobufs::DataDescriptor descriptor_102 = MakeDataDescriptor(102, {});
- ASSERT_TRUE(DataDescriptorEquals()(&descriptor_102,
- &fact_manager.GetSynonymsForId(101)[0]));
-
- TransformationCopyObject copy_true_again(7, 102, 1, 103);
- ASSERT_TRUE(copy_true_again.IsApplicable(context.get(), fact_manager));
- copy_true_again.Apply(context.get(), &fact_manager);
- // This does re-uses an id for which synonyms are already known, so the count
- // of such ids does not change.
- ASSERT_EQ(3, ids_for_which_synonyms_are_known.size());
- ASSERT_TRUE(ids_for_which_synonyms_are_known.find(7) !=
- ids_for_which_synonyms_are_known.end());
- ASSERT_EQ(2, fact_manager.GetSynonymsForId(7).size());
- protobufs::DataDescriptor descriptor_103 = MakeDataDescriptor(103, {});
- ASSERT_TRUE(DataDescriptorEquals()(&descriptor_103,
- &fact_manager.GetSynonymsForId(7)[0]) ||
- DataDescriptorEquals()(&descriptor_103,
- &fact_manager.GetSynonymsForId(7)[1]));
+ {
+ TransformationCopyObject copy_true(
+ 7, MakeInstructionDescriptor(5, SpvOpReturn, 0), 100);
+ ASSERT_TRUE(copy_true.IsApplicable(context.get(), fact_manager));
+ copy_true.Apply(context.get(), &fact_manager);
+
+ auto ids_for_which_synonyms_are_known =
+ fact_manager.GetIdsForWhichSynonymsAreKnown();
+ ASSERT_EQ(2, ids_for_which_synonyms_are_known.size());
+ ASSERT_TRUE(std::find(ids_for_which_synonyms_are_known.begin(),
+ ids_for_which_synonyms_are_known.end(),
+ 7) != ids_for_which_synonyms_are_known.end());
+ ASSERT_EQ(2, fact_manager.GetSynonymsForId(7).size());
+ protobufs::DataDescriptor descriptor_100 = MakeDataDescriptor(100, {});
+ ASSERT_TRUE(
+ fact_manager.IsSynonymous(MakeDataDescriptor(7, {}), descriptor_100));
+ }
+
+ {
+ TransformationCopyObject copy_false(
+ 8, MakeInstructionDescriptor(100, SpvOpReturn, 0), 101);
+ ASSERT_TRUE(copy_false.IsApplicable(context.get(), fact_manager));
+ copy_false.Apply(context.get(), &fact_manager);
+ auto ids_for_which_synonyms_are_known =
+ fact_manager.GetIdsForWhichSynonymsAreKnown();
+ ASSERT_EQ(4, ids_for_which_synonyms_are_known.size());
+ ASSERT_TRUE(std::find(ids_for_which_synonyms_are_known.begin(),
+ ids_for_which_synonyms_are_known.end(),
+ 8) != ids_for_which_synonyms_are_known.end());
+ ASSERT_EQ(2, fact_manager.GetSynonymsForId(8).size());
+ protobufs::DataDescriptor descriptor_101 = MakeDataDescriptor(101, {});
+ ASSERT_TRUE(
+ fact_manager.IsSynonymous(MakeDataDescriptor(8, {}), descriptor_101));
+ }
+
+ {
+ TransformationCopyObject copy_false_again(
+ 101, MakeInstructionDescriptor(5, SpvOpReturn, 0), 102);
+ ASSERT_TRUE(copy_false_again.IsApplicable(context.get(), fact_manager));
+ copy_false_again.Apply(context.get(), &fact_manager);
+ auto ids_for_which_synonyms_are_known =
+ fact_manager.GetIdsForWhichSynonymsAreKnown();
+ ASSERT_EQ(5, ids_for_which_synonyms_are_known.size());
+ ASSERT_TRUE(std::find(ids_for_which_synonyms_are_known.begin(),
+ ids_for_which_synonyms_are_known.end(),
+ 101) != ids_for_which_synonyms_are_known.end());
+ ASSERT_EQ(3, fact_manager.GetSynonymsForId(101).size());
+ protobufs::DataDescriptor descriptor_102 = MakeDataDescriptor(102, {});
+ ASSERT_TRUE(
+ fact_manager.IsSynonymous(MakeDataDescriptor(101, {}), descriptor_102));
+ }
+
+ {
+ TransformationCopyObject copy_true_again(
+ 7, MakeInstructionDescriptor(102, SpvOpReturn, 0), 103);
+ ASSERT_TRUE(copy_true_again.IsApplicable(context.get(), fact_manager));
+ copy_true_again.Apply(context.get(), &fact_manager);
+ auto ids_for_which_synonyms_are_known =
+ fact_manager.GetIdsForWhichSynonymsAreKnown();
+ ASSERT_EQ(6, ids_for_which_synonyms_are_known.size());
+ ASSERT_TRUE(std::find(ids_for_which_synonyms_are_known.begin(),
+ ids_for_which_synonyms_are_known.end(),
+ 7) != ids_for_which_synonyms_are_known.end());
+ ASSERT_EQ(3, fact_manager.GetSynonymsForId(7).size());
+ protobufs::DataDescriptor descriptor_103 = MakeDataDescriptor(103, {});
+ ASSERT_TRUE(
+ fact_manager.IsSynonymous(MakeDataDescriptor(7, {}), descriptor_103));
+ }
std::string after_transformation = R"(
OpCapability Shader
@@ -318,90 +341,113 @@ TEST(TransformationCopyObjectTest, CheckIllegalCases) {
FactManager fact_manager;
// Inapplicable because %18 is decorated.
- ASSERT_FALSE(TransformationCopyObject(18, 21, 0, 200)
+ ASSERT_FALSE(TransformationCopyObject(
+ 18, MakeInstructionDescriptor(21, SpvOpAccessChain, 0), 200)
.IsApplicable(context.get(), fact_manager));
// Inapplicable because %77 is decorated.
- ASSERT_FALSE(TransformationCopyObject(17, 17, 1, 200)
+ ASSERT_FALSE(TransformationCopyObject(
+ 77, MakeInstructionDescriptor(77, SpvOpBranch, 0), 200)
.IsApplicable(context.get(), fact_manager));
// Inapplicable because %80 is decorated.
- ASSERT_FALSE(TransformationCopyObject(80, 77, 0, 200)
+ ASSERT_FALSE(TransformationCopyObject(
+ 80, MakeInstructionDescriptor(77, SpvOpIAdd, 0), 200)
.IsApplicable(context.get(), fact_manager));
// Inapplicable because %84 is not available at the requested point
- ASSERT_FALSE(TransformationCopyObject(84, 32, 1, 200)
- .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationCopyObject(
+ 84, MakeInstructionDescriptor(32, SpvOpCompositeExtract, 0), 200)
+ .IsApplicable(context.get(), fact_manager));
// Fine because %84 is available at the requested point
- ASSERT_TRUE(TransformationCopyObject(84, 32, 2, 200)
- .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationCopyObject(
+ 84, MakeInstructionDescriptor(32, SpvOpCompositeConstruct, 0), 200)
+ .IsApplicable(context.get(), fact_manager));
// Inapplicable because id %9 is already in use
- ASSERT_FALSE(TransformationCopyObject(84, 32, 2, 9)
- .IsApplicable(context.get(), fact_manager));
-
- // Inapplicable because the requested point is not in a block
- ASSERT_FALSE(TransformationCopyObject(84, 86, 3, 200)
+ ASSERT_FALSE(
+ TransformationCopyObject(
+ 84, MakeInstructionDescriptor(32, SpvOpCompositeConstruct, 0), 9)
+ .IsApplicable(context.get(), fact_manager));
+
+ // Inapplicable because the requested point does not exist
+ ASSERT_FALSE(TransformationCopyObject(
+ 84, MakeInstructionDescriptor(86, SpvOpReturn, 2), 200)
.IsApplicable(context.get(), fact_manager));
// Inapplicable because %9 is not in a function
- ASSERT_FALSE(TransformationCopyObject(9, 9, 1, 200)
- .IsApplicable(context.get(), fact_manager));
-
- // Inapplicable because %9 is not in a function
- ASSERT_FALSE(TransformationCopyObject(9, 9, 1, 200)
+ ASSERT_FALSE(TransformationCopyObject(
+ 9, MakeInstructionDescriptor(9, SpvOpTypeInt, 0), 200)
.IsApplicable(context.get(), fact_manager));
// Inapplicable because the insert point is right before, or inside, a chunk
// of OpPhis
- ASSERT_FALSE(TransformationCopyObject(9, 30, 1, 200)
+ ASSERT_FALSE(TransformationCopyObject(
+ 9, MakeInstructionDescriptor(30, SpvOpPhi, 0), 200)
.IsApplicable(context.get(), fact_manager));
- ASSERT_FALSE(TransformationCopyObject(9, 99, 1, 200)
+ ASSERT_FALSE(TransformationCopyObject(
+ 9, MakeInstructionDescriptor(99, SpvOpPhi, 1), 200)
.IsApplicable(context.get(), fact_manager));
// OK, because the insert point is just after a chunk of OpPhis.
- ASSERT_TRUE(TransformationCopyObject(9, 96, 1, 200)
+ ASSERT_TRUE(TransformationCopyObject(
+ 9, MakeInstructionDescriptor(96, SpvOpAccessChain, 0), 200)
.IsApplicable(context.get(), fact_manager));
// Inapplicable because the insert point is right after an OpSelectionMerge
- ASSERT_FALSE(TransformationCopyObject(9, 58, 2, 200)
- .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationCopyObject(
+ 9, MakeInstructionDescriptor(58, SpvOpBranchConditional, 0), 200)
+ .IsApplicable(context.get(), fact_manager));
// OK, because the insert point is right before the OpSelectionMerge
- ASSERT_TRUE(TransformationCopyObject(9, 58, 1, 200)
+ ASSERT_TRUE(TransformationCopyObject(
+ 9, MakeInstructionDescriptor(58, SpvOpSelectionMerge, 0), 200)
.IsApplicable(context.get(), fact_manager));
// Inapplicable because the insert point is right after an OpSelectionMerge
- ASSERT_FALSE(TransformationCopyObject(9, 43, 2, 200)
+ ASSERT_FALSE(TransformationCopyObject(
+ 9, MakeInstructionDescriptor(43, SpvOpSwitch, 0), 200)
.IsApplicable(context.get(), fact_manager));
// OK, because the insert point is right before the OpSelectionMerge
- ASSERT_TRUE(TransformationCopyObject(9, 43, 1, 200)
+ ASSERT_TRUE(TransformationCopyObject(
+ 9, MakeInstructionDescriptor(43, SpvOpSelectionMerge, 0), 200)
.IsApplicable(context.get(), fact_manager));
// Inapplicable because the insert point is right after an OpLoopMerge
- ASSERT_FALSE(TransformationCopyObject(9, 40, 2, 200)
- .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationCopyObject(
+ 9, MakeInstructionDescriptor(40, SpvOpBranchConditional, 0), 200)
+ .IsApplicable(context.get(), fact_manager));
// OK, because the insert point is right before the OpLoopMerge
- ASSERT_TRUE(TransformationCopyObject(9, 40, 1, 200)
+ ASSERT_TRUE(TransformationCopyObject(
+ 9, MakeInstructionDescriptor(40, SpvOpLoopMerge, 0), 200)
.IsApplicable(context.get(), fact_manager));
// Inapplicable because id %300 does not exist
- ASSERT_FALSE(TransformationCopyObject(300, 40, 1, 200)
+ ASSERT_FALSE(TransformationCopyObject(
+ 300, MakeInstructionDescriptor(40, SpvOpLoopMerge, 0), 200)
.IsApplicable(context.get(), fact_manager));
// Inapplicable because the following instruction is OpVariable
- ASSERT_FALSE(TransformationCopyObject(9, 180, 0, 200)
+ ASSERT_FALSE(TransformationCopyObject(
+ 9, MakeInstructionDescriptor(180, SpvOpVariable, 0), 200)
.IsApplicable(context.get(), fact_manager));
- ASSERT_FALSE(TransformationCopyObject(9, 181, 0, 200)
+ ASSERT_FALSE(TransformationCopyObject(
+ 9, MakeInstructionDescriptor(181, SpvOpVariable, 0), 200)
.IsApplicable(context.get(), fact_manager));
- ASSERT_FALSE(TransformationCopyObject(9, 182, 0, 200)
+ ASSERT_FALSE(TransformationCopyObject(
+ 9, MakeInstructionDescriptor(182, SpvOpVariable, 0), 200)
.IsApplicable(context.get(), fact_manager));
// OK, because this is just past the group of OpVariable instructions.
- ASSERT_TRUE(TransformationCopyObject(9, 182, 1, 200)
+ ASSERT_TRUE(TransformationCopyObject(
+ 9, MakeInstructionDescriptor(182, SpvOpAccessChain, 0), 200)
.IsApplicable(context.get(), fact_manager));
}
@@ -470,13 +516,20 @@ TEST(TransformationCopyObjectTest, MiscellaneousCopies) {
FactManager fact_manager;
std::vector<TransformationCopyObject> transformations = {
- TransformationCopyObject(19, 22, 1, 100),
- TransformationCopyObject(22, 22, 1, 101),
- TransformationCopyObject(12, 22, 1, 102),
- TransformationCopyObject(11, 22, 1, 103),
- TransformationCopyObject(16, 22, 1, 104),
- TransformationCopyObject(8, 22, 1, 105),
- TransformationCopyObject(17, 22, 1, 106)};
+ TransformationCopyObject(19, MakeInstructionDescriptor(22, SpvOpStore, 0),
+ 100),
+ TransformationCopyObject(
+ 22, MakeInstructionDescriptor(22, SpvOpCopyObject, 0), 101),
+ TransformationCopyObject(
+ 12, MakeInstructionDescriptor(22, SpvOpCopyObject, 0), 102),
+ TransformationCopyObject(
+ 11, MakeInstructionDescriptor(22, SpvOpCopyObject, 0), 103),
+ TransformationCopyObject(
+ 16, MakeInstructionDescriptor(22, SpvOpCopyObject, 0), 104),
+ TransformationCopyObject(
+ 8, MakeInstructionDescriptor(22, SpvOpCopyObject, 0), 105),
+ TransformationCopyObject(
+ 17, MakeInstructionDescriptor(22, SpvOpCopyObject, 0), 106)};
for (auto& transformation : transformations) {
ASSERT_TRUE(transformation.IsApplicable(context.get(), fact_manager));
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_replace_boolean_constant_with_constant_binary_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_replace_boolean_constant_with_constant_binary_test.cpp
index 704494b5028..bfc7fa77cb0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_replace_boolean_constant_with_constant_binary_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_replace_boolean_constant_with_constant_binary_test.cpp
@@ -16,6 +16,7 @@
#include "source/fuzz/fuzzer_util.h"
#include "source/fuzz/id_use_descriptor.h"
+#include "source/fuzz/instruction_descriptor.h"
#include "test/fuzz/fuzz_test_util.h"
namespace spvtools {
@@ -164,12 +165,14 @@ TEST(TransformationReplaceBooleanConstantWithConstantBinaryTest,
FactManager fact_manager;
std::vector<protobufs::IdUseDescriptor> uses_of_true = {
- transformation::MakeIdUseDescriptor(41, SpvOpStore, 1, 44, 12),
- transformation::MakeIdUseDescriptor(41, SpvOpLogicalOr, 0, 46, 0)};
+ MakeIdUseDescriptor(41, MakeInstructionDescriptor(44, SpvOpStore, 12), 1),
+ MakeIdUseDescriptor(41, MakeInstructionDescriptor(46, SpvOpLogicalOr, 0),
+ 0)};
std::vector<protobufs::IdUseDescriptor> uses_of_false = {
- transformation::MakeIdUseDescriptor(43, SpvOpStore, 1, 44, 13),
- transformation::MakeIdUseDescriptor(43, SpvOpLogicalAnd, 1, 48, 0)};
+ MakeIdUseDescriptor(43, MakeInstructionDescriptor(44, SpvOpStore, 13), 1),
+ MakeIdUseDescriptor(43, MakeInstructionDescriptor(48, SpvOpLogicalAnd, 0),
+ 1)};
const uint32_t fresh_id = 100;
@@ -529,10 +532,10 @@ TEST(TransformationReplaceBooleanConstantWithConstantBinaryTest,
FactManager fact_manager;
- auto use_of_true_in_if =
- transformation::MakeIdUseDescriptor(13, SpvOpBranchConditional, 0, 10, 0);
- auto use_of_false_in_while =
- transformation::MakeIdUseDescriptor(21, SpvOpBranchConditional, 0, 16, 0);
+ auto use_of_true_in_if = MakeIdUseDescriptor(
+ 13, MakeInstructionDescriptor(10, SpvOpBranchConditional, 0), 0);
+ auto use_of_false_in_while = MakeIdUseDescriptor(
+ 21, MakeInstructionDescriptor(16, SpvOpBranchConditional, 0), 0);
auto replacement_1 = TransformationReplaceBooleanConstantWithConstantBinary(
use_of_true_in_if, 9, 11, SpvOpSLessThan, 100);
@@ -641,8 +644,8 @@ TEST(TransformationReplaceBooleanConstantWithConstantBinaryTest, OpPhi) {
FactManager fact_manager;
auto replacement = TransformationReplaceBooleanConstantWithConstantBinary(
- transformation::MakeIdUseDescriptor(9, SpvOpPhi, 0, 23, 0), 13, 15,
- SpvOpSLessThan, 100);
+ MakeIdUseDescriptor(9, MakeInstructionDescriptor(23, SpvOpPhi, 0), 0), 13,
+ 15, SpvOpSLessThan, 100);
ASSERT_FALSE(replacement.IsApplicable(context.get(), fact_manager));
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_replace_constant_with_uniform_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_replace_constant_with_uniform_test.cpp
index 06ee025859d..ac2e3f9a632 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_replace_constant_with_uniform_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_replace_constant_with_uniform_test.cpp
@@ -13,6 +13,7 @@
// limitations under the License.
#include "source/fuzz/transformation_replace_constant_with_uniform.h"
+#include "source/fuzz/instruction_descriptor.h"
#include "source/fuzz/uniform_buffer_element_descriptor.h"
#include "test/fuzz/fuzz_test_util.h"
@@ -116,11 +117,11 @@ TEST(TransformationReplaceConstantWithUniformTest, BasicReplacements) {
// The constant ids are 9, 11 and 14, for 1, 2 and 3 respectively.
protobufs::IdUseDescriptor use_of_9_in_store =
- transformation::MakeIdUseDescriptor(9, SpvOpStore, 1, 8, 0);
+ MakeIdUseDescriptor(9, MakeInstructionDescriptor(8, SpvOpStore, 0), 1);
protobufs::IdUseDescriptor use_of_11_in_add =
- transformation::MakeIdUseDescriptor(11, SpvOpIAdd, 1, 12, 0);
+ MakeIdUseDescriptor(11, MakeInstructionDescriptor(12, SpvOpIAdd, 0), 1);
protobufs::IdUseDescriptor use_of_14_in_add =
- transformation::MakeIdUseDescriptor(14, SpvOpIAdd, 0, 15, 0);
+ MakeIdUseDescriptor(14, MakeInstructionDescriptor(15, SpvOpIAdd, 0), 0);
// These transformations work: they match the facts.
auto transformation_use_of_9_in_store =
@@ -167,7 +168,7 @@ TEST(TransformationReplaceConstantWithUniformTest, BasicReplacements) {
// The following transformation does not apply because the id descriptor is
// not sensible.
protobufs::IdUseDescriptor nonsense_id_use_descriptor =
- transformation::MakeIdUseDescriptor(9, SpvOpIAdd, 0, 15, 0);
+ MakeIdUseDescriptor(9, MakeInstructionDescriptor(15, SpvOpIAdd, 0), 0);
ASSERT_FALSE(TransformationReplaceConstantWithUniform(
nonsense_id_use_descriptor, blockname_a, 101, 102)
.IsApplicable(context.get(), fact_manager));
@@ -477,13 +478,13 @@ TEST(TransformationReplaceConstantWithUniformTest, NestedStruct) {
// The constant ids are 13, 15, 17 and 20, for 1, 2, 3 and 4 respectively.
protobufs::IdUseDescriptor use_of_13_in_store =
- transformation::MakeIdUseDescriptor(13, SpvOpStore, 1, 21, 0);
+ MakeIdUseDescriptor(13, MakeInstructionDescriptor(21, SpvOpStore, 0), 1);
protobufs::IdUseDescriptor use_of_15_in_add =
- transformation::MakeIdUseDescriptor(15, SpvOpIAdd, 1, 16, 0);
+ MakeIdUseDescriptor(15, MakeInstructionDescriptor(16, SpvOpIAdd, 0), 1);
protobufs::IdUseDescriptor use_of_17_in_add =
- transformation::MakeIdUseDescriptor(17, SpvOpIAdd, 0, 19, 0);
+ MakeIdUseDescriptor(17, MakeInstructionDescriptor(19, SpvOpIAdd, 0), 0);
protobufs::IdUseDescriptor use_of_20_in_store =
- transformation::MakeIdUseDescriptor(20, SpvOpStore, 1, 19, 1);
+ MakeIdUseDescriptor(20, MakeInstructionDescriptor(19, SpvOpStore, 1), 1);
// These transformations work: they match the facts.
auto transformation_use_of_13_in_store =
@@ -703,7 +704,7 @@ TEST(TransformationReplaceConstantWithUniformTest, NoUniformIntPointerPresent) {
// The constant id is 9 for 0.
protobufs::IdUseDescriptor use_of_9_in_store =
- transformation::MakeIdUseDescriptor(9, SpvOpStore, 1, 8, 0);
+ MakeIdUseDescriptor(9, MakeInstructionDescriptor(8, SpvOpStore, 0), 1);
// This transformation is not available because no uniform pointer to integer
// type is present:
@@ -778,7 +779,7 @@ TEST(TransformationReplaceConstantWithUniformTest, NoConstantPresentForIndex) {
// The constant id is 9 for 9.
protobufs::IdUseDescriptor use_of_9_in_store =
- transformation::MakeIdUseDescriptor(9, SpvOpStore, 1, 8, 0);
+ MakeIdUseDescriptor(9, MakeInstructionDescriptor(8, SpvOpStore, 0), 1);
// This transformation is not available because no constant is present for the
// index 1 required to index into the uniform buffer:
@@ -852,7 +853,7 @@ TEST(TransformationReplaceConstantWithUniformTest,
// The constant id is 9 for 3.0.
protobufs::IdUseDescriptor use_of_9_in_store =
- transformation::MakeIdUseDescriptor(9, SpvOpStore, 1, 8, 0);
+ MakeIdUseDescriptor(9, MakeInstructionDescriptor(8, SpvOpStore, 0), 1);
// This transformation is not available because no integer type is present to
// allow a constant index to be expressed:
@@ -937,9 +938,9 @@ TEST(TransformationReplaceConstantWithUniformTest,
// The constant ids for 9 and 10 are 9 and 11 respectively
protobufs::IdUseDescriptor use_of_9_in_store =
- transformation::MakeIdUseDescriptor(9, SpvOpStore, 1, 10, 0);
+ MakeIdUseDescriptor(9, MakeInstructionDescriptor(10, SpvOpStore, 0), 1);
protobufs::IdUseDescriptor use_of_11_in_store =
- transformation::MakeIdUseDescriptor(11, SpvOpStore, 1, 10, 1);
+ MakeIdUseDescriptor(11, MakeInstructionDescriptor(10, SpvOpStore, 1), 1);
// These are right:
ASSERT_TRUE(TransformationReplaceConstantWithUniform(use_of_9_in_store,
@@ -1220,58 +1221,58 @@ TEST(TransformationReplaceConstantWithUniformTest, ComplexReplacements) {
std::vector<TransformationReplaceConstantWithUniform> transformations;
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(18, SpvOpStore, 1, 20, 0),
+ MakeIdUseDescriptor(18, MakeInstructionDescriptor(20, SpvOpStore, 0), 1),
uniform_f_a_4, 200, 201));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(22, SpvOpStore, 1, 23, 0),
+ MakeIdUseDescriptor(22, MakeInstructionDescriptor(23, SpvOpStore, 0), 1),
uniform_f_a_3, 202, 203));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(25, SpvOpStore, 1, 26, 0),
+ MakeIdUseDescriptor(25, MakeInstructionDescriptor(26, SpvOpStore, 0), 1),
uniform_f_a_2, 204, 205));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(28, SpvOpStore, 1, 29, 0),
+ MakeIdUseDescriptor(28, MakeInstructionDescriptor(29, SpvOpStore, 0), 1),
uniform_f_a_1, 206, 207));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(31, SpvOpStore, 1, 32, 0),
+ MakeIdUseDescriptor(31, MakeInstructionDescriptor(32, SpvOpStore, 0), 1),
uniform_f_a_0, 208, 209));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(30, SpvOpStore, 1, 35, 0),
+ MakeIdUseDescriptor(30, MakeInstructionDescriptor(35, SpvOpStore, 0), 1),
uniform_f_b_w, 210, 211));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(27, SpvOpStore, 1, 37, 0),
+ MakeIdUseDescriptor(27, MakeInstructionDescriptor(37, SpvOpStore, 0), 1),
uniform_f_b_z, 212, 213));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(24, SpvOpStore, 1, 39, 0),
+ MakeIdUseDescriptor(24, MakeInstructionDescriptor(39, SpvOpStore, 0), 1),
uniform_f_b_y, 214, 215));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(21, SpvOpStore, 1, 41, 0),
+ MakeIdUseDescriptor(21, MakeInstructionDescriptor(41, SpvOpStore, 0), 1),
uniform_f_b_x, 216, 217));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(44, SpvOpStore, 1, 45, 0),
+ MakeIdUseDescriptor(44, MakeInstructionDescriptor(45, SpvOpStore, 0), 1),
uniform_f_c_z, 220, 221));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(46, SpvOpStore, 1, 47, 0),
+ MakeIdUseDescriptor(46, MakeInstructionDescriptor(47, SpvOpStore, 0), 1),
uniform_f_c_y, 222, 223));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(48, SpvOpStore, 1, 49, 0),
+ MakeIdUseDescriptor(48, MakeInstructionDescriptor(49, SpvOpStore, 0), 1),
uniform_f_c_x, 224, 225));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(50, SpvOpStore, 1, 52, 0),
+ MakeIdUseDescriptor(50, MakeInstructionDescriptor(52, SpvOpStore, 0), 1),
uniform_f_d, 226, 227));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(53, SpvOpStore, 1, 54, 0),
+ MakeIdUseDescriptor(53, MakeInstructionDescriptor(54, SpvOpStore, 0), 1),
uniform_h_x, 228, 229));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(55, SpvOpStore, 1, 56, 0),
+ MakeIdUseDescriptor(55, MakeInstructionDescriptor(56, SpvOpStore, 0), 1),
uniform_h_y, 230, 231));
transformations.emplace_back(TransformationReplaceConstantWithUniform(
- transformation::MakeIdUseDescriptor(42, SpvOpStore, 1, 43, 0), uniform_g,
- 218, 219));
+ MakeIdUseDescriptor(42, MakeInstructionDescriptor(43, SpvOpStore, 0), 1),
+ uniform_g, 218, 219));
for (auto& transformation : transformations) {
ASSERT_TRUE(transformation.IsApplicable(context.get(), fact_manager));
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_replace_id_with_synonym_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_replace_id_with_synonym_test.cpp
deleted file mode 100644
index 479eb160bf4..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_replace_id_with_synonym_test.cpp
+++ /dev/null
@@ -1,1176 +0,0 @@
-// Copyright (c) 2019 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "source/fuzz/transformation_replace_id_with_synonym.h"
-#include "source/fuzz/data_descriptor.h"
-#include "source/fuzz/id_use_descriptor.h"
-#include "test/fuzz/fuzz_test_util.h"
-
-namespace spvtools {
-namespace fuzz {
-namespace {
-
-// The following shader was obtained from this GLSL, which was then optimized
-// with spirv-opt -O and manually edited to include some uses of OpCopyObject
-// (to introduce id synonyms).
-//
-// #version 310 es
-//
-// precision highp int;
-// precision highp float;
-//
-// layout(set = 0, binding = 0) uniform buf {
-// int a;
-// int b;
-// int c;
-// };
-//
-// layout(location = 0) out vec4 color;
-//
-// void main() {
-// int x = a;
-// float f = 0.0;
-// while (x < b) {
-// switch(x % 4) {
-// case 0:
-// color[0] = f;
-// break;
-// case 1:
-// color[1] = f;
-// break;
-// case 2:
-// color[2] = f;
-// break;
-// case 3:
-// color[3] = f;
-// break;
-// default:
-// break;
-// }
-// if (x > c) {
-// x++;
-// } else {
-// x += 2;
-// }
-// }
-// color[0] += color[1] + float(x);
-// }
-const std::string kComplexShader = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main" %42
- OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- OpName %4 "main"
- OpName %9 "buf"
- OpMemberName %9 0 "a"
- OpMemberName %9 1 "b"
- OpMemberName %9 2 "c"
- OpName %11 ""
- OpName %42 "color"
- OpMemberDecorate %9 0 Offset 0
- OpMemberDecorate %9 1 Offset 4
- OpMemberDecorate %9 2 Offset 8
- OpDecorate %9 Block
- OpDecorate %11 DescriptorSet 0
- OpDecorate %11 Binding 0
- OpDecorate %42 Location 0
- %2 = OpTypeVoid
- %3 = OpTypeFunction %2
- %6 = OpTypeInt 32 1
- %9 = OpTypeStruct %6 %6 %6
- %10 = OpTypePointer Uniform %9
- %11 = OpVariable %10 Uniform
- %12 = OpConstant %6 0
- %13 = OpTypePointer Uniform %6
- %16 = OpTypeFloat 32
- %19 = OpConstant %16 0
- %26 = OpConstant %6 1
- %29 = OpTypeBool
- %32 = OpConstant %6 4
- %40 = OpTypeVector %16 4
- %41 = OpTypePointer Output %40
- %42 = OpVariable %41 Output
- %44 = OpTypeInt 32 0
- %45 = OpConstant %44 0
- %46 = OpTypePointer Output %16
- %50 = OpConstant %44 1
- %54 = OpConstant %44 2
- %58 = OpConstant %44 3
- %64 = OpConstant %6 2
- %4 = OpFunction %2 None %3
- %5 = OpLabel
- %209 = OpCopyObject %6 %12
- %14 = OpAccessChain %13 %11 %12
- %15 = OpLoad %6 %14
- %200 = OpCopyObject %6 %15
- OpBranch %20
- %20 = OpLabel
- %84 = OpPhi %6 %15 %5 %86 %69
- %27 = OpAccessChain %13 %11 %26
- %28 = OpLoad %6 %27
- %207 = OpCopyObject %6 %84
- %201 = OpCopyObject %6 %15
- %30 = OpSLessThan %29 %84 %28
- OpLoopMerge %22 %69 None
- OpBranchConditional %30 %21 %22
- %21 = OpLabel
- %33 = OpSMod %6 %84 %32
- %208 = OpCopyObject %6 %33
- OpSelectionMerge %39 None
- OpSwitch %33 %38 0 %34 1 %35 2 %36 3 %37
- %38 = OpLabel
- %202 = OpCopyObject %6 %15
- OpBranch %39
- %34 = OpLabel
- %210 = OpCopyObject %16 %19
- %47 = OpAccessChain %46 %42 %45
- OpStore %47 %19
- OpBranch %39
- %35 = OpLabel
- %51 = OpAccessChain %46 %42 %50
- OpStore %51 %19
- OpBranch %39
- %36 = OpLabel
- %204 = OpCopyObject %44 %54
- %55 = OpAccessChain %46 %42 %54
- %203 = OpCopyObject %46 %55
- OpStore %55 %19
- OpBranch %39
- %37 = OpLabel
- %59 = OpAccessChain %46 %42 %58
- OpStore %59 %19
- OpBranch %39
- %39 = OpLabel
- %300 = OpIAdd %6 %15 %15
- %65 = OpAccessChain %13 %11 %64
- %66 = OpLoad %6 %65
- %67 = OpSGreaterThan %29 %84 %66
- OpSelectionMerge %69 None
- OpBranchConditional %67 %68 %72
- %68 = OpLabel
- %71 = OpIAdd %6 %84 %26
- OpBranch %69
- %72 = OpLabel
- %74 = OpIAdd %6 %84 %64
- %205 = OpCopyObject %6 %74
- OpBranch %69
- %69 = OpLabel
- %86 = OpPhi %6 %71 %68 %74 %72
- %301 = OpPhi %6 %71 %68 %15 %72
- OpBranch %20
- %22 = OpLabel
- %75 = OpAccessChain %46 %42 %50
- %76 = OpLoad %16 %75
- %78 = OpConvertSToF %16 %84
- %80 = OpAccessChain %46 %42 %45
- %206 = OpCopyObject %16 %78
- %81 = OpLoad %16 %80
- %79 = OpFAdd %16 %76 %78
- %82 = OpFAdd %16 %81 %79
- OpStore %80 %82
- OpReturn
- OpFunctionEnd
-)";
-
-protobufs::Fact MakeFact(uint32_t id, uint32_t copy_id) {
- protobufs::FactIdSynonym id_synonym_fact;
- id_synonym_fact.set_id(id);
- id_synonym_fact.mutable_data_descriptor()->set_object(copy_id);
- protobufs::Fact result;
- *result.mutable_id_synonym_fact() = id_synonym_fact;
- return result;
-}
-
-// Equips the fact manager with synonym facts for the above shader.
-void SetUpIdSynonyms(FactManager* fact_manager, opt::IRContext* context) {
- fact_manager->AddFact(MakeFact(15, 200), context);
- fact_manager->AddFact(MakeFact(15, 201), context);
- fact_manager->AddFact(MakeFact(15, 202), context);
- fact_manager->AddFact(MakeFact(55, 203), context);
- fact_manager->AddFact(MakeFact(54, 204), context);
- fact_manager->AddFact(MakeFact(74, 205), context);
- fact_manager->AddFact(MakeFact(78, 206), context);
- fact_manager->AddFact(MakeFact(84, 207), context);
- fact_manager->AddFact(MakeFact(33, 208), context);
- fact_manager->AddFact(MakeFact(12, 209), context);
- fact_manager->AddFact(MakeFact(19, 210), context);
-}
-
-TEST(TransformationReplaceIdWithSynonymTest, IllegalTransformations) {
- const auto env = SPV_ENV_UNIVERSAL_1_3;
- const auto consumer = nullptr;
- const auto context =
- BuildModule(env, consumer, kComplexShader, kFuzzAssembleOption);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- FactManager fact_manager;
- SetUpIdSynonyms(&fact_manager, context.get());
-
- // %202 cannot replace %15 as in-operand 0 of %300, since %202 does not
- // dominate %300.
- auto synonym_does_not_dominate_use = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(15, SpvOpIAdd, 0, 300, 0),
- MakeDataDescriptor(202, {}), 0);
- ASSERT_FALSE(
- synonym_does_not_dominate_use.IsApplicable(context.get(), fact_manager));
-
- // %202 cannot replace %15 as in-operand 2 of %301, since this is the OpPhi's
- // incoming value for block %72, and %202 does not dominate %72.
- auto synonym_does_not_dominate_use_op_phi =
- TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(15, SpvOpPhi, 2, 301, 0),
- MakeDataDescriptor(202, {}), 0);
- ASSERT_FALSE(synonym_does_not_dominate_use_op_phi.IsApplicable(context.get(),
- fact_manager));
-
- // %200 is not a synonym for %84
- auto id_in_use_is_not_synonymous = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(84, SpvOpSGreaterThan, 0, 67, 0),
- MakeDataDescriptor(200, {}), 0);
- ASSERT_FALSE(
- id_in_use_is_not_synonymous.IsApplicable(context.get(), fact_manager));
-
- // %86 is not a synonym for anything (and in particular not for %74)
- auto id_has_no_synonyms = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(86, SpvOpPhi, 2, 84, 0),
- MakeDataDescriptor(74, {}), 0);
- ASSERT_FALSE(id_has_no_synonyms.IsApplicable(context.get(), fact_manager));
-
- // This would lead to %207 = 'OpCopyObject %type %207' if it were allowed
- auto synonym_use_is_in_synonym_definition =
- TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(84, SpvOpCopyObject, 0, 207, 0),
- MakeDataDescriptor(207, {}), 0);
- ASSERT_FALSE(synonym_use_is_in_synonym_definition.IsApplicable(context.get(),
- fact_manager));
-
- // The id use descriptor does not lead to a use (%84 is not used in the
- // definition of %207)
- auto bad_id_use_descriptor = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(84, SpvOpCopyObject, 0, 200, 0),
- MakeDataDescriptor(207, {}), 0);
- ASSERT_FALSE(bad_id_use_descriptor.IsApplicable(context.get(), fact_manager));
-
- // This replacement would lead to an access chain into a struct using a
- // non-constant index.
- auto bad_access_chain = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(12, SpvOpAccessChain, 1, 14, 0),
- MakeDataDescriptor(209, {}), 0);
- ASSERT_FALSE(bad_access_chain.IsApplicable(context.get(), fact_manager));
-}
-
-TEST(TransformationReplaceIdWithSynonymTest, LegalTransformations) {
- const auto env = SPV_ENV_UNIVERSAL_1_3;
- const auto consumer = nullptr;
- const auto context =
- BuildModule(env, consumer, kComplexShader, kFuzzAssembleOption);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- FactManager fact_manager;
- SetUpIdSynonyms(&fact_manager, context.get());
-
- auto global_constant_synonym = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(19, SpvOpStore, 1, 47, 0),
- MakeDataDescriptor(210, {}), 0);
- ASSERT_TRUE(
- global_constant_synonym.IsApplicable(context.get(), fact_manager));
- global_constant_synonym.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- auto replace_vector_access_chain_index = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(54, SpvOpAccessChain, 1, 55, 0),
- MakeDataDescriptor(204, {}), 0);
- ASSERT_TRUE(replace_vector_access_chain_index.IsApplicable(context.get(),
- fact_manager));
- replace_vector_access_chain_index.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- // This is an interesting case because it replaces something that is being
- // copied with something that is already a synonym.
- auto regular_replacement = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(15, SpvOpCopyObject, 0, 202, 0),
- MakeDataDescriptor(201, {}), 0);
- ASSERT_TRUE(regular_replacement.IsApplicable(context.get(), fact_manager));
- regular_replacement.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- auto regular_replacement2 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(55, SpvOpStore, 0, 203, 0),
- MakeDataDescriptor(203, {}), 0);
- ASSERT_TRUE(regular_replacement2.IsApplicable(context.get(), fact_manager));
- regular_replacement2.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- auto good_op_phi = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(74, SpvOpPhi, 2, 86, 0),
- MakeDataDescriptor(205, {}), 0);
- ASSERT_TRUE(good_op_phi.IsApplicable(context.get(), fact_manager));
- good_op_phi.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- const std::string after_transformation = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main" %42
- OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- OpName %4 "main"
- OpName %9 "buf"
- OpMemberName %9 0 "a"
- OpMemberName %9 1 "b"
- OpMemberName %9 2 "c"
- OpName %11 ""
- OpName %42 "color"
- OpMemberDecorate %9 0 Offset 0
- OpMemberDecorate %9 1 Offset 4
- OpMemberDecorate %9 2 Offset 8
- OpDecorate %9 Block
- OpDecorate %11 DescriptorSet 0
- OpDecorate %11 Binding 0
- OpDecorate %42 Location 0
- %2 = OpTypeVoid
- %3 = OpTypeFunction %2
- %6 = OpTypeInt 32 1
- %9 = OpTypeStruct %6 %6 %6
- %10 = OpTypePointer Uniform %9
- %11 = OpVariable %10 Uniform
- %12 = OpConstant %6 0
- %13 = OpTypePointer Uniform %6
- %16 = OpTypeFloat 32
- %19 = OpConstant %16 0
- %26 = OpConstant %6 1
- %29 = OpTypeBool
- %32 = OpConstant %6 4
- %40 = OpTypeVector %16 4
- %41 = OpTypePointer Output %40
- %42 = OpVariable %41 Output
- %44 = OpTypeInt 32 0
- %45 = OpConstant %44 0
- %46 = OpTypePointer Output %16
- %50 = OpConstant %44 1
- %54 = OpConstant %44 2
- %58 = OpConstant %44 3
- %64 = OpConstant %6 2
- %4 = OpFunction %2 None %3
- %5 = OpLabel
- %209 = OpCopyObject %6 %12
- %14 = OpAccessChain %13 %11 %12
- %15 = OpLoad %6 %14
- %200 = OpCopyObject %6 %15
- OpBranch %20
- %20 = OpLabel
- %84 = OpPhi %6 %15 %5 %86 %69
- %27 = OpAccessChain %13 %11 %26
- %28 = OpLoad %6 %27
- %207 = OpCopyObject %6 %84
- %201 = OpCopyObject %6 %15
- %30 = OpSLessThan %29 %84 %28
- OpLoopMerge %22 %69 None
- OpBranchConditional %30 %21 %22
- %21 = OpLabel
- %33 = OpSMod %6 %84 %32
- %208 = OpCopyObject %6 %33
- OpSelectionMerge %39 None
- OpSwitch %33 %38 0 %34 1 %35 2 %36 3 %37
- %38 = OpLabel
- %202 = OpCopyObject %6 %201
- OpBranch %39
- %34 = OpLabel
- %210 = OpCopyObject %16 %19
- %47 = OpAccessChain %46 %42 %45
- OpStore %47 %210
- OpBranch %39
- %35 = OpLabel
- %51 = OpAccessChain %46 %42 %50
- OpStore %51 %19
- OpBranch %39
- %36 = OpLabel
- %204 = OpCopyObject %44 %54
- %55 = OpAccessChain %46 %42 %204
- %203 = OpCopyObject %46 %55
- OpStore %203 %19
- OpBranch %39
- %37 = OpLabel
- %59 = OpAccessChain %46 %42 %58
- OpStore %59 %19
- OpBranch %39
- %39 = OpLabel
- %300 = OpIAdd %6 %15 %15
- %65 = OpAccessChain %13 %11 %64
- %66 = OpLoad %6 %65
- %67 = OpSGreaterThan %29 %84 %66
- OpSelectionMerge %69 None
- OpBranchConditional %67 %68 %72
- %68 = OpLabel
- %71 = OpIAdd %6 %84 %26
- OpBranch %69
- %72 = OpLabel
- %74 = OpIAdd %6 %84 %64
- %205 = OpCopyObject %6 %74
- OpBranch %69
- %69 = OpLabel
- %86 = OpPhi %6 %71 %68 %205 %72
- %301 = OpPhi %6 %71 %68 %15 %72
- OpBranch %20
- %22 = OpLabel
- %75 = OpAccessChain %46 %42 %50
- %76 = OpLoad %16 %75
- %78 = OpConvertSToF %16 %84
- %80 = OpAccessChain %46 %42 %45
- %206 = OpCopyObject %16 %78
- %81 = OpLoad %16 %80
- %79 = OpFAdd %16 %76 %78
- %82 = OpFAdd %16 %81 %79
- OpStore %80 %82
- OpReturn
- OpFunctionEnd
- )";
-
- ASSERT_TRUE(IsEqual(env, after_transformation, context.get()));
-}
-
-TEST(TransformationReplaceIdWithSynonymTest, SynonymsOfVariables) {
- // The following SPIR-V comes from this GLSL, with object copies added:
- //
- // #version 310 es
- //
- // precision highp int;
- //
- // int g;
- //
- // void main() {
- // int l;
- // l = g;
- // g = l;
- // }
- const std::string shader = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main"
- OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- OpName %4 "main"
- OpName %8 "l"
- OpName %10 "g"
- %2 = OpTypeVoid
- %3 = OpTypeFunction %2
- %6 = OpTypeInt 32 1
- %7 = OpTypePointer Function %6
- %9 = OpTypePointer Private %6
- %10 = OpVariable %9 Private
- %4 = OpFunction %2 None %3
- %5 = OpLabel
- %8 = OpVariable %7 Function
- %100 = OpCopyObject %9 %10
- %101 = OpCopyObject %7 %8
- %11 = OpLoad %6 %10
- OpStore %8 %11
- %12 = OpLoad %6 %8
- OpStore %10 %12
- OpReturn
- OpFunctionEnd
- )";
-
- const auto env = SPV_ENV_UNIVERSAL_1_3;
- const auto consumer = nullptr;
- const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- FactManager fact_manager;
-
- fact_manager.AddFact(MakeFact(10, 100), context.get());
- fact_manager.AddFact(MakeFact(8, 101), context.get());
-
- // Replace %10 with %100 in:
- // %11 = OpLoad %6 %10
- auto replacement1 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(10, SpvOpLoad, 0, 11, 0),
- MakeDataDescriptor(100, {}), 0);
- ASSERT_TRUE(replacement1.IsApplicable(context.get(), fact_manager));
- replacement1.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- // Replace %8 with %101 in:
- // OpStore %8 %11
- auto replacement2 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(8, SpvOpStore, 0, 11, 0),
- MakeDataDescriptor(101, {}), 0);
- ASSERT_TRUE(replacement2.IsApplicable(context.get(), fact_manager));
- replacement2.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- // Replace %8 with %101 in:
- // %12 = OpLoad %6 %8
- auto replacement3 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(8, SpvOpLoad, 0, 12, 0),
- MakeDataDescriptor(101, {}), 0);
- ASSERT_TRUE(replacement3.IsApplicable(context.get(), fact_manager));
- replacement3.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- // Replace %10 with %100 in:
- // OpStore %10 %12
- auto replacement4 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(10, SpvOpStore, 0, 12, 0),
- MakeDataDescriptor(100, {}), 0);
- ASSERT_TRUE(replacement4.IsApplicable(context.get(), fact_manager));
- replacement4.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- const std::string after_transformation = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main"
- OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- OpName %4 "main"
- OpName %8 "l"
- OpName %10 "g"
- %2 = OpTypeVoid
- %3 = OpTypeFunction %2
- %6 = OpTypeInt 32 1
- %7 = OpTypePointer Function %6
- %9 = OpTypePointer Private %6
- %10 = OpVariable %9 Private
- %4 = OpFunction %2 None %3
- %5 = OpLabel
- %8 = OpVariable %7 Function
- %100 = OpCopyObject %9 %10
- %101 = OpCopyObject %7 %8
- %11 = OpLoad %6 %100
- OpStore %101 %11
- %12 = OpLoad %6 %101
- OpStore %100 %12
- OpReturn
- OpFunctionEnd
- )";
-
- ASSERT_TRUE(IsEqual(env, after_transformation, context.get()));
-}
-
-TEST(TransformationReplaceIdWithSynonymTest,
- SynonymOfVariableNoGoodInFunctionCall) {
- // The following SPIR-V comes from this GLSL, with an object copy added:
- //
- // #version 310 es
- //
- // precision highp int;
- //
- // void foo(int x) { }
- //
- // void main() {
- // int a;
- // a = 2;
- // foo(a);
- // }
- const std::string shader = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main"
- OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- OpName %4 "main"
- OpName %10 "foo(i1;"
- OpName %9 "x"
- OpName %12 "a"
- OpName %14 "param"
- %2 = OpTypeVoid
- %3 = OpTypeFunction %2
- %6 = OpTypeInt 32 1
- %7 = OpTypePointer Function %6
- %8 = OpTypeFunction %2 %7
- %13 = OpConstant %6 2
- %4 = OpFunction %2 None %3
- %5 = OpLabel
- %12 = OpVariable %7 Function
- %14 = OpVariable %7 Function
- OpStore %12 %13
- %15 = OpLoad %6 %12
- OpStore %14 %15
- %100 = OpCopyObject %7 %14
- %16 = OpFunctionCall %2 %10 %14
- OpReturn
- OpFunctionEnd
- %10 = OpFunction %2 None %8
- %9 = OpFunctionParameter %7
- %11 = OpLabel
- OpReturn
- OpFunctionEnd
- )";
-
- const auto env = SPV_ENV_UNIVERSAL_1_3;
- const auto consumer = nullptr;
- const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- FactManager fact_manager;
-
- fact_manager.AddFact(MakeFact(14, 100), context.get());
-
- // Replace %14 with %100 in:
- // %16 = OpFunctionCall %2 %10 %14
- auto replacement = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(14, SpvOpFunctionCall, 1, 16, 0),
- MakeDataDescriptor(100, {}), 0);
- ASSERT_FALSE(replacement.IsApplicable(context.get(), fact_manager));
-}
-
-TEST(TransformationReplaceIdWithSynonymTest, SynonymsOfAccessChainIndices) {
- // The following SPIR-V comes from this GLSL, with object copies added:
- //
- // #version 310 es
- //
- // precision highp float;
- // precision highp int;
- //
- // struct S {
- // int[3] a;
- // vec4 b;
- // bool c;
- // } d;
- //
- // float[20] e;
- //
- // struct T {
- // float f;
- // S g;
- // } h;
- //
- // T[4] i;
- //
- // void main() {
- // d.a[2] = 10;
- // d.b[3] = 11.0;
- // d.c = false;
- // e[17] = 12.0;
- // h.f = 13.0;
- // h.g.a[1] = 14;
- // h.g.b[0] = 15.0;
- // h.g.c = true;
- // i[0].f = 16.0;
- // i[1].g.a[0] = 17;
- // i[2].g.b[1] = 18.0;
- // i[3].g.c = true;
- // }
- const std::string shader = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main"
- OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- OpName %4 "main"
- OpName %13 "S"
- OpMemberName %13 0 "a"
- OpMemberName %13 1 "b"
- OpMemberName %13 2 "c"
- OpName %15 "d"
- OpName %31 "e"
- OpName %35 "T"
- OpMemberName %35 0 "f"
- OpMemberName %35 1 "g"
- OpName %37 "h"
- OpName %50 "i"
- %2 = OpTypeVoid
- %3 = OpTypeFunction %2
- %6 = OpTypeInt 32 1
- %7 = OpTypeInt 32 0
- %8 = OpConstant %7 3
- %9 = OpTypeArray %6 %8
- %10 = OpTypeFloat 32
- %11 = OpTypeVector %10 4
- %12 = OpTypeBool
- %13 = OpTypeStruct %9 %11 %12
- %14 = OpTypePointer Private %13
- %15 = OpVariable %14 Private
- %16 = OpConstant %6 0
- %17 = OpConstant %6 2
- %18 = OpConstant %6 10
- %19 = OpTypePointer Private %6
- %21 = OpConstant %6 1
- %22 = OpConstant %10 11
- %23 = OpTypePointer Private %10
- %25 = OpConstantFalse %12
- %26 = OpTypePointer Private %12
- %28 = OpConstant %7 20
- %29 = OpTypeArray %10 %28
- %30 = OpTypePointer Private %29
- %31 = OpVariable %30 Private
- %32 = OpConstant %6 17
- %33 = OpConstant %10 12
- %35 = OpTypeStruct %10 %13
- %36 = OpTypePointer Private %35
- %37 = OpVariable %36 Private
- %38 = OpConstant %10 13
- %40 = OpConstant %6 14
- %42 = OpConstant %10 15
- %43 = OpConstant %7 0
- %45 = OpConstantTrue %12
- %47 = OpConstant %7 4
- %48 = OpTypeArray %35 %47
- %49 = OpTypePointer Private %48
- %50 = OpVariable %49 Private
- %51 = OpConstant %10 16
- %54 = OpConstant %10 18
- %55 = OpConstant %7 1
- %57 = OpConstant %6 3
- %4 = OpFunction %2 None %3
- %5 = OpLabel
-
- %100 = OpCopyObject %6 %16 ; 0
- %101 = OpCopyObject %6 %21 ; 1
- %102 = OpCopyObject %6 %17 ; 2
- %103 = OpCopyObject %6 %57 ; 3
- %104 = OpCopyObject %6 %18 ; 10
- %105 = OpCopyObject %6 %40 ; 14
- %106 = OpCopyObject %6 %32 ; 17
- %107 = OpCopyObject %7 %43 ; 0
- %108 = OpCopyObject %7 %55 ; 1
- %109 = OpCopyObject %7 %8 ; 3
- %110 = OpCopyObject %7 %47 ; 4
- %111 = OpCopyObject %7 %28 ; 20
- %112 = OpCopyObject %12 %45 ; true
-
- %20 = OpAccessChain %19 %15 %16 %17
- OpStore %20 %18
- %24 = OpAccessChain %23 %15 %21 %8
- OpStore %24 %22
- %27 = OpAccessChain %26 %15 %17
- OpStore %27 %25
- %34 = OpAccessChain %23 %31 %32
- OpStore %34 %33
- %39 = OpAccessChain %23 %37 %16
- OpStore %39 %38
- %41 = OpAccessChain %19 %37 %21 %16 %21
- OpStore %41 %40
- %44 = OpAccessChain %23 %37 %21 %21 %43
- OpStore %44 %42
- %46 = OpAccessChain %26 %37 %21 %17
- OpStore %46 %45
- %52 = OpAccessChain %23 %50 %16 %16
- OpStore %52 %51
- %53 = OpAccessChain %19 %50 %21 %21 %16 %16
- OpStore %53 %32
- %56 = OpAccessChain %23 %50 %17 %21 %21 %55
- OpStore %56 %54
- %58 = OpAccessChain %26 %50 %57 %21 %17
- OpStore %58 %45
- OpReturn
- OpFunctionEnd
- )";
-
- const auto env = SPV_ENV_UNIVERSAL_1_3;
- const auto consumer = nullptr;
- const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- FactManager fact_manager;
-
- // Add synonym facts corresponding to the OpCopyObject operations that have
- // been applied to all constants in the module.
- fact_manager.AddFact(MakeFact(16, 100), context.get());
- fact_manager.AddFact(MakeFact(21, 101), context.get());
- fact_manager.AddFact(MakeFact(17, 102), context.get());
- fact_manager.AddFact(MakeFact(57, 103), context.get());
- fact_manager.AddFact(MakeFact(18, 104), context.get());
- fact_manager.AddFact(MakeFact(40, 105), context.get());
- fact_manager.AddFact(MakeFact(32, 106), context.get());
- fact_manager.AddFact(MakeFact(43, 107), context.get());
- fact_manager.AddFact(MakeFact(55, 108), context.get());
- fact_manager.AddFact(MakeFact(8, 109), context.get());
- fact_manager.AddFact(MakeFact(47, 110), context.get());
- fact_manager.AddFact(MakeFact(28, 111), context.get());
- fact_manager.AddFact(MakeFact(45, 112), context.get());
-
- // Replacements of the form %16 -> %100
-
- // %20 = OpAccessChain %19 %15 *%16* %17
- // Corresponds to d.*a*[2]
- // The index %16 used for a cannot be replaced
- auto replacement1 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(16, SpvOpAccessChain, 1, 20, 0),
- MakeDataDescriptor(100, {}), 0);
- ASSERT_FALSE(replacement1.IsApplicable(context.get(), fact_manager));
-
- // %39 = OpAccessChain %23 %37 *%16*
- // Corresponds to h.*f*
- // The index %16 used for f cannot be replaced
- auto replacement2 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(16, SpvOpAccessChain, 1, 39, 0),
- MakeDataDescriptor(100, {}), 0);
- ASSERT_FALSE(replacement2.IsApplicable(context.get(), fact_manager));
-
- // %41 = OpAccessChain %19 %37 %21 *%16* %21
- // Corresponds to h.g.*a*[1]
- // The index %16 used for a cannot be replaced
- auto replacement3 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(16, SpvOpAccessChain, 2, 41, 0),
- MakeDataDescriptor(100, {}), 0);
- ASSERT_FALSE(replacement3.IsApplicable(context.get(), fact_manager));
-
- // %52 = OpAccessChain %23 %50 *%16* %16
- // Corresponds to i[*0*].f
- // The index %16 used for 0 *can* be replaced
- auto replacement4 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(16, SpvOpAccessChain, 1, 52, 0),
- MakeDataDescriptor(100, {}), 0);
- ASSERT_TRUE(replacement4.IsApplicable(context.get(), fact_manager));
- replacement4.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- // %52 = OpAccessChain %23 %50 %16 *%16*
- // Corresponds to i[0].*f*
- // The index %16 used for f cannot be replaced
- auto replacement5 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(16, SpvOpAccessChain, 2, 52, 0),
- MakeDataDescriptor(100, {}), 0);
- ASSERT_FALSE(replacement5.IsApplicable(context.get(), fact_manager));
-
- // %53 = OpAccessChain %19 %50 %21 %21 *%16* %16
- // Corresponds to i[1].g.*a*[0]
- // The index %16 used for a cannot be replaced
- auto replacement6 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(16, SpvOpAccessChain, 3, 53, 0),
- MakeDataDescriptor(100, {}), 0);
- ASSERT_FALSE(replacement6.IsApplicable(context.get(), fact_manager));
-
- // %53 = OpAccessChain %19 %50 %21 %21 %16 *%16*
- // Corresponds to i[1].g.a[*0*]
- // The index %16 used for 0 *can* be replaced
- auto replacement7 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(16, SpvOpAccessChain, 4, 53, 0),
- MakeDataDescriptor(100, {}), 0);
- ASSERT_TRUE(replacement7.IsApplicable(context.get(), fact_manager));
- replacement7.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- // Replacements of the form %21 -> %101
-
- // %24 = OpAccessChain %23 %15 *%21* %8
- // Corresponds to d.*b*[3]
- // The index %24 used for b cannot be replaced
- auto replacement8 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(21, SpvOpAccessChain, 1, 24, 0),
- MakeDataDescriptor(101, {}), 0);
- ASSERT_FALSE(replacement8.IsApplicable(context.get(), fact_manager));
-
- // %41 = OpAccessChain %19 %37 *%21* %16 %21
- // Corresponds to h.*g*.a[1]
- // The index %24 used for g cannot be replaced
- auto replacement9 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(21, SpvOpAccessChain, 1, 41, 0),
- MakeDataDescriptor(101, {}), 0);
- ASSERT_FALSE(replacement9.IsApplicable(context.get(), fact_manager));
-
- // %41 = OpAccessChain %19 %37 %21 %16 *%21*
- // Corresponds to h.g.a[*1*]
- // The index %24 used for 1 *can* be replaced
- auto replacement10 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(21, SpvOpAccessChain, 3, 41, 0),
- MakeDataDescriptor(101, {}), 0);
- ASSERT_TRUE(replacement10.IsApplicable(context.get(), fact_manager));
- replacement10.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- // %44 = OpAccessChain %23 %37 *%21* %21 %43
- // Corresponds to h.*g*.b[0]
- // The index %24 used for g cannot be replaced
- auto replacement11 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(21, SpvOpAccessChain, 1, 44, 0),
- MakeDataDescriptor(101, {}), 0);
- ASSERT_FALSE(replacement11.IsApplicable(context.get(), fact_manager));
-
- // %44 = OpAccessChain %23 %37 %21 *%21* %43
- // Corresponds to h.g.*b*[0]
- // The index %24 used for b cannot be replaced
- auto replacement12 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(21, SpvOpAccessChain, 2, 44, 0),
- MakeDataDescriptor(101, {}), 0);
- ASSERT_FALSE(replacement12.IsApplicable(context.get(), fact_manager));
-
- // %46 = OpAccessChain %26 %37 *%21* %17
- // Corresponds to h.*g*.c
- // The index %24 used for g cannot be replaced
- auto replacement13 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(21, SpvOpAccessChain, 1, 46, 0),
- MakeDataDescriptor(101, {}), 0);
- ASSERT_FALSE(replacement13.IsApplicable(context.get(), fact_manager));
-
- // %53 = OpAccessChain %19 %50 *%21* %21 %16 %16
- // Corresponds to i[*1*].g.a[0]
- // The index %24 used for 1 *can* be replaced
- auto replacement14 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(21, SpvOpAccessChain, 1, 53, 0),
- MakeDataDescriptor(101, {}), 0);
- ASSERT_TRUE(replacement14.IsApplicable(context.get(), fact_manager));
- replacement14.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- // %53 = OpAccessChain %19 %50 %21 *%21* %16 %16
- // Corresponds to i[1].*g*.a[0]
- // The index %24 used for g cannot be replaced
- auto replacement15 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(21, SpvOpAccessChain, 2, 53, 0),
- MakeDataDescriptor(101, {}), 0);
- ASSERT_FALSE(replacement15.IsApplicable(context.get(), fact_manager));
-
- // %56 = OpAccessChain %23 %50 %17 *%21* %21 %55
- // Corresponds to i[2].*g*.b[1]
- // The index %24 used for g cannot be replaced
- auto replacement16 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(21, SpvOpAccessChain, 2, 56, 0),
- MakeDataDescriptor(101, {}), 0);
- ASSERT_FALSE(replacement16.IsApplicable(context.get(), fact_manager));
-
- // %56 = OpAccessChain %23 %50 %17 %21 *%21* %55
- // Corresponds to i[2].g.*b*[1]
- // The index %24 used for b cannot be replaced
- auto replacement17 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(21, SpvOpAccessChain, 3, 56, 0),
- MakeDataDescriptor(101, {}), 0);
- ASSERT_FALSE(replacement17.IsApplicable(context.get(), fact_manager));
-
- // %58 = OpAccessChain %26 %50 %57 *%21* %17
- // Corresponds to i[3].*g*.c
- // The index %24 used for g cannot be replaced
- auto replacement18 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(21, SpvOpAccessChain, 2, 58, 0),
- MakeDataDescriptor(101, {}), 0);
- ASSERT_FALSE(replacement18.IsApplicable(context.get(), fact_manager));
-
- // Replacements of the form %17 -> %102
-
- // %20 = OpAccessChain %19 %15 %16 %17
- // Corresponds to d.a[*2*]
- // The index %17 used for 2 *can* be replaced
- auto replacement19 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(17, SpvOpAccessChain, 2, 20, 0),
- MakeDataDescriptor(102, {}), 0);
- ASSERT_TRUE(replacement19.IsApplicable(context.get(), fact_manager));
- replacement19.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- // %27 = OpAccessChain %26 %15 %17
- // Corresponds to d.c
- // The index %17 used for c cannot be replaced
- auto replacement20 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(17, SpvOpAccessChain, 1, 27, 0),
- MakeDataDescriptor(102, {}), 0);
- ASSERT_FALSE(replacement20.IsApplicable(context.get(), fact_manager));
-
- // %46 = OpAccessChain %26 %37 %21 %17
- // Corresponds to h.g.*c*
- // The index %17 used for c cannot be replaced
- auto replacement21 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(17, SpvOpAccessChain, 2, 46, 0),
- MakeDataDescriptor(102, {}), 0);
- ASSERT_FALSE(replacement21.IsApplicable(context.get(), fact_manager));
-
- // %56 = OpAccessChain %23 %50 %17 %21 %21 %55
- // Corresponds to i[*2*].g.b[1]
- // The index %17 used for 2 *can* be replaced
- auto replacement22 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(17, SpvOpAccessChain, 1, 56, 0),
- MakeDataDescriptor(102, {}), 0);
- ASSERT_TRUE(replacement22.IsApplicable(context.get(), fact_manager));
- replacement22.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- // %58 = OpAccessChain %26 %50 %57 %21 %17
- // Corresponds to i[3].g.*c*
- // The index %17 used for c cannot be replaced
- auto replacement23 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(17, SpvOpAccessChain, 3, 58, 0),
- MakeDataDescriptor(102, {}), 0);
- ASSERT_FALSE(replacement23.IsApplicable(context.get(), fact_manager));
-
- // Replacements of the form %57 -> %103
-
- // %58 = OpAccessChain %26 %50 *%57* %21 %17
- // Corresponds to i[*3*].g.c
- // The index %57 used for 3 *can* be replaced
- auto replacement24 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(57, SpvOpAccessChain, 1, 58, 0),
- MakeDataDescriptor(103, {}), 0);
- ASSERT_TRUE(replacement24.IsApplicable(context.get(), fact_manager));
- replacement24.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- // Replacements of the form %32 -> %106
-
- // %34 = OpAccessChain %23 %31 *%32*
- // Corresponds to e[*17*]
- // The index %32 used for 17 *can* be replaced
- auto replacement25 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(32, SpvOpAccessChain, 1, 34, 0),
- MakeDataDescriptor(106, {}), 0);
- ASSERT_TRUE(replacement25.IsApplicable(context.get(), fact_manager));
- replacement25.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- // Replacements of the form %43 -> %107
-
- // %44 = OpAccessChain %23 %37 %21 %21 *%43*
- // Corresponds to h.g.b[*0*]
- // The index %43 used for 0 *can* be replaced
- auto replacement26 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(43, SpvOpAccessChain, 3, 44, 0),
- MakeDataDescriptor(107, {}), 0);
- ASSERT_TRUE(replacement26.IsApplicable(context.get(), fact_manager));
- replacement26.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- // Replacements of the form %55 -> %108
-
- // %56 = OpAccessChain %23 %50 %17 %21 %21 *%55*
- // Corresponds to i[2].g.b[*1*]
- // The index %55 used for 1 *can* be replaced
- auto replacement27 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(55, SpvOpAccessChain, 4, 56, 0),
- MakeDataDescriptor(108, {}), 0);
- ASSERT_TRUE(replacement27.IsApplicable(context.get(), fact_manager));
- replacement27.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- // Replacements of the form %8 -> %109
-
- // %24 = OpAccessChain %23 %15 %21 *%8*
- // Corresponds to d.b[*3*]
- // The index %8 used for 3 *can* be replaced
- auto replacement28 = TransformationReplaceIdWithSynonym(
- transformation::MakeIdUseDescriptor(8, SpvOpAccessChain, 2, 24, 0),
- MakeDataDescriptor(109, {}), 0);
- ASSERT_TRUE(replacement28.IsApplicable(context.get(), fact_manager));
- replacement28.Apply(context.get(), &fact_manager);
- ASSERT_TRUE(IsValid(env, context.get()));
-
- const std::string after_transformation = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main"
- OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- OpName %4 "main"
- OpName %13 "S"
- OpMemberName %13 0 "a"
- OpMemberName %13 1 "b"
- OpMemberName %13 2 "c"
- OpName %15 "d"
- OpName %31 "e"
- OpName %35 "T"
- OpMemberName %35 0 "f"
- OpMemberName %35 1 "g"
- OpName %37 "h"
- OpName %50 "i"
- %2 = OpTypeVoid
- %3 = OpTypeFunction %2
- %6 = OpTypeInt 32 1
- %7 = OpTypeInt 32 0
- %8 = OpConstant %7 3
- %9 = OpTypeArray %6 %8
- %10 = OpTypeFloat 32
- %11 = OpTypeVector %10 4
- %12 = OpTypeBool
- %13 = OpTypeStruct %9 %11 %12
- %14 = OpTypePointer Private %13
- %15 = OpVariable %14 Private
- %16 = OpConstant %6 0
- %17 = OpConstant %6 2
- %18 = OpConstant %6 10
- %19 = OpTypePointer Private %6
- %21 = OpConstant %6 1
- %22 = OpConstant %10 11
- %23 = OpTypePointer Private %10
- %25 = OpConstantFalse %12
- %26 = OpTypePointer Private %12
- %28 = OpConstant %7 20
- %29 = OpTypeArray %10 %28
- %30 = OpTypePointer Private %29
- %31 = OpVariable %30 Private
- %32 = OpConstant %6 17
- %33 = OpConstant %10 12
- %35 = OpTypeStruct %10 %13
- %36 = OpTypePointer Private %35
- %37 = OpVariable %36 Private
- %38 = OpConstant %10 13
- %40 = OpConstant %6 14
- %42 = OpConstant %10 15
- %43 = OpConstant %7 0
- %45 = OpConstantTrue %12
- %47 = OpConstant %7 4
- %48 = OpTypeArray %35 %47
- %49 = OpTypePointer Private %48
- %50 = OpVariable %49 Private
- %51 = OpConstant %10 16
- %54 = OpConstant %10 18
- %55 = OpConstant %7 1
- %57 = OpConstant %6 3
- %4 = OpFunction %2 None %3
- %5 = OpLabel
-
- %100 = OpCopyObject %6 %16 ; 0
- %101 = OpCopyObject %6 %21 ; 1
- %102 = OpCopyObject %6 %17 ; 2
- %103 = OpCopyObject %6 %57 ; 3
- %104 = OpCopyObject %6 %18 ; 10
- %105 = OpCopyObject %6 %40 ; 14
- %106 = OpCopyObject %6 %32 ; 17
- %107 = OpCopyObject %7 %43 ; 0
- %108 = OpCopyObject %7 %55 ; 1
- %109 = OpCopyObject %7 %8 ; 3
- %110 = OpCopyObject %7 %47 ; 4
- %111 = OpCopyObject %7 %28 ; 20
- %112 = OpCopyObject %12 %45 ; true
-
- %20 = OpAccessChain %19 %15 %16 %102
- OpStore %20 %18
- %24 = OpAccessChain %23 %15 %21 %109
- OpStore %24 %22
- %27 = OpAccessChain %26 %15 %17
- OpStore %27 %25
- %34 = OpAccessChain %23 %31 %106
- OpStore %34 %33
- %39 = OpAccessChain %23 %37 %16
- OpStore %39 %38
- %41 = OpAccessChain %19 %37 %21 %16 %101
- OpStore %41 %40
- %44 = OpAccessChain %23 %37 %21 %21 %107
- OpStore %44 %42
- %46 = OpAccessChain %26 %37 %21 %17
- OpStore %46 %45
- %52 = OpAccessChain %23 %50 %100 %16
- OpStore %52 %51
- %53 = OpAccessChain %19 %50 %101 %21 %16 %100
- OpStore %53 %32
- %56 = OpAccessChain %23 %50 %102 %21 %21 %108
- OpStore %56 %54
- %58 = OpAccessChain %26 %50 %103 %21 %17
- OpStore %58 %45
- OpReturn
- OpFunctionEnd
- )";
-
- ASSERT_TRUE(IsEqual(env, after_transformation, context.get()));
-}
-
-} // namespace
-} // namespace fuzz
-} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_function_control_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_function_control_test.cpp
new file mode 100644
index 00000000000..536e965e397
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_function_control_test.cpp
@@ -0,0 +1,251 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/transformation_set_function_control.h"
+#include "test/fuzz/fuzz_test_util.h"
+
+namespace spvtools {
+namespace fuzz {
+namespace {
+
+TEST(TransformationSetFunctionControlTest, VariousScenarios) {
+ // This is a simple transformation; this test captures the important things
+ // to check for.
+
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %54
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %11 "foo(i1;i1;"
+ OpName %9 "a"
+ OpName %10 "b"
+ OpName %13 "bar("
+ OpName %17 "baz(i1;"
+ OpName %16 "x"
+ OpName %21 "boo(i1;i1;"
+ OpName %19 "a"
+ OpName %20 "b"
+ OpName %29 "g"
+ OpName %42 "param"
+ OpName %44 "param"
+ OpName %45 "param"
+ OpName %48 "param"
+ OpName %49 "param"
+ OpName %54 "color"
+ OpDecorate %54 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %8 = OpTypeFunction %6 %7 %7
+ %15 = OpTypeFunction %6 %7
+ %28 = OpTypePointer Private %6
+ %29 = OpVariable %28 Private
+ %30 = OpConstant %6 2
+ %31 = OpConstant %6 5
+ %51 = OpTypeFloat 32
+ %52 = OpTypeVector %51 4
+ %53 = OpTypePointer Output %52
+ %54 = OpVariable %53 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %42 = OpVariable %7 Function
+ %44 = OpVariable %7 Function
+ %45 = OpVariable %7 Function
+ %48 = OpVariable %7 Function
+ %49 = OpVariable %7 Function
+ %41 = OpFunctionCall %2 %13
+ OpStore %42 %30
+ %43 = OpFunctionCall %6 %17 %42
+ OpStore %44 %31
+ %46 = OpLoad %6 %29
+ OpStore %45 %46
+ %47 = OpFunctionCall %6 %21 %44 %45
+ OpStore %48 %43
+ OpStore %49 %47
+ %50 = OpFunctionCall %6 %11 %48 %49
+ OpReturn
+ OpFunctionEnd
+ %11 = OpFunction %6 Const %8
+ %9 = OpFunctionParameter %7
+ %10 = OpFunctionParameter %7
+ %12 = OpLabel
+ %23 = OpLoad %6 %9
+ %24 = OpLoad %6 %10
+ %25 = OpIAdd %6 %23 %24
+ OpReturnValue %25
+ OpFunctionEnd
+ %13 = OpFunction %2 Inline %3
+ %14 = OpLabel
+ OpStore %29 %30
+ OpReturn
+ OpFunctionEnd
+ %17 = OpFunction %6 Pure|DontInline %15
+ %16 = OpFunctionParameter %7
+ %18 = OpLabel
+ %32 = OpLoad %6 %16
+ %33 = OpIAdd %6 %31 %32
+ OpReturnValue %33
+ OpFunctionEnd
+ %21 = OpFunction %6 DontInline %8
+ %19 = OpFunctionParameter %7
+ %20 = OpFunctionParameter %7
+ %22 = OpLabel
+ %36 = OpLoad %6 %19
+ %37 = OpLoad %6 %20
+ %38 = OpIMul %6 %36 %37
+ OpReturnValue %38
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_3;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
+
+ FactManager fact_manager;
+
+ // %36 is not a function
+ ASSERT_FALSE(TransformationSetFunctionControl(36, SpvFunctionControlMaskNone)
+ .IsApplicable(context.get(), fact_manager));
+ // Cannot add the Pure function control to %4 as it did not already have it
+ ASSERT_FALSE(TransformationSetFunctionControl(4, SpvFunctionControlPureMask)
+ .IsApplicable(context.get(), fact_manager));
+ // Cannot add the Const function control to %21 as it did not already
+ // have it
+ ASSERT_FALSE(TransformationSetFunctionControl(21, SpvFunctionControlConstMask)
+ .IsApplicable(context.get(), fact_manager));
+
+ // Set to None, removing Const
+ TransformationSetFunctionControl transformation1(11,
+ SpvFunctionControlMaskNone);
+ ASSERT_TRUE(transformation1.IsApplicable(context.get(), fact_manager));
+ transformation1.Apply(context.get(), &fact_manager);
+
+ // Set to Inline; silly to do it on an entry point, but it is allowed
+ TransformationSetFunctionControl transformation2(
+ 4, SpvFunctionControlInlineMask);
+ ASSERT_TRUE(transformation2.IsApplicable(context.get(), fact_manager));
+ transformation2.Apply(context.get(), &fact_manager);
+
+ // Set to Pure, removing DontInline
+ TransformationSetFunctionControl transformation3(17,
+ SpvFunctionControlPureMask);
+ ASSERT_TRUE(transformation3.IsApplicable(context.get(), fact_manager));
+ transformation3.Apply(context.get(), &fact_manager);
+
+ // Change from Inline to DontInline
+ TransformationSetFunctionControl transformation4(
+ 13, SpvFunctionControlDontInlineMask);
+ ASSERT_TRUE(transformation4.IsApplicable(context.get(), fact_manager));
+ transformation4.Apply(context.get(), &fact_manager);
+
+ std::string after_transformation = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %54
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %11 "foo(i1;i1;"
+ OpName %9 "a"
+ OpName %10 "b"
+ OpName %13 "bar("
+ OpName %17 "baz(i1;"
+ OpName %16 "x"
+ OpName %21 "boo(i1;i1;"
+ OpName %19 "a"
+ OpName %20 "b"
+ OpName %29 "g"
+ OpName %42 "param"
+ OpName %44 "param"
+ OpName %45 "param"
+ OpName %48 "param"
+ OpName %49 "param"
+ OpName %54 "color"
+ OpDecorate %54 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %8 = OpTypeFunction %6 %7 %7
+ %15 = OpTypeFunction %6 %7
+ %28 = OpTypePointer Private %6
+ %29 = OpVariable %28 Private
+ %30 = OpConstant %6 2
+ %31 = OpConstant %6 5
+ %51 = OpTypeFloat 32
+ %52 = OpTypeVector %51 4
+ %53 = OpTypePointer Output %52
+ %54 = OpVariable %53 Output
+ %4 = OpFunction %2 Inline %3
+ %5 = OpLabel
+ %42 = OpVariable %7 Function
+ %44 = OpVariable %7 Function
+ %45 = OpVariable %7 Function
+ %48 = OpVariable %7 Function
+ %49 = OpVariable %7 Function
+ %41 = OpFunctionCall %2 %13
+ OpStore %42 %30
+ %43 = OpFunctionCall %6 %17 %42
+ OpStore %44 %31
+ %46 = OpLoad %6 %29
+ OpStore %45 %46
+ %47 = OpFunctionCall %6 %21 %44 %45
+ OpStore %48 %43
+ OpStore %49 %47
+ %50 = OpFunctionCall %6 %11 %48 %49
+ OpReturn
+ OpFunctionEnd
+ %11 = OpFunction %6 None %8
+ %9 = OpFunctionParameter %7
+ %10 = OpFunctionParameter %7
+ %12 = OpLabel
+ %23 = OpLoad %6 %9
+ %24 = OpLoad %6 %10
+ %25 = OpIAdd %6 %23 %24
+ OpReturnValue %25
+ OpFunctionEnd
+ %13 = OpFunction %2 DontInline %3
+ %14 = OpLabel
+ OpStore %29 %30
+ OpReturn
+ OpFunctionEnd
+ %17 = OpFunction %6 Pure %15
+ %16 = OpFunctionParameter %7
+ %18 = OpLabel
+ %32 = OpLoad %6 %16
+ %33 = OpIAdd %6 %31 %32
+ OpReturnValue %33
+ OpFunctionEnd
+ %21 = OpFunction %6 DontInline %8
+ %19 = OpFunctionParameter %7
+ %20 = OpFunctionParameter %7
+ %22 = OpLabel
+ %36 = OpLoad %6 %19
+ %37 = OpLoad %6 %20
+ %38 = OpIMul %6 %36 %37
+ OpReturnValue %38
+ OpFunctionEnd
+ )";
+ ASSERT_TRUE(IsEqual(env, after_transformation, context.get()));
+}
+
+} // namespace
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_loop_control_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_loop_control_test.cpp
new file mode 100644
index 00000000000..83953ec0e6a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_loop_control_test.cpp
@@ -0,0 +1,968 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/transformation_set_loop_control.h"
+#include "test/fuzz/fuzz_test_util.h"
+
+namespace spvtools {
+namespace fuzz {
+namespace {
+
+TEST(TransformationSetLoopControlTest, VariousScenarios) {
+ // This test features loops with various different controls, and goes through
+ // a number of acceptable and unacceptable transformations to those controls.
+
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %9 = OpConstant %6 0
+ %16 = OpConstant %6 100
+ %17 = OpTypeBool
+ %20 = OpConstant %6 1
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %22 = OpVariable %7 Function
+ %32 = OpVariable %7 Function
+ %42 = OpVariable %7 Function
+ %52 = OpVariable %7 Function
+ %62 = OpVariable %7 Function
+ %72 = OpVariable %7 Function
+ %82 = OpVariable %7 Function
+ %92 = OpVariable %7 Function
+ %102 = OpVariable %7 Function
+ %112 = OpVariable %7 Function
+ %122 = OpVariable %7 Function
+ OpStore %8 %9
+ OpBranch %10
+ %10 = OpLabel
+ %132 = OpPhi %6 %9 %5 %21 %13
+ OpLoopMerge %12 %13 None
+ OpBranch %14
+ %14 = OpLabel
+ %18 = OpSLessThan %17 %132 %16
+ OpBranchConditional %18 %11 %12
+ %11 = OpLabel
+ OpBranch %13
+ %13 = OpLabel
+ %21 = OpIAdd %6 %132 %20
+ OpStore %8 %21
+ OpBranch %10
+ %12 = OpLabel
+ OpStore %22 %9
+ OpBranch %23
+ %23 = OpLabel
+ %133 = OpPhi %6 %9 %12 %31 %26
+ OpLoopMerge %25 %26 Unroll
+ OpBranch %27
+ %27 = OpLabel
+ %29 = OpSLessThan %17 %133 %16
+ OpBranchConditional %29 %24 %25
+ %24 = OpLabel
+ OpBranch %26
+ %26 = OpLabel
+ %31 = OpIAdd %6 %133 %20
+ OpStore %22 %31
+ OpBranch %23
+ %25 = OpLabel
+ OpStore %32 %9
+ OpBranch %33
+ %33 = OpLabel
+ %134 = OpPhi %6 %9 %25 %41 %36
+ OpLoopMerge %35 %36 DontUnroll
+ OpBranch %37
+ %37 = OpLabel
+ %39 = OpSLessThan %17 %134 %16
+ OpBranchConditional %39 %34 %35
+ %34 = OpLabel
+ OpBranch %36
+ %36 = OpLabel
+ %41 = OpIAdd %6 %134 %20
+ OpStore %32 %41
+ OpBranch %33
+ %35 = OpLabel
+ OpStore %42 %9
+ OpBranch %43
+ %43 = OpLabel
+ %135 = OpPhi %6 %9 %35 %51 %46
+ OpLoopMerge %45 %46 DependencyInfinite
+ OpBranch %47
+ %47 = OpLabel
+ %49 = OpSLessThan %17 %135 %16
+ OpBranchConditional %49 %44 %45
+ %44 = OpLabel
+ OpBranch %46
+ %46 = OpLabel
+ %51 = OpIAdd %6 %135 %20
+ OpStore %42 %51
+ OpBranch %43
+ %45 = OpLabel
+ OpStore %52 %9
+ OpBranch %53
+ %53 = OpLabel
+ %136 = OpPhi %6 %9 %45 %61 %56
+ OpLoopMerge %55 %56 DependencyLength 3
+ OpBranch %57
+ %57 = OpLabel
+ %59 = OpSLessThan %17 %136 %16
+ OpBranchConditional %59 %54 %55
+ %54 = OpLabel
+ OpBranch %56
+ %56 = OpLabel
+ %61 = OpIAdd %6 %136 %20
+ OpStore %52 %61
+ OpBranch %53
+ %55 = OpLabel
+ OpStore %62 %9
+ OpBranch %63
+ %63 = OpLabel
+ %137 = OpPhi %6 %9 %55 %71 %66
+ OpLoopMerge %65 %66 MinIterations 10
+ OpBranch %67
+ %67 = OpLabel
+ %69 = OpSLessThan %17 %137 %16
+ OpBranchConditional %69 %64 %65
+ %64 = OpLabel
+ OpBranch %66
+ %66 = OpLabel
+ %71 = OpIAdd %6 %137 %20
+ OpStore %62 %71
+ OpBranch %63
+ %65 = OpLabel
+ OpStore %72 %9
+ OpBranch %73
+ %73 = OpLabel
+ %138 = OpPhi %6 %9 %65 %81 %76
+ OpLoopMerge %75 %76 MaxIterations 50
+ OpBranch %77
+ %77 = OpLabel
+ %79 = OpSLessThan %17 %138 %16
+ OpBranchConditional %79 %74 %75
+ %74 = OpLabel
+ OpBranch %76
+ %76 = OpLabel
+ %81 = OpIAdd %6 %138 %20
+ OpStore %72 %81
+ OpBranch %73
+ %75 = OpLabel
+ OpStore %82 %9
+ OpBranch %83
+ %83 = OpLabel
+ %139 = OpPhi %6 %9 %75 %91 %86
+ OpLoopMerge %85 %86 IterationMultiple 4
+ OpBranch %87
+ %87 = OpLabel
+ %89 = OpSLessThan %17 %139 %16
+ OpBranchConditional %89 %84 %85
+ %84 = OpLabel
+ OpBranch %86
+ %86 = OpLabel
+ %91 = OpIAdd %6 %139 %20
+ OpStore %82 %91
+ OpBranch %83
+ %85 = OpLabel
+ OpStore %92 %9
+ OpBranch %93
+ %93 = OpLabel
+ %140 = OpPhi %6 %9 %85 %101 %96
+ OpLoopMerge %95 %96 PeelCount 2
+ OpBranch %97
+ %97 = OpLabel
+ %99 = OpSLessThan %17 %140 %16
+ OpBranchConditional %99 %94 %95
+ %94 = OpLabel
+ OpBranch %96
+ %96 = OpLabel
+ %101 = OpIAdd %6 %140 %20
+ OpStore %92 %101
+ OpBranch %93
+ %95 = OpLabel
+ OpStore %102 %9
+ OpBranch %103
+ %103 = OpLabel
+ %141 = OpPhi %6 %9 %95 %111 %106
+ OpLoopMerge %105 %106 PartialCount 3
+ OpBranch %107
+ %107 = OpLabel
+ %109 = OpSLessThan %17 %141 %16
+ OpBranchConditional %109 %104 %105
+ %104 = OpLabel
+ OpBranch %106
+ %106 = OpLabel
+ %111 = OpIAdd %6 %141 %20
+ OpStore %102 %111
+ OpBranch %103
+ %105 = OpLabel
+ OpStore %112 %9
+ OpBranch %113
+ %113 = OpLabel
+ %142 = OpPhi %6 %9 %105 %121 %116
+ OpLoopMerge %115 %116 Unroll|PeelCount|PartialCount 3 4
+ OpBranch %117
+ %117 = OpLabel
+ %119 = OpSLessThan %17 %142 %16
+ OpBranchConditional %119 %114 %115
+ %114 = OpLabel
+ OpBranch %116
+ %116 = OpLabel
+ %121 = OpIAdd %6 %142 %20
+ OpStore %112 %121
+ OpBranch %113
+ %115 = OpLabel
+ OpStore %122 %9
+ OpBranch %123
+ %123 = OpLabel
+ %143 = OpPhi %6 %9 %115 %131 %126
+ OpLoopMerge %125 %126 DependencyLength|MinIterations|MaxIterations|IterationMultiple|PeelCount|PartialCount 2 5 90 4 7 14
+ OpBranch %127
+ %127 = OpLabel
+ %129 = OpSLessThan %17 %143 %16
+ OpBranchConditional %129 %124 %125
+ %124 = OpLabel
+ OpBranch %126
+ %126 = OpLabel
+ %131 = OpIAdd %6 %143 %20
+ OpStore %122 %131
+ OpBranch %123
+ %125 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_4;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
+
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ FactManager fact_manager;
+
+ // These are the loop headers together with the selection controls of their
+ // merge instructions:
+ // %10 None
+ // %23 Unroll
+ // %33 DontUnroll
+ // %43 DependencyInfinite
+ // %53 DependencyLength 3
+ // %63 MinIterations 10
+ // %73 MaxIterations 50
+ // %83 IterationMultiple 4
+ // %93 PeelCount 2
+ // %103 PartialCount 3
+ // %113 Unroll|PeelCount|PartialCount 3 4
+ // %123
+ // DependencyLength|MinIterations|MaxIterations|IterationMultiple|PeelCount|PartialCount
+ // 2 5 90 4 7 14
+
+ ASSERT_TRUE(TransformationSetLoopControl(10, SpvLoopControlMaskNone, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(10, SpvLoopControlUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(10, SpvLoopControlDontUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSetLoopControl(
+ 10, SpvLoopControlDependencyInfiniteMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(10, SpvLoopControlDependencyLengthMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(10, SpvLoopControlMinIterationsMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(10, SpvLoopControlMaxIterationsMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSetLoopControl(
+ 10, SpvLoopControlIterationMultipleMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(10, SpvLoopControlPeelCountMask, 3, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(10, SpvLoopControlPeelCountMask, 3, 3)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(10, SpvLoopControlPartialCountMask, 0, 3)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(10, SpvLoopControlPartialCountMask, 3, 3)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(
+ 10,
+ SpvLoopControlPeelCountMask | SpvLoopControlPartialCountMask,
+ 3, 3)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(10,
+ SpvLoopControlUnrollMask |
+ SpvLoopControlPeelCountMask |
+ SpvLoopControlPartialCountMask,
+ 3, 3)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSetLoopControl(10,
+ SpvLoopControlDontUnrollMask |
+ SpvLoopControlPeelCountMask |
+ SpvLoopControlPartialCountMask,
+ 3, 3)
+ .IsApplicable(context.get(), fact_manager));
+
+ ASSERT_TRUE(TransformationSetLoopControl(23, SpvLoopControlMaskNone, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(23, SpvLoopControlUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(23, SpvLoopControlDontUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(
+ 23,
+ SpvLoopControlPeelCountMask | SpvLoopControlPartialCountMask,
+ 3, 3)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(23, SpvLoopControlMaxIterationsMask, 2, 3)
+ .IsApplicable(context.get(), fact_manager));
+
+ ASSERT_TRUE(TransformationSetLoopControl(33, SpvLoopControlMaskNone, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(33, SpvLoopControlUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(33, SpvLoopControlDontUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(33, SpvLoopControlMinIterationsMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(
+ 33, SpvLoopControlUnrollMask | SpvLoopControlPeelCountMask, 5, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSetLoopControl(33,
+ SpvLoopControlDontUnrollMask |
+ SpvLoopControlPartialCountMask,
+ 0, 10)
+ .IsApplicable(context.get(), fact_manager));
+
+ ASSERT_TRUE(TransformationSetLoopControl(43, SpvLoopControlMaskNone, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(43, SpvLoopControlUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(43, SpvLoopControlDontUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(
+ 43,
+ SpvLoopControlMaskNone | SpvLoopControlDependencyInfiniteMask,
+ 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(
+ 43, SpvLoopControlUnrollMask | SpvLoopControlDependencyInfiniteMask,
+ 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(
+ 43,
+ SpvLoopControlDontUnrollMask | SpvLoopControlDependencyInfiniteMask,
+ 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(43,
+ SpvLoopControlDependencyInfiniteMask |
+ SpvLoopControlDependencyLengthMask,
+ 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(
+ 43, SpvLoopControlUnrollMask | SpvLoopControlPeelCountMask, 5, 0)
+ .IsApplicable(context.get(), fact_manager));
+
+ ASSERT_TRUE(TransformationSetLoopControl(53, SpvLoopControlMaskNone, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(53, SpvLoopControlUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(53, SpvLoopControlDontUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(53, SpvLoopControlMaxIterationsMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(
+ 53, SpvLoopControlMaskNone | SpvLoopControlDependencyLengthMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(
+ 53, SpvLoopControlUnrollMask | SpvLoopControlDependencyInfiniteMask,
+ 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(
+ 53, SpvLoopControlDontUnrollMask | SpvLoopControlDependencyLengthMask,
+ 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(53,
+ SpvLoopControlDependencyInfiniteMask |
+ SpvLoopControlDependencyLengthMask,
+ 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(
+ 53,
+ SpvLoopControlUnrollMask | SpvLoopControlDependencyLengthMask |
+ SpvLoopControlPeelCountMask | SpvLoopControlPartialCountMask,
+ 5, 3)
+ .IsApplicable(context.get(), fact_manager));
+
+ ASSERT_TRUE(TransformationSetLoopControl(63, SpvLoopControlMaskNone, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(63, SpvLoopControlUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(63, SpvLoopControlDontUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(63,
+ SpvLoopControlUnrollMask |
+ SpvLoopControlMinIterationsMask |
+ SpvLoopControlPeelCountMask |
+ SpvLoopControlPartialCountMask,
+ 5, 3)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(63,
+ SpvLoopControlUnrollMask |
+ SpvLoopControlMinIterationsMask |
+ SpvLoopControlPeelCountMask,
+ 23, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSetLoopControl(
+ 63,
+ SpvLoopControlUnrollMask | SpvLoopControlMinIterationsMask |
+ SpvLoopControlPeelCountMask,
+ 2, 23)
+ .IsApplicable(context.get(), fact_manager));
+
+ ASSERT_TRUE(TransformationSetLoopControl(73, SpvLoopControlMaskNone, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(73, SpvLoopControlUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(73, SpvLoopControlDontUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSetLoopControl(
+ 73,
+ SpvLoopControlUnrollMask | SpvLoopControlMinIterationsMask |
+ SpvLoopControlPeelCountMask |
+ SpvLoopControlPartialCountMask,
+ 5, 3)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(73,
+ SpvLoopControlUnrollMask |
+ SpvLoopControlMaxIterationsMask |
+ SpvLoopControlPeelCountMask,
+ 23, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSetLoopControl(
+ 73,
+ SpvLoopControlUnrollMask | SpvLoopControlMaxIterationsMask |
+ SpvLoopControlPeelCountMask,
+ 2, 23)
+ .IsApplicable(context.get(), fact_manager));
+
+ ASSERT_TRUE(TransformationSetLoopControl(83, SpvLoopControlMaskNone, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(83, SpvLoopControlUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(83, SpvLoopControlDontUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSetLoopControl(
+ 83,
+ SpvLoopControlUnrollMask | SpvLoopControlMinIterationsMask |
+ SpvLoopControlPeelCountMask |
+ SpvLoopControlPartialCountMask,
+ 5, 3)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(83,
+ SpvLoopControlUnrollMask |
+ SpvLoopControlIterationMultipleMask |
+ SpvLoopControlPeelCountMask,
+ 23, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(83,
+ SpvLoopControlUnrollMask |
+ SpvLoopControlIterationMultipleMask |
+ SpvLoopControlPeelCountMask,
+ 2, 23)
+ .IsApplicable(context.get(), fact_manager));
+
+ ASSERT_TRUE(TransformationSetLoopControl(93, SpvLoopControlMaskNone, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(93, SpvLoopControlUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(93, SpvLoopControlDontUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(93, SpvLoopControlPeelCountMask, 8, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(93, SpvLoopControlPeelCountMask, 8, 8)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(93, SpvLoopControlPartialCountMask, 0, 8)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(
+ 93,
+ SpvLoopControlPeelCountMask | SpvLoopControlPartialCountMask,
+ 16, 8)
+ .IsApplicable(context.get(), fact_manager));
+
+ ASSERT_TRUE(TransformationSetLoopControl(103, SpvLoopControlMaskNone, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(103, SpvLoopControlUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(103, SpvLoopControlDontUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(103, SpvLoopControlPartialCountMask, 0, 60)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSetLoopControl(103,
+ SpvLoopControlDontUnrollMask |
+ SpvLoopControlPartialCountMask,
+ 0, 60)
+ .IsApplicable(context.get(), fact_manager));
+
+ ASSERT_TRUE(TransformationSetLoopControl(113, SpvLoopControlMaskNone, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(113, SpvLoopControlUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(113, SpvLoopControlDontUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(113, SpvLoopControlPeelCountMask, 12, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(
+ 113,
+ SpvLoopControlIterationMultipleMask | SpvLoopControlPeelCountMask, 12,
+ 0)
+ .IsApplicable(context.get(), fact_manager));
+
+ ASSERT_TRUE(TransformationSetLoopControl(123, SpvLoopControlMaskNone, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(123, SpvLoopControlUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(123, SpvLoopControlDontUnrollMask, 0, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(
+ TransformationSetLoopControl(
+ 123,
+ SpvLoopControlMinIterationsMask | SpvLoopControlMaxIterationsMask |
+ SpvLoopControlIterationMultipleMask |
+ SpvLoopControlPeelCountMask | SpvLoopControlPartialCountMask,
+ 7, 8)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(TransformationSetLoopControl(123,
+ SpvLoopControlUnrollMask |
+ SpvLoopControlMinIterationsMask |
+ SpvLoopControlMaxIterationsMask |
+ SpvLoopControlPartialCountMask,
+ 0, 9)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSetLoopControl(
+ 123,
+ SpvLoopControlUnrollMask | SpvLoopControlMinIterationsMask |
+ SpvLoopControlMaxIterationsMask |
+ SpvLoopControlPartialCountMask,
+ 7, 9)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSetLoopControl(
+ 123,
+ SpvLoopControlDontUnrollMask | SpvLoopControlMinIterationsMask |
+ SpvLoopControlMaxIterationsMask | SpvLoopControlPartialCountMask,
+ 7, 9)
+ .IsApplicable(context.get(), fact_manager));
+
+ TransformationSetLoopControl(10,
+ SpvLoopControlUnrollMask |
+ SpvLoopControlPeelCountMask |
+ SpvLoopControlPartialCountMask,
+ 3, 3)
+ .Apply(context.get(), &fact_manager);
+ TransformationSetLoopControl(23, SpvLoopControlDontUnrollMask, 0, 0)
+ .Apply(context.get(), &fact_manager);
+ TransformationSetLoopControl(33, SpvLoopControlUnrollMask, 0, 0)
+ .Apply(context.get(), &fact_manager);
+ TransformationSetLoopControl(
+ 43, SpvLoopControlDontUnrollMask | SpvLoopControlDependencyInfiniteMask,
+ 0, 0)
+ .Apply(context.get(), &fact_manager);
+ TransformationSetLoopControl(53, SpvLoopControlMaskNone, 0, 0)
+ .Apply(context.get(), &fact_manager);
+ TransformationSetLoopControl(63,
+ SpvLoopControlUnrollMask |
+ SpvLoopControlMinIterationsMask |
+ SpvLoopControlPeelCountMask,
+ 23, 0)
+ .Apply(context.get(), &fact_manager);
+ TransformationSetLoopControl(73,
+ SpvLoopControlUnrollMask |
+ SpvLoopControlMaxIterationsMask |
+ SpvLoopControlPeelCountMask,
+ 23, 0)
+ .Apply(context.get(), &fact_manager);
+ TransformationSetLoopControl(83, SpvLoopControlDontUnrollMask, 0, 0)
+ .Apply(context.get(), &fact_manager);
+ TransformationSetLoopControl(
+ 93, SpvLoopControlPeelCountMask | SpvLoopControlPartialCountMask, 16, 8)
+ .Apply(context.get(), &fact_manager);
+ TransformationSetLoopControl(103, SpvLoopControlPartialCountMask, 0, 60)
+ .Apply(context.get(), &fact_manager);
+ TransformationSetLoopControl(113, SpvLoopControlPeelCountMask, 12, 0)
+ .Apply(context.get(), &fact_manager);
+ TransformationSetLoopControl(
+ 123,
+ SpvLoopControlUnrollMask | SpvLoopControlMinIterationsMask |
+ SpvLoopControlMaxIterationsMask | SpvLoopControlPartialCountMask,
+ 0, 9)
+ .Apply(context.get(), &fact_manager);
+
+ std::string after_transformation = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %9 = OpConstant %6 0
+ %16 = OpConstant %6 100
+ %17 = OpTypeBool
+ %20 = OpConstant %6 1
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %22 = OpVariable %7 Function
+ %32 = OpVariable %7 Function
+ %42 = OpVariable %7 Function
+ %52 = OpVariable %7 Function
+ %62 = OpVariable %7 Function
+ %72 = OpVariable %7 Function
+ %82 = OpVariable %7 Function
+ %92 = OpVariable %7 Function
+ %102 = OpVariable %7 Function
+ %112 = OpVariable %7 Function
+ %122 = OpVariable %7 Function
+ OpStore %8 %9
+ OpBranch %10
+ %10 = OpLabel
+ %132 = OpPhi %6 %9 %5 %21 %13
+ OpLoopMerge %12 %13 Unroll|PeelCount|PartialCount 3 3
+ OpBranch %14
+ %14 = OpLabel
+ %18 = OpSLessThan %17 %132 %16
+ OpBranchConditional %18 %11 %12
+ %11 = OpLabel
+ OpBranch %13
+ %13 = OpLabel
+ %21 = OpIAdd %6 %132 %20
+ OpStore %8 %21
+ OpBranch %10
+ %12 = OpLabel
+ OpStore %22 %9
+ OpBranch %23
+ %23 = OpLabel
+ %133 = OpPhi %6 %9 %12 %31 %26
+ OpLoopMerge %25 %26 DontUnroll
+ OpBranch %27
+ %27 = OpLabel
+ %29 = OpSLessThan %17 %133 %16
+ OpBranchConditional %29 %24 %25
+ %24 = OpLabel
+ OpBranch %26
+ %26 = OpLabel
+ %31 = OpIAdd %6 %133 %20
+ OpStore %22 %31
+ OpBranch %23
+ %25 = OpLabel
+ OpStore %32 %9
+ OpBranch %33
+ %33 = OpLabel
+ %134 = OpPhi %6 %9 %25 %41 %36
+ OpLoopMerge %35 %36 Unroll
+ OpBranch %37
+ %37 = OpLabel
+ %39 = OpSLessThan %17 %134 %16
+ OpBranchConditional %39 %34 %35
+ %34 = OpLabel
+ OpBranch %36
+ %36 = OpLabel
+ %41 = OpIAdd %6 %134 %20
+ OpStore %32 %41
+ OpBranch %33
+ %35 = OpLabel
+ OpStore %42 %9
+ OpBranch %43
+ %43 = OpLabel
+ %135 = OpPhi %6 %9 %35 %51 %46
+ OpLoopMerge %45 %46 DontUnroll|DependencyInfinite
+ OpBranch %47
+ %47 = OpLabel
+ %49 = OpSLessThan %17 %135 %16
+ OpBranchConditional %49 %44 %45
+ %44 = OpLabel
+ OpBranch %46
+ %46 = OpLabel
+ %51 = OpIAdd %6 %135 %20
+ OpStore %42 %51
+ OpBranch %43
+ %45 = OpLabel
+ OpStore %52 %9
+ OpBranch %53
+ %53 = OpLabel
+ %136 = OpPhi %6 %9 %45 %61 %56
+ OpLoopMerge %55 %56 None
+ OpBranch %57
+ %57 = OpLabel
+ %59 = OpSLessThan %17 %136 %16
+ OpBranchConditional %59 %54 %55
+ %54 = OpLabel
+ OpBranch %56
+ %56 = OpLabel
+ %61 = OpIAdd %6 %136 %20
+ OpStore %52 %61
+ OpBranch %53
+ %55 = OpLabel
+ OpStore %62 %9
+ OpBranch %63
+ %63 = OpLabel
+ %137 = OpPhi %6 %9 %55 %71 %66
+ OpLoopMerge %65 %66 Unroll|MinIterations|PeelCount 10 23
+ OpBranch %67
+ %67 = OpLabel
+ %69 = OpSLessThan %17 %137 %16
+ OpBranchConditional %69 %64 %65
+ %64 = OpLabel
+ OpBranch %66
+ %66 = OpLabel
+ %71 = OpIAdd %6 %137 %20
+ OpStore %62 %71
+ OpBranch %63
+ %65 = OpLabel
+ OpStore %72 %9
+ OpBranch %73
+ %73 = OpLabel
+ %138 = OpPhi %6 %9 %65 %81 %76
+ OpLoopMerge %75 %76 Unroll|MaxIterations|PeelCount 50 23
+ OpBranch %77
+ %77 = OpLabel
+ %79 = OpSLessThan %17 %138 %16
+ OpBranchConditional %79 %74 %75
+ %74 = OpLabel
+ OpBranch %76
+ %76 = OpLabel
+ %81 = OpIAdd %6 %138 %20
+ OpStore %72 %81
+ OpBranch %73
+ %75 = OpLabel
+ OpStore %82 %9
+ OpBranch %83
+ %83 = OpLabel
+ %139 = OpPhi %6 %9 %75 %91 %86
+ OpLoopMerge %85 %86 DontUnroll
+ OpBranch %87
+ %87 = OpLabel
+ %89 = OpSLessThan %17 %139 %16
+ OpBranchConditional %89 %84 %85
+ %84 = OpLabel
+ OpBranch %86
+ %86 = OpLabel
+ %91 = OpIAdd %6 %139 %20
+ OpStore %82 %91
+ OpBranch %83
+ %85 = OpLabel
+ OpStore %92 %9
+ OpBranch %93
+ %93 = OpLabel
+ %140 = OpPhi %6 %9 %85 %101 %96
+ OpLoopMerge %95 %96 PeelCount|PartialCount 16 8
+ OpBranch %97
+ %97 = OpLabel
+ %99 = OpSLessThan %17 %140 %16
+ OpBranchConditional %99 %94 %95
+ %94 = OpLabel
+ OpBranch %96
+ %96 = OpLabel
+ %101 = OpIAdd %6 %140 %20
+ OpStore %92 %101
+ OpBranch %93
+ %95 = OpLabel
+ OpStore %102 %9
+ OpBranch %103
+ %103 = OpLabel
+ %141 = OpPhi %6 %9 %95 %111 %106
+ OpLoopMerge %105 %106 PartialCount 60
+ OpBranch %107
+ %107 = OpLabel
+ %109 = OpSLessThan %17 %141 %16
+ OpBranchConditional %109 %104 %105
+ %104 = OpLabel
+ OpBranch %106
+ %106 = OpLabel
+ %111 = OpIAdd %6 %141 %20
+ OpStore %102 %111
+ OpBranch %103
+ %105 = OpLabel
+ OpStore %112 %9
+ OpBranch %113
+ %113 = OpLabel
+ %142 = OpPhi %6 %9 %105 %121 %116
+ OpLoopMerge %115 %116 PeelCount 12
+ OpBranch %117
+ %117 = OpLabel
+ %119 = OpSLessThan %17 %142 %16
+ OpBranchConditional %119 %114 %115
+ %114 = OpLabel
+ OpBranch %116
+ %116 = OpLabel
+ %121 = OpIAdd %6 %142 %20
+ OpStore %112 %121
+ OpBranch %113
+ %115 = OpLabel
+ OpStore %122 %9
+ OpBranch %123
+ %123 = OpLabel
+ %143 = OpPhi %6 %9 %115 %131 %126
+ OpLoopMerge %125 %126 Unroll|MinIterations|MaxIterations|PartialCount 5 90 9
+ OpBranch %127
+ %127 = OpLabel
+ %129 = OpSLessThan %17 %143 %16
+ OpBranchConditional %129 %124 %125
+ %124 = OpLabel
+ OpBranch %126
+ %126 = OpLabel
+ %131 = OpIAdd %6 %143 %20
+ OpStore %122 %131
+ OpBranch %123
+ %125 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ ASSERT_TRUE(IsEqual(env, after_transformation, context.get()));
+}
+
+TEST(TransformationSetLoopControlTest, CheckSPIRVVersionsRespected) {
+ // This test checks that we do not allow introducing PeelCount and
+ // PartialCount loop controls if the SPIR-V version being used does not
+ // support them.
+
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "i"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %9 = OpConstant %6 0
+ %16 = OpConstant %6 10
+ %17 = OpTypeBool
+ %20 = OpConstant %6 1
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ OpStore %8 %9
+ OpBranch %10
+ %10 = OpLabel
+ OpLoopMerge %12 %13 None
+ OpBranch %14
+ %14 = OpLabel
+ %15 = OpLoad %6 %8
+ %18 = OpSLessThan %17 %15 %16
+ OpBranchConditional %18 %11 %12
+ %11 = OpLabel
+ OpBranch %13
+ %13 = OpLabel
+ %19 = OpLoad %6 %8
+ %21 = OpIAdd %6 %19 %20
+ OpStore %8 %21
+ OpBranch %10
+ %12 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto consumer = nullptr;
+ const auto context_1_0 =
+ BuildModule(SPV_ENV_UNIVERSAL_1_0, consumer, shader, kFuzzAssembleOption);
+ const auto context_1_1 =
+ BuildModule(SPV_ENV_UNIVERSAL_1_1, consumer, shader, kFuzzAssembleOption);
+ const auto context_1_2 =
+ BuildModule(SPV_ENV_UNIVERSAL_1_2, consumer, shader, kFuzzAssembleOption);
+ const auto context_1_3 =
+ BuildModule(SPV_ENV_UNIVERSAL_1_3, consumer, shader, kFuzzAssembleOption);
+ const auto context_1_4 =
+ BuildModule(SPV_ENV_UNIVERSAL_1_4, consumer, shader, kFuzzAssembleOption);
+ const auto context_1_5 =
+ BuildModule(SPV_ENV_UNIVERSAL_1_5, consumer, shader, kFuzzAssembleOption);
+
+ FactManager fact_manager;
+
+ TransformationSetLoopControl set_peel_and_partial(
+ 10, SpvLoopControlPeelCountMask | SpvLoopControlPartialCountMask, 4, 4);
+
+ // PeelCount and PartialCount were introduced in SPIRV 1.4, so are not valid
+ // in the context of older versions.
+ ASSERT_FALSE(
+ set_peel_and_partial.IsApplicable(context_1_0.get(), fact_manager));
+ ASSERT_FALSE(
+ set_peel_and_partial.IsApplicable(context_1_1.get(), fact_manager));
+ ASSERT_FALSE(
+ set_peel_and_partial.IsApplicable(context_1_2.get(), fact_manager));
+ ASSERT_FALSE(
+ set_peel_and_partial.IsApplicable(context_1_3.get(), fact_manager));
+
+ ASSERT_TRUE(
+ set_peel_and_partial.IsApplicable(context_1_4.get(), fact_manager));
+ ASSERT_TRUE(
+ set_peel_and_partial.IsApplicable(context_1_5.get(), fact_manager));
+}
+
+} // namespace
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_memory_operands_mask_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_memory_operands_mask_test.cpp
new file mode 100644
index 00000000000..ad4dc2567e8
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_memory_operands_mask_test.cpp
@@ -0,0 +1,432 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/transformation_set_memory_operands_mask.h"
+#include "source/fuzz/instruction_descriptor.h"
+#include "test/fuzz/fuzz_test_util.h"
+
+namespace spvtools {
+namespace fuzz {
+namespace {
+
+TEST(TransformationSetMemoryOperandsMaskTest, PreSpirv14) {
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %7 "Point3D"
+ OpMemberName %7 0 "x"
+ OpMemberName %7 1 "y"
+ OpMemberName %7 2 "z"
+ OpName %12 "global_points"
+ OpName %15 "block"
+ OpMemberName %15 0 "in_points"
+ OpMemberName %15 1 "in_point"
+ OpName %17 ""
+ OpName %133 "local_points"
+ OpMemberDecorate %7 0 Offset 0
+ OpMemberDecorate %7 1 Offset 4
+ OpMemberDecorate %7 2 Offset 8
+ OpDecorate %10 ArrayStride 16
+ OpMemberDecorate %15 0 Offset 0
+ OpMemberDecorate %15 1 Offset 192
+ OpDecorate %15 Block
+ OpDecorate %17 DescriptorSet 0
+ OpDecorate %17 Binding 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeStruct %6 %6 %6
+ %8 = OpTypeInt 32 0
+ %9 = OpConstant %8 12
+ %10 = OpTypeArray %7 %9
+ %11 = OpTypePointer Private %10
+ %12 = OpVariable %11 Private
+ %15 = OpTypeStruct %10 %7
+ %16 = OpTypePointer Uniform %15
+ %17 = OpVariable %16 Uniform
+ %18 = OpTypeInt 32 1
+ %19 = OpConstant %18 0
+ %20 = OpTypePointer Uniform %10
+ %24 = OpTypePointer Private %7
+ %27 = OpTypePointer Private %6
+ %30 = OpConstant %18 1
+ %132 = OpTypePointer Function %10
+ %135 = OpTypePointer Uniform %7
+ %145 = OpTypePointer Function %7
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %133 = OpVariable %132 Function
+ %21 = OpAccessChain %20 %17 %19
+ OpCopyMemory %12 %21 Aligned 16
+ OpCopyMemory %133 %12 Volatile
+ %136 = OpAccessChain %135 %17 %30
+ %138 = OpAccessChain %24 %12 %19
+ OpCopyMemory %138 %136 None
+ %146 = OpAccessChain %145 %133 %30
+ %147 = OpLoad %7 %146 Volatile|Nontemporal|Aligned 16
+ %148 = OpAccessChain %24 %12 %19
+ OpStore %148 %147 Nontemporal
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_3;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ FactManager fact_manager;
+
+ // Not OK: the instruction is not a memory access.
+ ASSERT_FALSE(TransformationSetMemoryOperandsMask(
+ MakeInstructionDescriptor(21, SpvOpAccessChain, 0),
+ SpvMemoryAccessMaskNone, 0)
+ .IsApplicable(context.get(), fact_manager));
+
+ // Not OK to remove Aligned
+ ASSERT_FALSE(TransformationSetMemoryOperandsMask(
+ MakeInstructionDescriptor(147, SpvOpLoad, 0),
+ SpvMemoryAccessVolatileMask | SpvMemoryAccessNontemporalMask,
+ 0)
+ .IsApplicable(context.get(), fact_manager));
+
+ TransformationSetMemoryOperandsMask transformation1(
+ MakeInstructionDescriptor(147, SpvOpLoad, 0),
+ SpvMemoryAccessAlignedMask | SpvMemoryAccessVolatileMask, 0);
+ ASSERT_TRUE(transformation1.IsApplicable(context.get(), fact_manager));
+ transformation1.Apply(context.get(), &fact_manager);
+
+ // Not OK to remove Aligned
+ ASSERT_FALSE(TransformationSetMemoryOperandsMask(
+ MakeInstructionDescriptor(21, SpvOpCopyMemory, 0),
+ SpvMemoryAccessMaskNone, 0)
+ .IsApplicable(context.get(), fact_manager));
+
+ // OK: leaves the mask as is
+ ASSERT_TRUE(TransformationSetMemoryOperandsMask(
+ MakeInstructionDescriptor(21, SpvOpCopyMemory, 0),
+ SpvMemoryAccessAlignedMask, 0)
+ .IsApplicable(context.get(), fact_manager));
+
+ // OK: adds Nontemporal and Volatile
+ TransformationSetMemoryOperandsMask transformation2(
+ MakeInstructionDescriptor(21, SpvOpCopyMemory, 0),
+ SpvMemoryAccessAlignedMask | SpvMemoryAccessNontemporalMask |
+ SpvMemoryAccessVolatileMask,
+ 0);
+ ASSERT_TRUE(transformation2.IsApplicable(context.get(), fact_manager));
+ transformation2.Apply(context.get(), &fact_manager);
+
+ // Not OK to remove Volatile
+ ASSERT_FALSE(TransformationSetMemoryOperandsMask(
+ MakeInstructionDescriptor(21, SpvOpCopyMemory, 1),
+ SpvMemoryAccessNontemporalMask, 0)
+ .IsApplicable(context.get(), fact_manager));
+
+ // Not OK to add Aligned
+ ASSERT_FALSE(TransformationSetMemoryOperandsMask(
+ MakeInstructionDescriptor(21, SpvOpCopyMemory, 1),
+ SpvMemoryAccessAlignedMask | SpvMemoryAccessVolatileMask, 0)
+ .IsApplicable(context.get(), fact_manager));
+
+ // OK: adds Nontemporal
+ TransformationSetMemoryOperandsMask transformation3(
+ MakeInstructionDescriptor(21, SpvOpCopyMemory, 1),
+ SpvMemoryAccessNontemporalMask | SpvMemoryAccessVolatileMask, 0);
+ ASSERT_TRUE(transformation3.IsApplicable(context.get(), fact_manager));
+ transformation3.Apply(context.get(), &fact_manager);
+
+ // OK: adds Nontemporal and Volatile
+ TransformationSetMemoryOperandsMask transformation4(
+ MakeInstructionDescriptor(138, SpvOpCopyMemory, 0),
+ SpvMemoryAccessNontemporalMask | SpvMemoryAccessVolatileMask, 0);
+ ASSERT_TRUE(transformation4.IsApplicable(context.get(), fact_manager));
+ transformation4.Apply(context.get(), &fact_manager);
+
+ // OK: removes Nontemporal, adds Volatile
+ TransformationSetMemoryOperandsMask transformation5(
+ MakeInstructionDescriptor(148, SpvOpStore, 0),
+ SpvMemoryAccessVolatileMask, 0);
+ ASSERT_TRUE(transformation5.IsApplicable(context.get(), fact_manager));
+ transformation5.Apply(context.get(), &fact_manager);
+
+ std::string after_transformation = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %7 "Point3D"
+ OpMemberName %7 0 "x"
+ OpMemberName %7 1 "y"
+ OpMemberName %7 2 "z"
+ OpName %12 "global_points"
+ OpName %15 "block"
+ OpMemberName %15 0 "in_points"
+ OpMemberName %15 1 "in_point"
+ OpName %17 ""
+ OpName %133 "local_points"
+ OpMemberDecorate %7 0 Offset 0
+ OpMemberDecorate %7 1 Offset 4
+ OpMemberDecorate %7 2 Offset 8
+ OpDecorate %10 ArrayStride 16
+ OpMemberDecorate %15 0 Offset 0
+ OpMemberDecorate %15 1 Offset 192
+ OpDecorate %15 Block
+ OpDecorate %17 DescriptorSet 0
+ OpDecorate %17 Binding 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeStruct %6 %6 %6
+ %8 = OpTypeInt 32 0
+ %9 = OpConstant %8 12
+ %10 = OpTypeArray %7 %9
+ %11 = OpTypePointer Private %10
+ %12 = OpVariable %11 Private
+ %15 = OpTypeStruct %10 %7
+ %16 = OpTypePointer Uniform %15
+ %17 = OpVariable %16 Uniform
+ %18 = OpTypeInt 32 1
+ %19 = OpConstant %18 0
+ %20 = OpTypePointer Uniform %10
+ %24 = OpTypePointer Private %7
+ %27 = OpTypePointer Private %6
+ %30 = OpConstant %18 1
+ %132 = OpTypePointer Function %10
+ %135 = OpTypePointer Uniform %7
+ %145 = OpTypePointer Function %7
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %133 = OpVariable %132 Function
+ %21 = OpAccessChain %20 %17 %19
+ OpCopyMemory %12 %21 Aligned|Nontemporal|Volatile 16
+ OpCopyMemory %133 %12 Nontemporal|Volatile
+ %136 = OpAccessChain %135 %17 %30
+ %138 = OpAccessChain %24 %12 %19
+ OpCopyMemory %138 %136 Nontemporal|Volatile
+ %146 = OpAccessChain %145 %133 %30
+ %147 = OpLoad %7 %146 Aligned|Volatile 16
+ %148 = OpAccessChain %24 %12 %19
+ OpStore %148 %147 Volatile
+ OpReturn
+ OpFunctionEnd
+ )";
+ ASSERT_TRUE(IsEqual(env, after_transformation, context.get()));
+}
+
+TEST(TransformationSetMemoryOperandsMaskTest, Spirv14) {
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %12 %17
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %7 "Point3D"
+ OpMemberName %7 0 "x"
+ OpMemberName %7 1 "y"
+ OpMemberName %7 2 "z"
+ OpName %12 "global_points"
+ OpName %15 "block"
+ OpMemberName %15 0 "in_points"
+ OpMemberName %15 1 "in_point"
+ OpName %17 ""
+ OpName %133 "local_points"
+ OpMemberDecorate %7 0 Offset 0
+ OpMemberDecorate %7 1 Offset 4
+ OpMemberDecorate %7 2 Offset 8
+ OpDecorate %10 ArrayStride 16
+ OpMemberDecorate %15 0 Offset 0
+ OpMemberDecorate %15 1 Offset 192
+ OpDecorate %15 Block
+ OpDecorate %17 DescriptorSet 0
+ OpDecorate %17 Binding 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeStruct %6 %6 %6
+ %8 = OpTypeInt 32 0
+ %9 = OpConstant %8 12
+ %10 = OpTypeArray %7 %9
+ %11 = OpTypePointer Private %10
+ %12 = OpVariable %11 Private
+ %15 = OpTypeStruct %10 %7
+ %16 = OpTypePointer Uniform %15
+ %17 = OpVariable %16 Uniform
+ %18 = OpTypeInt 32 1
+ %19 = OpConstant %18 0
+ %20 = OpTypePointer Uniform %10
+ %24 = OpTypePointer Private %7
+ %27 = OpTypePointer Private %6
+ %30 = OpConstant %18 1
+ %132 = OpTypePointer Function %10
+ %135 = OpTypePointer Uniform %7
+ %145 = OpTypePointer Function %7
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %133 = OpVariable %132 Function
+ %21 = OpAccessChain %20 %17 %19
+ OpCopyMemory %12 %21 Aligned 16 Nontemporal|Aligned 16
+ OpCopyMemory %133 %12 Volatile
+ %136 = OpAccessChain %135 %17 %30
+ %138 = OpAccessChain %24 %12 %19
+ OpCopyMemory %138 %136 None Aligned 16
+ OpCopyMemory %138 %136 Aligned 16
+ %146 = OpAccessChain %145 %133 %30
+ %147 = OpLoad %7 %146 Volatile|Nontemporal|Aligned 16
+ %148 = OpAccessChain %24 %12 %19
+ OpStore %148 %147 Nontemporal
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_4;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
+ ASSERT_TRUE(IsValid(env, context.get()));
+
+ FactManager fact_manager;
+
+ TransformationSetMemoryOperandsMask transformation1(
+ MakeInstructionDescriptor(21, SpvOpCopyMemory, 0),
+ SpvMemoryAccessAlignedMask | SpvMemoryAccessVolatileMask, 1);
+ // Bad: cannot remove aligned
+ ASSERT_FALSE(TransformationSetMemoryOperandsMask(
+ MakeInstructionDescriptor(21, SpvOpCopyMemory, 0),
+ SpvMemoryAccessVolatileMask, 1)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(transformation1.IsApplicable(context.get(), fact_manager));
+ transformation1.Apply(context.get(), &fact_manager);
+
+ TransformationSetMemoryOperandsMask transformation2(
+ MakeInstructionDescriptor(21, SpvOpCopyMemory, 1),
+ SpvMemoryAccessNontemporalMask | SpvMemoryAccessVolatileMask, 1);
+ // Bad: cannot remove volatile
+ ASSERT_FALSE(TransformationSetMemoryOperandsMask(
+ MakeInstructionDescriptor(21, SpvOpCopyMemory, 1),
+ SpvMemoryAccessNontemporalMask, 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(transformation2.IsApplicable(context.get(), fact_manager));
+ transformation2.Apply(context.get(), &fact_manager);
+
+ TransformationSetMemoryOperandsMask transformation3(
+ MakeInstructionDescriptor(138, SpvOpCopyMemory, 0),
+ SpvMemoryAccessAlignedMask | SpvMemoryAccessNontemporalMask, 1);
+ // Bad: the first mask is None, so Aligned cannot be added to it.
+ ASSERT_FALSE(TransformationSetMemoryOperandsMask(
+ MakeInstructionDescriptor(138, SpvOpCopyMemory, 0),
+ SpvMemoryAccessAlignedMask | SpvMemoryAccessNontemporalMask,
+ 0)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_TRUE(transformation3.IsApplicable(context.get(), fact_manager));
+ transformation3.Apply(context.get(), &fact_manager);
+
+ TransformationSetMemoryOperandsMask transformation4(
+ MakeInstructionDescriptor(138, SpvOpCopyMemory, 1),
+ SpvMemoryAccessVolatileMask, 1);
+ ASSERT_TRUE(transformation4.IsApplicable(context.get(), fact_manager));
+ transformation4.Apply(context.get(), &fact_manager);
+
+ TransformationSetMemoryOperandsMask transformation5(
+ MakeInstructionDescriptor(147, SpvOpLoad, 0),
+ SpvMemoryAccessVolatileMask | SpvMemoryAccessAlignedMask, 0);
+ ASSERT_TRUE(transformation5.IsApplicable(context.get(), fact_manager));
+ transformation5.Apply(context.get(), &fact_manager);
+
+ TransformationSetMemoryOperandsMask transformation6(
+ MakeInstructionDescriptor(148, SpvOpStore, 0), SpvMemoryAccessMaskNone,
+ 0);
+ ASSERT_TRUE(transformation6.IsApplicable(context.get(), fact_manager));
+ transformation6.Apply(context.get(), &fact_manager);
+
+ std::string after_transformation = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %12 %17
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %7 "Point3D"
+ OpMemberName %7 0 "x"
+ OpMemberName %7 1 "y"
+ OpMemberName %7 2 "z"
+ OpName %12 "global_points"
+ OpName %15 "block"
+ OpMemberName %15 0 "in_points"
+ OpMemberName %15 1 "in_point"
+ OpName %17 ""
+ OpName %133 "local_points"
+ OpMemberDecorate %7 0 Offset 0
+ OpMemberDecorate %7 1 Offset 4
+ OpMemberDecorate %7 2 Offset 8
+ OpDecorate %10 ArrayStride 16
+ OpMemberDecorate %15 0 Offset 0
+ OpMemberDecorate %15 1 Offset 192
+ OpDecorate %15 Block
+ OpDecorate %17 DescriptorSet 0
+ OpDecorate %17 Binding 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeStruct %6 %6 %6
+ %8 = OpTypeInt 32 0
+ %9 = OpConstant %8 12
+ %10 = OpTypeArray %7 %9
+ %11 = OpTypePointer Private %10
+ %12 = OpVariable %11 Private
+ %15 = OpTypeStruct %10 %7
+ %16 = OpTypePointer Uniform %15
+ %17 = OpVariable %16 Uniform
+ %18 = OpTypeInt 32 1
+ %19 = OpConstant %18 0
+ %20 = OpTypePointer Uniform %10
+ %24 = OpTypePointer Private %7
+ %27 = OpTypePointer Private %6
+ %30 = OpConstant %18 1
+ %132 = OpTypePointer Function %10
+ %135 = OpTypePointer Uniform %7
+ %145 = OpTypePointer Function %7
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %133 = OpVariable %132 Function
+ %21 = OpAccessChain %20 %17 %19
+ OpCopyMemory %12 %21 Aligned 16 Aligned|Volatile 16
+ OpCopyMemory %133 %12 Volatile Nontemporal|Volatile
+ %136 = OpAccessChain %135 %17 %30
+ %138 = OpAccessChain %24 %12 %19
+ OpCopyMemory %138 %136 None Aligned|Nontemporal 16
+ OpCopyMemory %138 %136 Aligned 16 Volatile
+ %146 = OpAccessChain %145 %133 %30
+ %147 = OpLoad %7 %146 Volatile|Aligned 16
+ %148 = OpAccessChain %24 %12 %19
+ OpStore %148 %147 None
+ OpReturn
+ OpFunctionEnd
+ )";
+ ASSERT_TRUE(IsEqual(env, after_transformation, context.get()));
+}
+
+} // namespace
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_selection_control_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_selection_control_test.cpp
new file mode 100644
index 00000000000..9696417b0d6
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_set_selection_control_test.cpp
@@ -0,0 +1,219 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/fuzz/transformation_set_selection_control.h"
+#include "test/fuzz/fuzz_test_util.h"
+
+namespace spvtools {
+namespace fuzz {
+namespace {
+
+TEST(TransformationSetSelectionControlTest, VariousScenarios) {
+ // This is a simple transformation; this test captures the important things
+ // to check for.
+
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "i"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %9 = OpConstant %6 0
+ %16 = OpConstant %6 10
+ %17 = OpTypeBool
+ %20 = OpConstant %6 3
+ %25 = OpConstant %6 1
+ %28 = OpConstant %6 2
+ %38 = OpConstant %6 4
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ OpStore %8 %9
+ OpBranch %10
+ %10 = OpLabel
+ OpLoopMerge %12 %13 None
+ OpBranch %14
+ %14 = OpLabel
+ %15 = OpLoad %6 %8
+ %18 = OpSLessThan %17 %15 %16
+ OpBranchConditional %18 %11 %12
+ %11 = OpLabel
+ %19 = OpLoad %6 %8
+ %21 = OpSGreaterThan %17 %19 %20
+ OpSelectionMerge %23 Flatten
+ OpBranchConditional %21 %22 %23
+ %22 = OpLabel
+ %24 = OpLoad %6 %8
+ %26 = OpIAdd %6 %24 %25
+ OpStore %8 %26
+ OpBranch %23
+ %23 = OpLabel
+ %27 = OpLoad %6 %8
+ %29 = OpSLessThan %17 %27 %28
+ OpSelectionMerge %31 DontFlatten
+ OpBranchConditional %29 %30 %31
+ %30 = OpLabel
+ %32 = OpLoad %6 %8
+ %33 = OpISub %6 %32 %25
+ OpStore %8 %33
+ OpBranch %31
+ %31 = OpLabel
+ %34 = OpLoad %6 %8
+ OpSelectionMerge %37 None
+ OpSwitch %34 %36 0 %35
+ %36 = OpLabel
+ OpBranch %37
+ %35 = OpLabel
+ %39 = OpLoad %6 %8
+ %40 = OpIAdd %6 %39 %38
+ OpStore %8 %40
+ OpBranch %36
+ %37 = OpLabel
+ OpBranch %13
+ %13 = OpLabel
+ %43 = OpLoad %6 %8
+ %44 = OpIAdd %6 %43 %25
+ OpStore %8 %44
+ OpBranch %10
+ %12 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_3;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
+
+ FactManager fact_manager;
+
+ // %44 is not a block
+ ASSERT_FALSE(
+ TransformationSetSelectionControl(44, SpvSelectionControlFlattenMask)
+ .IsApplicable(context.get(), fact_manager));
+ // %13 does not end with OpSelectionMerge
+ ASSERT_FALSE(
+ TransformationSetSelectionControl(13, SpvSelectionControlMaskNone)
+ .IsApplicable(context.get(), fact_manager));
+ // %10 ends in OpLoopMerge, not OpSelectionMerge
+ ASSERT_FALSE(
+ TransformationSetSelectionControl(10, SpvSelectionControlMaskNone)
+ .IsApplicable(context.get(), fact_manager));
+
+ TransformationSetSelectionControl transformation1(
+ 11, SpvSelectionControlDontFlattenMask);
+ ASSERT_TRUE(transformation1.IsApplicable(context.get(), fact_manager));
+ transformation1.Apply(context.get(), &fact_manager);
+
+ TransformationSetSelectionControl transformation2(
+ 23, SpvSelectionControlFlattenMask);
+ ASSERT_TRUE(transformation2.IsApplicable(context.get(), fact_manager));
+ transformation2.Apply(context.get(), &fact_manager);
+
+ TransformationSetSelectionControl transformation3(
+ 31, SpvSelectionControlMaskNone);
+ ASSERT_TRUE(transformation3.IsApplicable(context.get(), fact_manager));
+ transformation3.Apply(context.get(), &fact_manager);
+
+ TransformationSetSelectionControl transformation4(
+ 31, SpvSelectionControlFlattenMask);
+ ASSERT_TRUE(transformation4.IsApplicable(context.get(), fact_manager));
+ transformation4.Apply(context.get(), &fact_manager);
+
+ std::string after_transformation = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "i"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %9 = OpConstant %6 0
+ %16 = OpConstant %6 10
+ %17 = OpTypeBool
+ %20 = OpConstant %6 3
+ %25 = OpConstant %6 1
+ %28 = OpConstant %6 2
+ %38 = OpConstant %6 4
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ OpStore %8 %9
+ OpBranch %10
+ %10 = OpLabel
+ OpLoopMerge %12 %13 None
+ OpBranch %14
+ %14 = OpLabel
+ %15 = OpLoad %6 %8
+ %18 = OpSLessThan %17 %15 %16
+ OpBranchConditional %18 %11 %12
+ %11 = OpLabel
+ %19 = OpLoad %6 %8
+ %21 = OpSGreaterThan %17 %19 %20
+ OpSelectionMerge %23 DontFlatten
+ OpBranchConditional %21 %22 %23
+ %22 = OpLabel
+ %24 = OpLoad %6 %8
+ %26 = OpIAdd %6 %24 %25
+ OpStore %8 %26
+ OpBranch %23
+ %23 = OpLabel
+ %27 = OpLoad %6 %8
+ %29 = OpSLessThan %17 %27 %28
+ OpSelectionMerge %31 Flatten
+ OpBranchConditional %29 %30 %31
+ %30 = OpLabel
+ %32 = OpLoad %6 %8
+ %33 = OpISub %6 %32 %25
+ OpStore %8 %33
+ OpBranch %31
+ %31 = OpLabel
+ %34 = OpLoad %6 %8
+ OpSelectionMerge %37 Flatten
+ OpSwitch %34 %36 0 %35
+ %36 = OpLabel
+ OpBranch %37
+ %35 = OpLabel
+ %39 = OpLoad %6 %8
+ %40 = OpIAdd %6 %39 %38
+ OpStore %8 %40
+ OpBranch %36
+ %37 = OpLabel
+ OpBranch %13
+ %13 = OpLabel
+ %43 = OpLoad %6 %8
+ %44 = OpIAdd %6 %43 %25
+ OpStore %8 %44
+ OpBranch %10
+ %12 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ ASSERT_TRUE(IsEqual(env, after_transformation, context.get()));
+}
+
+} // namespace
+} // namespace fuzz
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_split_block_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_split_block_test.cpp
index dc6d4d037f1..d162e0715fb 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_split_block_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzz/transformation_split_block_test.cpp
@@ -13,6 +13,7 @@
// limitations under the License.
#include "source/fuzz/transformation_split_block.h"
+#include "source/fuzz/instruction_descriptor.h"
#include "test/fuzz/fuzz_test_util.h"
namespace spvtools {
@@ -90,44 +91,55 @@ TEST(TransformationSplitBlockTest, NotApplicable) {
FactManager fact_manager;
// No split before OpVariable
- ASSERT_FALSE(TransformationSplitBlock(8, 0, 100).IsApplicable(context.get(),
- fact_manager));
- ASSERT_FALSE(TransformationSplitBlock(8, 1, 100).IsApplicable(context.get(),
- fact_manager));
+ ASSERT_FALSE(TransformationSplitBlock(
+ MakeInstructionDescriptor(8, SpvOpVariable, 0), 100)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSplitBlock(
+ MakeInstructionDescriptor(8, SpvOpVariable, 1), 100)
+ .IsApplicable(context.get(), fact_manager));
// No split before OpLabel
- ASSERT_FALSE(TransformationSplitBlock(14, 0, 100)
+ ASSERT_FALSE(TransformationSplitBlock(
+ MakeInstructionDescriptor(14, SpvOpLabel, 0), 100)
.IsApplicable(context.get(), fact_manager));
// No split if base instruction is outside a function
- ASSERT_FALSE(TransformationSplitBlock(1, 0, 100).IsApplicable(context.get(),
- fact_manager));
- ASSERT_FALSE(TransformationSplitBlock(1, 4, 100).IsApplicable(context.get(),
- fact_manager));
- ASSERT_FALSE(TransformationSplitBlock(1, 35, 100)
+ ASSERT_FALSE(
+ TransformationSplitBlock(MakeInstructionDescriptor(1, SpvOpLabel, 0), 100)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSplitBlock(
+ MakeInstructionDescriptor(1, SpvOpExecutionMode, 0), 100)
.IsApplicable(context.get(), fact_manager));
// No split if block is loop header
- ASSERT_FALSE(TransformationSplitBlock(27, 0, 100)
- .IsApplicable(context.get(), fact_manager));
- ASSERT_FALSE(TransformationSplitBlock(27, 1, 100)
- .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSplitBlock(MakeInstructionDescriptor(27, SpvOpPhi, 0), 100)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSplitBlock(MakeInstructionDescriptor(27, SpvOpPhi, 1), 100)
+ .IsApplicable(context.get(), fact_manager));
// No split if base instruction does not exist
- ASSERT_FALSE(TransformationSplitBlock(88, 0, 100)
- .IsApplicable(context.get(), fact_manager));
- ASSERT_FALSE(TransformationSplitBlock(88, 22, 100)
+ ASSERT_FALSE(
+ TransformationSplitBlock(MakeInstructionDescriptor(88, SpvOpIAdd, 0), 100)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSplitBlock(
+ MakeInstructionDescriptor(88, SpvOpIMul, 22), 100)
.IsApplicable(context.get(), fact_manager));
- // No split if offset is too large (goes into another block)
- ASSERT_FALSE(TransformationSplitBlock(18, 3, 100)
- .IsApplicable(context.get(), fact_manager));
+ // No split if too many instructions with the desired opcode are skipped
+ ASSERT_FALSE(
+ TransformationSplitBlock(
+ MakeInstructionDescriptor(18, SpvOpBranchConditional, 1), 100)
+ .IsApplicable(context.get(), fact_manager));
// No split if id in use
- ASSERT_FALSE(TransformationSplitBlock(18, 0, 27).IsApplicable(context.get(),
- fact_manager));
- ASSERT_FALSE(TransformationSplitBlock(18, 0, 14).IsApplicable(context.get(),
- fact_manager));
+ ASSERT_FALSE(TransformationSplitBlock(
+ MakeInstructionDescriptor(18, SpvOpSLessThan, 0), 27)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSplitBlock(
+ MakeInstructionDescriptor(18, SpvOpSLessThan, 0), 14)
+ .IsApplicable(context.get(), fact_manager));
}
TEST(TransformationSplitBlockTest, SplitBlockSeveralTimes) {
@@ -188,7 +200,8 @@ TEST(TransformationSplitBlockTest, SplitBlockSeveralTimes) {
FactManager fact_manager;
- auto split_1 = TransformationSplitBlock(5, 3, 100);
+ auto split_1 = TransformationSplitBlock(
+ MakeInstructionDescriptor(5, SpvOpStore, 0), 100);
ASSERT_TRUE(split_1.IsApplicable(context.get(), fact_manager));
split_1.Apply(context.get(), &fact_manager);
ASSERT_TRUE(IsValid(env, context.get()));
@@ -235,7 +248,8 @@ TEST(TransformationSplitBlockTest, SplitBlockSeveralTimes) {
)";
ASSERT_TRUE(IsEqual(env, after_split_1, context.get()));
- auto split_2 = TransformationSplitBlock(11, 1, 101);
+ auto split_2 = TransformationSplitBlock(
+ MakeInstructionDescriptor(11, SpvOpStore, 0), 101);
ASSERT_TRUE(split_2.IsApplicable(context.get(), fact_manager));
split_2.Apply(context.get(), &fact_manager);
ASSERT_TRUE(IsValid(env, context.get()));
@@ -284,7 +298,8 @@ TEST(TransformationSplitBlockTest, SplitBlockSeveralTimes) {
)";
ASSERT_TRUE(IsEqual(env, after_split_2, context.get()));
- auto split_3 = TransformationSplitBlock(14, 0, 102);
+ auto split_3 = TransformationSplitBlock(
+ MakeInstructionDescriptor(14, SpvOpLoad, 0), 102);
ASSERT_TRUE(split_3.IsApplicable(context.get(), fact_manager));
split_3.Apply(context.get(), &fact_manager);
ASSERT_TRUE(IsValid(env, context.get()));
@@ -399,12 +414,17 @@ TEST(TransformationSplitBlockTest, SplitBlockBeforeSelectBranch) {
FactManager fact_manager;
// Illegal to split between the merge and the conditional branch.
- ASSERT_FALSE(TransformationSplitBlock(14, 2, 100)
- .IsApplicable(context.get(), fact_manager));
- ASSERT_FALSE(TransformationSplitBlock(12, 3, 100)
- .IsApplicable(context.get(), fact_manager));
-
- auto split = TransformationSplitBlock(14, 1, 100);
+ ASSERT_FALSE(
+ TransformationSplitBlock(
+ MakeInstructionDescriptor(14, SpvOpBranchConditional, 0), 100)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSplitBlock(
+ MakeInstructionDescriptor(12, SpvOpBranchConditional, 0), 100)
+ .IsApplicable(context.get(), fact_manager));
+
+ auto split = TransformationSplitBlock(
+ MakeInstructionDescriptor(14, SpvOpSelectionMerge, 0), 100);
ASSERT_TRUE(split.IsApplicable(context.get(), fact_manager));
split.Apply(context.get(), &fact_manager);
ASSERT_TRUE(IsValid(env, context.get()));
@@ -523,12 +543,15 @@ TEST(TransformationSplitBlockTest, SplitBlockBeforeSwitchBranch) {
FactManager fact_manager;
// Illegal to split between the merge and the conditional branch.
- ASSERT_FALSE(TransformationSplitBlock(9, 2, 100).IsApplicable(context.get(),
- fact_manager));
- ASSERT_FALSE(TransformationSplitBlock(15, 3, 100)
+ ASSERT_FALSE(TransformationSplitBlock(
+ MakeInstructionDescriptor(9, SpvOpSwitch, 0), 100)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(TransformationSplitBlock(
+ MakeInstructionDescriptor(15, SpvOpSwitch, 0), 100)
.IsApplicable(context.get(), fact_manager));
- auto split = TransformationSplitBlock(9, 1, 100);
+ auto split = TransformationSplitBlock(
+ MakeInstructionDescriptor(9, SpvOpSelectionMerge, 0), 100);
ASSERT_TRUE(split.IsApplicable(context.get(), fact_manager));
split.Apply(context.get(), &fact_manager);
ASSERT_TRUE(IsValid(env, context.get()));
@@ -654,12 +677,15 @@ TEST(TransformationSplitBlockTest, NoSplitDuringOpPhis) {
// We cannot split before OpPhi instructions, since the number of incoming
// blocks may not appropriately match after splitting.
- ASSERT_FALSE(TransformationSplitBlock(26, 0, 100)
- .IsApplicable(context.get(), fact_manager));
- ASSERT_FALSE(TransformationSplitBlock(27, 0, 100)
- .IsApplicable(context.get(), fact_manager));
- ASSERT_FALSE(TransformationSplitBlock(27, 1, 100)
- .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSplitBlock(MakeInstructionDescriptor(26, SpvOpPhi, 0), 100)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSplitBlock(MakeInstructionDescriptor(27, SpvOpPhi, 0), 100)
+ .IsApplicable(context.get(), fact_manager));
+ ASSERT_FALSE(
+ TransformationSplitBlock(MakeInstructionDescriptor(27, SpvOpPhi, 1), 100)
+ .IsApplicable(context.get(), fact_manager));
}
TEST(TransformationSplitBlockTest, SplitOpPhiWithSinglePredecessor) {
@@ -701,9 +727,13 @@ TEST(TransformationSplitBlockTest, SplitOpPhiWithSinglePredecessor) {
FactManager fact_manager;
- ASSERT_TRUE(TransformationSplitBlock(21, 0, 100)
- .IsApplicable(context.get(), fact_manager));
- auto split = TransformationSplitBlock(20, 1, 100);
+ ASSERT_TRUE(
+ TransformationSplitBlock(MakeInstructionDescriptor(21, SpvOpPhi, 0), 100)
+ .IsApplicable(context.get(), fact_manager));
+ // An equivalent transformation to the above, just described with respect to a
+ // different base instruction.
+ auto split =
+ TransformationSplitBlock(MakeInstructionDescriptor(20, SpvOpPhi, 0), 100);
ASSERT_TRUE(split.IsApplicable(context.get(), fact_manager));
split.Apply(context.get(), &fact_manager);
ASSERT_TRUE(IsValid(env, context.get()));
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzzers/BUILD.gn b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzzers/BUILD.gn
index c565e113b3f..be1258a459e 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzzers/BUILD.gn
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzzers/BUILD.gn
@@ -33,7 +33,9 @@ if (!build_with_chromium || use_fuzzing_engine) {
testonly = true
deps = [
+ ":spvtools_as_fuzzer",
":spvtools_binary_parser_fuzzer",
+ ":spvtools_dis_fuzzer",
":spvtools_opt_legalization_fuzzer",
":spvtools_opt_performance_fuzzer",
":spvtools_opt_size_fuzzer",
@@ -66,12 +68,24 @@ template("spvtools_fuzzer") {
}
}
+spvtools_fuzzer("spvtools_as_fuzzer_src") {
+ sources = [
+ "spvtools_as_fuzzer.cpp",
+ ]
+}
+
spvtools_fuzzer("spvtools_binary_parser_fuzzer_src") {
sources = [
"spvtools_binary_parser_fuzzer.cpp",
]
}
+spvtools_fuzzer("spvtools_dis_fuzzer_src") {
+ sources = [
+ "spvtools_dis_fuzzer.cpp",
+ ]
+}
+
spvtools_fuzzer("spvtools_opt_performance_fuzzer_src") {
sources = [
"spvtools_opt_performance_fuzzer.cpp",
@@ -116,6 +130,15 @@ spvtools_fuzzer("spvtools_val_webgpu_fuzzer_src") {
}
if (!build_with_chromium || use_fuzzing_engine) {
+ fuzzer_test("spvtools_as_fuzzer") {
+ sources = []
+ deps = [
+ ":spvtools_as_fuzzer_src",
+ ]
+ # Intentionally doesn't use the seed corpus, because it consumes
+ # part of the input as not part of the file.
+ }
+
fuzzer_test("spvtools_binary_parser_fuzzer") {
sources = []
deps = [
@@ -125,6 +148,15 @@ if (!build_with_chromium || use_fuzzing_engine) {
# part of the input as not part of the file.
}
+ fuzzer_test("spvtools_dis_fuzzer") {
+ sources = []
+ deps = [
+ ":spvtools_dis_fuzzer_src",
+ ]
+ # Intentionally doesn't use the seed corpus, because it consumes
+ # part of the input as not part of the file.
+ }
+
fuzzer_test("spvtools_opt_performance_fuzzer") {
sources = []
deps = [
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzzers/spvtools_as_fuzzer.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzzers/spvtools_as_fuzzer.cpp
new file mode 100644
index 00000000000..1b1de0082f2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzzers/spvtools_as_fuzzer.cpp
@@ -0,0 +1,70 @@
+// Copyright (c) 2019 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <cstdint>
+#include <cstring> // memcpy
+#include <vector>
+
+#include "source/spirv_target_env.h"
+#include "spirv-tools/libspirv.hpp"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ if (size < sizeof(spv_target_env) + 1) return 0;
+
+ const spv_context context =
+ spvContextCreate(*reinterpret_cast<const spv_target_env*>(data));
+ if (context == nullptr) return 0;
+
+ data += sizeof(spv_target_env);
+ size -= sizeof(spv_target_env);
+
+ std::vector<uint32_t> input;
+
+ std::vector<char> input_str;
+ size_t char_count = input.size() * sizeof(uint32_t) / sizeof(char);
+ input_str.resize(char_count);
+ memcpy(input_str.data(), input.data(), input.size() * sizeof(uint32_t));
+
+ spv_binary binary;
+ spv_diagnostic diagnostic = nullptr;
+ spvTextToBinaryWithOptions(context, input_str.data(), input_str.size(),
+ SPV_TEXT_TO_BINARY_OPTION_NONE, &binary,
+ &diagnostic);
+ if (diagnostic) {
+ spvDiagnosticPrint(diagnostic);
+ spvDiagnosticDestroy(diagnostic);
+ diagnostic = nullptr;
+ }
+
+ if (binary) {
+ spvBinaryDestroy(binary);
+ binary = nullptr;
+ }
+
+ spvTextToBinaryWithOptions(context, input_str.data(), input_str.size(),
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS,
+ &binary, &diagnostic);
+ if (diagnostic) {
+ spvDiagnosticPrint(diagnostic);
+ spvDiagnosticDestroy(diagnostic);
+ diagnostic = nullptr;
+ }
+
+ if (binary) {
+ spvBinaryDestroy(binary);
+ binary = nullptr;
+ }
+
+ return 0;
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzzers/spvtools_dis_fuzzer.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzzers/spvtools_dis_fuzzer.cpp
new file mode 100644
index 00000000000..ca9a52d8698
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/fuzzers/spvtools_dis_fuzzer.cpp
@@ -0,0 +1,71 @@
+// Copyright (c) 2019 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <cstdint>
+#include <cstring> // memcpy
+#include <vector>
+
+#include "source/spirv_target_env.h"
+#include "spirv-tools/libspirv.hpp"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ if (size < sizeof(spv_target_env) + 1) return 0;
+
+ const spv_context context =
+ spvContextCreate(*reinterpret_cast<const spv_target_env*>(data));
+ if (context == nullptr) return 0;
+
+ data += sizeof(spv_target_env);
+ size -= sizeof(spv_target_env);
+
+ std::vector<uint32_t> input;
+ input.resize(size >> 2);
+ size_t count = 0;
+ for (size_t i = 0; (i + 3) < size; i += 4) {
+ input[count++] = data[i] | (data[i + 1] << 8) | (data[i + 2] << 16) |
+ (data[i + 3]) << 24;
+ }
+
+ std::vector<char> input_str;
+ size_t char_count = input.size() * sizeof(uint32_t) / sizeof(char);
+ input_str.resize(char_count);
+ memcpy(input_str.data(), input.data(), input.size() * sizeof(uint32_t));
+
+ spv_text text = nullptr;
+ spv_diagnostic diagnostic = nullptr;
+
+ for (uint32_t options = SPV_BINARY_TO_TEXT_OPTION_NONE;
+ options <
+ (SPV_BINARY_TO_TEXT_OPTION_PRINT | SPV_BINARY_TO_TEXT_OPTION_COLOR |
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET |
+ SPV_BINARY_TO_TEXT_OPTION_NO_HEADER |
+ SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+ options++) {
+ spvBinaryToText(context, input.data(), input.size(), options, &text,
+ &diagnostic);
+ if (diagnostic) {
+ spvDiagnosticDestroy(diagnostic);
+ diagnostic = nullptr;
+ }
+
+ if (text) {
+ spvTextDestroy(text);
+ text = nullptr;
+ }
+ }
+
+ spvContextDestroy(context);
+ return 0;
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp
index c96dc8c5a79..7eddf7e99fb 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp
@@ -112,8 +112,12 @@ std::vector<std::string> CommonTypesAndConstants() {
// clang-format off
// scalar types
"%bool = OpTypeBool",
+ "%ushort = OpTypeInt 16 0",
+ "%short = OpTypeInt 16 1",
"%uint = OpTypeInt 32 0",
"%int = OpTypeInt 32 1",
+ "%ulong = OpTypeInt 64 0",
+ "%long = OpTypeInt 64 1",
"%float = OpTypeFloat 32",
"%double = OpTypeFloat 64",
// vector types
@@ -122,6 +126,8 @@ std::vector<std::string> CommonTypesAndConstants() {
"%v2int = OpTypeVector %int 2",
"%v3int = OpTypeVector %int 3",
"%v4int = OpTypeVector %int 4",
+ "%v2long = OpTypeVector %long 2",
+ "%v2ulong = OpTypeVector %ulong 2",
"%v2float = OpTypeVector %float 2",
"%v2double = OpTypeVector %double 2",
// variable pointer types
@@ -145,6 +151,8 @@ std::vector<std::string> CommonTypesAndConstants() {
"%bool_null = OpConstantNull %bool",
"%signed_zero = OpConstant %int 0",
"%unsigned_zero = OpConstant %uint 0",
+ "%long_zero = OpConstant %long 0",
+ "%ulong_zero = OpConstant %ulong 0",
"%signed_one = OpConstant %int 1",
"%unsigned_one = OpConstant %uint 1",
"%signed_two = OpConstant %int 2",
@@ -153,6 +161,7 @@ std::vector<std::string> CommonTypesAndConstants() {
"%unsigned_three = OpConstant %uint 3",
"%signed_null = OpConstantNull %int",
"%unsigned_null = OpConstantNull %uint",
+ "%signed_minus_one = OpConstant %int -1",
// vector constants:
"%bool_true_vec = OpConstantComposite %v2bool %bool_true %bool_true",
"%bool_false_vec = OpConstantComposite %v2bool %bool_false %bool_false",
@@ -167,6 +176,7 @@ std::vector<std::string> CommonTypesAndConstants() {
"%unsigned_three_vec = OpConstantComposite %v2uint %unsigned_three %unsigned_three",
"%signed_null_vec = OpConstantNull %v2int",
"%unsigned_null_vec = OpConstantNull %v2uint",
+ "%signed_minus_one_vec = OpConstantComposite %v2int %signed_minus_one %signed_minus_one",
"%v4int_0_1_2_3 = OpConstantComposite %v4int %signed_zero %signed_one %signed_two %signed_three",
// clang-format on
};
@@ -345,9 +355,9 @@ INSTANTIATE_TEST_SUITE_P(
// Tests for operations that resulting in different types.
INSTANTIATE_TEST_SUITE_P(
Cast, FoldSpecConstantOpAndCompositePassTest,
- ::testing::ValuesIn(
- std::vector<FoldSpecConstantOpAndCompositePassTestCase>({
- // clang-format off
+ ::testing::ValuesIn(std::vector<
+ FoldSpecConstantOpAndCompositePassTestCase>({
+ // clang-format off
// int -> bool scalar
{
// original
@@ -575,8 +585,108 @@ INSTANTIATE_TEST_SUITE_P(
"%spec_uint_from_null = OpConstantComposite %v2uint %unsigned_zero %unsigned_zero",
},
},
- // clang-format on
- })));
+
+ // UConvert scalar
+ {
+ // original
+ {
+ "%spec_uint_zero = OpSpecConstantOp %uint UConvert %bool_false",
+ "%spec_uint_one = OpSpecConstantOp %uint UConvert %bool_true",
+ "%spec_ulong_zero = OpSpecConstantOp %ulong UConvert %unsigned_zero",
+ "%spec_ulong_one = OpSpecConstantOp %ulong UConvert %unsigned_one",
+ "%spec_short_zero = OpSpecConstantOp %ushort UConvert %unsigned_zero",
+ "%spec_short_one = OpSpecConstantOp %ushort UConvert %unsigned_one",
+ "%uint_max = OpConstant %uint 4294967295",
+ "%spec_ushort_max = OpSpecConstantOp %ushort UConvert %uint_max",
+ "%uint_0xDDDDDDDD = OpConstant %uint 3722304989",
+ "%spec_ushort_0xDDDD = OpSpecConstantOp %ushort UConvert %uint_0xDDDDDDDD",
+ },
+ // expected
+ {
+ "%spec_uint_zero = OpConstant %uint 0",
+ "%spec_uint_one = OpConstant %uint 1",
+ "%spec_ulong_zero = OpConstant %ulong 0",
+ "%spec_ulong_one = OpConstant %ulong 1",
+ "%spec_short_zero = OpConstant %ushort 0",
+ "%spec_short_one = OpConstant %ushort 1",
+ "%uint_max = OpConstant %uint 4294967295",
+ "%spec_ushort_max = OpConstant %ushort 65535",
+ "%uint_0xDDDDDDDD = OpConstant %uint 3722304989",
+ "%spec_ushort_0xDDDD = OpConstant %ushort 56797",
+ },
+ },
+
+ // SConvert scalar
+ {
+ // original
+ {
+ "%spec_long_zero = OpSpecConstantOp %long SConvert %signed_zero",
+ "%spec_long_one = OpSpecConstantOp %long SConvert %signed_one",
+ "%spec_long_minus_one = OpSpecConstantOp %long SConvert %signed_minus_one",
+ "%spec_short_minus_one_trunc = OpSpecConstantOp %short SConvert %signed_minus_one",
+ "%int_2_to_17_minus_one = OpConstant %int 131071",
+ "%spec_short_minus_one_trunc2 = OpSpecConstantOp %short SConvert %int_2_to_17_minus_one",
+ },
+ // expected
+ {
+ "%spec_long_zero = OpConstant %long 0",
+ "%spec_long_one = OpConstant %long 1",
+ "%spec_long_minus_one = OpConstant %long -1",
+ "%spec_short_minus_one_trunc = OpConstant %short -1",
+ "%int_2_to_17_minus_one = OpConstant %int 131071",
+ "%spec_short_minus_one_trunc2 = OpConstant %short -1",
+ },
+ },
+
+ // UConvert vector
+ {
+ // original
+ {
+ "%spec_v2uint_zero = OpSpecConstantOp %v2uint UConvert %bool_false_vec",
+ "%spec_v2uint_one = OpSpecConstantOp %v2uint UConvert %bool_true_vec",
+ "%spec_v2ulong_zero = OpSpecConstantOp %v2ulong UConvert %unsigned_zero_vec",
+ "%spec_v2ulong_one = OpSpecConstantOp %v2ulong UConvert %unsigned_one_vec",
+ },
+ // expected
+ {
+ "%uint_0 = OpConstant %uint 0",
+ "%uint_0_0 = OpConstant %uint 0",
+ "%spec_v2uint_zero = OpConstantComposite %v2uint %unsigned_zero %unsigned_zero",
+ "%uint_1 = OpConstant %uint 1",
+ "%uint_1_0 = OpConstant %uint 1",
+ "%spec_v2uint_one = OpConstantComposite %v2uint %unsigned_one %unsigned_one",
+ "%ulong_0 = OpConstant %ulong 0",
+ "%ulong_0_0 = OpConstant %ulong 0",
+ "%spec_v2ulong_zero = OpConstantComposite %v2ulong %ulong_zero %ulong_zero",
+ "%ulong_1 = OpConstant %ulong 1",
+ "%ulong_1_0 = OpConstant %ulong 1",
+ "%spec_v2ulong_one = OpConstantComposite %v2ulong %ulong_1 %ulong_1",
+ },
+ },
+
+ // SConvert vector
+ {
+ // original
+ {
+ "%spec_v2long_zero = OpSpecConstantOp %v2long SConvert %signed_zero_vec",
+ "%spec_v2long_one = OpSpecConstantOp %v2long SConvert %signed_one_vec",
+ "%spec_v2long_minus_one = OpSpecConstantOp %v2long SConvert %signed_minus_one_vec",
+ },
+ // expected
+ {
+ "%long_0 = OpConstant %long 0",
+ "%long_0_0 = OpConstant %long 0",
+ "%spec_v2long_zero = OpConstantComposite %v2long %long_zero %long_zero",
+ "%long_1 = OpConstant %long 1",
+ "%long_1_0 = OpConstant %long 1",
+ "%spec_v2long_one = OpConstantComposite %v2long %long_1 %long_1",
+ "%long_n1 = OpConstant %long -1",
+ "%long_n1_0 = OpConstant %long -1",
+ "%spec_v2long_minus_one = OpConstantComposite %v2long %long_n1 %long_n1",
+ },
+ },
+ // clang-format on
+ })));
// Tests about boolean scalar logical operations and comparison operations with
// scalar int/uint type.
@@ -851,7 +961,7 @@ INSTANTIATE_TEST_SUITE_P(
{
"%int_n1 = OpConstant %int -1",
"%int_n1_0 = OpConstant %int -1",
- "%v2int_minus_1 = OpConstantComposite %v2int %int_n1 %int_n1",
+ "%v2int_minus_1 = OpConstantComposite %v2int %signed_minus_one %signed_minus_one",
"%int_n2 = OpConstant %int -2",
"%int_n2_0 = OpConstant %int -2",
"%v2int_minus_2 = OpConstantComposite %v2int %int_n2 %int_n2",
@@ -956,13 +1066,13 @@ INSTANTIATE_TEST_SUITE_P(
"%7_srem_3 = OpConstantComposite %v2int %signed_one %signed_one",
"%int_n1 = OpConstant %int -1",
"%int_n1_0 = OpConstant %int -1",
- "%minus_7_srem_3 = OpConstantComposite %v2int %int_n1 %int_n1",
+ "%minus_7_srem_3 = OpConstantComposite %v2int %signed_minus_one %signed_minus_one",
"%int_1_1 = OpConstant %int 1",
"%int_1_2 = OpConstant %int 1",
"%7_srem_minus_3 = OpConstantComposite %v2int %signed_one %signed_one",
"%int_n1_1 = OpConstant %int -1",
"%int_n1_2 = OpConstant %int -1",
- "%minus_7_srem_minus_3 = OpConstantComposite %v2int %int_n1 %int_n1",
+ "%minus_7_srem_minus_3 = OpConstantComposite %v2int %signed_minus_one %signed_minus_one",
// smod
"%int_1_3 = OpConstant %int 1",
"%int_1_4 = OpConstant %int 1",
@@ -975,7 +1085,7 @@ INSTANTIATE_TEST_SUITE_P(
"%7_smod_minus_3 = OpConstantComposite %v2int %int_n2 %int_n2",
"%int_n1_3 = OpConstant %int -1",
"%int_n1_4 = OpConstant %int -1",
- "%minus_7_smod_minus_3 = OpConstantComposite %v2int %int_n1 %int_n1",
+ "%minus_7_smod_minus_3 = OpConstantComposite %v2int %signed_minus_one %signed_minus_one",
// umod
"%uint_1 = OpConstant %uint 1",
"%uint_1_0 = OpConstant %uint 1",
@@ -1018,7 +1128,7 @@ INSTANTIATE_TEST_SUITE_P(
"%unsigned_right_shift_logical = OpConstantComposite %v2uint %unsigned_one %unsigned_one",
"%int_n1 = OpConstant %int -1",
"%int_n1_0 = OpConstant %int -1",
- "%signed_right_shift_arithmetic = OpConstantComposite %v2int %int_n1 %int_n1",
+ "%signed_right_shift_arithmetic = OpConstantComposite %v2int %signed_minus_one %signed_minus_one",
},
},
// Skip folding if any vector operands or components of the operands
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/fold_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/fold_test.cpp
index 5c2adec9072..a6e75d8b1c2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/fold_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/fold_test.cpp
@@ -3333,16 +3333,7 @@ INSTANTIATE_TEST_SUITE_P(CompositeExtractFoldingTest, GeneralInstructionFoldingT
"%3 = OpCompositeExtract %float %2 4\n" +
"OpReturn\n" +
"OpFunctionEnd",
- 3, 0),
- // Test case 14: Fold OpCompositeExtract with no indexes.
- InstructionFoldingCase<uint32_t>(
- Header() + "%main = OpFunction %void None %void_func\n" +
- "%main_lab = OpLabel\n" +
- "%2 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1\n" +
- "%3 = OpCompositeExtract %v4float %2\n" +
- "OpReturn\n" +
- "OpFunctionEnd",
- 3, 2)
+ 3, 0)
));
INSTANTIATE_TEST_SUITE_P(CompositeConstructFoldingTest, GeneralInstructionFoldingTest,
@@ -5772,6 +5763,132 @@ INSTANTIATE_TEST_SUITE_P(MergeAddTest, MatchingInstructionFoldingTest,
4, true)
));
+INSTANTIATE_TEST_SUITE_P(MergeGenericAddSub, MatchingInstructionFoldingTest,
+::testing::Values(
+ // Test case 0: merge of add of sub
+ // (a - b) + b => a
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" +
+ "; CHECK: %6 = OpCopyObject [[float]] %3\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var0 = OpVariable %_ptr_float Function\n" +
+ "%var1 = OpVariable %_ptr_float Function\n" +
+ "%3 = OpLoad %float %var0\n" +
+ "%4 = OpLoad %float %var1\n" +
+ "%5 = OpFSub %float %3 %4\n" +
+ "%6 = OpFAdd %float %5 %4\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd\n",
+ 6, true),
+ // Test case 1: merge of add of sub
+ // b + (a - b) => a
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" +
+ "; CHECK: %6 = OpCopyObject [[float]] %3\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var0 = OpVariable %_ptr_float Function\n" +
+ "%var1 = OpVariable %_ptr_float Function\n" +
+ "%3 = OpLoad %float %var0\n" +
+ "%4 = OpLoad %float %var1\n" +
+ "%5 = OpFSub %float %3 %4\n" +
+ "%6 = OpFAdd %float %4 %5\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd\n",
+ 6, true)
+));
+
+INSTANTIATE_TEST_SUITE_P(FactorAddMul, MatchingInstructionFoldingTest,
+::testing::Values(
+ // Test case 0: factor of add of muls
+ // (a * b) + (a * c) => a * (b + c)
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" +
+ "; CHECK: [[newadd:%\\w+]] = OpFAdd [[float]] %4 %5\n" +
+ "; CHECK: %9 = OpFMul [[float]] %6 [[newadd]]\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var0 = OpVariable %_ptr_float Function\n" +
+ "%var1 = OpVariable %_ptr_float Function\n" +
+ "%var2 = OpVariable %_ptr_float Function\n" +
+ "%4 = OpLoad %float %var0\n" +
+ "%5 = OpLoad %float %var1\n" +
+ "%6 = OpLoad %float %var2\n" +
+ "%7 = OpFMul %float %6 %4\n" +
+ "%8 = OpFMul %float %6 %5\n" +
+ "%9 = OpFAdd %float %7 %8\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd\n",
+ 9, true),
+ // Test case 1: factor of add of muls
+ // (b * a) + (a * c) => a * (b + c)
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" +
+ "; CHECK: [[newadd:%\\w+]] = OpFAdd [[float]] %4 %5\n" +
+ "; CHECK: %9 = OpFMul [[float]] %6 [[newadd]]\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var0 = OpVariable %_ptr_float Function\n" +
+ "%var1 = OpVariable %_ptr_float Function\n" +
+ "%var2 = OpVariable %_ptr_float Function\n" +
+ "%4 = OpLoad %float %var0\n" +
+ "%5 = OpLoad %float %var1\n" +
+ "%6 = OpLoad %float %var2\n" +
+ "%7 = OpFMul %float %4 %6\n" +
+ "%8 = OpFMul %float %6 %5\n" +
+ "%9 = OpFAdd %float %7 %8\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd\n",
+ 9, true),
+ // Test case 2: factor of add of muls
+ // (a * b) + (c * a) => a * (b + c)
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" +
+ "; CHECK: [[newadd:%\\w+]] = OpFAdd [[float]] %4 %5\n" +
+ "; CHECK: %9 = OpFMul [[float]] %6 [[newadd]]\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var0 = OpVariable %_ptr_float Function\n" +
+ "%var1 = OpVariable %_ptr_float Function\n" +
+ "%var2 = OpVariable %_ptr_float Function\n" +
+ "%4 = OpLoad %float %var0\n" +
+ "%5 = OpLoad %float %var1\n" +
+ "%6 = OpLoad %float %var2\n" +
+ "%7 = OpFMul %float %6 %4\n" +
+ "%8 = OpFMul %float %5 %6\n" +
+ "%9 = OpFAdd %float %7 %8\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd\n",
+ 9, true),
+ // Test case 3: factor of add of muls
+ // (b * a) + (c * a) => a * (b + c)
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK: [[float:%\\w+]] = OpTypeFloat 32\n" +
+ "; CHECK: [[newadd:%\\w+]] = OpFAdd [[float]] %4 %5\n" +
+ "; CHECK: %9 = OpFMul [[float]] %6 [[newadd]]\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var0 = OpVariable %_ptr_float Function\n" +
+ "%var1 = OpVariable %_ptr_float Function\n" +
+ "%var2 = OpVariable %_ptr_float Function\n" +
+ "%4 = OpLoad %float %var0\n" +
+ "%5 = OpLoad %float %var1\n" +
+ "%6 = OpLoad %float %var2\n" +
+ "%7 = OpFMul %float %4 %6\n" +
+ "%8 = OpFMul %float %5 %6\n" +
+ "%9 = OpFAdd %float %7 %8\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd\n",
+ 9, true)
+));
+
INSTANTIATE_TEST_SUITE_P(MergeSubTest, MatchingInstructionFoldingTest,
::testing::Values(
// Test case 0: merge sub of negate
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/graphics_robust_access_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/graphics_robust_access_test.cpp
index 646b92c22cb..4ae412144f8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/graphics_robust_access_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/graphics_robust_access_test.cpp
@@ -199,11 +199,11 @@ std::string ACCheck(const std::string& access_chain_inst,
const std::string& original,
const std::string& transformed) {
return "\n ; CHECK: %ac = " + access_chain_inst + " %ptr_ty %var" +
- (transformed.size() ? " " : "") + transformed +
+ (transformed.empty() ? "" : " ") + transformed +
"\n ; CHECK-NOT: " + access_chain_inst +
"\n ; CHECK-NEXT: OpReturn"
"\n %ac = " +
- access_chain_inst + " %ptr_ty %var " + (original.size() ? " " : "") +
+ access_chain_inst + " %ptr_ty %var " + (original.empty() ? "" : " ") +
original + "\n";
}
@@ -211,11 +211,11 @@ std::string ACCheckFail(const std::string& access_chain_inst,
const std::string& original,
const std::string& transformed) {
return "\n ; CHECK: %ac = " + access_chain_inst + " %ptr_ty %var" +
- (transformed.size() ? " " : "") + transformed +
+ (transformed.empty() ? "" : " ") + transformed +
"\n ; CHECK-NOT: " + access_chain_inst +
"\n ; CHECK-NOT: OpReturn"
"\n %ac = " +
- access_chain_inst + " %ptr_ty %var " + (original.size() ? " " : "") +
+ access_chain_inst + " %ptr_ty %var " + (original.empty() ? "" : " ") +
original + "\n";
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/if_conversion_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/if_conversion_test.cpp
index 03932a95a99..aa5adea6e89 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/if_conversion_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/if_conversion_test.cpp
@@ -375,14 +375,12 @@ OpEntryPoint Vertex %1 "func" %2
OpSelectionMerge %12 None
OpBranchConditional %true %13 %12
%13 = OpLabel
-OpBranchConditional %true %14 %15
+OpBranchConditional %true %14 %12
%14 = OpLabel
OpBranch %12
-%15 = OpLabel
-OpBranch %12
%12 = OpLabel
-%16 = OpPhi %uint %uint_0 %11 %uint_0 %14 %uint_1 %15
-OpStore %2 %16
+%15 = OpPhi %uint %uint_0 %11 %uint_0 %13 %uint_1 %14
+OpStore %2 %15
OpReturn
OpFunctionEnd
)";
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/inst_bindless_check_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/inst_bindless_check_test.cpp
index 130f70decb1..b4db2d50ae8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/inst_bindless_check_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/inst_bindless_check_test.cpp
@@ -10820,6 +10820,415 @@ OpFunctionEnd
true, 7u, 23u, true, true, 2u);
}
+TEST_F(InstBindlessTest, InstBoundsInitSameBlockOpReplication) {
+ // Test that same block ops like OpSampledImage are replicated properly
+ // where needed.
+ //
+ // clang-format off
+ //
+ // #version 450 core
+ // #extension GL_EXT_nonuniform_qualifier : enable
+ //
+ // layout(location = 0) in vec2 inTexcoord;
+ // layout(location = 0) out vec4 outColor;
+ //
+ // layout(set = 0, binding = 0) uniform Uniforms {
+ // vec2 var0;
+ // } uniforms;
+ //
+ // layout(set = 0, binding = 1) uniform sampler uniformSampler;
+ // layout(set = 0, binding = 2) uniform texture2D uniformTex;
+ // layout(set = 0, binding = 3) uniform texture2D uniformTexArr[8];
+ //
+ // void main() {
+ // int index = 0;
+ // float x = texture(sampler2D(uniformTexArr[nonuniformEXT(index)], uniformSampler), inTexcoord.xy).x;
+ // float y = texture(sampler2D(uniformTex, uniformSampler), inTexcoord.xy * uniforms.var0.xy).x;
+ // outColor = vec4(x, y, 0.0, 0.0);
+ // }
+ //
+ // clang-format on
+
+ const std::string defs_before =
+ R"(OpCapability Shader
+OpCapability ShaderNonUniformEXT
+OpCapability SampledImageArrayNonUniformIndexingEXT
+OpExtension "SPV_EXT_descriptor_indexing"
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main" %inTexcoord %outColor
+OpExecutionMode %main OriginUpperLeft
+OpSource GLSL 450
+OpSourceExtension "GL_EXT_nonuniform_qualifier"
+OpName %main "main"
+OpName %index "index"
+OpName %x "x"
+OpName %uniformTexArr "uniformTexArr"
+OpName %uniformSampler "uniformSampler"
+OpName %inTexcoord "inTexcoord"
+OpName %y "y"
+OpName %uniformTex "uniformTex"
+OpName %Uniforms "Uniforms"
+OpMemberName %Uniforms 0 "var0"
+OpName %uniforms "uniforms"
+OpName %outColor "outColor"
+OpDecorate %uniformTexArr DescriptorSet 0
+OpDecorate %uniformTexArr Binding 3
+OpDecorate %19 NonUniformEXT
+OpDecorate %22 NonUniformEXT
+OpDecorate %uniformSampler DescriptorSet 0
+OpDecorate %uniformSampler Binding 1
+OpDecorate %inTexcoord Location 0
+OpDecorate %uniformTex DescriptorSet 0
+OpDecorate %uniformTex Binding 2
+OpMemberDecorate %Uniforms 0 Offset 0
+OpDecorate %Uniforms Block
+OpDecorate %uniforms DescriptorSet 0
+OpDecorate %uniforms Binding 0
+OpDecorate %outColor Location 0
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+%int_0 = OpConstant %int 0
+%float = OpTypeFloat 32
+%_ptr_Function_float = OpTypePointer Function %float
+%13 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%uint = OpTypeInt 32 0
+%uint_8 = OpConstant %uint 8
+%_arr_13_uint_8 = OpTypeArray %13 %uint_8
+%_ptr_UniformConstant__arr_13_uint_8 = OpTypePointer UniformConstant %_arr_13_uint_8
+%uniformTexArr = OpVariable %_ptr_UniformConstant__arr_13_uint_8 UniformConstant
+%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13
+%23 = OpTypeSampler
+%_ptr_UniformConstant_23 = OpTypePointer UniformConstant %23
+%uniformSampler = OpVariable %_ptr_UniformConstant_23 UniformConstant
+%27 = OpTypeSampledImage %13
+%v2float = OpTypeVector %float 2
+%_ptr_Input_v2float = OpTypePointer Input %v2float
+%inTexcoord = OpVariable %_ptr_Input_v2float Input
+%v4float = OpTypeVector %float 4
+%uint_0 = OpConstant %uint 0
+%uniformTex = OpVariable %_ptr_UniformConstant_13 UniformConstant
+%Uniforms = OpTypeStruct %v2float
+%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
+%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
+%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%outColor = OpVariable %_ptr_Output_v4float Output
+%float_0 = OpConstant %float 0
+)";
+
+ const std::string defs_after =
+ R"(OpCapability Shader
+OpCapability ShaderNonUniform
+OpCapability SampledImageArrayNonUniformIndexing
+OpExtension "SPV_EXT_descriptor_indexing"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main" %inTexcoord %outColor %gl_FragCoord
+OpExecutionMode %main OriginUpperLeft
+OpSource GLSL 450
+OpSourceExtension "GL_EXT_nonuniform_qualifier"
+OpName %main "main"
+OpName %index "index"
+OpName %x "x"
+OpName %uniformTexArr "uniformTexArr"
+OpName %uniformSampler "uniformSampler"
+OpName %inTexcoord "inTexcoord"
+OpName %y "y"
+OpName %uniformTex "uniformTex"
+OpName %Uniforms "Uniforms"
+OpMemberName %Uniforms 0 "var0"
+OpName %uniforms "uniforms"
+OpName %outColor "outColor"
+OpDecorate %uniformTexArr DescriptorSet 0
+OpDecorate %uniformTexArr Binding 3
+OpDecorate %19 NonUniform
+OpDecorate %22 NonUniform
+OpDecorate %uniformSampler DescriptorSet 0
+OpDecorate %uniformSampler Binding 1
+OpDecorate %inTexcoord Location 0
+OpDecorate %uniformTex DescriptorSet 0
+OpDecorate %uniformTex Binding 2
+OpMemberDecorate %Uniforms 0 Offset 0
+OpDecorate %Uniforms Block
+OpDecorate %uniforms DescriptorSet 0
+OpDecorate %uniforms Binding 0
+OpDecorate %outColor Location 0
+OpDecorate %63 NonUniform
+OpDecorate %_runtimearr_uint ArrayStride 4
+OpDecorate %_struct_75 Block
+OpMemberDecorate %_struct_75 0 Offset 0
+OpMemberDecorate %_struct_75 1 Offset 4
+OpDecorate %77 DescriptorSet 7
+OpDecorate %77 Binding 0
+OpDecorate %gl_FragCoord BuiltIn FragCoord
+OpDecorate %_struct_132 Block
+OpMemberDecorate %_struct_132 0 Offset 0
+OpDecorate %134 DescriptorSet 7
+OpDecorate %134 Binding 1
+OpDecorate %151 NonUniform
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+%int_0 = OpConstant %int 0
+%float = OpTypeFloat 32
+%_ptr_Function_float = OpTypePointer Function %float
+%13 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%uint = OpTypeInt 32 0
+%uint_8 = OpConstant %uint 8
+%_arr_13_uint_8 = OpTypeArray %13 %uint_8
+%_ptr_UniformConstant__arr_13_uint_8 = OpTypePointer UniformConstant %_arr_13_uint_8
+%uniformTexArr = OpVariable %_ptr_UniformConstant__arr_13_uint_8 UniformConstant
+%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13
+%23 = OpTypeSampler
+%_ptr_UniformConstant_23 = OpTypePointer UniformConstant %23
+%uniformSampler = OpVariable %_ptr_UniformConstant_23 UniformConstant
+%27 = OpTypeSampledImage %13
+%v2float = OpTypeVector %float 2
+%_ptr_Input_v2float = OpTypePointer Input %v2float
+%inTexcoord = OpVariable %_ptr_Input_v2float Input
+%v4float = OpTypeVector %float 4
+%uint_0 = OpConstant %uint 0
+%uniformTex = OpVariable %_ptr_UniformConstant_13 UniformConstant
+%Uniforms = OpTypeStruct %v2float
+%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
+%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
+%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%outColor = OpVariable %_ptr_Output_v4float Output
+%float_0 = OpConstant %float 0
+%bool = OpTypeBool
+%68 = OpTypeFunction %void %uint %uint %uint %uint
+%_runtimearr_uint = OpTypeRuntimeArray %uint
+%_struct_75 = OpTypeStruct %uint %_runtimearr_uint
+%_ptr_StorageBuffer__struct_75 = OpTypePointer StorageBuffer %_struct_75
+%77 = OpVariable %_ptr_StorageBuffer__struct_75 StorageBuffer
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+%uint_10 = OpConstant %uint 10
+%uint_4 = OpConstant %uint 4
+%uint_1 = OpConstant %uint 1
+%uint_23 = OpConstant %uint 23
+%uint_2 = OpConstant %uint 2
+%uint_3 = OpConstant %uint 3
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
+%v4uint = OpTypeVector %uint 4
+%uint_5 = OpConstant %uint 5
+%uint_7 = OpConstant %uint 7
+%uint_9 = OpConstant %uint 9
+%uint_79 = OpConstant %uint 79
+%122 = OpConstantNull %v4float
+%126 = OpTypeFunction %uint %uint %uint %uint %uint
+%_struct_132 = OpTypeStruct %_runtimearr_uint
+%_ptr_StorageBuffer__struct_132 = OpTypePointer StorageBuffer %_struct_132
+%134 = OpVariable %_ptr_StorageBuffer__struct_132 StorageBuffer
+%uint_87 = OpConstant %uint 87
+%165 = OpConstantNull %v2float
+%uint_89 = OpConstant %uint 89
+)";
+
+ const std::string func_before =
+ R"(%main = OpFunction %void None %3
+%5 = OpLabel
+%index = OpVariable %_ptr_Function_int Function
+%x = OpVariable %_ptr_Function_float Function
+%y = OpVariable %_ptr_Function_float Function
+OpStore %index %int_0
+%19 = OpLoad %int %index
+%21 = OpAccessChain %_ptr_UniformConstant_13 %uniformTexArr %19
+%22 = OpLoad %13 %21
+%26 = OpLoad %23 %uniformSampler
+%28 = OpSampledImage %27 %22 %26
+%32 = OpLoad %v2float %inTexcoord
+%34 = OpImageSampleImplicitLod %v4float %28 %32
+%36 = OpCompositeExtract %float %34 0
+OpStore %x %36
+%39 = OpLoad %13 %uniformTex
+%40 = OpLoad %23 %uniformSampler
+%41 = OpSampledImage %27 %39 %40
+%42 = OpLoad %v2float %inTexcoord
+%47 = OpAccessChain %_ptr_Uniform_v2float %uniforms %int_0
+%48 = OpLoad %v2float %47
+%49 = OpFMul %v2float %42 %48
+%50 = OpImageSampleImplicitLod %v4float %41 %49
+%51 = OpCompositeExtract %float %50 0
+OpStore %y %51
+%54 = OpLoad %float %x
+%55 = OpLoad %float %y
+%57 = OpCompositeConstruct %v4float %54 %55 %float_0 %float_0
+OpStore %outColor %57
+OpReturn
+OpFunctionEnd
+)";
+
+ const std::string func_after =
+ R"(%main = OpFunction %void None %3
+%5 = OpLabel
+%index = OpVariable %_ptr_Function_int Function
+%x = OpVariable %_ptr_Function_float Function
+%y = OpVariable %_ptr_Function_float Function
+OpStore %index %int_0
+%19 = OpLoad %int %index
+%21 = OpAccessChain %_ptr_UniformConstant_13 %uniformTexArr %19
+%22 = OpLoad %13 %21
+%26 = OpLoad %23 %uniformSampler
+%28 = OpSampledImage %27 %22 %26
+%32 = OpLoad %v2float %inTexcoord
+%59 = OpULessThan %bool %19 %uint_8
+OpSelectionMerge %60 None
+OpBranchConditional %59 %61 %62
+%61 = OpLabel
+%63 = OpLoad %13 %21
+%64 = OpSampledImage %27 %63 %26
+%124 = OpBitcast %uint %19
+%146 = OpFunctionCall %uint %125 %uint_0 %uint_0 %uint_3 %124
+%147 = OpINotEqual %bool %146 %uint_0
+OpSelectionMerge %148 None
+OpBranchConditional %147 %149 %150
+%149 = OpLabel
+%151 = OpLoad %13 %21
+%152 = OpSampledImage %27 %151 %26
+%153 = OpImageSampleImplicitLod %v4float %152 %32
+OpBranch %148
+%150 = OpLabel
+%154 = OpBitcast %uint %19
+%155 = OpFunctionCall %void %67 %uint_79 %uint_1 %154 %uint_0
+OpBranch %148
+%148 = OpLabel
+%156 = OpPhi %v4float %153 %149 %122 %150
+OpBranch %60
+%62 = OpLabel
+%66 = OpBitcast %uint %19
+%121 = OpFunctionCall %void %67 %uint_79 %uint_0 %66 %uint_8
+OpBranch %60
+%60 = OpLabel
+%123 = OpPhi %v4float %156 %148 %122 %62
+%36 = OpCompositeExtract %float %123 0
+OpStore %x %36
+%39 = OpLoad %13 %uniformTex
+%40 = OpLoad %23 %uniformSampler
+%41 = OpSampledImage %27 %39 %40
+%42 = OpLoad %v2float %inTexcoord
+%47 = OpAccessChain %_ptr_Uniform_v2float %uniforms %int_0
+%157 = OpFunctionCall %uint %125 %uint_0 %uint_0 %uint_0 %uint_0
+%158 = OpINotEqual %bool %157 %uint_0
+OpSelectionMerge %159 None
+OpBranchConditional %158 %160 %161
+%160 = OpLabel
+%162 = OpLoad %v2float %47
+OpBranch %159
+%161 = OpLabel
+%164 = OpFunctionCall %void %67 %uint_87 %uint_1 %uint_0 %uint_0
+OpBranch %159
+%159 = OpLabel
+%166 = OpPhi %v2float %162 %160 %165 %161
+%49 = OpFMul %v2float %42 %166
+%167 = OpSampledImage %27 %39 %40
+%168 = OpFunctionCall %uint %125 %uint_0 %uint_0 %uint_2 %uint_0
+%169 = OpINotEqual %bool %168 %uint_0
+OpSelectionMerge %170 None
+OpBranchConditional %169 %171 %172
+%171 = OpLabel
+%173 = OpLoad %13 %uniformTex
+%174 = OpSampledImage %27 %173 %40
+%175 = OpImageSampleImplicitLod %v4float %174 %49
+OpBranch %170
+%172 = OpLabel
+%177 = OpFunctionCall %void %67 %uint_89 %uint_1 %uint_0 %uint_0
+OpBranch %170
+%170 = OpLabel
+%178 = OpPhi %v4float %175 %171 %122 %172
+%51 = OpCompositeExtract %float %178 0
+OpStore %y %51
+%54 = OpLoad %float %x
+%55 = OpLoad %float %y
+%57 = OpCompositeConstruct %v4float %54 %55 %float_0 %float_0
+OpStore %outColor %57
+OpReturn
+OpFunctionEnd
+)";
+
+ const std::string new_funcs =
+ R"(%67 = OpFunction %void None %68
+%69 = OpFunctionParameter %uint
+%70 = OpFunctionParameter %uint
+%71 = OpFunctionParameter %uint
+%72 = OpFunctionParameter %uint
+%73 = OpLabel
+%79 = OpAccessChain %_ptr_StorageBuffer_uint %77 %uint_0
+%82 = OpAtomicIAdd %uint %79 %uint_4 %uint_0 %uint_10
+%83 = OpIAdd %uint %82 %uint_10
+%84 = OpArrayLength %uint %77 1
+%85 = OpULessThanEqual %bool %83 %84
+OpSelectionMerge %86 None
+OpBranchConditional %85 %87 %86
+%87 = OpLabel
+%88 = OpIAdd %uint %82 %uint_0
+%90 = OpAccessChain %_ptr_StorageBuffer_uint %77 %uint_1 %88
+OpStore %90 %uint_10
+%92 = OpIAdd %uint %82 %uint_1
+%93 = OpAccessChain %_ptr_StorageBuffer_uint %77 %uint_1 %92
+OpStore %93 %uint_23
+%95 = OpIAdd %uint %82 %uint_2
+%96 = OpAccessChain %_ptr_StorageBuffer_uint %77 %uint_1 %95
+OpStore %96 %69
+%98 = OpIAdd %uint %82 %uint_3
+%99 = OpAccessChain %_ptr_StorageBuffer_uint %77 %uint_1 %98
+OpStore %99 %uint_4
+%102 = OpLoad %v4float %gl_FragCoord
+%104 = OpBitcast %v4uint %102
+%105 = OpCompositeExtract %uint %104 0
+%106 = OpIAdd %uint %82 %uint_4
+%107 = OpAccessChain %_ptr_StorageBuffer_uint %77 %uint_1 %106
+OpStore %107 %105
+%108 = OpCompositeExtract %uint %104 1
+%110 = OpIAdd %uint %82 %uint_5
+%111 = OpAccessChain %_ptr_StorageBuffer_uint %77 %uint_1 %110
+OpStore %111 %108
+%113 = OpIAdd %uint %82 %uint_7
+%114 = OpAccessChain %_ptr_StorageBuffer_uint %77 %uint_1 %113
+OpStore %114 %70
+%115 = OpIAdd %uint %82 %uint_8
+%116 = OpAccessChain %_ptr_StorageBuffer_uint %77 %uint_1 %115
+OpStore %116 %71
+%118 = OpIAdd %uint %82 %uint_9
+%119 = OpAccessChain %_ptr_StorageBuffer_uint %77 %uint_1 %118
+OpStore %119 %72
+OpBranch %86
+%86 = OpLabel
+OpReturn
+OpFunctionEnd
+%125 = OpFunction %uint None %126
+%127 = OpFunctionParameter %uint
+%128 = OpFunctionParameter %uint
+%129 = OpFunctionParameter %uint
+%130 = OpFunctionParameter %uint
+%131 = OpLabel
+%135 = OpAccessChain %_ptr_StorageBuffer_uint %134 %uint_0 %127
+%136 = OpLoad %uint %135
+%137 = OpIAdd %uint %136 %128
+%138 = OpAccessChain %_ptr_StorageBuffer_uint %134 %uint_0 %137
+%139 = OpLoad %uint %138
+%140 = OpIAdd %uint %139 %129
+%141 = OpAccessChain %_ptr_StorageBuffer_uint %134 %uint_0 %140
+%142 = OpLoad %uint %141
+%143 = OpIAdd %uint %142 %130
+%144 = OpAccessChain %_ptr_StorageBuffer_uint %134 %uint_0 %143
+%145 = OpLoad %uint %144
+OpReturnValue %145
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SinglePassRunAndCheck<InstBindlessCheckPass>(
+ defs_before + func_before, defs_after + func_after + new_funcs, true,
+ true, 7u, 23u, true, true, 2u);
+}
+
// TODO(greg-lunarg): Add tests to verify handling of these cases:
//
// Compute shader
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/ir_context_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/ir_context_test.cpp
index 4e2f5b2c4da..d5710fc469a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/ir_context_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/ir_context_test.cpp
@@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+#include "source/opt/ir_context.h"
+
#include <algorithm>
#include <memory>
#include <string>
@@ -19,7 +21,6 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
-#include "source/opt/ir_context.h"
#include "source/opt/pass.h"
#include "test/opt/pass_fixture.h"
#include "test/opt/pass_utils.h"
@@ -664,6 +665,90 @@ OpFunctionEnd)";
EXPECT_EQ(next_id_bound, 0);
EXPECT_EQ(current_bound, context->module()->id_bound());
}
+
+TEST_F(IRContextTest, CfgAndDomAnalysis) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%1 = OpTypeVoid
+%2 = OpTypeFunction %1
+%3 = OpFunction %1 None %2
+%4 = OpLabel
+OpReturn
+OpFunctionEnd)";
+
+ std::unique_ptr<IRContext> ctx =
+ BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text,
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+
+ // Building the dominator analysis should build the CFG.
+ ASSERT_TRUE(ctx->module()->begin() != ctx->module()->end());
+ ctx->GetDominatorAnalysis(&*ctx->module()->begin());
+
+ EXPECT_TRUE(ctx->AreAnalysesValid(IRContext::kAnalysisCFG));
+ EXPECT_TRUE(ctx->AreAnalysesValid(IRContext::kAnalysisDominatorAnalysis));
+
+ // Invalidating the CFG analysis should invalidate the dominator analysis.
+ ctx->InvalidateAnalyses(IRContext::kAnalysisCFG);
+ EXPECT_FALSE(ctx->AreAnalysesValid(IRContext::kAnalysisCFG));
+ EXPECT_FALSE(ctx->AreAnalysesValid(IRContext::kAnalysisDominatorAnalysis));
+}
+
+TEST_F(IRContextTest, AsanErrorTest) {
+ std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "x"
+ OpName %10 "y"
+ OpDecorate %8 RelaxedPrecision
+ OpDecorate %10 RelaxedPrecision
+ OpDecorate %11 RelaxedPrecision
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %9 = OpConstant %6 1
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %10 = OpVariable %7 Function
+ OpStore %8 %9
+ %11 = OpLoad %6 %8
+ OpBranch %20
+ %20 = OpLabel
+ %21 = OpPhi %6 %11 %5
+ OpStore %10 %21
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ const auto env = SPV_ENV_UNIVERSAL_1_3;
+ const auto consumer = nullptr;
+ const auto context = BuildModule(
+ env, consumer, shader, SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+
+ opt::Function* fun =
+ context->cfg()->block(5)->GetParent(); // Computes the CFG analysis
+ opt::DominatorAnalysis* dom = nullptr;
+ dom = context->GetDominatorAnalysis(fun); // Computes the dominator analysis,
+ // which depends on the CFG
+ // analysis
+ context->InvalidateAnalysesExceptFor(
+ opt::IRContext::Analysis::kAnalysisDominatorAnalysis); // Invalidates the
+ // CFG analysis
+ dom = context->GetDominatorAnalysis(
+ fun); // Recompute the CFG analysis because the Dominator tree uses it.
+ auto bb = dom->ImmediateDominator(5);
+ std::cout
+ << bb->id(); // Make sure asan does not complain about use after free.
+}
+
} // namespace
} // namespace opt
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/optimizer_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/optimizer_test.cpp
index 5e9ea950c0c..5c0707d73f1 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/optimizer_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/optimizer_test.cpp
@@ -744,6 +744,54 @@ INSTANTIATE_TEST_SUITE_P(
// pass
"compact-ids"}}));
+TEST(Optimizer, RemoveNop) {
+ // Test that OpNops are removed even if no optimizations are run.
+ const std::string before = R"(OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%2 = OpTypeFunction %void
+%3 = OpFunction %void None %2
+%4 = OpLabel
+OpNop
+OpReturn
+OpFunctionEnd
+)";
+
+ const std::string after = R"(OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%2 = OpTypeFunction %void
+%3 = OpFunction %void None %2
+%4 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ std::vector<uint32_t> binary;
+ {
+ SpirvTools tools(SPV_ENV_VULKAN_1_1);
+ tools.Assemble(before, &binary);
+ }
+
+ Optimizer opt(SPV_ENV_VULKAN_1_1);
+
+ std::vector<uint32_t> optimized;
+ class ValidatorOptions validator_options;
+ ASSERT_TRUE(opt.Run(binary.data(), binary.size(), &optimized,
+ validator_options, true))
+ << before << "\n";
+ std::string disassembly;
+ {
+ SpirvTools tools(SPV_ENV_WEBGPU_0);
+ tools.Disassemble(optimized.data(), optimized.size(), &disassembly);
+ }
+
+ EXPECT_EQ(after, disassembly)
+ << "Was expecting the OpNop to have been removed.";
+}
+
} // namespace
} // namespace opt
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/reduce_load_size_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/reduce_load_size_test.cpp
index 7b850e317db..50dc5017ca3 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/reduce_load_size_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/reduce_load_size_test.cpp
@@ -321,34 +321,6 @@ OpFunctionEnd
SinglePassRunAndCheck<ReduceLoadSize>(test, test, true, false);
}
-TEST_F(ReduceLoadSizeTest, extract_with_no_index) {
- const std::string test =
- R"(
- OpCapability ImageGatherExtended
- OpExtension ""
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "P�Ma'" %12 %17
- OpExecutionMode %4 OriginUpperLeft
- %void = OpTypeVoid
- %3 = OpTypeFunction %void
- %float = OpTypeFloat 32
- %_struct_7 = OpTypeStruct %float %float
-%_ptr_Input__struct_7 = OpTypePointer Input %_struct_7
-%_ptr_Output__struct_7 = OpTypePointer Output %_struct_7
- %12 = OpVariable %_ptr_Input__struct_7 Input
- %17 = OpVariable %_ptr_Output__struct_7 Output
- %4 = OpFunction %void DontInline|Pure|Const %3
- %245 = OpLabel
- %13 = OpLoad %_struct_7 %12
- %33 = OpCompositeExtract %_struct_7 %13
- OpReturn
- OpFunctionEnd
- )";
-
- auto result = SinglePassRunAndDisassemble<ReduceLoadSize>(test, true, true);
- EXPECT_EQ(Pass::Status::SuccessWithoutChange, std::get<1>(result));
-}
-
} // namespace
} // namespace opt
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/scalar_replacement_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/scalar_replacement_test.cpp
index 12280760089..3cf46ca13d2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/scalar_replacement_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/scalar_replacement_test.cpp
@@ -1899,37 +1899,6 @@ TEST_F(ScalarReplacementTest, RelaxedPrecisionMemberDecoration) {
SinglePassRunAndMatch<ScalarReplacementPass>(text, true);
}
-TEST_F(ScalarReplacementTest, ExtractWithNoIndex) {
- const std::string text = R"(
-; CHECK: [[var1:%\w+]] = OpVariable %_ptr_Function_float Function
-; CHECK: [[var2:%\w+]] = OpVariable %_ptr_Function_float Function
-; CHECK: [[ld1:%\w+]] = OpLoad %float [[var1]]
-; CHECK: [[ld2:%\w+]] = OpLoad %float [[var2]]
-; CHECK: [[constr:%\w+]] = OpCompositeConstruct {{%\w+}} [[ld2]] [[ld1]]
-; CHECK: OpCompositeExtract {{%\w+}} [[constr]]
-OpCapability Shader
-OpExtension ""
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %1 "main"
-OpExecutionMode %1 OriginUpperLeft
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%_struct_5 = OpTypeStruct %float %float
-%_ptr_Private__struct_5 = OpTypePointer Private %_struct_5
-%_ptr_Function__struct_5 = OpTypePointer Function %_struct_5
-%1 = OpFunction %void Inline %3
-%8 = OpLabel
-%9 = OpVariable %_ptr_Function__struct_5 Function
-%10 = OpLoad %_struct_5 %9
-%11 = OpCompositeExtract %_struct_5 %10
-OpReturn
-OpFunctionEnd
-)";
-
- SinglePassRunAndMatch<ScalarReplacementPass>(text, true);
-}
-
} // namespace
} // namespace opt
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/simplification_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/simplification_test.cpp
index e1f10a561e2..7a9696eab49 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/simplification_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/simplification_test.cpp
@@ -71,6 +71,41 @@ TEST_F(SimplificationTest, StraightLineTest) {
SinglePassRunAndMatch<SimplificationPass>(text, false);
}
+TEST_F(SimplificationTest, NewInstructionTest) {
+ // Testing that new instructions are simplified. Specifically,
+ // that the new add instruction generated by FactorAddMul is
+ // further simplified by MergeGenericAddSub.
+ const std::string text = R"(OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginUpperLeft
+ OpSource GLSL 430
+ OpName %main "main"
+ %void = OpTypeVoid
+ %4 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %_ptr_int = OpTypePointer Function %int
+; CHECK: [[mul:%[a-zA-Z_\d]+]] = OpIMul %int %13 %11
+ %main = OpFunction %void None %4
+ %7 = OpLabel
+ %8 = OpVariable %_ptr_int Function
+ %9 = OpVariable %_ptr_int Function
+ %10 = OpVariable %_ptr_int Function
+ %11 = OpLoad %int %8
+ %12 = OpLoad %int %9
+ %13 = OpLoad %int %10
+ %14 = OpISub %int %11 %12
+ %15 = OpIMul %int %13 %11
+ %16 = OpIMul %int %13 %12
+ %17 = OpIAdd %int %14 %15
+ OpReturn
+ OpFunctionEnd
+)";
+
+ SinglePassRunAndMatch<SimplificationPass>(text, false);
+}
+
TEST_F(SimplificationTest, AcrossBasicBlocks) {
// Testing that folding rules are combined across basic blocks.
const std::string text = R"(OpCapability Shader
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/type_manager_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/type_manager_test.cpp
index 267d98c3f64..743d0b616a2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/type_manager_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/type_manager_test.cpp
@@ -156,7 +156,8 @@ std::vector<std::unique_ptr<Type>> GenerateAllTypes() {
types.emplace_back(new ReserveId());
types.emplace_back(new Queue());
- // Pipe, Forward Pointer, PipeStorage, NamedBarrier, AccelerationStructureNV
+ // Pipe, Forward Pointer, PipeStorage, NamedBarrier, AccelerationStructureNV,
+ // CooperativeMatrixNV
types.emplace_back(new Pipe(SpvAccessQualifierReadWrite));
types.emplace_back(new Pipe(SpvAccessQualifierReadOnly));
types.emplace_back(new ForwardPointer(1, SpvStorageClassInput));
@@ -165,6 +166,7 @@ std::vector<std::unique_ptr<Type>> GenerateAllTypes() {
types.emplace_back(new PipeStorage());
types.emplace_back(new NamedBarrier());
types.emplace_back(new AccelerationStructureNV());
+ types.emplace_back(new CooperativeMatrixNV(f32, 24, 24, 24));
return types;
}
@@ -214,6 +216,7 @@ TEST(TypeManager, TypeStrings) {
%arr_spec_const_with_id = OpTypeArray %s32 %spec_const_with_id
%arr_long_constant = OpTypeArray %s32 %long_constant
%arr_spec_const_op = OpTypeArray %s32 %spec_const_op
+ %cm = OpTypeCooperativeMatrixNV %f64 %id4 %id4 %id4
)";
std::vector<std::pair<uint32_t, std::string>> type_id_strs = {
@@ -251,6 +254,7 @@ TEST(TypeManager, TypeStrings) {
{36, "[sint32, id(1), words(1,99,42)]"},
{37, "[sint32, id(33), words(0,705032704,1)]"},
{38, "[sint32, id(34), words(2,34)]"},
+ {39, "<float64, 6, 6, 6>"},
};
std::unique_ptr<IRContext> context =
@@ -1060,6 +1064,7 @@ TEST(TypeManager, GetTypeInstructionAllTypes) {
; CHECK: OpTypePipeStorage
; CHECK: OpTypeNamedBarrier
; CHECK: OpTypeAccelerationStructureNV
+; CHECK: OpTypeCooperativeMatrixNV [[f32]] [[uint24]] [[uint24]] [[uint24]]
OpCapability Shader
OpCapability Int64
OpCapability Linkage
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/vector_dce_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/vector_dce_test.cpp
index a978a07f9d2..594995c16d2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/vector_dce_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/opt/vector_dce_test.cpp
@@ -1158,74 +1158,6 @@ OpFunctionEnd
SinglePassRunAndCheck<VectorDCE>(text, text, true, true);
}
-TEST_F(VectorDCETest, InsertWithNoIndices) {
- const std::string text = R"(
-; CHECK: OpEntryPoint Fragment {{%\w+}} "PSMain" [[in1:%\w+]] [[in2:%\w+]] [[out:%\w+]]
-; CHECK: OpFunction
-; CHECK: [[ld:%\w+]] = OpLoad %v4float [[in2]]
-; CHECK: OpStore [[out]] [[ld]]
- OpCapability Shader
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %1 "PSMain" %2 %14 %3
- OpExecutionMode %1 OriginUpperLeft
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Input_v4float = OpTypePointer Input %v4float
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %2 = OpVariable %_ptr_Input_v4float Input
- %14 = OpVariable %_ptr_Input_v4float Input
- %3 = OpVariable %_ptr_Output_v4float Output
- %1 = OpFunction %void None %5
- %10 = OpLabel
- %13 = OpLoad %v4float %14
- %11 = OpLoad %v4float %2
- %12 = OpCompositeInsert %v4float %13 %11
- OpStore %3 %12
- OpReturn
- OpFunctionEnd
-)";
-
- SinglePassRunAndMatch<VectorDCE>(text, true);
-}
-
-TEST_F(VectorDCETest, ExtractWithNoIndices) {
- const std::string text = R"(
-; CHECK: OpLoad %float
-; CHECK: [[ld:%\w+]] = OpLoad %v4float
-; CHECK: [[ex1:%\w+]] = OpCompositeExtract %v4float [[ld]]
-; CHECK: [[ex2:%\w+]] = OpCompositeExtract %float [[ex1]] 1
-; CHECK: OpStore {{%\w+}} [[ex2]]
- OpCapability Shader
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %1 "PSMain" %2 %14 %3
- OpExecutionMode %1 OriginUpperLeft
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Input_float = OpTypePointer Input %float
-%_ptr_Input_v4float = OpTypePointer Input %v4float
-%_ptr_Output_float = OpTypePointer Output %float
- %2 = OpVariable %_ptr_Input_v4float Input
- %14 = OpVariable %_ptr_Input_float Input
- %3 = OpVariable %_ptr_Output_float Output
- %1 = OpFunction %void None %5
- %10 = OpLabel
- %13 = OpLoad %float %14
- %11 = OpLoad %v4float %2
- %12 = OpCompositeInsert %v4float %13 %11 0
- %20 = OpCompositeExtract %v4float %12
- %21 = OpCompositeExtract %float %20 1
- OpStore %3 %21
- OpReturn
- OpFunctionEnd
-)";
-
- SinglePassRunAndMatch<VectorDCE>(text, true);
-}
-
} // namespace
} // namespace opt
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/CMakeLists.txt b/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/CMakeLists.txt
index 2d3b3783446..b19bba45371 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/CMakeLists.txt
@@ -23,8 +23,6 @@ add_spvtools_unittest(TARGET reduce
reducer_test.cpp
remove_block_test.cpp
remove_function_test.cpp
- remove_opname_instruction_test.cpp
- remove_relaxed_precision_decoration_test.cpp
remove_selection_test.cpp
remove_unreferenced_instruction_test.cpp
structured_loop_to_selection_test.cpp
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/reducer_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/reducer_test.cpp
index 8787733c986..a650d3becce 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/reducer_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/reducer_test.cpp
@@ -14,8 +14,8 @@
#include "source/reduce/reducer.h"
+#include "source/opt/build_module.h"
#include "source/reduce/operand_to_const_reduction_opportunity_finder.h"
-#include "source/reduce/remove_opname_instruction_reduction_opportunity_finder.h"
#include "source/reduce/remove_unreferenced_instruction_reduction_opportunity_finder.h"
#include "test/reduce/reduce_test_util.h"
@@ -23,6 +23,12 @@ namespace spvtools {
namespace reduce {
namespace {
+using opt::BasicBlock;
+using opt::IRContext;
+
+const spv_target_env kEnv = SPV_ENV_UNIVERSAL_1_3;
+const MessageConsumer kMessageConsumer = CLIMessageConsumer;
+
// This changes its mind each time IsInteresting is invoked as to whether the
// binary is interesting, until some limit is reached after which the binary is
// always deemed interesting. This is useful to test that reduction passes
@@ -55,6 +61,8 @@ class PingPongInteresting {
};
TEST(ReducerTest, ExprToConstantAndRemoveUnreferenced) {
+ // Check that ExprToConstant and RemoveUnreferenced work together; once some
+ // ID uses have been changed to constants, those IDs can be removed.
std::string original = R"(
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
@@ -149,15 +157,6 @@ TEST(ReducerTest, ExprToConstantAndRemoveUnreferenced) {
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main" %60
OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- OpName %4 "main"
- OpName %16 "buf2"
- OpMemberName %16 0 "i"
- OpName %18 ""
- OpName %25 "buf1"
- OpMemberName %25 0 "f"
- OpName %27 ""
- OpName %60 "_GLF_color"
OpMemberDecorate %16 0 Offset 0
OpDecorate %16 Block
OpDecorate %18 DescriptorSet 0
@@ -174,14 +173,12 @@ TEST(ReducerTest, ExprToConstantAndRemoveUnreferenced) {
%16 = OpTypeStruct %6
%17 = OpTypePointer Uniform %16
%18 = OpVariable %17 Uniform
- %19 = OpTypePointer Uniform %6
%22 = OpTypeBool
%100 = OpConstantTrue %22
%24 = OpTypeFloat 32
%25 = OpTypeStruct %24
%26 = OpTypePointer Uniform %25
%27 = OpVariable %26 Uniform
- %28 = OpTypePointer Uniform %24
%31 = OpConstant %24 2
%56 = OpConstant %6 1
%58 = OpTypeVector %24 4
@@ -209,8 +206,7 @@ TEST(ReducerTest, ExprToConstantAndRemoveUnreferenced) {
OpFunctionEnd
)";
- spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
- Reducer reducer(env);
+ Reducer reducer(kEnv);
PingPongInteresting ping_pong_interesting(10);
reducer.SetMessageConsumer(NopDiagnostic);
reducer.SetInterestingnessFunction(
@@ -218,12 +214,13 @@ TEST(ReducerTest, ExprToConstantAndRemoveUnreferenced) {
return ping_pong_interesting.IsInteresting(binary);
});
reducer.AddReductionPass(
- MakeUnique<OperandToConstReductionOpportunityFinder>());
+ MakeUnique<RemoveUnreferencedInstructionReductionOpportunityFinder>(
+ false));
reducer.AddReductionPass(
- MakeUnique<RemoveUnreferencedInstructionReductionOpportunityFinder>());
+ MakeUnique<OperandToConstReductionOpportunityFinder>());
std::vector<uint32_t> binary_in;
- SpirvTools t(env);
+ SpirvTools t(kEnv);
ASSERT_TRUE(t.Assemble(original, &binary_in, kReduceAssembleOption));
std::vector<uint32_t> binary_out;
@@ -237,71 +234,169 @@ TEST(ReducerTest, ExprToConstantAndRemoveUnreferenced) {
ASSERT_EQ(status, Reducer::ReductionResultStatus::kComplete);
- CheckEqual(env, expected, binary_out);
+ CheckEqual(kEnv, expected, binary_out);
}
-TEST(ReducerTest, RemoveOpnameAndRemoveUnreferenced) {
- const std::string original = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %2 "main"
- OpExecutionMode %2 OriginUpperLeft
- OpSource ESSL 310
- OpName %2 "main"
- OpName %3 "a"
- OpName %4 "this-name-counts-as-usage-for-load-instruction"
- %5 = OpTypeVoid
- %6 = OpTypeFunction %5
- %7 = OpTypeFloat 32
- %8 = OpTypePointer Function %7
- %9 = OpConstant %7 1
- %2 = OpFunction %5 None %6
- %10 = OpLabel
- %3 = OpVariable %8 Function
- %4 = OpLoad %7 %3
- OpStore %3 %9
- OpReturn
- OpFunctionEnd
- )";
+bool InterestingWhileOpcodeExists(const std::vector<uint32_t>& binary,
+ uint32_t opcode, uint32_t count, bool dump) {
+ if (dump) {
+ std::stringstream ss;
+ ss << "temp_" << count << ".spv";
+ DumpShader(binary, ss.str().c_str());
+ }
+
+ std::unique_ptr<IRContext> context =
+ BuildModule(kEnv, kMessageConsumer, binary.data(), binary.size());
+ assert(context);
+ bool interesting = false;
+ for (auto& function : *context->module()) {
+ context->cfg()->ForEachBlockInPostOrder(
+ &*function.begin(), [opcode, &interesting](BasicBlock* block) -> void {
+ for (auto& inst : *block) {
+ if (inst.opcode() == opcode) {
+ interesting = true;
+ break;
+ }
+ }
+ });
+ if (interesting) {
+ break;
+ }
+ }
+ return interesting;
+}
+
+bool InterestingWhileIMulReachable(const std::vector<uint32_t>& binary,
+ uint32_t count) {
+ return InterestingWhileOpcodeExists(binary, SpvOpIMul, count, false);
+}
+
+bool InterestingWhileSDivReachable(const std::vector<uint32_t>& binary,
+ uint32_t count) {
+ return InterestingWhileOpcodeExists(binary, SpvOpSDiv, count, false);
+}
- const std::string expected = R"(
+// The shader below was derived from the following GLSL, and optimized.
+// #version 310 es
+// precision highp float;
+// layout(location = 0) out vec4 _GLF_color;
+// int foo() {
+// int x = 1;
+// int y;
+// x = y / x; // SDiv
+// return x;
+// }
+// void main() {
+// int c;
+// while (bool(c)) {
+// do {
+// if (bool(c)) {
+// if (bool(c)) {
+// ++c;
+// } else {
+// _GLF_color.x = float(c*c); // IMul
+// }
+// return;
+// }
+// } while(bool(foo()));
+// return;
+// }
+// }
+const std::string kShaderWithLoopsDivAndMul = R"(
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %2 "main"
- OpExecutionMode %2 OriginUpperLeft
+ OpEntryPoint Fragment %4 "main" %49
+ OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 310
- %5 = OpTypeVoid
- %6 = OpTypeFunction %5
- %7 = OpTypeFloat 32
- %8 = OpTypePointer Function %7
- %9 = OpConstant %7 1
- %2 = OpFunction %5 None %6
- %10 = OpLabel
+ OpName %4 "main"
+ OpName %49 "_GLF_color"
+ OpDecorate %49 Location 0
+ OpDecorate %52 RelaxedPrecision
+ OpDecorate %77 RelaxedPrecision
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %12 = OpConstant %6 1
+ %27 = OpTypeBool
+ %28 = OpTypeInt 32 0
+ %29 = OpConstant %28 0
+ %46 = OpTypeFloat 32
+ %47 = OpTypeVector %46 4
+ %48 = OpTypePointer Output %47
+ %49 = OpVariable %48 Output
+ %54 = OpTypePointer Output %46
+ %64 = OpConstantFalse %27
+ %67 = OpConstantTrue %27
+ %81 = OpUndef %6
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ OpBranch %61
+ %61 = OpLabel
+ OpLoopMerge %60 %63 None
+ OpBranch %20
+ %20 = OpLabel
+ %30 = OpINotEqual %27 %81 %29
+ OpLoopMerge %22 %23 None
+ OpBranchConditional %30 %21 %22
+ %21 = OpLabel
+ OpBranch %31
+ %31 = OpLabel
+ OpLoopMerge %33 %38 None
+ OpBranch %32
+ %32 = OpLabel
+ OpSelectionMerge %38 None
+ OpBranchConditional %30 %37 %38
+ %37 = OpLabel
+ OpSelectionMerge %42 None
+ OpBranchConditional %30 %41 %45
+ %41 = OpLabel
+ OpBranch %42
+ %45 = OpLabel
+ %52 = OpIMul %6 %81 %81
+ %53 = OpConvertSToF %46 %52
+ %55 = OpAccessChain %54 %49 %29
+ OpStore %55 %53
+ OpBranch %42
+ %42 = OpLabel
+ OpBranch %33
+ %38 = OpLabel
+ %77 = OpSDiv %6 %81 %12
+ %58 = OpINotEqual %27 %77 %29
+ OpBranchConditional %58 %31 %33
+ %33 = OpLabel
+ %86 = OpPhi %27 %67 %42 %64 %38
+ OpSelectionMerge %68 None
+ OpBranchConditional %86 %22 %68
+ %68 = OpLabel
+ OpBranch %22
+ %23 = OpLabel
+ OpBranch %20
+ %22 = OpLabel
+ %90 = OpPhi %27 %64 %20 %86 %33 %67 %68
+ OpSelectionMerge %70 None
+ OpBranchConditional %90 %60 %70
+ %70 = OpLabel
+ OpBranch %60
+ %63 = OpLabel
+ OpBranch %61
+ %60 = OpLabel
OpReturn
OpFunctionEnd
)";
- spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
- Reducer reducer(env);
- // Make ping-pong interesting very quickly, as there are not many
- // opportunities.
- PingPongInteresting ping_pong_interesting(1);
- reducer.SetMessageConsumer(NopDiagnostic);
- reducer.SetInterestingnessFunction(
- [&](const std::vector<uint32_t>& binary, uint32_t) -> bool {
- return ping_pong_interesting.IsInteresting(binary);
- });
- reducer.AddReductionPass(
- MakeUnique<RemoveOpNameInstructionReductionOpportunityFinder>());
- reducer.AddReductionPass(
- MakeUnique<RemoveUnreferencedInstructionReductionOpportunityFinder>());
+TEST(ReducerTest, ShaderReduceWhileMulReachable) {
+ Reducer reducer(kEnv);
+
+ reducer.SetInterestingnessFunction(InterestingWhileIMulReachable);
+ reducer.AddDefaultReductionPasses();
+ reducer.SetMessageConsumer(kMessageConsumer);
std::vector<uint32_t> binary_in;
- SpirvTools t(env);
+ SpirvTools t(kEnv);
- ASSERT_TRUE(t.Assemble(original, &binary_in, kReduceAssembleOption));
+ ASSERT_TRUE(
+ t.Assemble(kShaderWithLoopsDivAndMul, &binary_in, kReduceAssembleOption));
std::vector<uint32_t> binary_out;
spvtools::ReducerOptions reducer_options;
reducer_options.set_step_limit(500);
@@ -312,8 +407,30 @@ TEST(ReducerTest, RemoveOpnameAndRemoveUnreferenced) {
std::move(binary_in), &binary_out, reducer_options, validator_options);
ASSERT_EQ(status, Reducer::ReductionResultStatus::kComplete);
+}
+
+TEST(ReducerTest, ShaderReduceWhileDivReachable) {
+ Reducer reducer(kEnv);
+
+ reducer.SetInterestingnessFunction(InterestingWhileSDivReachable);
+ reducer.AddDefaultReductionPasses();
+ reducer.SetMessageConsumer(kMessageConsumer);
+
+ std::vector<uint32_t> binary_in;
+ SpirvTools t(kEnv);
+
+ ASSERT_TRUE(
+ t.Assemble(kShaderWithLoopsDivAndMul, &binary_in, kReduceAssembleOption));
+ std::vector<uint32_t> binary_out;
+ spvtools::ReducerOptions reducer_options;
+ reducer_options.set_step_limit(500);
+ reducer_options.set_fail_on_validation_error(true);
+ spvtools::ValidatorOptions validator_options;
- CheckEqual(env, expected, binary_out);
+ Reducer::ReductionResultStatus status = reducer.Run(
+ std::move(binary_in), &binary_out, reducer_options, validator_options);
+
+ ASSERT_EQ(status, Reducer::ReductionResultStatus::kComplete);
}
} // namespace
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/remove_opname_instruction_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/remove_opname_instruction_test.cpp
deleted file mode 100644
index 9d40cfcfb7f..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/remove_opname_instruction_test.cpp
+++ /dev/null
@@ -1,225 +0,0 @@
-// Copyright (c) 2018 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "source/reduce/remove_opname_instruction_reduction_opportunity_finder.h"
-
-#include "source/opt/build_module.h"
-#include "source/reduce/reduction_opportunity.h"
-#include "source/reduce/reduction_pass.h"
-#include "test/reduce/reduce_test_util.h"
-
-namespace spvtools {
-namespace reduce {
-namespace {
-
-TEST(RemoveOpnameInstructionReductionPassTest, NothingToRemove) {
- const std::string source = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main"
- OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- %2 = OpTypeVoid
- %3 = OpTypeFunction %2
- %4 = OpFunction %2 None %3
- %5 = OpLabel
- OpReturn
- OpFunctionEnd
- )";
-
- const auto env = SPV_ENV_UNIVERSAL_1_3;
- const auto consumer = nullptr;
- const auto context =
- BuildModule(env, consumer, source, kReduceAssembleOption);
- const auto ops = RemoveOpNameInstructionReductionOpportunityFinder()
- .GetAvailableOpportunities(context.get());
- ASSERT_EQ(0, ops.size());
-}
-
-TEST(RemoveOpnameInstructionReductionPassTest, RemoveSingleOpName) {
- const std::string prologue = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main"
- OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- )";
-
- const std::string epilogue = R"(
- %2 = OpTypeVoid
- %3 = OpTypeFunction %2
- %4 = OpFunction %2 None %3
- %5 = OpLabel
- OpReturn
- OpFunctionEnd
- )";
-
- const std::string original = prologue + R"(
- OpName %4 "main"
- )" + epilogue;
-
- const std::string expected = prologue + epilogue;
-
- const auto env = SPV_ENV_UNIVERSAL_1_3;
- const auto consumer = nullptr;
- const auto context =
- BuildModule(env, consumer, original, kReduceAssembleOption);
- const auto ops = RemoveOpNameInstructionReductionOpportunityFinder()
- .GetAvailableOpportunities(context.get());
- ASSERT_EQ(1, ops.size());
- ASSERT_TRUE(ops[0]->PreconditionHolds());
- ops[0]->TryToApply();
-
- CheckEqual(env, expected, context.get());
-}
-
-TEST(RemoveOpnameInstructionReductionPassTest, TryApplyRemovesAllOpName) {
- const std::string prologue = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main"
- OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- )";
-
- const std::string epilogue = R"(
- %2 = OpTypeVoid
- %3 = OpTypeFunction %2
- %6 = OpTypeFloat 32
- %7 = OpTypePointer Function %6
- %9 = OpConstant %6 1
- %4 = OpFunction %2 None %3
- %5 = OpLabel
- %8 = OpVariable %7 Function
- %10 = OpVariable %7 Function
- %11 = OpVariable %7 Function
- %12 = OpVariable %7 Function
- OpStore %8 %9
- OpStore %10 %9
- OpStore %11 %9
- OpStore %12 %9
- OpReturn
- OpFunctionEnd
- )";
-
- const std::string original = prologue + R"(
- OpName %4 "main"
- OpName %8 "a"
- OpName %10 "b"
- OpName %11 "c"
- OpName %12 "d"
- )" + epilogue;
-
- const std::string expected = prologue + epilogue;
-
- const auto env = SPV_ENV_UNIVERSAL_1_3;
-
- {
- // Check the right number of opportunities is detected
- const auto consumer = nullptr;
- const auto context =
- BuildModule(env, consumer, original, kReduceAssembleOption);
- const auto ops = RemoveOpNameInstructionReductionOpportunityFinder()
- .GetAvailableOpportunities(context.get());
- ASSERT_EQ(5, ops.size());
- }
-
- {
- // The reduction should remove all OpName
- std::vector<uint32_t> binary;
- SpirvTools t(env);
- ASSERT_TRUE(t.Assemble(original, &binary, kReduceAssembleOption));
- auto reduced_binary =
- ReductionPass(env,
- spvtools::MakeUnique<
- RemoveOpNameInstructionReductionOpportunityFinder>())
- .TryApplyReduction(binary);
- CheckEqual(env, expected, reduced_binary);
- }
-}
-
-TEST(RemoveOpnameInstructionReductionPassTest,
- TryApplyRemovesAllOpNameAndOpMemberName) {
- const std::string prologue = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main"
- OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- )";
-
- const std::string epilogue = R"(
- %2 = OpTypeVoid
- %3 = OpTypeFunction %2
- %6 = OpTypeFloat 32
- %7 = OpTypeInt 32 1
- %8 = OpTypeVector %6 3
- %9 = OpTypeStruct %6 %7 %8
- %10 = OpTypePointer Function %9
- %12 = OpConstant %7 0
- %13 = OpConstant %6 1
- %14 = OpTypePointer Function %6
- %4 = OpFunction %2 None %3
- %5 = OpLabel
- %11 = OpVariable %10 Function
- %15 = OpAccessChain %14 %11 %12
- OpStore %15 %13
- OpReturn
- OpFunctionEnd
- )";
-
- const std::string original = prologue + R"(
- OpName %4 "main"
- OpName %9 "S"
- OpMemberName %9 0 "f"
- OpMemberName %9 1 "i"
- OpMemberName %9 2 "v"
- OpName %11 "s"
- )" + epilogue;
-
- const std::string expected = prologue + epilogue;
-
- const auto env = SPV_ENV_UNIVERSAL_1_3;
-
- {
- // Check the right number of opportunities is detected
- const auto consumer = nullptr;
- const auto context =
- BuildModule(env, consumer, original, kReduceAssembleOption);
- const auto ops = RemoveOpNameInstructionReductionOpportunityFinder()
- .GetAvailableOpportunities(context.get());
- ASSERT_EQ(6, ops.size());
- }
-
- {
- // The reduction should remove all OpName
- std::vector<uint32_t> binary;
- SpirvTools t(env);
- ASSERT_TRUE(t.Assemble(original, &binary, kReduceAssembleOption));
- auto reduced_binary =
- ReductionPass(env,
- spvtools::MakeUnique<
- RemoveOpNameInstructionReductionOpportunityFinder>())
- .TryApplyReduction(binary);
- CheckEqual(env, expected, reduced_binary);
- }
-}
-
-} // namespace
-} // namespace reduce
-} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/remove_relaxed_precision_decoration_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/remove_relaxed_precision_decoration_test.cpp
deleted file mode 100644
index f9ff081ccdd..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/remove_relaxed_precision_decoration_test.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-// Copyright (c) 2019 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "source/reduce/remove_relaxed_precision_decoration_opportunity_finder.h"
-
-#include "source/opt/build_module.h"
-#include "source/reduce/reduction_opportunity.h"
-#include "source/reduce/reduction_pass.h"
-#include "test/reduce/reduce_test_util.h"
-
-namespace spvtools {
-namespace reduce {
-namespace {
-
-TEST(RemoveRelaxedPrecisionDecorationTest, NothingToRemove) {
- const std::string source = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main"
- OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- %2 = OpTypeVoid
- %3 = OpTypeFunction %2
- %4 = OpFunction %2 None %3
- %5 = OpLabel
- OpReturn
- OpFunctionEnd
- )";
-
- const auto env = SPV_ENV_UNIVERSAL_1_3;
- const auto consumer = nullptr;
- const auto context =
- BuildModule(env, consumer, source, kReduceAssembleOption);
- const auto ops = RemoveRelaxedPrecisionDecorationOpportunityFinder()
- .GetAvailableOpportunities(context.get());
- ASSERT_EQ(0, ops.size());
-}
-
-TEST(RemoveRelaxedPrecisionDecorationTest, RemoveDecorations) {
- const std::string source = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main"
- OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- OpName %4 "main"
- OpName %8 "f"
- OpName %12 "i"
- OpName %16 "v"
- OpName %19 "S"
- OpMemberName %19 0 "a"
- OpMemberName %19 1 "b"
- OpMemberName %19 2 "c"
- OpName %21 "s"
- OpDecorate %8 RelaxedPrecision
- OpDecorate %12 RelaxedPrecision
- OpDecorate %16 RelaxedPrecision
- OpDecorate %17 RelaxedPrecision
- OpDecorate %18 RelaxedPrecision
- OpMemberDecorate %19 0 RelaxedPrecision
- OpMemberDecorate %19 1 RelaxedPrecision
- OpMemberDecorate %19 2 RelaxedPrecision
- OpDecorate %22 RelaxedPrecision
- OpDecorate %23 RelaxedPrecision
- OpDecorate %24 RelaxedPrecision
- %2 = OpTypeVoid
- %3 = OpTypeFunction %2
- %6 = OpTypeFloat 32
- %7 = OpTypePointer Function %6
- %9 = OpConstant %6 2
- %10 = OpTypeInt 32 1
- %11 = OpTypePointer Function %10
- %13 = OpConstant %10 22
- %14 = OpTypeVector %6 2
- %15 = OpTypePointer Function %14
- %19 = OpTypeStruct %10 %6 %14
- %20 = OpTypePointer Function %19
- %4 = OpFunction %2 None %3
- %5 = OpLabel
- %8 = OpVariable %7 Function
- %12 = OpVariable %11 Function
- %16 = OpVariable %15 Function
- %21 = OpVariable %20 Function
- OpStore %8 %9
- OpStore %12 %13
- %17 = OpLoad %6 %8
- %18 = OpCompositeConstruct %14 %17 %17
- OpStore %16 %18
- %22 = OpLoad %10 %12
- %23 = OpLoad %6 %8
- %24 = OpLoad %14 %16
- %25 = OpCompositeConstruct %19 %22 %23 %24
- OpStore %21 %25
- OpReturn
- OpFunctionEnd
- )";
-
- const auto env = SPV_ENV_UNIVERSAL_1_3;
- const auto consumer = nullptr;
- const auto context =
- BuildModule(env, consumer, source, kReduceAssembleOption);
- const auto ops = RemoveRelaxedPrecisionDecorationOpportunityFinder()
- .GetAvailableOpportunities(context.get());
- ASSERT_EQ(11, ops.size());
-
- for (auto& op : ops) {
- ASSERT_TRUE(op->PreconditionHolds());
- op->TryToApply();
- }
-
- const std::string expected = R"(
- OpCapability Shader
- %1 = OpExtInstImport "GLSL.std.450"
- OpMemoryModel Logical GLSL450
- OpEntryPoint Fragment %4 "main"
- OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- OpName %4 "main"
- OpName %8 "f"
- OpName %12 "i"
- OpName %16 "v"
- OpName %19 "S"
- OpMemberName %19 0 "a"
- OpMemberName %19 1 "b"
- OpMemberName %19 2 "c"
- OpName %21 "s"
- %2 = OpTypeVoid
- %3 = OpTypeFunction %2
- %6 = OpTypeFloat 32
- %7 = OpTypePointer Function %6
- %9 = OpConstant %6 2
- %10 = OpTypeInt 32 1
- %11 = OpTypePointer Function %10
- %13 = OpConstant %10 22
- %14 = OpTypeVector %6 2
- %15 = OpTypePointer Function %14
- %19 = OpTypeStruct %10 %6 %14
- %20 = OpTypePointer Function %19
- %4 = OpFunction %2 None %3
- %5 = OpLabel
- %8 = OpVariable %7 Function
- %12 = OpVariable %11 Function
- %16 = OpVariable %15 Function
- %21 = OpVariable %20 Function
- OpStore %8 %9
- OpStore %12 %13
- %17 = OpLoad %6 %8
- %18 = OpCompositeConstruct %14 %17 %17
- OpStore %16 %18
- %22 = OpLoad %10 %12
- %23 = OpLoad %6 %8
- %24 = OpLoad %14 %16
- %25 = OpCompositeConstruct %19 %22 %23 %24
- OpStore %21 %25
- OpReturn
- OpFunctionEnd
- )";
-
- CheckEqual(env, expected, context.get());
-}
-
-} // namespace
-} // namespace reduce
-} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/remove_unreferenced_instruction_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/remove_unreferenced_instruction_test.cpp
index 0babf781a29..3caf88cfe0e 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/remove_unreferenced_instruction_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/reduce/remove_unreferenced_instruction_test.cpp
@@ -23,19 +23,26 @@ namespace spvtools {
namespace reduce {
namespace {
+const spv_target_env kEnv = SPV_ENV_UNIVERSAL_1_3;
+
TEST(RemoveUnreferencedInstructionReductionPassTest, RemoveStores) {
- const std::string prologue = R"(
+ // A module with some unused instructions, including some unused OpStore
+ // instructions.
+
+ RemoveUnreferencedInstructionReductionOpportunityFinder finder(true);
+
+ const std::string original = R"(
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main"
OpExecutionMode %4 OriginUpperLeft
- OpSource ESSL 310
- OpName %4 "main"
- OpName %8 "a"
- OpName %10 "b"
- OpName %12 "c"
- OpName %14 "d"
+ OpSource ESSL 310 ; 0
+ OpName %4 "main" ; 1
+ OpName %8 "a" ; 2
+ OpName %10 "b" ; 3
+ OpName %12 "c" ; 4
+ OpName %14 "d" ; 5
%2 = OpTypeVoid
%3 = OpTypeFunction %2
%6 = OpTypeInt 32 1
@@ -49,51 +56,323 @@ TEST(RemoveUnreferencedInstructionReductionPassTest, RemoveStores) {
%10 = OpVariable %7 Function
%12 = OpVariable %7 Function
%14 = OpVariable %7 Function
+ OpStore %8 %9 ; 6
+ OpStore %10 %11 ; 7
+ OpStore %12 %13 ; 8
+ %15 = OpLoad %6 %8
+ OpStore %14 %15 ; 9
+ OpReturn
+ OpFunctionEnd
+
)";
- const std::string epilogue = R"(
+ const MessageConsumer consumer = nullptr;
+ const auto context =
+ BuildModule(kEnv, consumer, original, kReduceAssembleOption);
+
+ CheckValid(kEnv, context.get());
+
+ auto ops = finder.GetAvailableOpportunities(context.get());
+
+ ASSERT_EQ(10, ops.size());
+
+ for (auto& op : ops) {
+ ASSERT_TRUE(op->PreconditionHolds());
+ op->TryToApply();
+ CheckValid(kEnv, context.get());
+ }
+
+ const std::string step_2 = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %9 = OpConstant %6 10 ; 0
+ %11 = OpConstant %6 20 ; 1
+ %13 = OpConstant %6 30 ; 2
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %10 = OpVariable %7 Function ; 3
+ %12 = OpVariable %7 Function ; 4
+ %14 = OpVariable %7 Function ; 5
+ %15 = OpLoad %6 %8 ; 6
OpReturn
OpFunctionEnd
)";
- const std::string original = prologue + R"(
- OpStore %8 %9
- OpStore %10 %11
- OpStore %12 %13
- %15 = OpLoad %6 %8
- OpStore %14 %15
- )" + epilogue;
+ CheckEqual(kEnv, step_2, context.get());
- const std::string expected_after_2 = prologue + R"(
- OpStore %12 %13
- %15 = OpLoad %6 %8
- OpStore %14 %15
- )" + epilogue;
+ ops = finder.GetAvailableOpportunities(context.get());
- const std::string expected_after_4 = prologue + R"(
- %15 = OpLoad %6 %8
- )" + epilogue;
+ ASSERT_EQ(7, ops.size());
- const auto env = SPV_ENV_UNIVERSAL_1_3;
- const auto consumer = nullptr;
- const auto context =
- BuildModule(env, consumer, original, kReduceAssembleOption);
- const auto ops = RemoveUnreferencedInstructionReductionOpportunityFinder()
- .GetAvailableOpportunities(context.get());
- ASSERT_EQ(4, ops.size());
- ASSERT_TRUE(ops[0]->PreconditionHolds());
- ops[0]->TryToApply();
- ASSERT_TRUE(ops[1]->PreconditionHolds());
- ops[1]->TryToApply();
-
- CheckEqual(env, expected_after_2, context.get());
-
- ASSERT_TRUE(ops[2]->PreconditionHolds());
- ops[2]->TryToApply();
- ASSERT_TRUE(ops[3]->PreconditionHolds());
- ops[3]->TryToApply();
-
- CheckEqual(env, expected_after_4, context.get());
+ for (auto& op : ops) {
+ ASSERT_TRUE(op->PreconditionHolds());
+ op->TryToApply();
+ CheckValid(kEnv, context.get());
+ }
+
+ const std::string step_3 = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function ; 0
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CheckEqual(kEnv, step_3, context.get());
+
+ ops = finder.GetAvailableOpportunities(context.get());
+
+ ASSERT_EQ(1, ops.size());
+
+ for (auto& op : ops) {
+ ASSERT_TRUE(op->PreconditionHolds());
+ op->TryToApply();
+ CheckValid(kEnv, context.get());
+ }
+
+ const std::string step_4 = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6 ; 0
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CheckEqual(kEnv, step_4, context.get());
+
+ ops = finder.GetAvailableOpportunities(context.get());
+
+ ASSERT_EQ(1, ops.size());
+
+ for (auto& op : ops) {
+ ASSERT_TRUE(op->PreconditionHolds());
+ op->TryToApply();
+ CheckValid(kEnv, context.get());
+ }
+
+ const std::string step_5 = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1 ; 0
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CheckEqual(kEnv, step_5, context.get());
+
+ ops = finder.GetAvailableOpportunities(context.get());
+
+ ASSERT_EQ(1, ops.size());
+
+ for (auto& op : ops) {
+ ASSERT_TRUE(op->PreconditionHolds());
+ op->TryToApply();
+ CheckValid(kEnv, context.get());
+ }
+
+ const std::string step_6 = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CheckEqual(kEnv, step_6, context.get());
+
+ ops = finder.GetAvailableOpportunities(context.get());
+
+ ASSERT_EQ(0, ops.size());
+}
+
+TEST(RemoveUnreferencedInstructionReductionPassTest, Referenced) {
+ // A module with some unused global variables, constants, and types. Some will
+ // not be removed initially because of the OpDecorate instructions.
+
+ RemoveUnreferencedInstructionReductionOpportunityFinder finder(true);
+
+ const std::string shader = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310 ; 1
+ OpName %4 "main" ; 2
+ OpName %12 "a" ; 3
+ OpDecorate %12 RelaxedPrecision ; 4
+ OpDecorate %13 RelaxedPrecision ; 5
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeBool
+ %7 = OpConstantTrue %6 ; 6
+ %10 = OpTypeInt 32 1
+ %11 = OpTypePointer Private %10
+ %12 = OpVariable %11 Private
+ %13 = OpConstant %10 1
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ auto context = BuildModule(kEnv, nullptr, shader, kReduceAssembleOption);
+
+ CheckValid(kEnv, context.get());
+
+ auto ops = finder.GetAvailableOpportunities(context.get());
+
+ ASSERT_EQ(6, ops.size());
+
+ for (auto& op : ops) {
+ ASSERT_TRUE(op->PreconditionHolds());
+ op->TryToApply();
+ CheckValid(kEnv, context.get());
+ }
+
+ std::string after = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeBool ; 1
+ %10 = OpTypeInt 32 1
+ %11 = OpTypePointer Private %10
+ %12 = OpVariable %11 Private ; 2
+ %13 = OpConstant %10 1 ; 3
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CheckEqual(kEnv, after, context.get());
+
+ ops = finder.GetAvailableOpportunities(context.get());
+
+ ASSERT_EQ(3, ops.size());
+
+ for (auto& op : ops) {
+ ASSERT_TRUE(op->PreconditionHolds());
+ op->TryToApply();
+ CheckValid(kEnv, context.get());
+ }
+
+ std::string after_2 = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %10 = OpTypeInt 32 1
+ %11 = OpTypePointer Private %10 ; 1
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CheckEqual(kEnv, after_2, context.get());
+
+ ops = finder.GetAvailableOpportunities(context.get());
+
+ ASSERT_EQ(1, ops.size());
+
+ for (auto& op : ops) {
+ ASSERT_TRUE(op->PreconditionHolds());
+ op->TryToApply();
+ CheckValid(kEnv, context.get());
+ }
+
+ std::string after_3 = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %10 = OpTypeInt 32 1 ; 1
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CheckEqual(kEnv, after_3, context.get());
+
+ ops = finder.GetAvailableOpportunities(context.get());
+
+ ASSERT_EQ(1, ops.size());
+
+ for (auto& op : ops) {
+ ASSERT_TRUE(op->PreconditionHolds());
+ op->TryToApply();
+ CheckValid(kEnv, context.get());
+ }
+
+ std::string after_4 = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main"
+ OpExecutionMode %4 OriginUpperLeft
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CheckEqual(kEnv, after_4, context.get());
+
+ ops = finder.GetAvailableOpportunities(context.get());
+
+ ASSERT_EQ(0, ops.size());
}
} // namespace
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/util/CMakeLists.txt b/3rdparty/bgfx/3rdparty/spirv-tools/test/util/CMakeLists.txt
index 8cdb35f4256..6679dba7c6a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/util/CMakeLists.txt
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/util/CMakeLists.txt
@@ -15,6 +15,7 @@
add_spvtools_unittest(TARGET utils
SRCS ilist_test.cpp
bit_vector_test.cpp
+ bitutils_test.cpp
small_vector_test.cpp
LIBS SPIRV-Tools-opt
)
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/util/bitutils_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/util/bitutils_test.cpp
new file mode 100644
index 00000000000..3be7ed26910
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/util/bitutils_test.cpp
@@ -0,0 +1,193 @@
+// Copyright (c) 2019 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/util/bitutils.h"
+
+#include "gmock/gmock.h"
+
+namespace spvtools {
+namespace utils {
+namespace {
+
+using BitUtilsTest = ::testing::Test;
+
+TEST(BitUtilsTest, MutateBitsWholeWord) {
+ const uint32_t zero_u32 = 0;
+ const uint32_t max_u32 = ~0;
+
+ EXPECT_EQ(MutateBits(zero_u32, 0, 0, false), zero_u32);
+ EXPECT_EQ(MutateBits(max_u32, 0, 0, false), max_u32);
+ EXPECT_EQ(MutateBits(zero_u32, 0, 32, false), zero_u32);
+ EXPECT_EQ(MutateBits(zero_u32, 0, 32, true), max_u32);
+ EXPECT_EQ(MutateBits(max_u32, 0, 32, true), max_u32);
+ EXPECT_EQ(MutateBits(max_u32, 0, 32, false), zero_u32);
+}
+
+TEST(BitUtilsTest, MutateBitsLow) {
+ const uint32_t zero_u32 = 0;
+ const uint32_t one_u32 = 1;
+ const uint32_t max_u32 = ~0;
+
+ EXPECT_EQ(MutateBits(zero_u32, 0, 1, false), zero_u32);
+ EXPECT_EQ(MutateBits(zero_u32, 0, 1, true), one_u32);
+ EXPECT_EQ(MutateBits(max_u32, 0, 1, true), max_u32);
+ EXPECT_EQ(MutateBits(one_u32, 0, 32, false), zero_u32);
+ EXPECT_EQ(MutateBits(one_u32, 0, 1, true), one_u32);
+ EXPECT_EQ(MutateBits(one_u32, 0, 1, false), zero_u32);
+ EXPECT_EQ(MutateBits(zero_u32, 0, 3, true), uint32_t(7));
+ EXPECT_EQ(MutateBits(uint32_t(7), 0, 2, false), uint32_t(4));
+}
+
+TEST(BitUtilsTest, MutateBitsHigh) {
+ const uint8_t zero_u8 = 0;
+ const uint8_t one_u8 = 1;
+ const uint8_t max_u8 = 255;
+
+ EXPECT_EQ(MutateBits(zero_u8, 7, 0, true), zero_u8);
+ EXPECT_EQ(MutateBits(zero_u8, 7, 1, true), uint8_t(128));
+ EXPECT_EQ(MutateBits(one_u8, 7, 1, true), uint8_t(129));
+ EXPECT_EQ(MutateBits(max_u8, 7, 1, true), max_u8);
+ EXPECT_EQ(MutateBits(max_u8, 7, 1, false), uint8_t(127));
+ EXPECT_EQ(MutateBits(max_u8, 6, 2, true), max_u8);
+ EXPECT_EQ(MutateBits(max_u8, 6, 2, false), uint8_t(63));
+}
+
+TEST(BitUtilsTest, MutateBitsUint8Mid) {
+ const uint8_t zero_u8 = 0;
+ const uint8_t max_u8 = 255;
+
+ EXPECT_EQ(MutateBits(zero_u8, 1, 2, true), uint8_t(6));
+ EXPECT_EQ(MutateBits(max_u8, 1, 2, true), max_u8);
+ EXPECT_EQ(MutateBits(max_u8, 1, 2, false), uint8_t(0xF9));
+ EXPECT_EQ(MutateBits(zero_u8, 2, 3, true), uint8_t(0x1C));
+}
+
+TEST(BitUtilsTest, MutateBitsUint64Mid) {
+ const uint64_t zero_u64 = 0;
+ const uint64_t max_u64 = ~zero_u64;
+
+ EXPECT_EQ(MutateBits(zero_u64, 1, 2, true), uint64_t(6));
+ EXPECT_EQ(MutateBits(max_u64, 1, 2, true), max_u64);
+ EXPECT_EQ(MutateBits(max_u64, 1, 2, false), uint64_t(0xFFFFFFFFFFFFFFF9));
+ EXPECT_EQ(MutateBits(zero_u64, 2, 3, true), uint64_t(0x000000000000001C));
+ EXPECT_EQ(MutateBits(zero_u64, 2, 35, true), uint64_t(0x0000001FFFFFFFFC));
+ EXPECT_EQ(MutateBits(zero_u64, 36, 4, true), uint64_t(0x000000F000000000));
+ EXPECT_EQ(MutateBits(max_u64, 36, 4, false), uint64_t(0xFFFFFF0FFFFFFFFF));
+}
+
+TEST(BitUtilsTest, SetHighBitsUint32) {
+ const uint32_t zero_u32 = 0;
+ const uint32_t one_u32 = 1;
+ const uint32_t max_u32 = ~zero_u32;
+
+ EXPECT_EQ(SetHighBits(zero_u32, 0), zero_u32);
+ EXPECT_EQ(SetHighBits(zero_u32, 1), 0x80000000);
+ EXPECT_EQ(SetHighBits(one_u32, 1), 0x80000001);
+ EXPECT_EQ(SetHighBits(one_u32, 2), 0xC0000001);
+ EXPECT_EQ(SetHighBits(zero_u32, 31), 0xFFFFFFFE);
+ EXPECT_EQ(SetHighBits(zero_u32, 32), max_u32);
+ EXPECT_EQ(SetHighBits(max_u32, 32), max_u32);
+}
+
+TEST(BitUtilsTest, ClearHighBitsUint32) {
+ const uint32_t zero_u32 = 0;
+ const uint32_t one_u32 = 1;
+ const uint32_t max_u32 = ~zero_u32;
+
+ EXPECT_EQ(ClearHighBits(zero_u32, 0), zero_u32);
+ EXPECT_EQ(ClearHighBits(zero_u32, 1), zero_u32);
+ EXPECT_EQ(ClearHighBits(one_u32, 1), one_u32);
+ EXPECT_EQ(ClearHighBits(one_u32, 31), one_u32);
+ EXPECT_EQ(ClearHighBits(one_u32, 32), zero_u32);
+ EXPECT_EQ(ClearHighBits(max_u32, 0), max_u32);
+ EXPECT_EQ(ClearHighBits(max_u32, 1), 0x7FFFFFFF);
+ EXPECT_EQ(ClearHighBits(max_u32, 2), 0x3FFFFFFF);
+ EXPECT_EQ(ClearHighBits(max_u32, 31), one_u32);
+ EXPECT_EQ(ClearHighBits(max_u32, 32), zero_u32);
+}
+
+TEST(BitUtilsTest, IsBitSetAtPositionZero) {
+ const uint32_t zero_u32 = 0;
+ for (size_t i = 0; i != 32; ++i) {
+ EXPECT_FALSE(IsBitAtPositionSet(zero_u32, i));
+ }
+
+ const uint8_t zero_u8 = 0;
+ for (size_t i = 0; i != 8; ++i) {
+ EXPECT_FALSE(IsBitAtPositionSet(zero_u8, i));
+ }
+
+ const uint64_t zero_u64 = 0;
+ for (size_t i = 0; i != 64; ++i) {
+ EXPECT_FALSE(IsBitAtPositionSet(zero_u64, i));
+ }
+}
+
+TEST(BitUtilsTest, IsBitSetAtPositionOne) {
+ const uint32_t one_u32 = 1;
+ for (size_t i = 0; i != 32; ++i) {
+ if (i == 0) {
+ EXPECT_TRUE(IsBitAtPositionSet(one_u32, i));
+ } else {
+ EXPECT_FALSE(IsBitAtPositionSet(one_u32, i));
+ }
+ }
+
+ const uint32_t two_to_17_u32 = 1 << 17;
+ for (size_t i = 0; i != 32; ++i) {
+ if (i == 17) {
+ EXPECT_TRUE(IsBitAtPositionSet(two_to_17_u32, i));
+ } else {
+ EXPECT_FALSE(IsBitAtPositionSet(two_to_17_u32, i));
+ }
+ }
+
+ const uint8_t two_to_4_u8 = 1 << 4;
+ for (size_t i = 0; i != 8; ++i) {
+ if (i == 4) {
+ EXPECT_TRUE(IsBitAtPositionSet(two_to_4_u8, i));
+ } else {
+ EXPECT_FALSE(IsBitAtPositionSet(two_to_4_u8, i));
+ }
+ }
+
+ const uint64_t two_to_55_u64 = uint64_t(1) << 55;
+ for (size_t i = 0; i != 64; ++i) {
+ if (i == 55) {
+ EXPECT_TRUE(IsBitAtPositionSet(two_to_55_u64, i));
+ } else {
+ EXPECT_FALSE(IsBitAtPositionSet(two_to_55_u64, i));
+ }
+ }
+}
+
+TEST(BitUtilsTest, IsBitSetAtPositionAll) {
+ const uint32_t max_u32 = ~0;
+ for (size_t i = 0; i != 32; ++i) {
+ EXPECT_TRUE(IsBitAtPositionSet(max_u32, i));
+ }
+
+ const uint32_t max_u8 = ~uint8_t(0);
+ for (size_t i = 0; i != 8; ++i) {
+ EXPECT_TRUE(IsBitAtPositionSet(max_u8, i));
+ }
+
+ const uint64_t max_u64 = ~uint64_t(0);
+ for (size_t i = 0; i != 64; ++i) {
+ EXPECT_TRUE(IsBitAtPositionSet(max_u64, i));
+ }
+}
+} // namespace
+} // namespace utils
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_cfg_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_cfg_test.cpp
index 547eb578f66..f06f36c14b7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_cfg_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_cfg_test.cpp
@@ -3026,6 +3026,7 @@ OpMemoryModel Logical GLSL450
%undef = OpUndef %bool
%func = OpFunction %void None %void_fn
%entry = OpLabel
+OpSelectionMerge %block None
OpBranchConditional %undef %block %unreachable
%block = OpLabel
OpReturn
@@ -3049,6 +3050,7 @@ OpMemoryModel Logical GLSL450
%undef = OpUndef %int
%func = OpFunction %void None %void_fn
%entry = OpLabel
+OpSelectionMerge %block1 None
OpSwitch %undef %block1 0 %unreachable 1 %block2
%block1 = OpLabel
OpReturn
@@ -3748,7 +3750,355 @@ OpFunctionEnd
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
}
-/// TODO(umar): Nested CFG constructs
+TEST_F(ValidateCFG, MissingMergeConditionalBranchBad) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%bool = OpTypeBool
+%undef = OpUndef %bool
+%func = OpFunction %void None %void_fn
+%entry = OpLabel
+OpBranchConditional %undef %then %else
+%then = OpLabel
+OpReturn
+%else = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Selection must be structured"));
+}
+
+TEST_F(ValidateCFG, MissingMergeSwitchBad) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%int = OpTypeInt 32 0
+%undef = OpUndef %int
+%func = OpFunction %void None %void_fn
+%entry = OpLabel
+OpSwitch %undef %then 0 %else
+%then = OpLabel
+OpReturn
+%else = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Selection must be structured"));
+}
+
+TEST_F(ValidateCFG, MissingMergeSwitchBad2) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%int = OpTypeInt 32 0
+%undef = OpUndef %int
+%func = OpFunction %void None %void_fn
+%entry = OpLabel
+OpSwitch %undef %then 0 %then 1 %then 2 %else
+%then = OpLabel
+OpReturn
+%else = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Selection must be structured"));
+}
+
+TEST_F(ValidateCFG, MissingMergeOneBranchToMergeGood) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%bool = OpTypeBool
+%undef = OpUndef %bool
+%func = OpFunction %void None %void_fn
+%entry = OpLabel
+OpSelectionMerge %b3 None
+OpBranchConditional %undef %b1 %b2
+%b1 = OpLabel
+OpBranchConditional %undef %b2 %b3
+%b2 = OpLabel
+OpBranch %b3
+%b3 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateCFG, MissingMergeSameTargetConditionalBranchGood) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%bool = OpTypeBool
+%undef = OpUndef %bool
+%func = OpFunction %void None %void_fn
+%entry = OpLabel
+OpBranchConditional %undef %then %then
+%then = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateCFG, MissingMergeOneTargetSwitchGood) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%int = OpTypeInt 32 0
+%undef = OpUndef %int
+%func = OpFunction %void None %void_fn
+%entry = OpLabel
+OpSwitch %undef %then 0 %then 1 %then
+%then = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateCFG, MissingMergeOneUnseenTargetSwitchGood) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%int = OpTypeInt 32 0
+%undef_int = OpUndef %int
+%bool = OpTypeBool
+%undef_bool = OpUndef %bool
+%func = OpFunction %void None %void_fn
+%entry = OpLabel
+OpSelectionMerge %merge None
+OpBranchConditional %undef_bool %merge %b1
+%b1 = OpLabel
+OpSwitch %undef_int %b2 0 %b2 1 %merge 2 %b2
+%b2 = OpLabel
+OpBranch %merge
+%merge = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateCFG, MissingMergeLoopBreakGood) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%bool = OpTypeBool
+%undef = OpUndef %bool
+%func = OpFunction %void None %void_fn
+%entry = OpLabel
+OpBranch %loop
+%loop = OpLabel
+OpLoopMerge %exit %continue None
+OpBranch %body
+%body = OpLabel
+OpBranchConditional %undef %body2 %exit
+%body2 = OpLabel
+OpBranch %continue
+%continue = OpLabel
+OpBranch %loop
+%exit = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateCFG, MissingMergeLoopContinueGood) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%bool = OpTypeBool
+%undef = OpUndef %bool
+%func = OpFunction %void None %void_fn
+%entry = OpLabel
+OpBranch %loop
+%loop = OpLabel
+OpLoopMerge %exit %continue None
+OpBranch %body
+%body = OpLabel
+OpBranchConditional %undef %body2 %continue
+%body2 = OpLabel
+OpBranch %continue
+%continue = OpLabel
+OpBranch %loop
+%exit = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateCFG, MissingMergeSwitchBreakGood) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%bool = OpTypeBool
+%undef = OpUndef %bool
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%func = OpFunction %void None %void_fn
+%entry = OpLabel
+OpSelectionMerge %merge None
+OpSwitch %int_0 %merge 1 %b1
+%b1 = OpLabel
+OpBranchConditional %undef %merge %b2
+%b2 = OpLabel
+OpBranch %merge
+%merge = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateCFG, MissingMergeSwitchFallThroughGood) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%bool = OpTypeBool
+%undef = OpUndef %bool
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%func = OpFunction %void None %void_fn
+%entry = OpLabel
+OpSelectionMerge %merge None
+OpSwitch %int_0 %b1 1 %b2
+%b1 = OpLabel
+OpBranchConditional %undef %b3 %b2
+%b2 = OpLabel
+OpBranch %merge
+%b3 = OpLabel
+OpBranch %merge
+%merge = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateCFG, MissingMergeInALoopBad) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%bool = OpTypeBool
+%undef = OpUndef %bool
+%func = OpFunction %void None %void_fn
+%entry = OpLabel
+OpBranch %loop
+%loop = OpLabel
+OpLoopMerge %exit %continue None
+OpBranch %body
+%body = OpLabel
+OpBranchConditional %undef %b1 %b2
+%b1 = OpLabel
+OpBranch %exit
+%b2 = OpLabel
+OpBranch %continue
+%continue = OpLabel
+OpBranch %loop
+%exit = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Selection must be structured"));
+}
+
+TEST_F(ValidateCFG, MissingMergeCrissCrossBad) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%bool = OpTypeBool
+%undef = OpUndef %bool
+%func = OpFunction %void None %void_fn
+%entry = OpLabel
+OpSelectionMerge %merge None
+OpBranchConditional %undef %b1 %b2
+%b1 = OpLabel
+OpBranchConditional %undef %b3 %b4
+%b2 = OpLabel
+OpBranchConditional %undef %b3 %b4
+%b3 = OpLabel
+OpBranch %merge
+%b4 = OpLabel
+OpBranch %merge
+%merge = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_ERROR_INVALID_CFG, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Selection must be structured"));
+}
} // namespace
} // namespace val
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_composites_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_composites_test.cpp
index 74b6f2095a9..e9705621109 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_composites_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_composites_test.cpp
@@ -648,7 +648,6 @@ TEST_F(ValidateComposites, CompositeExtractSuccess) {
%val16 = OpCompositeExtract %f32 %struct 4 1000 1
%val17 = OpCompositeExtract %f32 %struct 5 0
%val18 = OpCompositeExtract %u32 %struct 5 1
-%val19 = OpCompositeExtract %big_struct %struct
)";
CompileSuccessfully(GenerateShaderCode(body));
@@ -767,6 +766,18 @@ TEST_F(ValidateComposites, CompositeExtractTooManyIndices) {
"indexes still remain to be traversed."));
}
+TEST_F(ValidateComposites, CompositeExtractNoIndices) {
+ const std::string body = R"(
+%struct = OpLoad %big_struct %var_big_struct
+%val1 = OpCompositeExtract %big_struct %struct
+)";
+
+ CompileSuccessfully(GenerateShaderCode(body));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Expected at least one index to OpCompositeExtract"));
+}
+
TEST_F(ValidateComposites, CompositeExtractWrongType1) {
const std::string body = R"(
%struct = OpLoad %big_struct %var_big_struct
@@ -861,7 +872,6 @@ TEST_F(ValidateComposites, CompositeInsertSuccess) {
%val16 = OpCompositeInsert %big_struct %f32_3 %struct 4 1000 1
%val17 = OpCompositeInsert %big_struct %f32_3 %struct 5 0
%val18 = OpCompositeInsert %big_struct %u32_3 %struct 5 1
-%val19 = OpCompositeInsert %big_struct %struct %struct
)";
CompileSuccessfully(GenerateShaderCode(body));
@@ -1157,9 +1167,8 @@ TEST_F(ValidateComposites, CompositeInsertWrongResultTypeBad) {
HasSubstr("The Result Type must be the same as Composite type"));
}
-// Valid: No Indexes were passed to OpCompositeExtract, and the Result Type is
-// the same as the Base Composite type.
-TEST_F(ValidateComposites, CompositeExtractNoIndexesGood) {
+// Invalid: No Indexes were passed to OpCompositeExtract.
+TEST_F(ValidateComposites, CompositeExtractNoIndices2) {
std::ostringstream spirv;
spirv << GetHeaderForTestsFromValId() << std::endl;
spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl;
@@ -1167,29 +1176,32 @@ TEST_F(ValidateComposites, CompositeExtractNoIndexesGood) {
spirv << R"(OpReturn
OpFunctionEnd)";
CompileSuccessfully(spirv.str());
- EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected at least one index to OpCompositeExtract, zero found"));
}
-// Invalid: No Indexes were passed to OpCompositeExtract, but the Result Type is
-// different from the Base Composite type.
-TEST_F(ValidateComposites, CompositeExtractNoIndexesBad) {
+// Invalid: No Indexes were passed to OpCompositeExtract.
+TEST_F(ValidateComposites, CompositeExtractNoIndicesWrongResultType) {
std::ostringstream spirv;
spirv << GetHeaderForTestsFromValId() << std::endl;
spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl;
- spirv << "%float_entry = OpCompositeExtract %float %matrix" << std::endl;
+ spirv << "%float_entry = OpCompositeExtract %float %matrix" << std::endl;
spirv << R"(OpReturn
OpFunctionEnd)";
CompileSuccessfully(spirv.str());
EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Result type (OpTypeFloat) does not match the type "
- "that results from indexing into the composite "
- "(OpTypeMatrix)."));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected at least one index to OpCompositeExtract, zero found"));
}
-// Valid: No Indexes were passed to OpCompositeInsert, and the type of the
+// Invalid: No Indices were passed to OpCompositeInsert, and the type of the
// Object<id> argument matches the Composite type.
-TEST_F(ValidateComposites, CompositeInsertMissingIndexesGood) {
+TEST_F(ValidateComposites, CompositeInsertMissingIndices) {
std::ostringstream spirv;
spirv << GetHeaderForTestsFromValId() << std::endl;
spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl;
@@ -1199,12 +1211,16 @@ TEST_F(ValidateComposites, CompositeInsertMissingIndexesGood) {
OpReturn
OpFunctionEnd)";
CompileSuccessfully(spirv.str());
- EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected at least one index to OpCompositeInsert, zero found"));
}
-// Invalid: No Indexes were passed to OpCompositeInsert, but the type of the
+// Invalid: No Indices were passed to OpCompositeInsert, but the type of the
// Object<id> argument does not match the Composite type.
-TEST_F(ValidateComposites, CompositeInsertMissingIndexesBad) {
+TEST_F(ValidateComposites, CompositeInsertMissingIndices2) {
std::ostringstream spirv;
spirv << GetHeaderForTestsFromValId() << std::endl;
spirv << "%matrix = OpLoad %mat4x3 %my_matrix" << std::endl;
@@ -1214,10 +1230,10 @@ TEST_F(ValidateComposites, CompositeInsertMissingIndexesBad) {
OpFunctionEnd)";
CompileSuccessfully(spirv.str());
EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("The Object type (OpTypeInt) does not match the type "
- "that results from indexing into the Composite "
- "(OpTypeMatrix)."));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected at least one index to OpCompositeInsert, zero found"));
}
// Valid: Tests that we can index into Struct, Array, Matrix, and Vector!
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_derivatives_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_derivatives_test.cpp
index dac95f6eb34..606abb93ddf 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_derivatives_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_derivatives_test.cpp
@@ -62,7 +62,17 @@ OpCapability DerivativeControl
%f32vec4_ptr_input = OpTypePointer Input %f32vec4
%f32vec4_var_input = OpVariable %f32vec4_ptr_input Input
+)";
+
+ if (capabilities_and_extensions.find("OpCapability Float16") !=
+ std::string::npos) {
+ ss << "%f16 = OpTypeFloat 16\n"
+ << "%f16vec4 = OpTypeVector %f16 4\n"
+ << "%f16_0 = OpConstantNull %f16\n"
+ << "%f16vec4_0 = OpConstantNull %f16vec4\n";
+ }
+ ss << R"(
%main = OpFunction %void None %func
%main_entry = OpLabel
)";
@@ -150,6 +160,36 @@ TEST_F(ValidateDerivatives, OpDPdxWrongExecutionModel) {
"execution model: DPdx"));
}
+using ValidateHalfDerivatives = spvtest::ValidateBase<std::string>;
+
+TEST_P(ValidateHalfDerivatives, ScalarFailure) {
+ const std::string op = GetParam();
+ const std::string body = "%val = " + op + " %f16 %f16_0\n";
+
+ CompileSuccessfully(
+ GenerateShaderCode(body, "OpCapability Float16\n").c_str());
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Result type component width must be 32 bits"));
+}
+
+TEST_P(ValidateHalfDerivatives, VectorFailure) {
+ const std::string op = GetParam();
+ const std::string body = "%val = " + op + " %f16vec4 %f16vec4_0\n";
+
+ CompileSuccessfully(
+ GenerateShaderCode(body, "OpCapability Float16\n").c_str());
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Result type component width must be 32 bits"));
+}
+
+INSTANTIATE_TEST_SUITE_P(HalfDerivatives, ValidateHalfDerivatives,
+ ::testing::Values("OpDPdx", "OpDPdy", "OpFwidth",
+ "OpDPdxFine", "OpDPdyFine",
+ "OpFwidthFine", "OpDPdxCoarse",
+ "OpDPdyCoarse", "OpFwidthCoarse"));
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_misc_test.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_misc_test.cpp
index d266653e39e..dd9fff96e40 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_misc_test.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/test/val/val_misc_test.cpp
@@ -144,7 +144,8 @@ OpFunctionEnd)";
EXPECT_THAT(getDiagnosticString(), HasSubstr("vector of two components"));
}
-TEST_F(ValidateMisc, ShaderClockExecutionScope) {
+// #2952: disabled until scope discussion is resolved.
+TEST_F(ValidateMisc, DISABLED_ShaderClockExecutionScope) {
const std::string spirv = ShaderClockSpriv + R"(
%3 = OpTypeFunction %void
%ulong = OpTypeInt 64 0
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/utils/update_build_version.py b/3rdparty/bgfx/3rdparty/spirv-tools/utils/update_build_version.py
index 119bb054fd0..2b334f61878 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/utils/update_build_version.py
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/utils/update_build_version.py
@@ -116,10 +116,10 @@ def describe(directory):
# e.g. because the source tree might not be in a git tree.
# In this case, usually use a timestamp. However, to ensure
# reproducible builds, allow the builder to override the wall
- # clock time with enviornment variable SOURCE_DATE_EPOCH
+ # clock time with environment variable SOURCE_DATE_EPOCH
# containing a (presumably) fixed timestamp.
timestamp = int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
- formatted = datetime.date.fromtimestamp(timestamp).isoformat()
+ formatted = datetime.datetime.utcfromtimestamp(timestamp).isoformat()
return 'unknown hash, {}'.format(formatted)
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/.gitignore b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/.gitignore
new file mode 100644
index 00000000000..e934adfd1b9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/.gitignore
@@ -0,0 +1 @@
+cache/
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/README.md b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/README.md
new file mode 100644
index 00000000000..afbb24661a8
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/README.md
@@ -0,0 +1,7 @@
+# Visual Studio Code extension for SPIR-V disassembly files
+
+This directory holds a Visual Studio Code extension adding syntax highlighting for SPIR-V disassembly files (.spirv)
+
+## Installing (macOS / Linux)
+
+Simply run `install.sh`
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/install.sh b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/install.sh
new file mode 100755
index 00000000000..354baf0f833
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/install.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+# Copyright (c) 2019 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e # Fail on any error.
+
+EXT_PATH=~/.vscode/extensions/google.spirvls-0.0.1
+ROOT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
+go run ${ROOT_PATH}/src/tools/gen-grammar.go --cache ${ROOT_PATH}/cache --template ${ROOT_PATH}/spirv.json.tmpl --out ${ROOT_PATH}/spirv.json
+
+mkdir -p ${EXT_PATH}
+cp ${ROOT_PATH}/package.json ${EXT_PATH}
+cp ${ROOT_PATH}/spirv.configuration.json ${EXT_PATH}
+cp ${ROOT_PATH}/spirv.json ${EXT_PATH}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/package.json b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/package.json
new file mode 100644
index 00000000000..f6d333b370c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/package.json
@@ -0,0 +1,33 @@
+{
+ "name": "spirv",
+ "description": "Language support for SPIR-V disassembly files",
+ "author": "Google",
+ "license": "Apache-2.0",
+ "version": "0.0.1",
+ "private": true,
+ "publisher": "Google",
+ "engines": {
+ "vscode": "^0.10.10"
+ },
+ "categories": [
+ "Programming Languages"
+ ],
+ "contributes": {
+ "languages": [
+ {
+ "id": "spirv",
+ "configuration": "spirv.configuration.json",
+ "extensions": [
+ "spvasm"
+ ]
+ }
+ ],
+ "grammars": [
+ {
+ "language": "spirv",
+ "scopeName": "source.spirv",
+ "path": "spirv.json"
+ }
+ ]
+ }
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/spirv.configuration.json b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/spirv.configuration.json
new file mode 100644
index 00000000000..652330f94eb
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/spirv.configuration.json
@@ -0,0 +1,6 @@
+{
+ "comments": {
+ "lineComment": ";"
+ },
+ "wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)"
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/spirv.json b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/spirv.json
new file mode 100644
index 00000000000..30573d45507
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/spirv.json
@@ -0,0 +1,212 @@
+{
+ "scopeName": "source.spirv",
+ "name": "SPIR-V",
+ "comment": "Generated by gen-grammar.go --template=../../spirv.json.tmpl --out=../../spirv.json. Do not modify this file directly.",
+ "patterns": [
+ { "include": "#BitEnum_ImageOperands" },
+ { "include": "#BitEnum_FPFastMathMode" },
+ { "include": "#BitEnum_SelectionControl" },
+ { "include": "#BitEnum_LoopControl" },
+ { "include": "#BitEnum_FunctionControl" },
+ { "include": "#BitEnum_MemorySemantics" },
+ { "include": "#BitEnum_MemoryAccess" },
+ { "include": "#BitEnum_KernelProfilingInfo" },
+ { "include": "#ValueEnum_SourceLanguage" },
+ { "include": "#ValueEnum_ExecutionModel" },
+ { "include": "#ValueEnum_AddressingModel" },
+ { "include": "#ValueEnum_MemoryModel" },
+ { "include": "#ValueEnum_ExecutionMode" },
+ { "include": "#ValueEnum_StorageClass" },
+ { "include": "#ValueEnum_Dim" },
+ { "include": "#ValueEnum_SamplerAddressingMode" },
+ { "include": "#ValueEnum_SamplerFilterMode" },
+ { "include": "#ValueEnum_ImageFormat" },
+ { "include": "#ValueEnum_ImageChannelOrder" },
+ { "include": "#ValueEnum_ImageChannelDataType" },
+ { "include": "#ValueEnum_FPRoundingMode" },
+ { "include": "#ValueEnum_LinkageType" },
+ { "include": "#ValueEnum_AccessQualifier" },
+ { "include": "#ValueEnum_FunctionParameterAttribute" },
+ { "include": "#ValueEnum_Decoration" },
+ { "include": "#ValueEnum_BuiltIn" },
+ { "include": "#ValueEnum_Scope" },
+ { "include": "#ValueEnum_GroupOperation" },
+ { "include": "#ValueEnum_KernelEnqueueFlags" },
+ { "include": "#ValueEnum_Capability" },
+ { "include": "#opcode" },
+ { "include": "#identifier" },
+ { "include": "#number" },
+ { "include": "#string" },
+ { "include": "#comment" },
+ { "include": "#operator" }
+ ],
+ "repository": {
+ "BitEnum_ImageOperands": {
+ "match": "\\b(None|Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample|MinLod|MakeTexelAvailable|MakeTexelAvailableKHR|MakeTexelVisible|MakeTexelVisibleKHR|NonPrivateTexel|NonPrivateTexelKHR|VolatileTexel|VolatileTexelKHR|SignExtend|ZeroExtend)\\b",
+ "name": "keyword.spirv"
+ },
+ "BitEnum_FPFastMathMode": {
+ "match": "\\b(None|NotNaN|NotInf|NSZ|AllowRecip|Fast)\\b",
+ "name": "keyword.spirv"
+ },
+ "BitEnum_SelectionControl": {
+ "match": "\\b(None|Flatten|DontFlatten)\\b",
+ "name": "keyword.spirv"
+ },
+ "BitEnum_LoopControl": {
+ "match": "\\b(None|Unroll|DontUnroll|DependencyInfinite|DependencyLength|MinIterations|MaxIterations|IterationMultiple|PeelCount|PartialCount)\\b",
+ "name": "keyword.spirv"
+ },
+ "BitEnum_FunctionControl": {
+ "match": "\\b(None|Inline|DontInline|Pure|Const)\\b",
+ "name": "keyword.spirv"
+ },
+ "BitEnum_MemorySemantics": {
+ "match": "\\b(Relaxed|None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|OutputMemoryKHR|MakeAvailable|MakeAvailableKHR|MakeVisible|MakeVisibleKHR|Volatile)\\b",
+ "name": "keyword.spirv"
+ },
+ "BitEnum_MemoryAccess": {
+ "match": "\\b(None|Volatile|Aligned|Nontemporal|MakePointerAvailable|MakePointerAvailableKHR|MakePointerVisible|MakePointerVisibleKHR|NonPrivatePointer|NonPrivatePointerKHR)\\b",
+ "name": "keyword.spirv"
+ },
+ "BitEnum_KernelProfilingInfo": {
+ "match": "\\b(None|CmdExecTime)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_SourceLanguage": {
+ "match": "\\b(Unknown|ESSL|GLSL|OpenCL_C|OpenCL_CPP|HLSL)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_ExecutionModel": {
+ "match": "\\b(Vertex|TessellationControl|TessellationEvaluation|Geometry|Fragment|GLCompute|Kernel|TaskNV|MeshNV|RayGenerationNV|IntersectionNV|AnyHitNV|ClosestHitNV|MissNV|CallableNV)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_AddressingModel": {
+ "match": "\\b(Logical|Physical32|Physical64|PhysicalStorageBuffer64|PhysicalStorageBuffer64EXT)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_MemoryModel": {
+ "match": "\\b(Simple|GLSL450|OpenCL|Vulkan|VulkanKHR)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_ExecutionMode": {
+ "match": "\\b(Invocations|SpacingEqual|SpacingFractionalEven|SpacingFractionalOdd|VertexOrderCw|VertexOrderCcw|PixelCenterInteger|OriginUpperLeft|OriginLowerLeft|EarlyFragmentTests|PointMode|Xfb|DepthReplacing|DepthGreater|DepthLess|DepthUnchanged|LocalSize|LocalSizeHint|InputPoints|InputLines|InputLinesAdjacency|Triangles|InputTrianglesAdjacency|Quads|Isolines|OutputVertices|OutputPoints|OutputLineStrip|OutputTriangleStrip|VecTypeHint|ContractionOff|Initializer|Finalizer|SubgroupSize|SubgroupsPerWorkgroup|SubgroupsPerWorkgroupId|LocalSizeId|LocalSizeHintId|PostDepthCoverage|DenormPreserve|DenormFlushToZero|SignedZeroInfNanPreserve|RoundingModeRTE|RoundingModeRTZ|StencilRefReplacingEXT|OutputLinesNV|OutputPrimitivesNV|DerivativeGroupQuadsNV|DerivativeGroupLinearNV|OutputTrianglesNV|PixelInterlockOrderedEXT|PixelInterlockUnorderedEXT|SampleInterlockOrderedEXT|SampleInterlockUnorderedEXT|ShadingRateInterlockOrderedEXT|ShadingRateInterlockUnorderedEXT)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_StorageClass": {
+ "match": "\\b(UniformConstant|Input|Uniform|Output|Workgroup|CrossWorkgroup|Private|Function|Generic|PushConstant|AtomicCounter|Image|StorageBuffer|CallableDataNV|IncomingCallableDataNV|RayPayloadNV|HitAttributeNV|IncomingRayPayloadNV|ShaderRecordBufferNV|PhysicalStorageBuffer|PhysicalStorageBufferEXT)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_Dim": {
+ "match": "\\b(1D|2D|3D|Cube|Rect|Buffer|SubpassData)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_SamplerAddressingMode": {
+ "match": "\\b(None|ClampToEdge|Clamp|Repeat|RepeatMirrored)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_SamplerFilterMode": {
+ "match": "\\b(Nearest|Linear)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_ImageFormat": {
+ "match": "\\b(Unknown|Rgba32f|Rgba16f|R32f|Rgba8|Rgba8Snorm|Rg32f|Rg16f|R11fG11fB10f|R16f|Rgba16|Rgb10A2|Rg16|Rg8|R16|R8|Rgba16Snorm|Rg16Snorm|Rg8Snorm|R16Snorm|R8Snorm|Rgba32i|Rgba16i|Rgba8i|R32i|Rg32i|Rg16i|Rg8i|R16i|R8i|Rgba32ui|Rgba16ui|Rgba8ui|R32ui|Rgb10a2ui|Rg32ui|Rg16ui|Rg8ui|R16ui|R8ui)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_ImageChannelOrder": {
+ "match": "\\b(R|A|RG|RA|RGB|RGBA|BGRA|ARGB|Intensity|Luminance|Rx|RGx|RGBx|Depth|DepthStencil|sRGB|sRGBx|sRGBA|sBGRA|ABGR)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_ImageChannelDataType": {
+ "match": "\\b(SnormInt8|SnormInt16|UnormInt8|UnormInt16|UnormShort565|UnormShort555|UnormInt101010|SignedInt8|SignedInt16|SignedInt32|UnsignedInt8|UnsignedInt16|UnsignedInt32|HalfFloat|Float|UnormInt24|UnormInt101010_2)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_FPRoundingMode": {
+ "match": "\\b(RTE|RTZ|RTP|RTN)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_LinkageType": {
+ "match": "\\b(Export|Import)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_AccessQualifier": {
+ "match": "\\b(ReadOnly|WriteOnly|ReadWrite)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_FunctionParameterAttribute": {
+ "match": "\\b(Zext|Sext|ByVal|Sret|NoAlias|NoCapture|NoWrite|NoReadWrite)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_Decoration": {
+ "match": "\\b(RelaxedPrecision|SpecId|Block|BufferBlock|RowMajor|ColMajor|ArrayStride|MatrixStride|GLSLShared|GLSLPacked|CPacked|BuiltIn|NoPerspective|Flat|Patch|Centroid|Sample|Invariant|Restrict|Aliased|Volatile|Constant|Coherent|NonWritable|NonReadable|Uniform|UniformId|SaturatedConversion|Stream|Location|Component|Index|Binding|DescriptorSet|Offset|XfbBuffer|XfbStride|FuncParamAttr|FPRoundingMode|FPFastMathMode|LinkageAttributes|NoContraction|InputAttachmentIndex|Alignment|MaxByteOffset|AlignmentId|MaxByteOffsetId|NoSignedWrap|NoUnsignedWrap|ExplicitInterpAMD|OverrideCoverageNV|PassthroughNV|ViewportRelativeNV|SecondaryViewportRelativeNV|PerPrimitiveNV|PerViewNV|PerTaskNV|PerVertexNV|NonUniform|NonUniformEXT|RestrictPointer|RestrictPointerEXT|AliasedPointer|AliasedPointerEXT|CounterBuffer|HlslCounterBufferGOOGLE|UserSemantic|HlslSemanticGOOGLE|UserTypeGOOGLE)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_BuiltIn": {
+ "match": "\\b(Position|PointSize|ClipDistance|CullDistance|VertexId|InstanceId|PrimitiveId|InvocationId|Layer|ViewportIndex|TessLevelOuter|TessLevelInner|TessCoord|PatchVertices|FragCoord|PointCoord|FrontFacing|SampleId|SamplePosition|SampleMask|FragDepth|HelperInvocation|NumWorkgroups|WorkgroupSize|WorkgroupId|LocalInvocationId|GlobalInvocationId|LocalInvocationIndex|WorkDim|GlobalSize|EnqueuedWorkgroupSize|GlobalOffset|GlobalLinearId|SubgroupSize|SubgroupMaxSize|NumSubgroups|NumEnqueuedSubgroups|SubgroupId|SubgroupLocalInvocationId|VertexIndex|InstanceIndex|SubgroupEqMask|SubgroupGeMask|SubgroupGtMask|SubgroupLeMask|SubgroupLtMask|SubgroupEqMaskKHR|SubgroupGeMaskKHR|SubgroupGtMaskKHR|SubgroupLeMaskKHR|SubgroupLtMaskKHR|BaseVertex|BaseInstance|DrawIndex|DeviceIndex|ViewIndex|BaryCoordNoPerspAMD|BaryCoordNoPerspCentroidAMD|BaryCoordNoPerspSampleAMD|BaryCoordSmoothAMD|BaryCoordSmoothCentroidAMD|BaryCoordSmoothSampleAMD|BaryCoordPullModelAMD|FragStencilRefEXT|ViewportMaskNV|SecondaryPositionNV|SecondaryViewportMaskNV|PositionPerViewNV|ViewportMaskPerViewNV|FullyCoveredEXT|TaskCountNV|PrimitiveCountNV|PrimitiveIndicesNV|ClipDistancePerViewNV|CullDistancePerViewNV|LayerPerViewNV|MeshViewCountNV|MeshViewIndicesNV|BaryCoordNV|BaryCoordNoPerspNV|FragSizeEXT|FragmentSizeNV|FragInvocationCountEXT|InvocationsPerPixelNV|LaunchIdNV|LaunchSizeNV|WorldRayOriginNV|WorldRayDirectionNV|ObjectRayOriginNV|ObjectRayDirectionNV|RayTminNV|RayTmaxNV|InstanceCustomIndexNV|ObjectToWorldNV|WorldToObjectNV|HitTNV|HitKindNV|IncomingRayFlagsNV|WarpsPerSMNV|SMCountNV|WarpIDNV|SMIDNV)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_Scope": {
+ "match": "\\b(CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|QueueFamilyKHR)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_GroupOperation": {
+ "match": "\\b(Reduce|InclusiveScan|ExclusiveScan|ClusteredReduce|PartitionedReduceNV|PartitionedInclusiveScanNV|PartitionedExclusiveScanNV)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_KernelEnqueueFlags": {
+ "match": "\\b(NoWait|WaitKernel|WaitWorkGroup)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_Capability": {
+ "match": "\\b(Matrix|Shader|Geometry|Tessellation|Addresses|Linkage|Kernel|Vector16|Float16Buffer|Float16|Float64|Int64|Int64Atomics|ImageBasic|ImageReadWrite|ImageMipmap|Pipes|Groups|DeviceEnqueue|LiteralSampler|AtomicStorage|Int16|TessellationPointSize|GeometryPointSize|ImageGatherExtended|StorageImageMultisample|UniformBufferArrayDynamicIndexing|SampledImageArrayDynamicIndexing|StorageBufferArrayDynamicIndexing|StorageImageArrayDynamicIndexing|ClipDistance|CullDistance|ImageCubeArray|SampleRateShading|ImageRect|SampledRect|GenericPointer|Int8|InputAttachment|SparseResidency|MinLod|Sampled1D|Image1D|SampledCubeArray|SampledBuffer|ImageBuffer|ImageMSArray|StorageImageExtendedFormats|ImageQuery|DerivativeControl|InterpolationFunction|TransformFeedback|GeometryStreams|StorageImageReadWithoutFormat|StorageImageWriteWithoutFormat|MultiViewport|SubgroupDispatch|NamedBarrier|PipeStorage|GroupNonUniform|GroupNonUniformVote|GroupNonUniformArithmetic|GroupNonUniformBallot|GroupNonUniformShuffle|GroupNonUniformShuffleRelative|GroupNonUniformClustered|GroupNonUniformQuad|ShaderLayer|ShaderViewportIndex|SubgroupBallotKHR|DrawParameters|SubgroupVoteKHR|StorageBuffer16BitAccess|StorageUniformBufferBlock16|UniformAndStorageBuffer16BitAccess|StorageUniform16|StoragePushConstant16|StorageInputOutput16|DeviceGroup|MultiView|VariablePointersStorageBuffer|VariablePointers|AtomicStorageOps|SampleMaskPostDepthCoverage|StorageBuffer8BitAccess|UniformAndStorageBuffer8BitAccess|StoragePushConstant8|DenormPreserve|DenormFlushToZero|SignedZeroInfNanPreserve|RoundingModeRTE|RoundingModeRTZ|Float16ImageAMD|ImageGatherBiasLodAMD|FragmentMaskAMD|StencilExportEXT|ImageReadWriteLodAMD|ShaderClockKHR|SampleMaskOverrideCoverageNV|GeometryShaderPassthroughNV|ShaderViewportIndexLayerEXT|ShaderViewportIndexLayerNV|ShaderViewportMaskNV|ShaderStereoViewNV|PerViewAttributesNV|FragmentFullyCoveredEXT|MeshShadingNV|ImageFootprintNV|FragmentBarycentricNV|ComputeDerivativeGroupQuadsNV|FragmentDensityEXT|ShadingRateNV|GroupNonUniformPartitionedNV|ShaderNonUniform|ShaderNonUniformEXT|RuntimeDescriptorArray|RuntimeDescriptorArrayEXT|InputAttachmentArrayDynamicIndexing|InputAttachmentArrayDynamicIndexingEXT|UniformTexelBufferArrayDynamicIndexing|UniformTexelBufferArrayDynamicIndexingEXT|StorageTexelBufferArrayDynamicIndexing|StorageTexelBufferArrayDynamicIndexingEXT|UniformBufferArrayNonUniformIndexing|UniformBufferArrayNonUniformIndexingEXT|SampledImageArrayNonUniformIndexing|SampledImageArrayNonUniformIndexingEXT|StorageBufferArrayNonUniformIndexing|StorageBufferArrayNonUniformIndexingEXT|StorageImageArrayNonUniformIndexing|StorageImageArrayNonUniformIndexingEXT|InputAttachmentArrayNonUniformIndexing|InputAttachmentArrayNonUniformIndexingEXT|UniformTexelBufferArrayNonUniformIndexing|UniformTexelBufferArrayNonUniformIndexingEXT|StorageTexelBufferArrayNonUniformIndexing|StorageTexelBufferArrayNonUniformIndexingEXT|RayTracingNV|VulkanMemoryModel|VulkanMemoryModelKHR|VulkanMemoryModelDeviceScope|VulkanMemoryModelDeviceScopeKHR|PhysicalStorageBufferAddresses|PhysicalStorageBufferAddressesEXT|ComputeDerivativeGroupLinearNV|CooperativeMatrixNV|FragmentShaderSampleInterlockEXT|FragmentShaderShadingRateInterlockEXT|ShaderSMBuiltinsNV|FragmentShaderPixelInterlockEXT|DemoteToHelperInvocationEXT|SubgroupShuffleINTEL|SubgroupBufferBlockIOINTEL|SubgroupImageBlockIOINTEL|SubgroupImageMediaBlockIOINTEL|IntegerFunctions2INTEL|SubgroupAvcMotionEstimationINTEL|SubgroupAvcMotionEstimationIntraINTEL|SubgroupAvcMotionEstimationChromaINTEL)\\b",
+ "name": "keyword.spirv"
+ },
+ "opcode": {
+ "match": "(Op[a-zA-Z]+)",
+ "name": "entity.name.function.spirv"
+ },
+ "identifier": {
+ "match": "%[a-zA-Z0-9_]+",
+ "name": "variable.spirv"
+ },
+ "number": {
+ "match": "\\b[0-9]+.?[0-9]*\\b",
+ "name": "constant.numeric.spirv"
+ },
+ "comment": {
+ "match": ";[^\n]*",
+ "name": "comment.line.spirv"
+ },
+ "operator": {
+ "match": "=",
+ "name": "keyword.operator.spirv"
+ },
+ "string": {
+ "begin": "\"",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.spirv"
+ }
+ },
+ "end": "\"",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.spirv"
+ }
+ },
+ "name": "string.quoted.double.spirv",
+ "patterns": [ { "include": "#string_escaped_char" } ]
+ },
+ "string_escaped_char": {
+ "patterns": [
+ {
+ "match": "\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})",
+ "name": "constant.character.escape.spirv"
+ }, {
+ "match": "\\\\[^0-7xuUabfnrtv\\'\"]",
+ "name": "invalid.illegal.unknown-escape.spirv"
+ }
+ ]
+ }
+ }
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/spirv.json.tmpl b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/spirv.json.tmpl
new file mode 100644
index 00000000000..8582d03fd47
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/spirv.json.tmpl
@@ -0,0 +1,67 @@
+{
+ "scopeName": "source.spirv",
+ "name": "SPIR-V",
+ "comment": "Generated by {{GenerateArguments}}. Do not modify this file directly.",
+ "patterns": [
+{{range $o := .OperandKinds}}{{if len $o.Enumerants}} { "include": "#{{$o.Category}}_{{$o.Kind}}" },
+{{end}}{{end}} { "include": "#opcode" },
+ { "include": "#identifier" },
+ { "include": "#number" },
+ { "include": "#string" },
+ { "include": "#comment" },
+ { "include": "#operator" }
+ ],
+ "repository": { {{range $o := .OperandKinds}}{{if len $o.Enumerants}}
+ "{{$o.Category}}_{{$o.Kind}}": {
+ "match": "\\b({{OperandKindsMatch $o}})\\b",
+ "name": "keyword.spirv"
+ },{{end}}{{end}}
+ "opcode": {
+ "match": "(Op[a-zA-Z]+)",
+ "name": "entity.name.function.spirv"
+ },
+ "identifier": {
+ "match": "%[a-zA-Z0-9_]+",
+ "name": "variable.spirv"
+ },
+ "number": {
+ "match": "\\b[0-9]+.?[0-9]*\\b",
+ "name": "constant.numeric.spirv"
+ },
+ "comment": {
+ "match": ";[^\n]*",
+ "name": "comment.line.spirv"
+ },
+ "operator": {
+ "match": "=",
+ "name": "keyword.operator.spirv"
+ },
+ "string": {
+ "begin": "\"",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.spirv"
+ }
+ },
+ "end": "\"",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.spirv"
+ }
+ },
+ "name": "string.quoted.double.spirv",
+ "patterns": [ { "include": "#string_escaped_char" } ]
+ },
+ "string_escaped_char": {
+ "patterns": [
+ {
+ "match": "\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})",
+ "name": "constant.character.escape.spirv"
+ }, {
+ "match": "\\\\[^0-7xuUabfnrtv\\'\"]",
+ "name": "invalid.illegal.unknown-escape.spirv"
+ }
+ ]
+ }
+ }
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/src/grammar/grammar.go b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/src/grammar/grammar.go
new file mode 100644
index 00000000000..0d9ee0f1bdf
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/src/grammar/grammar.go
@@ -0,0 +1,75 @@
+// Copyright (C) 2019 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package grammar holds the JSON type definitions for the SPIR-V grammar schema.
+//
+// See https://www.khronos.org/registry/spir-v/specs/unified1/MachineReadableGrammar.html
+// for more information.
+package grammar
+
+// Root is the top-level structure of the JSON grammar.
+type Root struct {
+ MagicNumber string `json:"magic_number"`
+ MajorVersion int `json:"major_version"`
+ MinorVersion int `json:"minor_version"`
+ Revision int `json:"revision"`
+ Instructions []Instruction `json:"instructions"`
+ OperandKinds []OperandKind `json:"operand_kinds"`
+}
+
+// Instruction holds information about a specific SPIR-V instruction.
+type Instruction struct {
+ Opname string `json:"opname"`
+ Class string `json:"class"`
+ Opcode int `json:"opcode"`
+ Operands []Operand `json:"operands"`
+}
+
+// Operand contains information about a logical operand for an instruction.
+type Operand struct {
+ Kind string `json:"kind"`
+ Name string `json:"name"`
+ Quantifier Quantifier `json:"quantifier"`
+}
+
+// OperandKind contains information about a specific operand kind.
+type OperandKind struct {
+ Category string `json:"category"`
+ Kind string `json:"kind"`
+ Enumerants []Enumerant `json:"enumerants"`
+ Bases []string `json:"bases"`
+}
+
+// Enumerant contains information about an enumerant in an enum.
+type Enumerant struct {
+ Enumerant string `json:"enumerant"`
+ Value interface{} `json:"value"`
+ Capabilities []string `json:"capabilities"`
+ Parameters []Parameter `json:"parameters"`
+ Version string `json:"version"`
+}
+
+// Parameter contains information about a logical parameter for an enumerant.
+type Parameter struct {
+ Kind string `json:"kind"`
+ Name string `json:"name"`
+}
+
+type Quantifier string
+
+const (
+ Once Quantifier = ""
+ ZeroOrOnce Quantifier = "?"
+ ZeroOrMany Quantifier = "*"
+)
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/src/tools/gen-grammar.go b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/src/tools/gen-grammar.go
new file mode 100644
index 00000000000..f07dde0d636
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/utils/vscode/src/tools/gen-grammar.go
@@ -0,0 +1,167 @@
+// Copyright (C) 2019 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// gen-grammar generates the spirv.json grammar file from the official SPIR-V
+// grammar JSON file.
+package main
+
+import (
+ "bytes"
+ "encoding/json"
+ "flag"
+ "fmt"
+ "io/ioutil"
+ "net/http"
+ "os"
+ "path/filepath"
+ "runtime"
+ "strings"
+ "text/template"
+
+ "github.com/pkg/errors"
+
+ "../grammar"
+)
+
+const (
+ spirvGrammarURL = "https://raw.githubusercontent.com/KhronosGroup/SPIRV-Headers/master/include/spirv/unified1/spirv.core.grammar.json"
+ spirvGrammarName = "spirv.core.grammar.json"
+)
+
+var (
+ templatePath = flag.String("template", "", "Path to input template file (required)")
+ outputPath = flag.String("out", "", "Path to output generated file (required)")
+ cachePath = flag.String("cache", "", "Cache directory for downloaded files (optional)")
+
+ thisDir = func() string {
+ _, file, _, _ := runtime.Caller(1)
+ return filepath.Dir(file)
+ }()
+)
+
+func main() {
+ flag.Parse()
+ if *templatePath == "" || *outputPath == "" {
+ flag.Usage()
+ os.Exit(1)
+ }
+ if err := run(); err != nil {
+ fmt.Fprintln(os.Stderr, err)
+ os.Exit(1)
+ }
+}
+
+func run() error {
+ tf, err := ioutil.ReadFile(*templatePath)
+ if err != nil {
+ return errors.Wrap(err, "Could not open template file")
+ }
+ t, err := template.New("tmpl").
+ Funcs(template.FuncMap{
+ "GenerateArguments": func() string {
+ relPath := func(path string) string {
+ rel, err := filepath.Rel(thisDir, path)
+ if err != nil {
+ return path
+ }
+ return rel
+ }
+ args := []string{
+ "--template=" + relPath(*templatePath),
+ "--out=" + relPath(*outputPath),
+ }
+ return "gen-grammar.go " + strings.Join(args, " ")
+ },
+ "OperandKindsMatch": func(k grammar.OperandKind) string {
+ sb := strings.Builder{}
+ for i, e := range k.Enumerants {
+ if i > 0 {
+ sb.WriteString("|")
+ }
+ sb.WriteString(e.Enumerant)
+ }
+ return sb.String()
+ },
+ }).Parse(string(tf))
+ if err != nil {
+ return errors.Wrap(err, "Failed to parse template")
+ }
+
+ file, err := getOrDownload(spirvGrammarName, spirvGrammarURL)
+ if err != nil {
+ return errors.Wrap(err, "Failed to load grammar file")
+ }
+
+ g := grammar.Root{}
+ if err := json.NewDecoder(bytes.NewReader(file)).Decode(&g); err != nil {
+ return errors.Wrap(err, "Failed to parse grammar file")
+ }
+
+ buf := bytes.Buffer{}
+ if err := t.Execute(&buf, g); err != nil {
+ return errors.Wrap(err, "Failed to execute template")
+ }
+
+ out := buf.String()
+ out = strings.ReplaceAll(out, "•", "")
+
+ if err := ioutil.WriteFile(*outputPath, []byte(out), 0777); err != nil {
+ return errors.Wrap(err, "Failed to write output file")
+ }
+
+ return nil
+}
+
+// getOrDownload loads the specific file from the cache, or downloads the file
+// from the given url.
+func getOrDownload(name, url string) ([]byte, error) {
+ if *cachePath != "" {
+ if err := os.MkdirAll(*cachePath, 0777); err == nil {
+ path := filepath.Join(*cachePath, name)
+ if isFile(path) {
+ return ioutil.ReadFile(path)
+ }
+ }
+ }
+ resp, err := http.Get(url)
+ if err != nil {
+ return nil, err
+ }
+ data, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+ if *cachePath != "" {
+ ioutil.WriteFile(filepath.Join(*cachePath, name), data, 0777)
+ }
+ return data, nil
+}
+
+// isFile returns true if path is a file.
+func isFile(path string) bool {
+ s, err := os.Stat(path)
+ if err != nil {
+ return false
+ }
+ return !s.IsDir()
+}
+
+// isDir returns true if path is a directory.
+func isDir(path string) bool {
+ s, err := os.Stat(path)
+ if err != nil {
+ return false
+ }
+ return s.IsDir()
+}
diff --git a/3rdparty/bgfx/README.md b/3rdparty/bgfx/README.md
index 535a3a3f41e..6e5a643f701 100644
--- a/3rdparty/bgfx/README.md
+++ b/3rdparty/bgfx/README.md
@@ -49,8 +49,9 @@ Supported compilers:
Languages:
* [C/C++ API documentation](https://bkaradzic.github.io/bgfx/bgfx.html)
- * [C#/VB/F# language API bindings](https://github.com/MikePopoloski/SharpBgfx)
- * [D language API bindings](https://github.com/DerelictOrg/DerelictBgfx)
+ * [C# language API bindings #1](https://github.com/bkaradzic/bgfx/tree/master/bindings/cs)
+ * [C#/VB/F# language API bindings #2](https://github.com/MikePopoloski/SharpBgfx)
+ * [D language API bindings](https://github.com/GoaLitiuM/bindbc-bgfx)
* [Go language API bindings](https://github.com/james4k/go-bgfx)
* [Haskell language API bindings](https://github.com/haskell-game/bgfx)
* [Lightweight Java Game Library 3 bindings](https://github.com/LWJGL/lwjgl3)
@@ -356,6 +357,14 @@ target="_blank"><img src="http://img.youtube.com/vi/Gz9weuemhDA/0.jpg"
alt="Heroes of Hammerwatch"
width="640" height="480" border="0" /></a>
+## openblack
+
+An open source reimplementation of the game Black & White (2001).
+
+[OpenBlack](https://github.com/openblack/openblack#openblack)
+
+![openblack](https://user-images.githubusercontent.com/1388267/67631321-93c85380-f88c-11e9-9103-804807844af2.png)
+
[License (BSD 2-clause)](https://bkaradzic.github.io/bgfx/license.html)
-----------------------------------------------------------------------
diff --git a/3rdparty/bgfx/bindings/cs/bgfx.cs b/3rdparty/bgfx/bindings/cs/bgfx.cs
index e0bca6f808e..458e180e38b 100644
--- a/3rdparty/bgfx/bindings/cs/bgfx.cs
+++ b/3rdparty/bgfx/bindings/cs/bgfx.cs
@@ -249,6 +249,11 @@ public static partial class bgfx
None = 0x0000000000000000,
/// <summary>
+ /// Front counter-clockwise (default is clockwise).
+ /// </summary>
+ FrontCcw = 0x0000008000000000,
+
+ /// <summary>
/// Enable blend independent.
/// </summary>
BlendIndependent = 0x0000000400000000,
@@ -2051,8 +2056,10 @@ public static partial class bgfx
{
public fixed byte name[256];
public ushort view;
- public long cpuTimeElapsed;
- public long gpuTimeElapsed;
+ public long cpuTimeBegin;
+ public long cpuTimeEnd;
+ public long gpuTimeBegin;
+ public long gpuTimeEnd;
}
public unsafe struct EncoderStats
diff --git a/3rdparty/bgfx/bindings/d/funcs.d b/3rdparty/bgfx/bindings/d/funcs.d
new file mode 100644
index 00000000000..71f9e51be56
--- /dev/null
+++ b/3rdparty/bgfx/bindings/d/funcs.d
@@ -0,0 +1,4299 @@
+/*
+ *
+ * AUTO GENERATED! DO NOT EDIT!
+ *
+ */
+
+module bindbc.bgfx.funcs;
+
+private import bindbc.bgfx.types;
+
+extern(C) @nogc nothrow:
+
+version(BindBgfx_Static)
+{
+ /**
+ * Init attachment.
+ * Params:
+ * _handle = Render target texture handle.
+ * _access = Access. See `Access::Enum`.
+ * _layer = Cubemap side or depth layer/slice.
+ * _mip = Mip level.
+ * _resolve = Resolve flags. See: `BGFX_RESOLVE_*`
+ */
+ void bgfx_attachment_init(bgfx_attachment_t* _this, bgfx_texture_handle_t _handle, bgfx_access_t _access, ushort _layer, ushort _mip, byte _resolve);
+
+ /**
+ * Start VertexLayout.
+ */
+ bgfx_vertex_layout_t* bgfx_vertex_layout_begin(bgfx_vertex_layout_t* _this, bgfx_renderer_type_t _rendererType);
+
+ /**
+ * Add attribute to VertexLayout.
+ * Remarks: Must be called between begin/end.
+ * Params:
+ * _attrib = Attribute semantics. See: `bgfx::Attrib`
+ * _num = Number of elements 1, 2, 3 or 4.
+ * _type = Element type.
+ * _normalized = When using fixed point AttribType (f.e. Uint8)
+ * value will be normalized for vertex shader usage. When normalized
+ * is set to true, AttribType::Uint8 value in range 0-255 will be
+ * in range 0.0-1.0 in vertex shader.
+ * _asInt = Packaging rule for vertexPack, vertexUnpack, and
+ * vertexConvert for AttribType::Uint8 and AttribType::Int16.
+ * Unpacking code must be implemented inside vertex shader.
+ */
+ bgfx_vertex_layout_t* bgfx_vertex_layout_add(bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib, byte _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt);
+
+ /**
+ * Decode attribute.
+ * Params:
+ * _attrib = Attribute semantics. See: `bgfx::Attrib`
+ * _num = Number of elements.
+ * _type = Element type.
+ * _normalized = Attribute is normalized.
+ * _asInt = Attribute is packed as int.
+ */
+ void bgfx_vertex_layout_decode(const(bgfx_vertex_layout_t)* _this, bgfx_attrib_t _attrib, byte* _num, bgfx_attrib_type_t* _type, bool* _normalized, bool* _asInt);
+
+ /**
+ * Returns true if VertexLayout contains attribute.
+ * Params:
+ * _attrib = Attribute semantics. See: `bgfx::Attrib`
+ */
+ bool bgfx_vertex_layout_has(const(bgfx_vertex_layout_t)* _this, bgfx_attrib_t _attrib);
+
+ /**
+ * Skip `_num` bytes in vertex stream.
+ */
+ bgfx_vertex_layout_t* bgfx_vertex_layout_skip(bgfx_vertex_layout_t* _this, byte _num);
+
+ /**
+ * End VertexLayout.
+ */
+ void bgfx_vertex_layout_end(bgfx_vertex_layout_t* _this);
+
+ /**
+ * Pack vertex attribute into vertex stream format.
+ * Params:
+ * _input = Value to be packed into vertex stream.
+ * _inputNormalized = `true` if input value is already normalized.
+ * _attr = Attribute to pack.
+ * _layout = Vertex stream layout.
+ * _data = Destination vertex stream where data will be packed.
+ * _index = Vertex index that will be modified.
+ */
+ void bgfx_vertex_pack(const float[4] _input, bool _inputNormalized, bgfx_attrib_t _attr, const(bgfx_vertex_layout_t)* _layout, void* _data, uint _index);
+
+ /**
+ * Unpack vertex attribute from vertex stream format.
+ * Params:
+ * _output = Result of unpacking.
+ * _attr = Attribute to unpack.
+ * _layout = Vertex stream layout.
+ * _data = Source vertex stream from where data will be unpacked.
+ * _index = Vertex index that will be unpacked.
+ */
+ void bgfx_vertex_unpack(float[4] _output, bgfx_attrib_t _attr, const(bgfx_vertex_layout_t)* _layout, const(void)* _data, uint _index);
+
+ /**
+ * Converts vertex stream data from one vertex stream format to another.
+ * Params:
+ * _dstLayout = Destination vertex stream layout.
+ * _dstData = Destination vertex stream.
+ * _srcLayout = Source vertex stream layout.
+ * _srcData = Source vertex stream data.
+ * _num = Number of vertices to convert from source to destination.
+ */
+ void bgfx_vertex_convert(const(bgfx_vertex_layout_t)* _dstLayout, void* _dstData, const(bgfx_vertex_layout_t)* _srcLayout, const(void)* _srcData, uint _num);
+
+ /**
+ * Weld vertices.
+ * Params:
+ * _output = Welded vertices remapping table. The size of buffer
+ * must be the same as number of vertices.
+ * _layout = Vertex stream layout.
+ * _data = Vertex stream.
+ * _num = Number of vertices in vertex stream.
+ * _epsilon = Error tolerance for vertex position comparison.
+ */
+ ushort bgfx_weld_vertices(ushort* _output, const(bgfx_vertex_layout_t)* _layout, const(void)* _data, ushort _num, float _epsilon);
+
+ /**
+ * Convert index buffer for use with different primitive topologies.
+ * Params:
+ * _conversion = Conversion type, see `TopologyConvert::Enum`.
+ * _dst = Destination index buffer. If this argument is NULL
+ * function will return number of indices after conversion.
+ * _dstSize = Destination index buffer in bytes. It must be
+ * large enough to contain output indices. If destination size is
+ * insufficient index buffer will be truncated.
+ * _indices = Source indices.
+ * _numIndices = Number of input indices.
+ * _index32 = Set to `true` if input indices are 32-bit.
+ */
+ uint bgfx_topology_convert(bgfx_topology_convert_t _conversion, void* _dst, uint _dstSize, const(void)* _indices, uint _numIndices, bool _index32);
+
+ /**
+ * Sort indices.
+ * Params:
+ * _sort = Sort order, see `TopologySort::Enum`.
+ * _dst = Destination index buffer.
+ * _dstSize = Destination index buffer in bytes. It must be
+ * large enough to contain output indices. If destination size is
+ * insufficient index buffer will be truncated.
+ * _dir = Direction (vector must be normalized).
+ * _pos = Position.
+ * _vertices = Pointer to first vertex represented as
+ * float x, y, z. Must contain at least number of vertices
+ * referencende by index buffer.
+ * _stride = Vertex stride.
+ * _indices = Source indices.
+ * _numIndices = Number of input indices.
+ * _index32 = Set to `true` if input indices are 32-bit.
+ */
+ void bgfx_topology_sort_tri_list(bgfx_topology_sort_t _sort, void* _dst, uint _dstSize, const float[3] _dir, const float[3] _pos, const(void)* _vertices, uint _stride, const(void)* _indices, uint _numIndices, bool _index32);
+
+ /**
+ * Returns supported backend API renderers.
+ * Params:
+ * _max = Maximum number of elements in _enum array.
+ * _enum = Array where supported renderers will be written.
+ */
+ byte bgfx_get_supported_renderers(byte _max, bgfx_renderer_type_t* _enum);
+
+ /**
+ * Returns name of renderer.
+ * Params:
+ * _type = Renderer backend type. See: `bgfx::RendererType`
+ */
+ const(char)* bgfx_get_renderer_name(bgfx_renderer_type_t _type);
+
+ void bgfx_init_ctor(bgfx_init_t* _init);
+
+ /**
+ * Initialize bgfx library.
+ * Params:
+ * _init = Initialization parameters. See: `bgfx::Init` for more info.
+ */
+ bool bgfx_init(const(bgfx_init_t)* _init);
+
+ /**
+ * Shutdown bgfx library.
+ */
+ void bgfx_shutdown();
+
+ /**
+ * Reset graphic settings and back-buffer size.
+ * Attention: This call doesn't actually change window size, it just
+ * resizes back-buffer. Windowing code has to change window size.
+ * Params:
+ * _width = Back-buffer width.
+ * _height = Back-buffer height.
+ * _flags = See: `BGFX_RESET_*` for more info.
+ * - `BGFX_RESET_NONE` - No reset flags.
+ * - `BGFX_RESET_FULLSCREEN` - Not supported yet.
+ * - `BGFX_RESET_MSAA_X[2/4/8/16]` - Enable 2, 4, 8 or 16 x MSAA.
+ * - `BGFX_RESET_VSYNC` - Enable V-Sync.
+ * - `BGFX_RESET_MAXANISOTROPY` - Turn on/off max anisotropy.
+ * - `BGFX_RESET_CAPTURE` - Begin screen capture.
+ * - `BGFX_RESET_FLUSH_AFTER_RENDER` - Flush rendering after submitting to GPU.
+ * - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip
+ * occurs. Default behavior is that flip occurs before rendering new
+ * frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
+ * - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB backbuffer.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ */
+ void bgfx_reset(uint _width, uint _height, uint _flags, bgfx_texture_format_t _format);
+
+ /**
+ * Advance to next frame. When using multithreaded renderer, this call
+ * just swaps internal buffers, kicks render thread, and returns. In
+ * singlethreaded renderer this call does frame rendering.
+ * Params:
+ * _capture = Capture frame with graphics debugger.
+ */
+ uint bgfx_frame(bool _capture);
+
+ /**
+ * Returns current renderer backend API type.
+ * Remarks:
+ * Library must be initialized.
+ */
+ bgfx_renderer_type_t bgfx_get_renderer_type();
+
+ /**
+ * Returns renderer capabilities.
+ * Remarks:
+ * Library must be initialized.
+ */
+ const(bgfx_caps_t)* bgfx_get_caps();
+
+ /**
+ * Returns performance counters.
+ * Attention: Pointer returned is valid until `bgfx::frame` is called.
+ */
+ const(bgfx_stats_t)* bgfx_get_stats();
+
+ /**
+ * Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.
+ * Params:
+ * _size = Size to allocate.
+ */
+ const(bgfx_memory_t)* bgfx_alloc(uint _size);
+
+ /**
+ * Allocate buffer and copy data into it. Data will be freed inside bgfx.
+ * Params:
+ * _data = Pointer to data to be copied.
+ * _size = Size of data to be copied.
+ */
+ const(bgfx_memory_t)* bgfx_copy(const(void)* _data, uint _size);
+
+ /**
+ * Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
+ * doesn't allocate memory for data. It just copies the _data pointer. You
+ * can pass `ReleaseFn` function pointer to release this memory after it's
+ * consumed, otherwise you must make sure _data is available for at least 2
+ * `bgfx::frame` calls. `ReleaseFn` function must be able to be called
+ * from any thread.
+ * Attention: Data passed must be available for at least 2 `bgfx::frame` calls.
+ * Params:
+ * _data = Pointer to data.
+ * _size = Size of data.
+ */
+ const(bgfx_memory_t)* bgfx_make_ref(const(void)* _data, uint _size);
+
+ /**
+ * Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
+ * doesn't allocate memory for data. It just copies the _data pointer. You
+ * can pass `ReleaseFn` function pointer to release this memory after it's
+ * consumed, otherwise you must make sure _data is available for at least 2
+ * `bgfx::frame` calls. `ReleaseFn` function must be able to be called
+ * from any thread.
+ * Attention: Data passed must be available for at least 2 `bgfx::frame` calls.
+ * Params:
+ * _data = Pointer to data.
+ * _size = Size of data.
+ * _releaseFn = Callback function to release memory after use.
+ * _userData = User data to be passed to callback function.
+ */
+ const(bgfx_memory_t)* bgfx_make_ref_release(const(void)* _data, uint _size, void* _releaseFn, void* _userData);
+
+ /**
+ * Set debug flags.
+ * Params:
+ * _debug = Available flags:
+ * - `BGFX_DEBUG_IFH` - Infinitely fast hardware. When this flag is set
+ * all rendering calls will be skipped. This is useful when profiling
+ * to quickly assess potential bottlenecks between CPU and GPU.
+ * - `BGFX_DEBUG_PROFILER` - Enable profiler.
+ * - `BGFX_DEBUG_STATS` - Display internal statistics.
+ * - `BGFX_DEBUG_TEXT` - Display debug text.
+ * - `BGFX_DEBUG_WIREFRAME` - Wireframe rendering. All rendering
+ * primitives will be rendered as lines.
+ */
+ void bgfx_set_debug(uint _debug);
+
+ /**
+ * Clear internal debug text buffer.
+ * Params:
+ * _attr = Background color.
+ * _small = Default 8x16 or 8x8 font.
+ */
+ void bgfx_dbg_text_clear(byte _attr, bool _small);
+
+ /**
+ * Print formatted data to internal debug text character-buffer (VGA-compatible text mode).
+ * Params:
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _attr = Color palette. Where top 4-bits represent index of background, and bottom
+ * 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
+ * _format = `printf` style format.
+ */
+ void bgfx_dbg_text_printf(ushort _x, ushort _y, byte _attr, const(char)* _format, ... );
+
+ /**
+ * Print formatted data from variable argument list to internal debug text character-buffer (VGA-compatible text mode).
+ * Params:
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _attr = Color palette. Where top 4-bits represent index of background, and bottom
+ * 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
+ * _format = `printf` style format.
+ * _argList = Variable arguments list for format string.
+ */
+ void bgfx_dbg_text_vprintf(ushort _x, ushort _y, byte _attr, const(char)* _format, va_list _argList);
+
+ /**
+ * Draw image into internal debug text buffer.
+ * Params:
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _width = Image width.
+ * _height = Image height.
+ * _data = Raw image data (character/attribute raw encoding).
+ * _pitch = Image pitch in bytes.
+ */
+ void bgfx_dbg_text_image(ushort _x, ushort _y, ushort _width, ushort _height, const(void)* _data, ushort _pitch);
+
+ /**
+ * Create static index buffer.
+ * Params:
+ * _mem = Index buffer data.
+ * _flags = Buffer creation flags.
+ * - `BGFX_BUFFER_NONE` - No flags.
+ * - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
+ * - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
+ * is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
+ * - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
+ * - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
+ * data is passed. If this flag is not specified, and more data is passed on update, the buffer
+ * will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
+ * buffers.
+ * - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
+ * index buffers.
+ */
+ bgfx_index_buffer_handle_t bgfx_create_index_buffer(const(bgfx_memory_t)* _mem, ushort _flags);
+
+ /**
+ * Set static index buffer debug name.
+ * Params:
+ * _handle = Static index buffer handle.
+ * _name = Static index buffer name.
+ * _len = Static index buffer name length (if length is INT32_MAX, it's expected
+ * that _name is zero terminated string.
+ */
+ void bgfx_set_index_buffer_name(bgfx_index_buffer_handle_t _handle, const(char)* _name, int _len);
+
+ /**
+ * Destroy static index buffer.
+ * Params:
+ * _handle = Static index buffer handle.
+ */
+ void bgfx_destroy_index_buffer(bgfx_index_buffer_handle_t _handle);
+
+ /**
+ * Create vertex layout.
+ * Params:
+ * _layout = Vertex layout.
+ */
+ bgfx_vertex_layout_handle_t bgfx_create_vertex_layout(const(bgfx_vertex_layout_t)* _layout);
+
+ /**
+ * Destroy vertex layout.
+ * Params:
+ * _layoutHandle = Vertex layout handle.
+ */
+ void bgfx_destroy_vertex_layout(bgfx_vertex_layout_handle_t _layoutHandle);
+
+ /**
+ * Create static vertex buffer.
+ * Params:
+ * _mem = Vertex buffer data.
+ * _layout = Vertex layout.
+ * _flags = Buffer creation flags.
+ * - `BGFX_BUFFER_NONE` - No flags.
+ * - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
+ * - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
+ * is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
+ * - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
+ * - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
+ * data is passed. If this flag is not specified, and more data is passed on update, the buffer
+ * will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers.
+ * - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
+ */
+ bgfx_vertex_buffer_handle_t bgfx_create_vertex_buffer(const(bgfx_memory_t)* _mem, const(bgfx_vertex_layout_t)* _layout, ushort _flags);
+
+ /**
+ * Set static vertex buffer debug name.
+ * Params:
+ * _handle = Static vertex buffer handle.
+ * _name = Static vertex buffer name.
+ * _len = Static vertex buffer name length (if length is INT32_MAX, it's expected
+ * that _name is zero terminated string.
+ */
+ void bgfx_set_vertex_buffer_name(bgfx_vertex_buffer_handle_t _handle, const(char)* _name, int _len);
+
+ /**
+ * Destroy static vertex buffer.
+ * Params:
+ * _handle = Static vertex buffer handle.
+ */
+ void bgfx_destroy_vertex_buffer(bgfx_vertex_buffer_handle_t _handle);
+
+ /**
+ * Create empty dynamic index buffer.
+ * Params:
+ * _num = Number of indices.
+ * _flags = Buffer creation flags.
+ * - `BGFX_BUFFER_NONE` - No flags.
+ * - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
+ * - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
+ * is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
+ * - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
+ * - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
+ * data is passed. If this flag is not specified, and more data is passed on update, the buffer
+ * will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
+ * buffers.
+ * - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
+ * index buffers.
+ */
+ bgfx_dynamic_index_buffer_handle_t bgfx_create_dynamic_index_buffer(uint _num, ushort _flags);
+
+ /**
+ * Create dynamic index buffer and initialized it.
+ * Params:
+ * _mem = Index buffer data.
+ * _flags = Buffer creation flags.
+ * - `BGFX_BUFFER_NONE` - No flags.
+ * - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
+ * - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
+ * is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
+ * - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
+ * - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
+ * data is passed. If this flag is not specified, and more data is passed on update, the buffer
+ * will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
+ * buffers.
+ * - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
+ * index buffers.
+ */
+ bgfx_dynamic_index_buffer_handle_t bgfx_create_dynamic_index_buffer_mem(const(bgfx_memory_t)* _mem, ushort _flags);
+
+ /**
+ * Update dynamic index buffer.
+ * Params:
+ * _handle = Dynamic index buffer handle.
+ * _startIndex = Start index.
+ * _mem = Index buffer data.
+ */
+ void bgfx_update_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle, uint _startIndex, const(bgfx_memory_t)* _mem);
+
+ /**
+ * Destroy dynamic index buffer.
+ * Params:
+ * _handle = Dynamic index buffer handle.
+ */
+ void bgfx_destroy_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle);
+
+ /**
+ * Create empty dynamic vertex buffer.
+ * Params:
+ * _num = Number of vertices.
+ * _layout = Vertex layout.
+ * _flags = Buffer creation flags.
+ * - `BGFX_BUFFER_NONE` - No flags.
+ * - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
+ * - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
+ * is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
+ * - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
+ * - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
+ * data is passed. If this flag is not specified, and more data is passed on update, the buffer
+ * will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
+ * buffers.
+ * - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
+ * index buffers.
+ */
+ bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer(uint _num, const(bgfx_vertex_layout_t)* _layout, ushort _flags);
+
+ /**
+ * Create dynamic vertex buffer and initialize it.
+ * Params:
+ * _mem = Vertex buffer data.
+ * _layout = Vertex layout.
+ * _flags = Buffer creation flags.
+ * - `BGFX_BUFFER_NONE` - No flags.
+ * - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
+ * - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
+ * is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
+ * - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
+ * - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
+ * data is passed. If this flag is not specified, and more data is passed on update, the buffer
+ * will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
+ * buffers.
+ * - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
+ * index buffers.
+ */
+ bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer_mem(const(bgfx_memory_t)* _mem, const(bgfx_vertex_layout_t)* _layout, ushort _flags);
+
+ /**
+ * Update dynamic vertex buffer.
+ * Params:
+ * _handle = Dynamic vertex buffer handle.
+ * _startVertex = Start vertex.
+ * _mem = Vertex buffer data.
+ */
+ void bgfx_update_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, const(bgfx_memory_t)* _mem);
+
+ /**
+ * Destroy dynamic vertex buffer.
+ * Params:
+ * _handle = Dynamic vertex buffer handle.
+ */
+ void bgfx_destroy_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle);
+
+ /**
+ * Returns number of requested or maximum available indices.
+ * Params:
+ * _num = Number of required indices.
+ */
+ uint bgfx_get_avail_transient_index_buffer(uint _num);
+
+ /**
+ * Returns number of requested or maximum available vertices.
+ * Params:
+ * _num = Number of required vertices.
+ * _layout = Vertex layout.
+ */
+ uint bgfx_get_avail_transient_vertex_buffer(uint _num, const(bgfx_vertex_layout_t)* _layout);
+
+ /**
+ * Returns number of requested or maximum available instance buffer slots.
+ * Params:
+ * _num = Number of required instances.
+ * _stride = Stride per instance.
+ */
+ uint bgfx_get_avail_instance_data_buffer(uint _num, ushort _stride);
+
+ /**
+ * Allocate transient index buffer.
+ * Remarks:
+ * Only 16-bit index buffer is supported.
+ * Params:
+ * _tib = TransientIndexBuffer structure is filled and is valid
+ * for the duration of frame, and it can be reused for multiple draw
+ * calls.
+ * _num = Number of indices to allocate.
+ */
+ void bgfx_alloc_transient_index_buffer(bgfx_transient_index_buffer_t* _tib, uint _num);
+
+ /**
+ * Allocate transient vertex buffer.
+ * Params:
+ * _tvb = TransientVertexBuffer structure is filled and is valid
+ * for the duration of frame, and it can be reused for multiple draw
+ * calls.
+ * _num = Number of vertices to allocate.
+ * _layout = Vertex layout.
+ */
+ void bgfx_alloc_transient_vertex_buffer(bgfx_transient_vertex_buffer_t* _tvb, uint _num, const(bgfx_vertex_layout_t)* _layout);
+
+ /**
+ * Check for required space and allocate transient vertex and index
+ * buffers. If both space requirements are satisfied function returns
+ * true.
+ * Remarks:
+ * Only 16-bit index buffer is supported.
+ * Params:
+ * _tvb = TransientVertexBuffer structure is filled and is valid
+ * for the duration of frame, and it can be reused for multiple draw
+ * calls.
+ * _layout = Vertex layout.
+ * _numVertices = Number of vertices to allocate.
+ * _tib = TransientIndexBuffer structure is filled and is valid
+ * for the duration of frame, and it can be reused for multiple draw
+ * calls.
+ * _numIndices = Number of indices to allocate.
+ */
+ bool bgfx_alloc_transient_buffers(bgfx_transient_vertex_buffer_t* _tvb, const(bgfx_vertex_layout_t)* _layout, uint _numVertices, bgfx_transient_index_buffer_t* _tib, uint _numIndices);
+
+ /**
+ * Allocate instance data buffer.
+ * Params:
+ * _idb = InstanceDataBuffer structure is filled and is valid
+ * for duration of frame, and it can be reused for multiple draw
+ * calls.
+ * _num = Number of instances.
+ * _stride = Instance stride. Must be multiple of 16.
+ */
+ void bgfx_alloc_instance_data_buffer(bgfx_instance_data_buffer_t* _idb, uint _num, ushort _stride);
+
+ /**
+ * Create draw indirect buffer.
+ * Params:
+ * _num = Number of indirect calls.
+ */
+ bgfx_indirect_buffer_handle_t bgfx_create_indirect_buffer(uint _num);
+
+ /**
+ * Destroy draw indirect buffer.
+ * Params:
+ * _handle = Indirect buffer handle.
+ */
+ void bgfx_destroy_indirect_buffer(bgfx_indirect_buffer_handle_t _handle);
+
+ /**
+ * Create shader from memory buffer.
+ * Params:
+ * _mem = Shader binary.
+ */
+ bgfx_shader_handle_t bgfx_create_shader(const(bgfx_memory_t)* _mem);
+
+ /**
+ * Returns the number of uniforms and uniform handles used inside a shader.
+ * Remarks:
+ * Only non-predefined uniforms are returned.
+ * Params:
+ * _handle = Shader handle.
+ * _uniforms = UniformHandle array where data will be stored.
+ * _max = Maximum capacity of array.
+ */
+ ushort bgfx_get_shader_uniforms(bgfx_shader_handle_t _handle, bgfx_uniform_handle_t* _uniforms, ushort _max);
+
+ /**
+ * Set shader debug name.
+ * Params:
+ * _handle = Shader handle.
+ * _name = Shader name.
+ * _len = Shader name length (if length is INT32_MAX, it's expected
+ * that _name is zero terminated string).
+ */
+ void bgfx_set_shader_name(bgfx_shader_handle_t _handle, const(char)* _name, int _len);
+
+ /**
+ * Destroy shader.
+ * Remarks: Once a shader program is created with _handle,
+ * it is safe to destroy that shader.
+ * Params:
+ * _handle = Shader handle.
+ */
+ void bgfx_destroy_shader(bgfx_shader_handle_t _handle);
+
+ /**
+ * Create program with vertex and fragment shaders.
+ * Params:
+ * _vsh = Vertex shader.
+ * _fsh = Fragment shader.
+ * _destroyShaders = If true, shaders will be destroyed when program is destroyed.
+ */
+ bgfx_program_handle_t bgfx_create_program(bgfx_shader_handle_t _vsh, bgfx_shader_handle_t _fsh, bool _destroyShaders);
+
+ /**
+ * Create program with compute shader.
+ * Params:
+ * _csh = Compute shader.
+ * _destroyShaders = If true, shaders will be destroyed when program is destroyed.
+ */
+ bgfx_program_handle_t bgfx_create_compute_program(bgfx_shader_handle_t _csh, bool _destroyShaders);
+
+ /**
+ * Destroy program.
+ * Params:
+ * _handle = Program handle.
+ */
+ void bgfx_destroy_program(bgfx_program_handle_t _handle);
+
+ /**
+ * Validate texture parameters.
+ * Params:
+ * _depth = Depth dimension of volume texture.
+ * _cubeMap = Indicates that texture contains cubemap.
+ * _numLayers = Number of layers in texture array.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _flags = Texture flags. See `BGFX_TEXTURE_*`.
+ */
+ bool bgfx_is_texture_valid(ushort _depth, bool _cubeMap, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags);
+
+ /**
+ * Calculate amount of memory required for texture.
+ * Params:
+ * _info = Resulting texture info structure. See: `TextureInfo`.
+ * _width = Width.
+ * _height = Height.
+ * _depth = Depth dimension of volume texture.
+ * _cubeMap = Indicates that texture contains cubemap.
+ * _hasMips = Indicates that texture contains full mip-map chain.
+ * _numLayers = Number of layers in texture array.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ */
+ void bgfx_calc_texture_size(bgfx_texture_info_t* _info, ushort _width, ushort _height, ushort _depth, bool _cubeMap, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format);
+
+ /**
+ * Create texture from memory buffer.
+ * Params:
+ * _mem = DDS, KTX or PVR texture binary data.
+ * _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ * _skip = Skip top level mips when parsing texture.
+ * _info = When non-`NULL` is specified it returns parsed texture information.
+ */
+ bgfx_texture_handle_t bgfx_create_texture(const(bgfx_memory_t)* _mem, ulong _flags, byte _skip, bgfx_texture_info_t* _info);
+
+ /**
+ * Create 2D texture.
+ * Params:
+ * _width = Width.
+ * _height = Height.
+ * _hasMips = Indicates that texture contains full mip-map chain.
+ * _numLayers = Number of layers in texture array. Must be 1 if caps
+ * `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ * _mem = Texture data. If `_mem` is non-NULL, created texture will be immutable. If
+ * `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
+ * 1, expected memory layout is texture and all mips together for each array element.
+ */
+ bgfx_texture_handle_t bgfx_create_texture_2d(ushort _width, ushort _height, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags, const(bgfx_memory_t)* _mem);
+
+ /**
+ * Create texture with size based on backbuffer ratio. Texture will maintain ratio
+ * if back buffer resolution changes.
+ * Params:
+ * _ratio = Texture size in respect to back-buffer size. See: `BackbufferRatio::Enum`.
+ * _hasMips = Indicates that texture contains full mip-map chain.
+ * _numLayers = Number of layers in texture array. Must be 1 if caps
+ * `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ */
+ bgfx_texture_handle_t bgfx_create_texture_2d_scaled(bgfx_backbuffer_ratio_t _ratio, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags);
+
+ /**
+ * Create 3D texture.
+ * Params:
+ * _width = Width.
+ * _height = Height.
+ * _depth = Depth.
+ * _hasMips = Indicates that texture contains full mip-map chain.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ * _mem = Texture data. If `_mem` is non-NULL, created texture will be immutable. If
+ * `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
+ * 1, expected memory layout is texture and all mips together for each array element.
+ */
+ bgfx_texture_handle_t bgfx_create_texture_3d(ushort _width, ushort _height, ushort _depth, bool _hasMips, bgfx_texture_format_t _format, ulong _flags, const(bgfx_memory_t)* _mem);
+
+ /**
+ * Create Cube texture.
+ * Params:
+ * _size = Cube side size.
+ * _hasMips = Indicates that texture contains full mip-map chain.
+ * _numLayers = Number of layers in texture array. Must be 1 if caps
+ * `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ * _mem = Texture data. If `_mem` is non-NULL, created texture will be immutable. If
+ * `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
+ * 1, expected memory layout is texture and all mips together for each array element.
+ */
+ bgfx_texture_handle_t bgfx_create_texture_cube(ushort _size, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags, const(bgfx_memory_t)* _mem);
+
+ /**
+ * Update 2D texture.
+ * Attention: It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.
+ * Params:
+ * _handle = Texture handle.
+ * _layer = Layer in texture array.
+ * _mip = Mip level.
+ * _x = X offset in texture.
+ * _y = Y offset in texture.
+ * _width = Width of texture block.
+ * _height = Height of texture block.
+ * _mem = Texture update data.
+ * _pitch = Pitch of input image (bytes). When _pitch is set to
+ * UINT16_MAX, it will be calculated internally based on _width.
+ */
+ void bgfx_update_texture_2d(bgfx_texture_handle_t _handle, ushort _layer, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
+
+ /**
+ * Update 3D texture.
+ * Attention: It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.
+ * Params:
+ * _handle = Texture handle.
+ * _mip = Mip level.
+ * _x = X offset in texture.
+ * _y = Y offset in texture.
+ * _z = Z offset in texture.
+ * _width = Width of texture block.
+ * _height = Height of texture block.
+ * _depth = Depth of texture block.
+ * _mem = Texture update data.
+ */
+ void bgfx_update_texture_3d(bgfx_texture_handle_t _handle, byte _mip, ushort _x, ushort _y, ushort _z, ushort _width, ushort _height, ushort _depth, const(bgfx_memory_t)* _mem);
+
+ /**
+ * Update Cube texture.
+ * Attention: It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.
+ * Params:
+ * _handle = Texture handle.
+ * _layer = Layer in texture array.
+ * _side = Cubemap side `BGFX_CUBE_MAP_<POSITIVE or NEGATIVE>_<X, Y or Z>`,
+ * where 0 is +X, 1 is -X, 2 is +Y, 3 is -Y, 4 is +Z, and 5 is -Z.
+ * +----------+
+ * |-z 2|
+ * | ^ +y |
+ * | | | Unfolded cube:
+ * | +---->+x |
+ * +----------+----------+----------+----------+
+ * |+y 1|+y 4|+y 0|+y 5|
+ * | ^ -x | ^ +z | ^ +x | ^ -z |
+ * | | | | | | | | |
+ * | +---->+z | +---->+x | +---->-z | +---->-x |
+ * +----------+----------+----------+----------+
+ * |+z 3|
+ * | ^ -y |
+ * | | |
+ * | +---->+x |
+ * +----------+
+ * _mip = Mip level.
+ * _x = X offset in texture.
+ * _y = Y offset in texture.
+ * _width = Width of texture block.
+ * _height = Height of texture block.
+ * _mem = Texture update data.
+ * _pitch = Pitch of input image (bytes). When _pitch is set to
+ * UINT16_MAX, it will be calculated internally based on _width.
+ */
+ void bgfx_update_texture_cube(bgfx_texture_handle_t _handle, ushort _layer, byte _side, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
+
+ /**
+ * Read back texture content.
+ * Attention: Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
+ * Attention: Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
+ * Params:
+ * _handle = Texture handle.
+ * _data = Destination buffer.
+ * _mip = Mip level.
+ */
+ uint bgfx_read_texture(bgfx_texture_handle_t _handle, void* _data, byte _mip);
+
+ /**
+ * Set texture debug name.
+ * Params:
+ * _handle = Texture handle.
+ * _name = Texture name.
+ * _len = Texture name length (if length is INT32_MAX, it's expected
+ * that _name is zero terminated string.
+ */
+ void bgfx_set_texture_name(bgfx_texture_handle_t _handle, const(char)* _name, int _len);
+
+ /**
+ * Returns texture direct access pointer.
+ * Attention: Availability depends on: `BGFX_CAPS_TEXTURE_DIRECT_ACCESS`. This feature
+ * is available on GPUs that have unified memory architecture (UMA) support.
+ * Params:
+ * _handle = Texture handle.
+ */
+ void* bgfx_get_direct_access_ptr(bgfx_texture_handle_t _handle);
+
+ /**
+ * Destroy texture.
+ * Params:
+ * _handle = Texture handle.
+ */
+ void bgfx_destroy_texture(bgfx_texture_handle_t _handle);
+
+ /**
+ * Create frame buffer (simple).
+ * Params:
+ * _width = Texture width.
+ * _height = Texture height.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _textureFlags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ */
+ bgfx_frame_buffer_handle_t bgfx_create_frame_buffer(ushort _width, ushort _height, bgfx_texture_format_t _format, ulong _textureFlags);
+
+ /**
+ * Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio
+ * if back buffer resolution changes.
+ * Params:
+ * _ratio = Frame buffer size in respect to back-buffer size. See:
+ * `BackbufferRatio::Enum`.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _textureFlags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ */
+ bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_scaled(bgfx_backbuffer_ratio_t _ratio, bgfx_texture_format_t _format, ulong _textureFlags);
+
+ /**
+ * Create MRT frame buffer from texture handles (simple).
+ * Params:
+ * _num = Number of texture handles.
+ * _handles = Texture attachments.
+ * _destroyTexture = If true, textures will be destroyed when
+ * frame buffer is destroyed.
+ */
+ bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_handles(byte _num, const(bgfx_texture_handle_t)* _handles, bool _destroyTexture);
+
+ /**
+ * Create MRT frame buffer from texture handles with specific layer and
+ * mip level.
+ * Params:
+ * _num = Number of attachements.
+ * _attachment = Attachment texture info. See: `bgfx::Attachment`.
+ * _destroyTexture = If true, textures will be destroyed when
+ * frame buffer is destroyed.
+ */
+ bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_attachment(byte _num, const(bgfx_attachment_t)* _attachment, bool _destroyTexture);
+
+ /**
+ * Create frame buffer for multiple window rendering.
+ * Remarks:
+ * Frame buffer cannot be used for sampling.
+ * Attention: Availability depends on: `BGFX_CAPS_SWAP_CHAIN`.
+ * Params:
+ * _nwh = OS' target native window handle.
+ * _width = Window back buffer width.
+ * _height = Window back buffer height.
+ * _format = Window back buffer color format.
+ * _depthFormat = Window back buffer depth format.
+ */
+ bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_nwh(void* _nwh, ushort _width, ushort _height, bgfx_texture_format_t _format, bgfx_texture_format_t _depthFormat);
+
+ /**
+ * Set frame buffer debug name.
+ * Params:
+ * _handle = Frame buffer handle.
+ * _name = Frame buffer name.
+ * _len = Frame buffer name length (if length is INT32_MAX, it's expected
+ * that _name is zero terminated string.
+ */
+ void bgfx_set_frame_buffer_name(bgfx_frame_buffer_handle_t _handle, const(char)* _name, int _len);
+
+ /**
+ * Obtain texture handle of frame buffer attachment.
+ * Params:
+ * _handle = Frame buffer handle.
+ */
+ bgfx_texture_handle_t bgfx_get_texture(bgfx_frame_buffer_handle_t _handle, byte _attachment);
+
+ /**
+ * Destroy frame buffer.
+ * Params:
+ * _handle = Frame buffer handle.
+ */
+ void bgfx_destroy_frame_buffer(bgfx_frame_buffer_handle_t _handle);
+
+ /**
+ * Create shader uniform parameter.
+ * Remarks:
+ * 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
+ * multiple times with the same uniform name. The library will always
+ * return the same handle, but the handle reference count will be
+ * incremented. This means that the same number of `bgfx::destroyUniform`
+ * must be called to properly destroy the uniform.
+ * 2. Predefined uniforms (declared in `bgfx_shader.sh`):
+ * - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
+ * view, in pixels.
+ * - `u_viewTexel vec4(1.0/width, 1.0/height, undef, undef)` - inverse
+ * width and height
+ * - `u_view mat4` - view matrix
+ * - `u_invView mat4` - inverted view matrix
+ * - `u_proj mat4` - projection matrix
+ * - `u_invProj mat4` - inverted projection matrix
+ * - `u_viewProj mat4` - concatenated view projection matrix
+ * - `u_invViewProj mat4` - concatenated inverted view projection matrix
+ * - `u_model mat4[BGFX_CONFIG_MAX_BONES]` - array of model matrices.
+ * - `u_modelView mat4` - concatenated model view matrix, only first
+ * model matrix from array is used.
+ * - `u_modelViewProj mat4` - concatenated model view projection matrix.
+ * - `u_alphaRef float` - alpha reference value for alpha test.
+ * Params:
+ * _name = Uniform name in shader.
+ * _type = Type of uniform (See: `bgfx::UniformType`).
+ * _num = Number of elements in array.
+ */
+ bgfx_uniform_handle_t bgfx_create_uniform(const(char)* _name, bgfx_uniform_type_t _type, ushort _num);
+
+ /**
+ * Retrieve uniform info.
+ * Params:
+ * _handle = Handle to uniform object.
+ * _info = Uniform info.
+ */
+ void bgfx_get_uniform_info(bgfx_uniform_handle_t _handle, bgfx_uniform_info_t* _info);
+
+ /**
+ * Destroy shader uniform parameter.
+ * Params:
+ * _handle = Handle to uniform object.
+ */
+ void bgfx_destroy_uniform(bgfx_uniform_handle_t _handle);
+
+ /**
+ * Create occlusion query.
+ */
+ bgfx_occlusion_query_handle_t bgfx_create_occlusion_query();
+
+ /**
+ * Retrieve occlusion query result from previous frame.
+ * Params:
+ * _handle = Handle to occlusion query object.
+ * _result = Number of pixels that passed test. This argument
+ * can be `NULL` if result of occlusion query is not needed.
+ */
+ bgfx_occlusion_query_result_t bgfx_get_result(bgfx_occlusion_query_handle_t _handle, int* _result);
+
+ /**
+ * Destroy occlusion query.
+ * Params:
+ * _handle = Handle to occlusion query object.
+ */
+ void bgfx_destroy_occlusion_query(bgfx_occlusion_query_handle_t _handle);
+
+ /**
+ * Set palette color value.
+ * Params:
+ * _index = Index into palette.
+ * _rgba = RGBA floating point values.
+ */
+ void bgfx_set_palette_color(byte _index, const float[4] _rgba);
+
+ /**
+ * Set palette color value.
+ * Params:
+ * _index = Index into palette.
+ * _rgba = Packed 32-bit RGBA value.
+ */
+ void bgfx_set_palette_color_rgba8(byte _index, uint _rgba);
+
+ /**
+ * Set view name.
+ * Remarks:
+ * This is debug only feature.
+ * In graphics debugger view name will appear as:
+ * "nnnc <view name>"
+ * ^ ^ ^
+ * | +--- compute (C)
+ * +------ view id
+ * Params:
+ * _id = View id.
+ * _name = View name.
+ */
+ void bgfx_set_view_name(bgfx_view_id_t _id, const(char)* _name);
+
+ /**
+ * Set view rectangle. Draw primitive outside view will be clipped.
+ * Params:
+ * _id = View id.
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _width = Width of view port region.
+ * _height = Height of view port region.
+ */
+ void bgfx_set_view_rect(bgfx_view_id_t _id, ushort _x, ushort _y, ushort _width, ushort _height);
+
+ /**
+ * Set view rectangle. Draw primitive outside view will be clipped.
+ * Params:
+ * _id = View id.
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _ratio = Width and height will be set in respect to back-buffer size.
+ * See: `BackbufferRatio::Enum`.
+ */
+ void bgfx_set_view_rect_ratio(bgfx_view_id_t _id, ushort _x, ushort _y, bgfx_backbuffer_ratio_t _ratio);
+
+ /**
+ * Set view scissor. Draw primitive outside view will be clipped. When
+ * _x, _y, _width and _height are set to 0, scissor will be disabled.
+ * Params:
+ * _id = View id.
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _width = Width of view scissor region.
+ * _height = Height of view scissor region.
+ */
+ void bgfx_set_view_scissor(bgfx_view_id_t _id, ushort _x, ushort _y, ushort _width, ushort _height);
+
+ /**
+ * Set view clear flags.
+ * Params:
+ * _id = View id.
+ * _flags = Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
+ * operation. See: `BGFX_CLEAR_*`.
+ * _rgba = Color clear value.
+ * _depth = Depth clear value.
+ * _stencil = Stencil clear value.
+ */
+ void bgfx_set_view_clear(bgfx_view_id_t _id, ushort _flags, uint _rgba, float _depth, byte _stencil);
+
+ /**
+ * Set view clear flags with different clear color for each
+ * frame buffer texture. Must use `bgfx::setPaletteColor` to setup clear color
+ * palette.
+ * Params:
+ * _id = View id.
+ * _flags = Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
+ * operation. See: `BGFX_CLEAR_*`.
+ * _depth = Depth clear value.
+ * _stencil = Stencil clear value.
+ * _c0 = Palette index for frame buffer attachment 0.
+ * _c1 = Palette index for frame buffer attachment 1.
+ * _c2 = Palette index for frame buffer attachment 2.
+ * _c3 = Palette index for frame buffer attachment 3.
+ * _c4 = Palette index for frame buffer attachment 4.
+ * _c5 = Palette index for frame buffer attachment 5.
+ * _c6 = Palette index for frame buffer attachment 6.
+ * _c7 = Palette index for frame buffer attachment 7.
+ */
+ void bgfx_set_view_clear_mrt(bgfx_view_id_t _id, ushort _flags, float _depth, byte _stencil, byte _c0, byte _c1, byte _c2, byte _c3, byte _c4, byte _c5, byte _c6, byte _c7);
+
+ /**
+ * Set view sorting mode.
+ * Remarks:
+ * View mode must be set prior calling `bgfx::submit` for the view.
+ * Params:
+ * _id = View id.
+ * _mode = View sort mode. See `ViewMode::Enum`.
+ */
+ void bgfx_set_view_mode(bgfx_view_id_t _id, bgfx_view_mode_t _mode);
+
+ /**
+ * Set view frame buffer.
+ * Remarks:
+ * Not persistent after `bgfx::reset` call.
+ * Params:
+ * _id = View id.
+ * _handle = Frame buffer handle. Passing `BGFX_INVALID_HANDLE` as
+ * frame buffer handle will draw primitives from this view into
+ * default back buffer.
+ */
+ void bgfx_set_view_frame_buffer(bgfx_view_id_t _id, bgfx_frame_buffer_handle_t _handle);
+
+ /**
+ * Set view view and projection matrices, all draw primitives in this
+ * view will use these matrices.
+ * Params:
+ * _id = View id.
+ * _view = View matrix.
+ * _proj = Projection matrix.
+ */
+ void bgfx_set_view_transform(bgfx_view_id_t _id, const(void)* _view, const(void)* _proj);
+
+ /**
+ * Post submit view reordering.
+ * Params:
+ * _id = First view id.
+ * _num = Number of views to remap.
+ * _order = View remap id table. Passing `NULL` will reset view ids
+ * to default state.
+ */
+ void bgfx_set_view_order(bgfx_view_id_t _id, ushort _num, const(bgfx_view_id_t)* _order);
+
+ /**
+ * Begin submitting draw calls from thread.
+ * Params:
+ * _forThread = Explicitly request an encoder for a worker thread.
+ */
+ bgfx_encoder_t* bgfx_encoder_begin(bool _forThread);
+
+ /**
+ * End submitting draw calls from thread.
+ * Params:
+ * _encoder = Encoder.
+ */
+ void bgfx_encoder_end(bgfx_encoder_t* _encoder);
+
+ /**
+ * Sets a debug marker. This allows you to group graphics calls together for easy browsing in
+ * graphics debugging tools.
+ * Params:
+ * _marker = Marker string.
+ */
+ void bgfx_encoder_set_marker(bgfx_encoder_t* _this, const(char)* _marker);
+
+ /**
+ * Set render states for draw primitive.
+ * Remarks:
+ * 1. To setup more complex states use:
+ * `BGFX_STATE_ALPHA_REF(_ref)`,
+ * `BGFX_STATE_POINT_SIZE(_size)`,
+ * `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
+ * `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
+ * `BGFX_STATE_BLEND_EQUATION(_equation)`,
+ * `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
+ * 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
+ * equation is specified.
+ * Params:
+ * _state = State flags. Default state for primitive type is
+ * triangles. See: `BGFX_STATE_DEFAULT`.
+ * - `BGFX_STATE_DEPTH_TEST_*` - Depth test function.
+ * - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC.
+ * - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2.
+ * - `BGFX_STATE_CULL_*` - Backface culling mode.
+ * - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write.
+ * - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing.
+ * - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.
+ * _rgba = Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and
+ * `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
+ */
+ void bgfx_encoder_set_state(bgfx_encoder_t* _this, ulong _state, uint _rgba);
+
+ /**
+ * Set condition for rendering.
+ * Params:
+ * _handle = Occlusion query handle.
+ * _visible = Render if occlusion query is visible.
+ */
+ void bgfx_encoder_set_condition(bgfx_encoder_t* _this, bgfx_occlusion_query_handle_t _handle, bool _visible);
+
+ /**
+ * Set stencil test state.
+ * Params:
+ * _fstencil = Front stencil state.
+ * _bstencil = Back stencil state. If back is set to `BGFX_STENCIL_NONE`
+ * _fstencil is applied to both front and back facing primitives.
+ */
+ void bgfx_encoder_set_stencil(bgfx_encoder_t* _this, uint _fstencil, uint _bstencil);
+
+ /**
+ * Set scissor for draw primitive.
+ * Remarks:
+ * To scissor for all primitives in view see `bgfx::setViewScissor`.
+ * Params:
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _width = Width of view scissor region.
+ * _height = Height of view scissor region.
+ */
+ ushort bgfx_encoder_set_scissor(bgfx_encoder_t* _this, ushort _x, ushort _y, ushort _width, ushort _height);
+
+ /**
+ * Set scissor from cache for draw primitive.
+ * Remarks:
+ * To scissor for all primitives in view see `bgfx::setViewScissor`.
+ * Params:
+ * _cache = Index in scissor cache.
+ */
+ void bgfx_encoder_set_scissor_cached(bgfx_encoder_t* _this, ushort _cache);
+
+ /**
+ * Set model matrix for draw primitive. If it is not called,
+ * the model will be rendered with an identity model matrix.
+ * Params:
+ * _mtx = Pointer to first matrix in array.
+ * _num = Number of matrices in array.
+ */
+ uint bgfx_encoder_set_transform(bgfx_encoder_t* _this, const(void)* _mtx, ushort _num);
+
+ /**
+ * Set model matrix from matrix cache for draw primitive.
+ * Params:
+ * _cache = Index in matrix cache.
+ * _num = Number of matrices from cache.
+ */
+ void bgfx_encoder_set_transform_cached(bgfx_encoder_t* _this, uint _cache, ushort _num);
+
+ /**
+ * Reserve matrices in internal matrix cache.
+ * Attention: Pointer returned can be modifed until `bgfx::frame` is called.
+ * Params:
+ * _transform = Pointer to `Transform` structure.
+ * _num = Number of matrices.
+ */
+ uint bgfx_encoder_alloc_transform(bgfx_encoder_t* _this, bgfx_transform_t* _transform, ushort _num);
+
+ /**
+ * Set shader uniform parameter for draw primitive.
+ * Params:
+ * _handle = Uniform.
+ * _value = Pointer to uniform data.
+ * _num = Number of elements. Passing `UINT16_MAX` will
+ * use the _num passed on uniform creation.
+ */
+ void bgfx_encoder_set_uniform(bgfx_encoder_t* _this, bgfx_uniform_handle_t _handle, const(void)* _value, ushort _num);
+
+ /**
+ * Set index buffer for draw primitive.
+ * Params:
+ * _handle = Index buffer.
+ * _firstIndex = First index to render.
+ * _numIndices = Number of indices to render.
+ */
+ void bgfx_encoder_set_index_buffer(bgfx_encoder_t* _this, bgfx_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
+
+ /**
+ * Set index buffer for draw primitive.
+ * Params:
+ * _handle = Dynamic index buffer.
+ * _firstIndex = First index to render.
+ * _numIndices = Number of indices to render.
+ */
+ void bgfx_encoder_set_dynamic_index_buffer(bgfx_encoder_t* _this, bgfx_dynamic_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
+
+ /**
+ * Set index buffer for draw primitive.
+ * Params:
+ * _tib = Transient index buffer.
+ * _firstIndex = First index to render.
+ * _numIndices = Number of indices to render.
+ */
+ void bgfx_encoder_set_transient_index_buffer(bgfx_encoder_t* _this, const(bgfx_transient_index_buffer_t)* _tib, uint _firstIndex, uint _numIndices);
+
+ /**
+ * Set vertex buffer for draw primitive.
+ * Params:
+ * _stream = Vertex stream.
+ * _handle = Vertex buffer.
+ * _startVertex = First vertex to render.
+ * _numVertices = Number of vertices to render.
+ * _layoutHandle = Vertex layout for aliasing vertex buffer.
+ */
+ void bgfx_encoder_set_vertex_buffer(bgfx_encoder_t* _this, byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+
+ /**
+ * Set vertex buffer for draw primitive.
+ * Params:
+ * _stream = Vertex stream.
+ * _handle = Dynamic vertex buffer.
+ * _startVertex = First vertex to render.
+ * _numVertices = Number of vertices to render.
+ * _layoutHandle = Vertex layout for aliasing vertex buffer.
+ */
+ void bgfx_encoder_set_dynamic_vertex_buffer(bgfx_encoder_t* _this, byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+
+ /**
+ * Set vertex buffer for draw primitive.
+ * Params:
+ * _stream = Vertex stream.
+ * _tvb = Transient vertex buffer.
+ * _startVertex = First vertex to render.
+ * _numVertices = Number of vertices to render.
+ * _layoutHandle = Vertex layout for aliasing vertex buffer.
+ */
+ void bgfx_encoder_set_transient_vertex_buffer(bgfx_encoder_t* _this, byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+
+ /**
+ * Set number of vertices for auto generated vertices use in conjuction
+ * with gl_VertexID.
+ * Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
+ * Params:
+ * _numVertices = Number of vertices.
+ */
+ void bgfx_encoder_set_vertex_count(bgfx_encoder_t* _this, uint _numVertices);
+
+ /**
+ * Set instance data buffer for draw primitive.
+ * Params:
+ * _idb = Transient instance data buffer.
+ * _start = First instance data.
+ * _num = Number of data instances.
+ */
+ void bgfx_encoder_set_instance_data_buffer(bgfx_encoder_t* _this, const(bgfx_instance_data_buffer_t)* _idb, uint _start, uint _num);
+
+ /**
+ * Set instance data buffer for draw primitive.
+ * Params:
+ * _handle = Vertex buffer.
+ * _startVertex = First instance data.
+ * _num = Number of data instances.
+ * Set instance data buffer for draw primitive.
+ */
+ void bgfx_encoder_set_instance_data_from_vertex_buffer(bgfx_encoder_t* _this, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
+
+ /**
+ * Set instance data buffer for draw primitive.
+ * Params:
+ * _handle = Dynamic vertex buffer.
+ * _startVertex = First instance data.
+ * _num = Number of data instances.
+ */
+ void bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer(bgfx_encoder_t* _this, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
+
+ /**
+ * Set number of instances for auto generated instances use in conjuction
+ * with gl_InstanceID.
+ * Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
+ */
+ void bgfx_encoder_set_instance_count(bgfx_encoder_t* _this, uint _numInstances);
+
+ /**
+ * Set texture stage for draw primitive.
+ * Params:
+ * _stage = Texture unit.
+ * _sampler = Program sampler.
+ * _handle = Texture handle.
+ * _flags = Texture sampling mode. Default value UINT32_MAX uses
+ * texture sampling settings from the texture.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ */
+ void bgfx_encoder_set_texture(bgfx_encoder_t* _this, byte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
+
+ /**
+ * Submit an empty primitive for rendering. Uniforms and draw state
+ * will be applied but no geometry will be submitted.
+ * Remarks:
+ * These empty draw calls will sort before ordinary draw calls.
+ * Params:
+ * _id = View id.
+ */
+ void bgfx_encoder_touch(bgfx_encoder_t* _this, bgfx_view_id_t _id);
+
+ /**
+ * Submit primitive for rendering.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _depth = Depth for sorting.
+ * _preserveState = Preserve internal draw state for next draw call submit.
+ */
+ void bgfx_encoder_submit(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, bool _preserveState);
+
+ /**
+ * Submit primitive with occlusion query for rendering.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _occlusionQuery = Occlusion query.
+ * _depth = Depth for sorting.
+ * _preserveState = Preserve internal draw state for next draw call submit.
+ */
+ void bgfx_encoder_submit_occlusion_query(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, bool _preserveState);
+
+ /**
+ * Submit primitive for rendering with index and instance data info from
+ * indirect buffer.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _indirectHandle = Indirect buffer.
+ * _start = First element in indirect buffer.
+ * _num = Number of dispatches.
+ * _depth = Depth for sorting.
+ * _preserveState = Preserve internal draw state for next draw call submit.
+ */
+ void bgfx_encoder_submit_indirect(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, bool _preserveState);
+
+ /**
+ * Set compute index buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Index buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ void bgfx_encoder_set_compute_index_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
+
+ /**
+ * Set compute vertex buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Vertex buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ void bgfx_encoder_set_compute_vertex_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+
+ /**
+ * Set compute dynamic index buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Dynamic index buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ void bgfx_encoder_set_compute_dynamic_index_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
+
+ /**
+ * Set compute dynamic vertex buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Dynamic vertex buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ void bgfx_encoder_set_compute_dynamic_vertex_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+
+ /**
+ * Set compute indirect buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Indirect buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ void bgfx_encoder_set_compute_indirect_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
+
+ /**
+ * Set compute image from texture.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Texture handle.
+ * _mip = Mip level.
+ * _access = Image access. See `Access::Enum`.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ */
+ void bgfx_encoder_set_image(bgfx_encoder_t* _this, byte _stage, bgfx_texture_handle_t _handle, byte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
+
+ /**
+ * Dispatch compute.
+ * Params:
+ * _id = View id.
+ * _program = Compute program.
+ * _numX = Number of groups X.
+ * _numY = Number of groups Y.
+ * _numZ = Number of groups Z.
+ */
+ void bgfx_encoder_dispatch(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ);
+
+ /**
+ * Dispatch compute indirect.
+ * Params:
+ * _id = View id.
+ * _program = Compute program.
+ * _indirectHandle = Indirect buffer.
+ * _start = First element in indirect buffer.
+ * _num = Number of dispatches.
+ */
+ void bgfx_encoder_dispatch_indirect(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num);
+
+ /**
+ * Discard all previously set state for draw or compute call.
+ */
+ void bgfx_encoder_discard(bgfx_encoder_t* _this);
+
+ /**
+ * Blit 2D texture region between two 2D textures.
+ * Attention: Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
+ * Attention: Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
+ * Params:
+ * _id = View id.
+ * _dst = Destination texture handle.
+ * _dstMip = Destination texture mip level.
+ * _dstX = Destination texture X position.
+ * _dstY = Destination texture Y position.
+ * _dstZ = If texture is 2D this argument should be 0. If destination texture is cube
+ * this argument represents destination texture cube face. For 3D texture this argument
+ * represents destination texture Z position.
+ * _src = Source texture handle.
+ * _srcMip = Source texture mip level.
+ * _srcX = Source texture X position.
+ * _srcY = Source texture Y position.
+ * _srcZ = If texture is 2D this argument should be 0. If source texture is cube
+ * this argument represents source texture cube face. For 3D texture this argument
+ * represents source texture Z position.
+ * _width = Width of region.
+ * _height = Height of region.
+ * _depth = If texture is 3D this argument represents depth of region, otherwise it's
+ * unused.
+ */
+ void bgfx_encoder_blit(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_texture_handle_t _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
+
+ /**
+ * Request screen shot of window back buffer.
+ * Remarks:
+ * `bgfx::CallbackI::screenShot` must be implemented.
+ * Attention: Frame buffer handle must be created with OS' target native window handle.
+ * Params:
+ * _handle = Frame buffer handle. If handle is `BGFX_INVALID_HANDLE` request will be
+ * made for main window back buffer.
+ * _filePath = Will be passed to `bgfx::CallbackI::screenShot` callback.
+ */
+ void bgfx_request_screen_shot(bgfx_frame_buffer_handle_t _handle, const(char)* _filePath);
+
+ /**
+ * Render frame.
+ * Attention: `bgfx::renderFrame` is blocking call. It waits for
+ * `bgfx::frame` to be called from API thread to process frame.
+ * If timeout value is passed call will timeout and return even
+ * if `bgfx::frame` is not called.
+ * Warning: This call should be only used on platforms that don't
+ * allow creating separate rendering thread. If it is called before
+ * to bgfx::init, render thread won't be created by bgfx::init call.
+ * Params:
+ * _msecs = Timeout in milliseconds.
+ */
+ bgfx_render_frame_t bgfx_render_frame(int _msecs);
+
+ /**
+ * Set platform data.
+ * Warning: Must be called before `bgfx::init`.
+ * Params:
+ * _data = Platform data.
+ */
+ void bgfx_set_platform_data(const(bgfx_platform_data_t)* _data);
+
+ /**
+ * Get internal data for interop.
+ * Attention: It's expected you understand some bgfx internals before you
+ * use this call.
+ * Warning: Must be called only on render thread.
+ */
+ const(bgfx_internal_data_t)* bgfx_get_internal_data();
+
+ /**
+ * Override internal texture with externally created texture. Previously
+ * created internal texture will released.
+ * Attention: It's expected you understand some bgfx internals before you
+ * use this call.
+ * Warning: Must be called only on render thread.
+ * Params:
+ * _handle = Texture handle.
+ * _ptr = Native API pointer to texture.
+ */
+ ulong bgfx_override_internal_texture_ptr(bgfx_texture_handle_t _handle, ulong _ptr);
+
+ /**
+ * Override internal texture by creating new texture. Previously created
+ * internal texture will released.
+ * Attention: It's expected you understand some bgfx internals before you
+ * use this call.
+ * Returns: Native API pointer to texture. If result is 0, texture is not created yet from the
+ * main thread.
+ * Warning: Must be called only on render thread.
+ * Params:
+ * _handle = Texture handle.
+ * _width = Width.
+ * _height = Height.
+ * _numMips = Number of mip-maps.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ */
+ ulong bgfx_override_internal_texture(bgfx_texture_handle_t _handle, ushort _width, ushort _height, byte _numMips, bgfx_texture_format_t _format, ulong _flags);
+
+ /**
+ * Sets a debug marker. This allows you to group graphics calls together for easy browsing in
+ * graphics debugging tools.
+ * Params:
+ * _marker = Marker string.
+ */
+ void bgfx_set_marker(const(char)* _marker);
+
+ /**
+ * Set render states for draw primitive.
+ * Remarks:
+ * 1. To setup more complex states use:
+ * `BGFX_STATE_ALPHA_REF(_ref)`,
+ * `BGFX_STATE_POINT_SIZE(_size)`,
+ * `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
+ * `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
+ * `BGFX_STATE_BLEND_EQUATION(_equation)`,
+ * `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
+ * 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
+ * equation is specified.
+ * Params:
+ * _state = State flags. Default state for primitive type is
+ * triangles. See: `BGFX_STATE_DEFAULT`.
+ * - `BGFX_STATE_DEPTH_TEST_*` - Depth test function.
+ * - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC.
+ * - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2.
+ * - `BGFX_STATE_CULL_*` - Backface culling mode.
+ * - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write.
+ * - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing.
+ * - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.
+ * _rgba = Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and
+ * `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
+ */
+ void bgfx_set_state(ulong _state, uint _rgba);
+
+ /**
+ * Set condition for rendering.
+ * Params:
+ * _handle = Occlusion query handle.
+ * _visible = Render if occlusion query is visible.
+ */
+ void bgfx_set_condition(bgfx_occlusion_query_handle_t _handle, bool _visible);
+
+ /**
+ * Set stencil test state.
+ * Params:
+ * _fstencil = Front stencil state.
+ * _bstencil = Back stencil state. If back is set to `BGFX_STENCIL_NONE`
+ * _fstencil is applied to both front and back facing primitives.
+ */
+ void bgfx_set_stencil(uint _fstencil, uint _bstencil);
+
+ /**
+ * Set scissor for draw primitive.
+ * Remarks:
+ * To scissor for all primitives in view see `bgfx::setViewScissor`.
+ * Params:
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _width = Width of view scissor region.
+ * _height = Height of view scissor region.
+ */
+ ushort bgfx_set_scissor(ushort _x, ushort _y, ushort _width, ushort _height);
+
+ /**
+ * Set scissor from cache for draw primitive.
+ * Remarks:
+ * To scissor for all primitives in view see `bgfx::setViewScissor`.
+ * Params:
+ * _cache = Index in scissor cache.
+ */
+ void bgfx_set_scissor_cached(ushort _cache);
+
+ /**
+ * Set model matrix for draw primitive. If it is not called,
+ * the model will be rendered with an identity model matrix.
+ * Params:
+ * _mtx = Pointer to first matrix in array.
+ * _num = Number of matrices in array.
+ */
+ uint bgfx_set_transform(const(void)* _mtx, ushort _num);
+
+ /**
+ * Set model matrix from matrix cache for draw primitive.
+ * Params:
+ * _cache = Index in matrix cache.
+ * _num = Number of matrices from cache.
+ */
+ void bgfx_set_transform_cached(uint _cache, ushort _num);
+
+ /**
+ * Reserve matrices in internal matrix cache.
+ * Attention: Pointer returned can be modifed until `bgfx::frame` is called.
+ * Params:
+ * _transform = Pointer to `Transform` structure.
+ * _num = Number of matrices.
+ */
+ uint bgfx_alloc_transform(bgfx_transform_t* _transform, ushort _num);
+
+ /**
+ * Set shader uniform parameter for draw primitive.
+ * Params:
+ * _handle = Uniform.
+ * _value = Pointer to uniform data.
+ * _num = Number of elements. Passing `UINT16_MAX` will
+ * use the _num passed on uniform creation.
+ */
+ void bgfx_set_uniform(bgfx_uniform_handle_t _handle, const(void)* _value, ushort _num);
+
+ /**
+ * Set index buffer for draw primitive.
+ * Params:
+ * _handle = Index buffer.
+ * _firstIndex = First index to render.
+ * _numIndices = Number of indices to render.
+ */
+ void bgfx_set_index_buffer(bgfx_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
+
+ /**
+ * Set index buffer for draw primitive.
+ * Params:
+ * _handle = Dynamic index buffer.
+ * _firstIndex = First index to render.
+ * _numIndices = Number of indices to render.
+ */
+ void bgfx_set_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
+
+ /**
+ * Set index buffer for draw primitive.
+ * Params:
+ * _tib = Transient index buffer.
+ * _firstIndex = First index to render.
+ * _numIndices = Number of indices to render.
+ */
+ void bgfx_set_transient_index_buffer(const(bgfx_transient_index_buffer_t)* _tib, uint _firstIndex, uint _numIndices);
+
+ /**
+ * Set vertex buffer for draw primitive.
+ * Params:
+ * _stream = Vertex stream.
+ * _handle = Vertex buffer.
+ * _startVertex = First vertex to render.
+ * _numVertices = Number of vertices to render.
+ */
+ void bgfx_set_vertex_buffer(byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
+
+ /**
+ * Set vertex buffer for draw primitive.
+ * Params:
+ * _stream = Vertex stream.
+ * _handle = Dynamic vertex buffer.
+ * _startVertex = First vertex to render.
+ * _numVertices = Number of vertices to render.
+ */
+ void bgfx_set_dynamic_vertex_buffer(byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
+
+ /**
+ * Set vertex buffer for draw primitive.
+ * Params:
+ * _stream = Vertex stream.
+ * _tvb = Transient vertex buffer.
+ * _startVertex = First vertex to render.
+ * _numVertices = Number of vertices to render.
+ */
+ void bgfx_set_transient_vertex_buffer(byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices);
+
+ /**
+ * Set number of vertices for auto generated vertices use in conjuction
+ * with gl_VertexID.
+ * Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
+ * Params:
+ * _numVertices = Number of vertices.
+ */
+ void bgfx_set_vertex_count(uint _numVertices);
+
+ /**
+ * Set instance data buffer for draw primitive.
+ * Params:
+ * _idb = Transient instance data buffer.
+ * _start = First instance data.
+ * _num = Number of data instances.
+ */
+ void bgfx_set_instance_data_buffer(const(bgfx_instance_data_buffer_t)* _idb, uint _start, uint _num);
+
+ /**
+ * Set instance data buffer for draw primitive.
+ * Params:
+ * _handle = Vertex buffer.
+ * _startVertex = First instance data.
+ * _num = Number of data instances.
+ * Set instance data buffer for draw primitive.
+ */
+ void bgfx_set_instance_data_from_vertex_buffer(bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
+
+ /**
+ * Set instance data buffer for draw primitive.
+ * Params:
+ * _handle = Dynamic vertex buffer.
+ * _startVertex = First instance data.
+ * _num = Number of data instances.
+ */
+ void bgfx_set_instance_data_from_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
+
+ /**
+ * Set number of instances for auto generated instances use in conjuction
+ * with gl_InstanceID.
+ * Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
+ */
+ void bgfx_set_instance_count(uint _numInstances);
+
+ /**
+ * Set texture stage for draw primitive.
+ * Params:
+ * _stage = Texture unit.
+ * _sampler = Program sampler.
+ * _handle = Texture handle.
+ * _flags = Texture sampling mode. Default value UINT32_MAX uses
+ * texture sampling settings from the texture.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ */
+ void bgfx_set_texture(byte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
+
+ /**
+ * Submit an empty primitive for rendering. Uniforms and draw state
+ * will be applied but no geometry will be submitted.
+ * Remarks:
+ * These empty draw calls will sort before ordinary draw calls.
+ * Params:
+ * _id = View id.
+ */
+ void bgfx_touch(bgfx_view_id_t _id);
+
+ /**
+ * Submit primitive for rendering.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _depth = Depth for sorting.
+ * _preserveState = Preserve internal draw state for next draw call submit.
+ */
+ void bgfx_submit(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, bool _preserveState);
+
+ /**
+ * Submit primitive with occlusion query for rendering.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _occlusionQuery = Occlusion query.
+ * _depth = Depth for sorting.
+ * _preserveState = Preserve internal draw state for next draw call submit.
+ */
+ void bgfx_submit_occlusion_query(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, bool _preserveState);
+
+ /**
+ * Submit primitive for rendering with index and instance data info from
+ * indirect buffer.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _indirectHandle = Indirect buffer.
+ * _start = First element in indirect buffer.
+ * _num = Number of dispatches.
+ * _depth = Depth for sorting.
+ * _preserveState = Preserve internal draw state for next draw call submit.
+ */
+ void bgfx_submit_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, bool _preserveState);
+
+ /**
+ * Set compute index buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Index buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ void bgfx_set_compute_index_buffer(byte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
+
+ /**
+ * Set compute vertex buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Vertex buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ void bgfx_set_compute_vertex_buffer(byte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+
+ /**
+ * Set compute dynamic index buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Dynamic index buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ void bgfx_set_compute_dynamic_index_buffer(byte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
+
+ /**
+ * Set compute dynamic vertex buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Dynamic vertex buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ void bgfx_set_compute_dynamic_vertex_buffer(byte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+
+ /**
+ * Set compute indirect buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Indirect buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ void bgfx_set_compute_indirect_buffer(byte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
+
+ /**
+ * Set compute image from texture.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Texture handle.
+ * _mip = Mip level.
+ * _access = Image access. See `Access::Enum`.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ */
+ void bgfx_set_image(byte _stage, bgfx_texture_handle_t _handle, byte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
+
+ /**
+ * Dispatch compute.
+ * Params:
+ * _id = View id.
+ * _program = Compute program.
+ * _numX = Number of groups X.
+ * _numY = Number of groups Y.
+ * _numZ = Number of groups Z.
+ */
+ void bgfx_dispatch(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ);
+
+ /**
+ * Dispatch compute indirect.
+ * Params:
+ * _id = View id.
+ * _program = Compute program.
+ * _indirectHandle = Indirect buffer.
+ * _start = First element in indirect buffer.
+ * _num = Number of dispatches.
+ */
+ void bgfx_dispatch_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num);
+
+ /**
+ * Discard all previously set state for draw or compute call.
+ */
+ void bgfx_discard();
+
+ /**
+ * Blit 2D texture region between two 2D textures.
+ * Attention: Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
+ * Attention: Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
+ * Params:
+ * _id = View id.
+ * _dst = Destination texture handle.
+ * _dstMip = Destination texture mip level.
+ * _dstX = Destination texture X position.
+ * _dstY = Destination texture Y position.
+ * _dstZ = If texture is 2D this argument should be 0. If destination texture is cube
+ * this argument represents destination texture cube face. For 3D texture this argument
+ * represents destination texture Z position.
+ * _src = Source texture handle.
+ * _srcMip = Source texture mip level.
+ * _srcX = Source texture X position.
+ * _srcY = Source texture Y position.
+ * _srcZ = If texture is 2D this argument should be 0. If source texture is cube
+ * this argument represents source texture cube face. For 3D texture this argument
+ * represents source texture Z position.
+ * _width = Width of region.
+ * _height = Height of region.
+ * _depth = If texture is 3D this argument represents depth of region, otherwise it's
+ * unused.
+ */
+ void bgfx_blit(bgfx_view_id_t _id, bgfx_texture_handle_t _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
+
+}
+else
+{
+ __gshared
+ {
+ /**
+ * Init attachment.
+ * Params:
+ * _handle = Render target texture handle.
+ * _access = Access. See `Access::Enum`.
+ * _layer = Cubemap side or depth layer/slice.
+ * _mip = Mip level.
+ * _resolve = Resolve flags. See: `BGFX_RESOLVE_*`
+ */
+ alias da_bgfx_attachment_init = void function(bgfx_attachment_t* _this, bgfx_texture_handle_t _handle, bgfx_access_t _access, ushort _layer, ushort _mip, byte _resolve);
+ da_bgfx_attachment_init bgfx_attachment_init;
+
+ /**
+ * Start VertexLayout.
+ */
+ alias da_bgfx_vertex_layout_begin = bgfx_vertex_layout_t* function(bgfx_vertex_layout_t* _this, bgfx_renderer_type_t _rendererType);
+ da_bgfx_vertex_layout_begin bgfx_vertex_layout_begin;
+
+ /**
+ * Add attribute to VertexLayout.
+ * Remarks: Must be called between begin/end.
+ * Params:
+ * _attrib = Attribute semantics. See: `bgfx::Attrib`
+ * _num = Number of elements 1, 2, 3 or 4.
+ * _type = Element type.
+ * _normalized = When using fixed point AttribType (f.e. Uint8)
+ * value will be normalized for vertex shader usage. When normalized
+ * is set to true, AttribType::Uint8 value in range 0-255 will be
+ * in range 0.0-1.0 in vertex shader.
+ * _asInt = Packaging rule for vertexPack, vertexUnpack, and
+ * vertexConvert for AttribType::Uint8 and AttribType::Int16.
+ * Unpacking code must be implemented inside vertex shader.
+ */
+ alias da_bgfx_vertex_layout_add = bgfx_vertex_layout_t* function(bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib, byte _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt);
+ da_bgfx_vertex_layout_add bgfx_vertex_layout_add;
+
+ /**
+ * Decode attribute.
+ * Params:
+ * _attrib = Attribute semantics. See: `bgfx::Attrib`
+ * _num = Number of elements.
+ * _type = Element type.
+ * _normalized = Attribute is normalized.
+ * _asInt = Attribute is packed as int.
+ */
+ alias da_bgfx_vertex_layout_decode = void function(const(bgfx_vertex_layout_t)* _this, bgfx_attrib_t _attrib, byte* _num, bgfx_attrib_type_t* _type, bool* _normalized, bool* _asInt);
+ da_bgfx_vertex_layout_decode bgfx_vertex_layout_decode;
+
+ /**
+ * Returns true if VertexLayout contains attribute.
+ * Params:
+ * _attrib = Attribute semantics. See: `bgfx::Attrib`
+ */
+ alias da_bgfx_vertex_layout_has = bool function(const(bgfx_vertex_layout_t)* _this, bgfx_attrib_t _attrib);
+ da_bgfx_vertex_layout_has bgfx_vertex_layout_has;
+
+ /**
+ * Skip `_num` bytes in vertex stream.
+ */
+ alias da_bgfx_vertex_layout_skip = bgfx_vertex_layout_t* function(bgfx_vertex_layout_t* _this, byte _num);
+ da_bgfx_vertex_layout_skip bgfx_vertex_layout_skip;
+
+ /**
+ * End VertexLayout.
+ */
+ alias da_bgfx_vertex_layout_end = void function(bgfx_vertex_layout_t* _this);
+ da_bgfx_vertex_layout_end bgfx_vertex_layout_end;
+
+ /**
+ * Pack vertex attribute into vertex stream format.
+ * Params:
+ * _input = Value to be packed into vertex stream.
+ * _inputNormalized = `true` if input value is already normalized.
+ * _attr = Attribute to pack.
+ * _layout = Vertex stream layout.
+ * _data = Destination vertex stream where data will be packed.
+ * _index = Vertex index that will be modified.
+ */
+ alias da_bgfx_vertex_pack = void function(const float[4] _input, bool _inputNormalized, bgfx_attrib_t _attr, const(bgfx_vertex_layout_t)* _layout, void* _data, uint _index);
+ da_bgfx_vertex_pack bgfx_vertex_pack;
+
+ /**
+ * Unpack vertex attribute from vertex stream format.
+ * Params:
+ * _output = Result of unpacking.
+ * _attr = Attribute to unpack.
+ * _layout = Vertex stream layout.
+ * _data = Source vertex stream from where data will be unpacked.
+ * _index = Vertex index that will be unpacked.
+ */
+ alias da_bgfx_vertex_unpack = void function(float[4] _output, bgfx_attrib_t _attr, const(bgfx_vertex_layout_t)* _layout, const(void)* _data, uint _index);
+ da_bgfx_vertex_unpack bgfx_vertex_unpack;
+
+ /**
+ * Converts vertex stream data from one vertex stream format to another.
+ * Params:
+ * _dstLayout = Destination vertex stream layout.
+ * _dstData = Destination vertex stream.
+ * _srcLayout = Source vertex stream layout.
+ * _srcData = Source vertex stream data.
+ * _num = Number of vertices to convert from source to destination.
+ */
+ alias da_bgfx_vertex_convert = void function(const(bgfx_vertex_layout_t)* _dstLayout, void* _dstData, const(bgfx_vertex_layout_t)* _srcLayout, const(void)* _srcData, uint _num);
+ da_bgfx_vertex_convert bgfx_vertex_convert;
+
+ /**
+ * Weld vertices.
+ * Params:
+ * _output = Welded vertices remapping table. The size of buffer
+ * must be the same as number of vertices.
+ * _layout = Vertex stream layout.
+ * _data = Vertex stream.
+ * _num = Number of vertices in vertex stream.
+ * _epsilon = Error tolerance for vertex position comparison.
+ */
+ alias da_bgfx_weld_vertices = ushort function(ushort* _output, const(bgfx_vertex_layout_t)* _layout, const(void)* _data, ushort _num, float _epsilon);
+ da_bgfx_weld_vertices bgfx_weld_vertices;
+
+ /**
+ * Convert index buffer for use with different primitive topologies.
+ * Params:
+ * _conversion = Conversion type, see `TopologyConvert::Enum`.
+ * _dst = Destination index buffer. If this argument is NULL
+ * function will return number of indices after conversion.
+ * _dstSize = Destination index buffer in bytes. It must be
+ * large enough to contain output indices. If destination size is
+ * insufficient index buffer will be truncated.
+ * _indices = Source indices.
+ * _numIndices = Number of input indices.
+ * _index32 = Set to `true` if input indices are 32-bit.
+ */
+ alias da_bgfx_topology_convert = uint function(bgfx_topology_convert_t _conversion, void* _dst, uint _dstSize, const(void)* _indices, uint _numIndices, bool _index32);
+ da_bgfx_topology_convert bgfx_topology_convert;
+
+ /**
+ * Sort indices.
+ * Params:
+ * _sort = Sort order, see `TopologySort::Enum`.
+ * _dst = Destination index buffer.
+ * _dstSize = Destination index buffer in bytes. It must be
+ * large enough to contain output indices. If destination size is
+ * insufficient index buffer will be truncated.
+ * _dir = Direction (vector must be normalized).
+ * _pos = Position.
+ * _vertices = Pointer to first vertex represented as
+ * float x, y, z. Must contain at least number of vertices
+ * referencende by index buffer.
+ * _stride = Vertex stride.
+ * _indices = Source indices.
+ * _numIndices = Number of input indices.
+ * _index32 = Set to `true` if input indices are 32-bit.
+ */
+ alias da_bgfx_topology_sort_tri_list = void function(bgfx_topology_sort_t _sort, void* _dst, uint _dstSize, const float[3] _dir, const float[3] _pos, const(void)* _vertices, uint _stride, const(void)* _indices, uint _numIndices, bool _index32);
+ da_bgfx_topology_sort_tri_list bgfx_topology_sort_tri_list;
+
+ /**
+ * Returns supported backend API renderers.
+ * Params:
+ * _max = Maximum number of elements in _enum array.
+ * _enum = Array where supported renderers will be written.
+ */
+ alias da_bgfx_get_supported_renderers = byte function(byte _max, bgfx_renderer_type_t* _enum);
+ da_bgfx_get_supported_renderers bgfx_get_supported_renderers;
+
+ /**
+ * Returns name of renderer.
+ * Params:
+ * _type = Renderer backend type. See: `bgfx::RendererType`
+ */
+ alias da_bgfx_get_renderer_name = const(char)* function(bgfx_renderer_type_t _type);
+ da_bgfx_get_renderer_name bgfx_get_renderer_name;
+
+ alias da_bgfx_init_ctor = void function(bgfx_init_t* _init);
+ da_bgfx_init_ctor bgfx_init_ctor;
+
+ /**
+ * Initialize bgfx library.
+ * Params:
+ * _init = Initialization parameters. See: `bgfx::Init` for more info.
+ */
+ alias da_bgfx_init = bool function(const(bgfx_init_t)* _init);
+ da_bgfx_init bgfx_init;
+
+ /**
+ * Shutdown bgfx library.
+ */
+ alias da_bgfx_shutdown = void function();
+ da_bgfx_shutdown bgfx_shutdown;
+
+ /**
+ * Reset graphic settings and back-buffer size.
+ * Attention: This call doesn't actually change window size, it just
+ * resizes back-buffer. Windowing code has to change window size.
+ * Params:
+ * _width = Back-buffer width.
+ * _height = Back-buffer height.
+ * _flags = See: `BGFX_RESET_*` for more info.
+ * - `BGFX_RESET_NONE` - No reset flags.
+ * - `BGFX_RESET_FULLSCREEN` - Not supported yet.
+ * - `BGFX_RESET_MSAA_X[2/4/8/16]` - Enable 2, 4, 8 or 16 x MSAA.
+ * - `BGFX_RESET_VSYNC` - Enable V-Sync.
+ * - `BGFX_RESET_MAXANISOTROPY` - Turn on/off max anisotropy.
+ * - `BGFX_RESET_CAPTURE` - Begin screen capture.
+ * - `BGFX_RESET_FLUSH_AFTER_RENDER` - Flush rendering after submitting to GPU.
+ * - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip
+ * occurs. Default behavior is that flip occurs before rendering new
+ * frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
+ * - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB backbuffer.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ */
+ alias da_bgfx_reset = void function(uint _width, uint _height, uint _flags, bgfx_texture_format_t _format);
+ da_bgfx_reset bgfx_reset;
+
+ /**
+ * Advance to next frame. When using multithreaded renderer, this call
+ * just swaps internal buffers, kicks render thread, and returns. In
+ * singlethreaded renderer this call does frame rendering.
+ * Params:
+ * _capture = Capture frame with graphics debugger.
+ */
+ alias da_bgfx_frame = uint function(bool _capture);
+ da_bgfx_frame bgfx_frame;
+
+ /**
+ * Returns current renderer backend API type.
+ * Remarks:
+ * Library must be initialized.
+ */
+ alias da_bgfx_get_renderer_type = bgfx_renderer_type_t function();
+ da_bgfx_get_renderer_type bgfx_get_renderer_type;
+
+ /**
+ * Returns renderer capabilities.
+ * Remarks:
+ * Library must be initialized.
+ */
+ alias da_bgfx_get_caps = const(bgfx_caps_t)* function();
+ da_bgfx_get_caps bgfx_get_caps;
+
+ /**
+ * Returns performance counters.
+ * Attention: Pointer returned is valid until `bgfx::frame` is called.
+ */
+ alias da_bgfx_get_stats = const(bgfx_stats_t)* function();
+ da_bgfx_get_stats bgfx_get_stats;
+
+ /**
+ * Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.
+ * Params:
+ * _size = Size to allocate.
+ */
+ alias da_bgfx_alloc = const(bgfx_memory_t)* function(uint _size);
+ da_bgfx_alloc bgfx_alloc;
+
+ /**
+ * Allocate buffer and copy data into it. Data will be freed inside bgfx.
+ * Params:
+ * _data = Pointer to data to be copied.
+ * _size = Size of data to be copied.
+ */
+ alias da_bgfx_copy = const(bgfx_memory_t)* function(const(void)* _data, uint _size);
+ da_bgfx_copy bgfx_copy;
+
+ /**
+ * Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
+ * doesn't allocate memory for data. It just copies the _data pointer. You
+ * can pass `ReleaseFn` function pointer to release this memory after it's
+ * consumed, otherwise you must make sure _data is available for at least 2
+ * `bgfx::frame` calls. `ReleaseFn` function must be able to be called
+ * from any thread.
+ * Attention: Data passed must be available for at least 2 `bgfx::frame` calls.
+ * Params:
+ * _data = Pointer to data.
+ * _size = Size of data.
+ */
+ alias da_bgfx_make_ref = const(bgfx_memory_t)* function(const(void)* _data, uint _size);
+ da_bgfx_make_ref bgfx_make_ref;
+
+ /**
+ * Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
+ * doesn't allocate memory for data. It just copies the _data pointer. You
+ * can pass `ReleaseFn` function pointer to release this memory after it's
+ * consumed, otherwise you must make sure _data is available for at least 2
+ * `bgfx::frame` calls. `ReleaseFn` function must be able to be called
+ * from any thread.
+ * Attention: Data passed must be available for at least 2 `bgfx::frame` calls.
+ * Params:
+ * _data = Pointer to data.
+ * _size = Size of data.
+ * _releaseFn = Callback function to release memory after use.
+ * _userData = User data to be passed to callback function.
+ */
+ alias da_bgfx_make_ref_release = const(bgfx_memory_t)* function(const(void)* _data, uint _size, void* _releaseFn, void* _userData);
+ da_bgfx_make_ref_release bgfx_make_ref_release;
+
+ /**
+ * Set debug flags.
+ * Params:
+ * _debug = Available flags:
+ * - `BGFX_DEBUG_IFH` - Infinitely fast hardware. When this flag is set
+ * all rendering calls will be skipped. This is useful when profiling
+ * to quickly assess potential bottlenecks between CPU and GPU.
+ * - `BGFX_DEBUG_PROFILER` - Enable profiler.
+ * - `BGFX_DEBUG_STATS` - Display internal statistics.
+ * - `BGFX_DEBUG_TEXT` - Display debug text.
+ * - `BGFX_DEBUG_WIREFRAME` - Wireframe rendering. All rendering
+ * primitives will be rendered as lines.
+ */
+ alias da_bgfx_set_debug = void function(uint _debug);
+ da_bgfx_set_debug bgfx_set_debug;
+
+ /**
+ * Clear internal debug text buffer.
+ * Params:
+ * _attr = Background color.
+ * _small = Default 8x16 or 8x8 font.
+ */
+ alias da_bgfx_dbg_text_clear = void function(byte _attr, bool _small);
+ da_bgfx_dbg_text_clear bgfx_dbg_text_clear;
+
+ /**
+ * Print formatted data to internal debug text character-buffer (VGA-compatible text mode).
+ * Params:
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _attr = Color palette. Where top 4-bits represent index of background, and bottom
+ * 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
+ * _format = `printf` style format.
+ */
+ alias da_bgfx_dbg_text_printf = void function(ushort _x, ushort _y, byte _attr, const(char)* _format, ... );
+ da_bgfx_dbg_text_printf bgfx_dbg_text_printf;
+
+ /**
+ * Print formatted data from variable argument list to internal debug text character-buffer (VGA-compatible text mode).
+ * Params:
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _attr = Color palette. Where top 4-bits represent index of background, and bottom
+ * 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
+ * _format = `printf` style format.
+ * _argList = Variable arguments list for format string.
+ */
+ alias da_bgfx_dbg_text_vprintf = void function(ushort _x, ushort _y, byte _attr, const(char)* _format, va_list _argList);
+ da_bgfx_dbg_text_vprintf bgfx_dbg_text_vprintf;
+
+ /**
+ * Draw image into internal debug text buffer.
+ * Params:
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _width = Image width.
+ * _height = Image height.
+ * _data = Raw image data (character/attribute raw encoding).
+ * _pitch = Image pitch in bytes.
+ */
+ alias da_bgfx_dbg_text_image = void function(ushort _x, ushort _y, ushort _width, ushort _height, const(void)* _data, ushort _pitch);
+ da_bgfx_dbg_text_image bgfx_dbg_text_image;
+
+ /**
+ * Create static index buffer.
+ * Params:
+ * _mem = Index buffer data.
+ * _flags = Buffer creation flags.
+ * - `BGFX_BUFFER_NONE` - No flags.
+ * - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
+ * - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
+ * is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
+ * - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
+ * - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
+ * data is passed. If this flag is not specified, and more data is passed on update, the buffer
+ * will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
+ * buffers.
+ * - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
+ * index buffers.
+ */
+ alias da_bgfx_create_index_buffer = bgfx_index_buffer_handle_t function(const(bgfx_memory_t)* _mem, ushort _flags);
+ da_bgfx_create_index_buffer bgfx_create_index_buffer;
+
+ /**
+ * Set static index buffer debug name.
+ * Params:
+ * _handle = Static index buffer handle.
+ * _name = Static index buffer name.
+ * _len = Static index buffer name length (if length is INT32_MAX, it's expected
+ * that _name is zero terminated string.
+ */
+ alias da_bgfx_set_index_buffer_name = void function(bgfx_index_buffer_handle_t _handle, const(char)* _name, int _len);
+ da_bgfx_set_index_buffer_name bgfx_set_index_buffer_name;
+
+ /**
+ * Destroy static index buffer.
+ * Params:
+ * _handle = Static index buffer handle.
+ */
+ alias da_bgfx_destroy_index_buffer = void function(bgfx_index_buffer_handle_t _handle);
+ da_bgfx_destroy_index_buffer bgfx_destroy_index_buffer;
+
+ /**
+ * Create vertex layout.
+ * Params:
+ * _layout = Vertex layout.
+ */
+ alias da_bgfx_create_vertex_layout = bgfx_vertex_layout_handle_t function(const(bgfx_vertex_layout_t)* _layout);
+ da_bgfx_create_vertex_layout bgfx_create_vertex_layout;
+
+ /**
+ * Destroy vertex layout.
+ * Params:
+ * _layoutHandle = Vertex layout handle.
+ */
+ alias da_bgfx_destroy_vertex_layout = void function(bgfx_vertex_layout_handle_t _layoutHandle);
+ da_bgfx_destroy_vertex_layout bgfx_destroy_vertex_layout;
+
+ /**
+ * Create static vertex buffer.
+ * Params:
+ * _mem = Vertex buffer data.
+ * _layout = Vertex layout.
+ * _flags = Buffer creation flags.
+ * - `BGFX_BUFFER_NONE` - No flags.
+ * - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
+ * - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
+ * is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
+ * - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
+ * - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
+ * data is passed. If this flag is not specified, and more data is passed on update, the buffer
+ * will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers.
+ * - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
+ */
+ alias da_bgfx_create_vertex_buffer = bgfx_vertex_buffer_handle_t function(const(bgfx_memory_t)* _mem, const(bgfx_vertex_layout_t)* _layout, ushort _flags);
+ da_bgfx_create_vertex_buffer bgfx_create_vertex_buffer;
+
+ /**
+ * Set static vertex buffer debug name.
+ * Params:
+ * _handle = Static vertex buffer handle.
+ * _name = Static vertex buffer name.
+ * _len = Static vertex buffer name length (if length is INT32_MAX, it's expected
+ * that _name is zero terminated string.
+ */
+ alias da_bgfx_set_vertex_buffer_name = void function(bgfx_vertex_buffer_handle_t _handle, const(char)* _name, int _len);
+ da_bgfx_set_vertex_buffer_name bgfx_set_vertex_buffer_name;
+
+ /**
+ * Destroy static vertex buffer.
+ * Params:
+ * _handle = Static vertex buffer handle.
+ */
+ alias da_bgfx_destroy_vertex_buffer = void function(bgfx_vertex_buffer_handle_t _handle);
+ da_bgfx_destroy_vertex_buffer bgfx_destroy_vertex_buffer;
+
+ /**
+ * Create empty dynamic index buffer.
+ * Params:
+ * _num = Number of indices.
+ * _flags = Buffer creation flags.
+ * - `BGFX_BUFFER_NONE` - No flags.
+ * - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
+ * - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
+ * is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
+ * - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
+ * - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
+ * data is passed. If this flag is not specified, and more data is passed on update, the buffer
+ * will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
+ * buffers.
+ * - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
+ * index buffers.
+ */
+ alias da_bgfx_create_dynamic_index_buffer = bgfx_dynamic_index_buffer_handle_t function(uint _num, ushort _flags);
+ da_bgfx_create_dynamic_index_buffer bgfx_create_dynamic_index_buffer;
+
+ /**
+ * Create dynamic index buffer and initialized it.
+ * Params:
+ * _mem = Index buffer data.
+ * _flags = Buffer creation flags.
+ * - `BGFX_BUFFER_NONE` - No flags.
+ * - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
+ * - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
+ * is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
+ * - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
+ * - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
+ * data is passed. If this flag is not specified, and more data is passed on update, the buffer
+ * will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
+ * buffers.
+ * - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
+ * index buffers.
+ */
+ alias da_bgfx_create_dynamic_index_buffer_mem = bgfx_dynamic_index_buffer_handle_t function(const(bgfx_memory_t)* _mem, ushort _flags);
+ da_bgfx_create_dynamic_index_buffer_mem bgfx_create_dynamic_index_buffer_mem;
+
+ /**
+ * Update dynamic index buffer.
+ * Params:
+ * _handle = Dynamic index buffer handle.
+ * _startIndex = Start index.
+ * _mem = Index buffer data.
+ */
+ alias da_bgfx_update_dynamic_index_buffer = void function(bgfx_dynamic_index_buffer_handle_t _handle, uint _startIndex, const(bgfx_memory_t)* _mem);
+ da_bgfx_update_dynamic_index_buffer bgfx_update_dynamic_index_buffer;
+
+ /**
+ * Destroy dynamic index buffer.
+ * Params:
+ * _handle = Dynamic index buffer handle.
+ */
+ alias da_bgfx_destroy_dynamic_index_buffer = void function(bgfx_dynamic_index_buffer_handle_t _handle);
+ da_bgfx_destroy_dynamic_index_buffer bgfx_destroy_dynamic_index_buffer;
+
+ /**
+ * Create empty dynamic vertex buffer.
+ * Params:
+ * _num = Number of vertices.
+ * _layout = Vertex layout.
+ * _flags = Buffer creation flags.
+ * - `BGFX_BUFFER_NONE` - No flags.
+ * - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
+ * - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
+ * is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
+ * - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
+ * - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
+ * data is passed. If this flag is not specified, and more data is passed on update, the buffer
+ * will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
+ * buffers.
+ * - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
+ * index buffers.
+ */
+ alias da_bgfx_create_dynamic_vertex_buffer = bgfx_dynamic_vertex_buffer_handle_t function(uint _num, const(bgfx_vertex_layout_t)* _layout, ushort _flags);
+ da_bgfx_create_dynamic_vertex_buffer bgfx_create_dynamic_vertex_buffer;
+
+ /**
+ * Create dynamic vertex buffer and initialize it.
+ * Params:
+ * _mem = Vertex buffer data.
+ * _layout = Vertex layout.
+ * _flags = Buffer creation flags.
+ * - `BGFX_BUFFER_NONE` - No flags.
+ * - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
+ * - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
+ * is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
+ * - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
+ * - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of
+ * data is passed. If this flag is not specified, and more data is passed on update, the buffer
+ * will be trimmed to fit the existing buffer size. This flag has effect only on dynamic
+ * buffers.
+ * - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
+ * index buffers.
+ */
+ alias da_bgfx_create_dynamic_vertex_buffer_mem = bgfx_dynamic_vertex_buffer_handle_t function(const(bgfx_memory_t)* _mem, const(bgfx_vertex_layout_t)* _layout, ushort _flags);
+ da_bgfx_create_dynamic_vertex_buffer_mem bgfx_create_dynamic_vertex_buffer_mem;
+
+ /**
+ * Update dynamic vertex buffer.
+ * Params:
+ * _handle = Dynamic vertex buffer handle.
+ * _startVertex = Start vertex.
+ * _mem = Vertex buffer data.
+ */
+ alias da_bgfx_update_dynamic_vertex_buffer = void function(bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, const(bgfx_memory_t)* _mem);
+ da_bgfx_update_dynamic_vertex_buffer bgfx_update_dynamic_vertex_buffer;
+
+ /**
+ * Destroy dynamic vertex buffer.
+ * Params:
+ * _handle = Dynamic vertex buffer handle.
+ */
+ alias da_bgfx_destroy_dynamic_vertex_buffer = void function(bgfx_dynamic_vertex_buffer_handle_t _handle);
+ da_bgfx_destroy_dynamic_vertex_buffer bgfx_destroy_dynamic_vertex_buffer;
+
+ /**
+ * Returns number of requested or maximum available indices.
+ * Params:
+ * _num = Number of required indices.
+ */
+ alias da_bgfx_get_avail_transient_index_buffer = uint function(uint _num);
+ da_bgfx_get_avail_transient_index_buffer bgfx_get_avail_transient_index_buffer;
+
+ /**
+ * Returns number of requested or maximum available vertices.
+ * Params:
+ * _num = Number of required vertices.
+ * _layout = Vertex layout.
+ */
+ alias da_bgfx_get_avail_transient_vertex_buffer = uint function(uint _num, const(bgfx_vertex_layout_t)* _layout);
+ da_bgfx_get_avail_transient_vertex_buffer bgfx_get_avail_transient_vertex_buffer;
+
+ /**
+ * Returns number of requested or maximum available instance buffer slots.
+ * Params:
+ * _num = Number of required instances.
+ * _stride = Stride per instance.
+ */
+ alias da_bgfx_get_avail_instance_data_buffer = uint function(uint _num, ushort _stride);
+ da_bgfx_get_avail_instance_data_buffer bgfx_get_avail_instance_data_buffer;
+
+ /**
+ * Allocate transient index buffer.
+ * Remarks:
+ * Only 16-bit index buffer is supported.
+ * Params:
+ * _tib = TransientIndexBuffer structure is filled and is valid
+ * for the duration of frame, and it can be reused for multiple draw
+ * calls.
+ * _num = Number of indices to allocate.
+ */
+ alias da_bgfx_alloc_transient_index_buffer = void function(bgfx_transient_index_buffer_t* _tib, uint _num);
+ da_bgfx_alloc_transient_index_buffer bgfx_alloc_transient_index_buffer;
+
+ /**
+ * Allocate transient vertex buffer.
+ * Params:
+ * _tvb = TransientVertexBuffer structure is filled and is valid
+ * for the duration of frame, and it can be reused for multiple draw
+ * calls.
+ * _num = Number of vertices to allocate.
+ * _layout = Vertex layout.
+ */
+ alias da_bgfx_alloc_transient_vertex_buffer = void function(bgfx_transient_vertex_buffer_t* _tvb, uint _num, const(bgfx_vertex_layout_t)* _layout);
+ da_bgfx_alloc_transient_vertex_buffer bgfx_alloc_transient_vertex_buffer;
+
+ /**
+ * Check for required space and allocate transient vertex and index
+ * buffers. If both space requirements are satisfied function returns
+ * true.
+ * Remarks:
+ * Only 16-bit index buffer is supported.
+ * Params:
+ * _tvb = TransientVertexBuffer structure is filled and is valid
+ * for the duration of frame, and it can be reused for multiple draw
+ * calls.
+ * _layout = Vertex layout.
+ * _numVertices = Number of vertices to allocate.
+ * _tib = TransientIndexBuffer structure is filled and is valid
+ * for the duration of frame, and it can be reused for multiple draw
+ * calls.
+ * _numIndices = Number of indices to allocate.
+ */
+ alias da_bgfx_alloc_transient_buffers = bool function(bgfx_transient_vertex_buffer_t* _tvb, const(bgfx_vertex_layout_t)* _layout, uint _numVertices, bgfx_transient_index_buffer_t* _tib, uint _numIndices);
+ da_bgfx_alloc_transient_buffers bgfx_alloc_transient_buffers;
+
+ /**
+ * Allocate instance data buffer.
+ * Params:
+ * _idb = InstanceDataBuffer structure is filled and is valid
+ * for duration of frame, and it can be reused for multiple draw
+ * calls.
+ * _num = Number of instances.
+ * _stride = Instance stride. Must be multiple of 16.
+ */
+ alias da_bgfx_alloc_instance_data_buffer = void function(bgfx_instance_data_buffer_t* _idb, uint _num, ushort _stride);
+ da_bgfx_alloc_instance_data_buffer bgfx_alloc_instance_data_buffer;
+
+ /**
+ * Create draw indirect buffer.
+ * Params:
+ * _num = Number of indirect calls.
+ */
+ alias da_bgfx_create_indirect_buffer = bgfx_indirect_buffer_handle_t function(uint _num);
+ da_bgfx_create_indirect_buffer bgfx_create_indirect_buffer;
+
+ /**
+ * Destroy draw indirect buffer.
+ * Params:
+ * _handle = Indirect buffer handle.
+ */
+ alias da_bgfx_destroy_indirect_buffer = void function(bgfx_indirect_buffer_handle_t _handle);
+ da_bgfx_destroy_indirect_buffer bgfx_destroy_indirect_buffer;
+
+ /**
+ * Create shader from memory buffer.
+ * Params:
+ * _mem = Shader binary.
+ */
+ alias da_bgfx_create_shader = bgfx_shader_handle_t function(const(bgfx_memory_t)* _mem);
+ da_bgfx_create_shader bgfx_create_shader;
+
+ /**
+ * Returns the number of uniforms and uniform handles used inside a shader.
+ * Remarks:
+ * Only non-predefined uniforms are returned.
+ * Params:
+ * _handle = Shader handle.
+ * _uniforms = UniformHandle array where data will be stored.
+ * _max = Maximum capacity of array.
+ */
+ alias da_bgfx_get_shader_uniforms = ushort function(bgfx_shader_handle_t _handle, bgfx_uniform_handle_t* _uniforms, ushort _max);
+ da_bgfx_get_shader_uniforms bgfx_get_shader_uniforms;
+
+ /**
+ * Set shader debug name.
+ * Params:
+ * _handle = Shader handle.
+ * _name = Shader name.
+ * _len = Shader name length (if length is INT32_MAX, it's expected
+ * that _name is zero terminated string).
+ */
+ alias da_bgfx_set_shader_name = void function(bgfx_shader_handle_t _handle, const(char)* _name, int _len);
+ da_bgfx_set_shader_name bgfx_set_shader_name;
+
+ /**
+ * Destroy shader.
+ * Remarks: Once a shader program is created with _handle,
+ * it is safe to destroy that shader.
+ * Params:
+ * _handle = Shader handle.
+ */
+ alias da_bgfx_destroy_shader = void function(bgfx_shader_handle_t _handle);
+ da_bgfx_destroy_shader bgfx_destroy_shader;
+
+ /**
+ * Create program with vertex and fragment shaders.
+ * Params:
+ * _vsh = Vertex shader.
+ * _fsh = Fragment shader.
+ * _destroyShaders = If true, shaders will be destroyed when program is destroyed.
+ */
+ alias da_bgfx_create_program = bgfx_program_handle_t function(bgfx_shader_handle_t _vsh, bgfx_shader_handle_t _fsh, bool _destroyShaders);
+ da_bgfx_create_program bgfx_create_program;
+
+ /**
+ * Create program with compute shader.
+ * Params:
+ * _csh = Compute shader.
+ * _destroyShaders = If true, shaders will be destroyed when program is destroyed.
+ */
+ alias da_bgfx_create_compute_program = bgfx_program_handle_t function(bgfx_shader_handle_t _csh, bool _destroyShaders);
+ da_bgfx_create_compute_program bgfx_create_compute_program;
+
+ /**
+ * Destroy program.
+ * Params:
+ * _handle = Program handle.
+ */
+ alias da_bgfx_destroy_program = void function(bgfx_program_handle_t _handle);
+ da_bgfx_destroy_program bgfx_destroy_program;
+
+ /**
+ * Validate texture parameters.
+ * Params:
+ * _depth = Depth dimension of volume texture.
+ * _cubeMap = Indicates that texture contains cubemap.
+ * _numLayers = Number of layers in texture array.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _flags = Texture flags. See `BGFX_TEXTURE_*`.
+ */
+ alias da_bgfx_is_texture_valid = bool function(ushort _depth, bool _cubeMap, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags);
+ da_bgfx_is_texture_valid bgfx_is_texture_valid;
+
+ /**
+ * Calculate amount of memory required for texture.
+ * Params:
+ * _info = Resulting texture info structure. See: `TextureInfo`.
+ * _width = Width.
+ * _height = Height.
+ * _depth = Depth dimension of volume texture.
+ * _cubeMap = Indicates that texture contains cubemap.
+ * _hasMips = Indicates that texture contains full mip-map chain.
+ * _numLayers = Number of layers in texture array.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ */
+ alias da_bgfx_calc_texture_size = void function(bgfx_texture_info_t* _info, ushort _width, ushort _height, ushort _depth, bool _cubeMap, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format);
+ da_bgfx_calc_texture_size bgfx_calc_texture_size;
+
+ /**
+ * Create texture from memory buffer.
+ * Params:
+ * _mem = DDS, KTX or PVR texture binary data.
+ * _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ * _skip = Skip top level mips when parsing texture.
+ * _info = When non-`NULL` is specified it returns parsed texture information.
+ */
+ alias da_bgfx_create_texture = bgfx_texture_handle_t function(const(bgfx_memory_t)* _mem, ulong _flags, byte _skip, bgfx_texture_info_t* _info);
+ da_bgfx_create_texture bgfx_create_texture;
+
+ /**
+ * Create 2D texture.
+ * Params:
+ * _width = Width.
+ * _height = Height.
+ * _hasMips = Indicates that texture contains full mip-map chain.
+ * _numLayers = Number of layers in texture array. Must be 1 if caps
+ * `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ * _mem = Texture data. If `_mem` is non-NULL, created texture will be immutable. If
+ * `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
+ * 1, expected memory layout is texture and all mips together for each array element.
+ */
+ alias da_bgfx_create_texture_2d = bgfx_texture_handle_t function(ushort _width, ushort _height, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags, const(bgfx_memory_t)* _mem);
+ da_bgfx_create_texture_2d bgfx_create_texture_2d;
+
+ /**
+ * Create texture with size based on backbuffer ratio. Texture will maintain ratio
+ * if back buffer resolution changes.
+ * Params:
+ * _ratio = Texture size in respect to back-buffer size. See: `BackbufferRatio::Enum`.
+ * _hasMips = Indicates that texture contains full mip-map chain.
+ * _numLayers = Number of layers in texture array. Must be 1 if caps
+ * `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ */
+ alias da_bgfx_create_texture_2d_scaled = bgfx_texture_handle_t function(bgfx_backbuffer_ratio_t _ratio, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags);
+ da_bgfx_create_texture_2d_scaled bgfx_create_texture_2d_scaled;
+
+ /**
+ * Create 3D texture.
+ * Params:
+ * _width = Width.
+ * _height = Height.
+ * _depth = Depth.
+ * _hasMips = Indicates that texture contains full mip-map chain.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ * _mem = Texture data. If `_mem` is non-NULL, created texture will be immutable. If
+ * `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
+ * 1, expected memory layout is texture and all mips together for each array element.
+ */
+ alias da_bgfx_create_texture_3d = bgfx_texture_handle_t function(ushort _width, ushort _height, ushort _depth, bool _hasMips, bgfx_texture_format_t _format, ulong _flags, const(bgfx_memory_t)* _mem);
+ da_bgfx_create_texture_3d bgfx_create_texture_3d;
+
+ /**
+ * Create Cube texture.
+ * Params:
+ * _size = Cube side size.
+ * _hasMips = Indicates that texture contains full mip-map chain.
+ * _numLayers = Number of layers in texture array. Must be 1 if caps
+ * `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ * _mem = Texture data. If `_mem` is non-NULL, created texture will be immutable. If
+ * `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
+ * 1, expected memory layout is texture and all mips together for each array element.
+ */
+ alias da_bgfx_create_texture_cube = bgfx_texture_handle_t function(ushort _size, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags, const(bgfx_memory_t)* _mem);
+ da_bgfx_create_texture_cube bgfx_create_texture_cube;
+
+ /**
+ * Update 2D texture.
+ * Attention: It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.
+ * Params:
+ * _handle = Texture handle.
+ * _layer = Layer in texture array.
+ * _mip = Mip level.
+ * _x = X offset in texture.
+ * _y = Y offset in texture.
+ * _width = Width of texture block.
+ * _height = Height of texture block.
+ * _mem = Texture update data.
+ * _pitch = Pitch of input image (bytes). When _pitch is set to
+ * UINT16_MAX, it will be calculated internally based on _width.
+ */
+ alias da_bgfx_update_texture_2d = void function(bgfx_texture_handle_t _handle, ushort _layer, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
+ da_bgfx_update_texture_2d bgfx_update_texture_2d;
+
+ /**
+ * Update 3D texture.
+ * Attention: It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.
+ * Params:
+ * _handle = Texture handle.
+ * _mip = Mip level.
+ * _x = X offset in texture.
+ * _y = Y offset in texture.
+ * _z = Z offset in texture.
+ * _width = Width of texture block.
+ * _height = Height of texture block.
+ * _depth = Depth of texture block.
+ * _mem = Texture update data.
+ */
+ alias da_bgfx_update_texture_3d = void function(bgfx_texture_handle_t _handle, byte _mip, ushort _x, ushort _y, ushort _z, ushort _width, ushort _height, ushort _depth, const(bgfx_memory_t)* _mem);
+ da_bgfx_update_texture_3d bgfx_update_texture_3d;
+
+ /**
+ * Update Cube texture.
+ * Attention: It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.
+ * Params:
+ * _handle = Texture handle.
+ * _layer = Layer in texture array.
+ * _side = Cubemap side `BGFX_CUBE_MAP_<POSITIVE or NEGATIVE>_<X, Y or Z>`,
+ * where 0 is +X, 1 is -X, 2 is +Y, 3 is -Y, 4 is +Z, and 5 is -Z.
+ * +----------+
+ * |-z 2|
+ * | ^ +y |
+ * | | | Unfolded cube:
+ * | +---->+x |
+ * +----------+----------+----------+----------+
+ * |+y 1|+y 4|+y 0|+y 5|
+ * | ^ -x | ^ +z | ^ +x | ^ -z |
+ * | | | | | | | | |
+ * | +---->+z | +---->+x | +---->-z | +---->-x |
+ * +----------+----------+----------+----------+
+ * |+z 3|
+ * | ^ -y |
+ * | | |
+ * | +---->+x |
+ * +----------+
+ * _mip = Mip level.
+ * _x = X offset in texture.
+ * _y = Y offset in texture.
+ * _width = Width of texture block.
+ * _height = Height of texture block.
+ * _mem = Texture update data.
+ * _pitch = Pitch of input image (bytes). When _pitch is set to
+ * UINT16_MAX, it will be calculated internally based on _width.
+ */
+ alias da_bgfx_update_texture_cube = void function(bgfx_texture_handle_t _handle, ushort _layer, byte _side, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
+ da_bgfx_update_texture_cube bgfx_update_texture_cube;
+
+ /**
+ * Read back texture content.
+ * Attention: Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
+ * Attention: Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
+ * Params:
+ * _handle = Texture handle.
+ * _data = Destination buffer.
+ * _mip = Mip level.
+ */
+ alias da_bgfx_read_texture = uint function(bgfx_texture_handle_t _handle, void* _data, byte _mip);
+ da_bgfx_read_texture bgfx_read_texture;
+
+ /**
+ * Set texture debug name.
+ * Params:
+ * _handle = Texture handle.
+ * _name = Texture name.
+ * _len = Texture name length (if length is INT32_MAX, it's expected
+ * that _name is zero terminated string.
+ */
+ alias da_bgfx_set_texture_name = void function(bgfx_texture_handle_t _handle, const(char)* _name, int _len);
+ da_bgfx_set_texture_name bgfx_set_texture_name;
+
+ /**
+ * Returns texture direct access pointer.
+ * Attention: Availability depends on: `BGFX_CAPS_TEXTURE_DIRECT_ACCESS`. This feature
+ * is available on GPUs that have unified memory architecture (UMA) support.
+ * Params:
+ * _handle = Texture handle.
+ */
+ alias da_bgfx_get_direct_access_ptr = void* function(bgfx_texture_handle_t _handle);
+ da_bgfx_get_direct_access_ptr bgfx_get_direct_access_ptr;
+
+ /**
+ * Destroy texture.
+ * Params:
+ * _handle = Texture handle.
+ */
+ alias da_bgfx_destroy_texture = void function(bgfx_texture_handle_t _handle);
+ da_bgfx_destroy_texture bgfx_destroy_texture;
+
+ /**
+ * Create frame buffer (simple).
+ * Params:
+ * _width = Texture width.
+ * _height = Texture height.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _textureFlags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ */
+ alias da_bgfx_create_frame_buffer = bgfx_frame_buffer_handle_t function(ushort _width, ushort _height, bgfx_texture_format_t _format, ulong _textureFlags);
+ da_bgfx_create_frame_buffer bgfx_create_frame_buffer;
+
+ /**
+ * Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio
+ * if back buffer resolution changes.
+ * Params:
+ * _ratio = Frame buffer size in respect to back-buffer size. See:
+ * `BackbufferRatio::Enum`.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _textureFlags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ */
+ alias da_bgfx_create_frame_buffer_scaled = bgfx_frame_buffer_handle_t function(bgfx_backbuffer_ratio_t _ratio, bgfx_texture_format_t _format, ulong _textureFlags);
+ da_bgfx_create_frame_buffer_scaled bgfx_create_frame_buffer_scaled;
+
+ /**
+ * Create MRT frame buffer from texture handles (simple).
+ * Params:
+ * _num = Number of texture handles.
+ * _handles = Texture attachments.
+ * _destroyTexture = If true, textures will be destroyed when
+ * frame buffer is destroyed.
+ */
+ alias da_bgfx_create_frame_buffer_from_handles = bgfx_frame_buffer_handle_t function(byte _num, const(bgfx_texture_handle_t)* _handles, bool _destroyTexture);
+ da_bgfx_create_frame_buffer_from_handles bgfx_create_frame_buffer_from_handles;
+
+ /**
+ * Create MRT frame buffer from texture handles with specific layer and
+ * mip level.
+ * Params:
+ * _num = Number of attachements.
+ * _attachment = Attachment texture info. See: `bgfx::Attachment`.
+ * _destroyTexture = If true, textures will be destroyed when
+ * frame buffer is destroyed.
+ */
+ alias da_bgfx_create_frame_buffer_from_attachment = bgfx_frame_buffer_handle_t function(byte _num, const(bgfx_attachment_t)* _attachment, bool _destroyTexture);
+ da_bgfx_create_frame_buffer_from_attachment bgfx_create_frame_buffer_from_attachment;
+
+ /**
+ * Create frame buffer for multiple window rendering.
+ * Remarks:
+ * Frame buffer cannot be used for sampling.
+ * Attention: Availability depends on: `BGFX_CAPS_SWAP_CHAIN`.
+ * Params:
+ * _nwh = OS' target native window handle.
+ * _width = Window back buffer width.
+ * _height = Window back buffer height.
+ * _format = Window back buffer color format.
+ * _depthFormat = Window back buffer depth format.
+ */
+ alias da_bgfx_create_frame_buffer_from_nwh = bgfx_frame_buffer_handle_t function(void* _nwh, ushort _width, ushort _height, bgfx_texture_format_t _format, bgfx_texture_format_t _depthFormat);
+ da_bgfx_create_frame_buffer_from_nwh bgfx_create_frame_buffer_from_nwh;
+
+ /**
+ * Set frame buffer debug name.
+ * Params:
+ * _handle = Frame buffer handle.
+ * _name = Frame buffer name.
+ * _len = Frame buffer name length (if length is INT32_MAX, it's expected
+ * that _name is zero terminated string.
+ */
+ alias da_bgfx_set_frame_buffer_name = void function(bgfx_frame_buffer_handle_t _handle, const(char)* _name, int _len);
+ da_bgfx_set_frame_buffer_name bgfx_set_frame_buffer_name;
+
+ /**
+ * Obtain texture handle of frame buffer attachment.
+ * Params:
+ * _handle = Frame buffer handle.
+ */
+ alias da_bgfx_get_texture = bgfx_texture_handle_t function(bgfx_frame_buffer_handle_t _handle, byte _attachment);
+ da_bgfx_get_texture bgfx_get_texture;
+
+ /**
+ * Destroy frame buffer.
+ * Params:
+ * _handle = Frame buffer handle.
+ */
+ alias da_bgfx_destroy_frame_buffer = void function(bgfx_frame_buffer_handle_t _handle);
+ da_bgfx_destroy_frame_buffer bgfx_destroy_frame_buffer;
+
+ /**
+ * Create shader uniform parameter.
+ * Remarks:
+ * 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
+ * multiple times with the same uniform name. The library will always
+ * return the same handle, but the handle reference count will be
+ * incremented. This means that the same number of `bgfx::destroyUniform`
+ * must be called to properly destroy the uniform.
+ * 2. Predefined uniforms (declared in `bgfx_shader.sh`):
+ * - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
+ * view, in pixels.
+ * - `u_viewTexel vec4(1.0/width, 1.0/height, undef, undef)` - inverse
+ * width and height
+ * - `u_view mat4` - view matrix
+ * - `u_invView mat4` - inverted view matrix
+ * - `u_proj mat4` - projection matrix
+ * - `u_invProj mat4` - inverted projection matrix
+ * - `u_viewProj mat4` - concatenated view projection matrix
+ * - `u_invViewProj mat4` - concatenated inverted view projection matrix
+ * - `u_model mat4[BGFX_CONFIG_MAX_BONES]` - array of model matrices.
+ * - `u_modelView mat4` - concatenated model view matrix, only first
+ * model matrix from array is used.
+ * - `u_modelViewProj mat4` - concatenated model view projection matrix.
+ * - `u_alphaRef float` - alpha reference value for alpha test.
+ * Params:
+ * _name = Uniform name in shader.
+ * _type = Type of uniform (See: `bgfx::UniformType`).
+ * _num = Number of elements in array.
+ */
+ alias da_bgfx_create_uniform = bgfx_uniform_handle_t function(const(char)* _name, bgfx_uniform_type_t _type, ushort _num);
+ da_bgfx_create_uniform bgfx_create_uniform;
+
+ /**
+ * Retrieve uniform info.
+ * Params:
+ * _handle = Handle to uniform object.
+ * _info = Uniform info.
+ */
+ alias da_bgfx_get_uniform_info = void function(bgfx_uniform_handle_t _handle, bgfx_uniform_info_t* _info);
+ da_bgfx_get_uniform_info bgfx_get_uniform_info;
+
+ /**
+ * Destroy shader uniform parameter.
+ * Params:
+ * _handle = Handle to uniform object.
+ */
+ alias da_bgfx_destroy_uniform = void function(bgfx_uniform_handle_t _handle);
+ da_bgfx_destroy_uniform bgfx_destroy_uniform;
+
+ /**
+ * Create occlusion query.
+ */
+ alias da_bgfx_create_occlusion_query = bgfx_occlusion_query_handle_t function();
+ da_bgfx_create_occlusion_query bgfx_create_occlusion_query;
+
+ /**
+ * Retrieve occlusion query result from previous frame.
+ * Params:
+ * _handle = Handle to occlusion query object.
+ * _result = Number of pixels that passed test. This argument
+ * can be `NULL` if result of occlusion query is not needed.
+ */
+ alias da_bgfx_get_result = bgfx_occlusion_query_result_t function(bgfx_occlusion_query_handle_t _handle, int* _result);
+ da_bgfx_get_result bgfx_get_result;
+
+ /**
+ * Destroy occlusion query.
+ * Params:
+ * _handle = Handle to occlusion query object.
+ */
+ alias da_bgfx_destroy_occlusion_query = void function(bgfx_occlusion_query_handle_t _handle);
+ da_bgfx_destroy_occlusion_query bgfx_destroy_occlusion_query;
+
+ /**
+ * Set palette color value.
+ * Params:
+ * _index = Index into palette.
+ * _rgba = RGBA floating point values.
+ */
+ alias da_bgfx_set_palette_color = void function(byte _index, const float[4] _rgba);
+ da_bgfx_set_palette_color bgfx_set_palette_color;
+
+ /**
+ * Set palette color value.
+ * Params:
+ * _index = Index into palette.
+ * _rgba = Packed 32-bit RGBA value.
+ */
+ alias da_bgfx_set_palette_color_rgba8 = void function(byte _index, uint _rgba);
+ da_bgfx_set_palette_color_rgba8 bgfx_set_palette_color_rgba8;
+
+ /**
+ * Set view name.
+ * Remarks:
+ * This is debug only feature.
+ * In graphics debugger view name will appear as:
+ * "nnnc <view name>"
+ * ^ ^ ^
+ * | +--- compute (C)
+ * +------ view id
+ * Params:
+ * _id = View id.
+ * _name = View name.
+ */
+ alias da_bgfx_set_view_name = void function(bgfx_view_id_t _id, const(char)* _name);
+ da_bgfx_set_view_name bgfx_set_view_name;
+
+ /**
+ * Set view rectangle. Draw primitive outside view will be clipped.
+ * Params:
+ * _id = View id.
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _width = Width of view port region.
+ * _height = Height of view port region.
+ */
+ alias da_bgfx_set_view_rect = void function(bgfx_view_id_t _id, ushort _x, ushort _y, ushort _width, ushort _height);
+ da_bgfx_set_view_rect bgfx_set_view_rect;
+
+ /**
+ * Set view rectangle. Draw primitive outside view will be clipped.
+ * Params:
+ * _id = View id.
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _ratio = Width and height will be set in respect to back-buffer size.
+ * See: `BackbufferRatio::Enum`.
+ */
+ alias da_bgfx_set_view_rect_ratio = void function(bgfx_view_id_t _id, ushort _x, ushort _y, bgfx_backbuffer_ratio_t _ratio);
+ da_bgfx_set_view_rect_ratio bgfx_set_view_rect_ratio;
+
+ /**
+ * Set view scissor. Draw primitive outside view will be clipped. When
+ * _x, _y, _width and _height are set to 0, scissor will be disabled.
+ * Params:
+ * _id = View id.
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _width = Width of view scissor region.
+ * _height = Height of view scissor region.
+ */
+ alias da_bgfx_set_view_scissor = void function(bgfx_view_id_t _id, ushort _x, ushort _y, ushort _width, ushort _height);
+ da_bgfx_set_view_scissor bgfx_set_view_scissor;
+
+ /**
+ * Set view clear flags.
+ * Params:
+ * _id = View id.
+ * _flags = Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
+ * operation. See: `BGFX_CLEAR_*`.
+ * _rgba = Color clear value.
+ * _depth = Depth clear value.
+ * _stencil = Stencil clear value.
+ */
+ alias da_bgfx_set_view_clear = void function(bgfx_view_id_t _id, ushort _flags, uint _rgba, float _depth, byte _stencil);
+ da_bgfx_set_view_clear bgfx_set_view_clear;
+
+ /**
+ * Set view clear flags with different clear color for each
+ * frame buffer texture. Must use `bgfx::setPaletteColor` to setup clear color
+ * palette.
+ * Params:
+ * _id = View id.
+ * _flags = Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
+ * operation. See: `BGFX_CLEAR_*`.
+ * _depth = Depth clear value.
+ * _stencil = Stencil clear value.
+ * _c0 = Palette index for frame buffer attachment 0.
+ * _c1 = Palette index for frame buffer attachment 1.
+ * _c2 = Palette index for frame buffer attachment 2.
+ * _c3 = Palette index for frame buffer attachment 3.
+ * _c4 = Palette index for frame buffer attachment 4.
+ * _c5 = Palette index for frame buffer attachment 5.
+ * _c6 = Palette index for frame buffer attachment 6.
+ * _c7 = Palette index for frame buffer attachment 7.
+ */
+ alias da_bgfx_set_view_clear_mrt = void function(bgfx_view_id_t _id, ushort _flags, float _depth, byte _stencil, byte _c0, byte _c1, byte _c2, byte _c3, byte _c4, byte _c5, byte _c6, byte _c7);
+ da_bgfx_set_view_clear_mrt bgfx_set_view_clear_mrt;
+
+ /**
+ * Set view sorting mode.
+ * Remarks:
+ * View mode must be set prior calling `bgfx::submit` for the view.
+ * Params:
+ * _id = View id.
+ * _mode = View sort mode. See `ViewMode::Enum`.
+ */
+ alias da_bgfx_set_view_mode = void function(bgfx_view_id_t _id, bgfx_view_mode_t _mode);
+ da_bgfx_set_view_mode bgfx_set_view_mode;
+
+ /**
+ * Set view frame buffer.
+ * Remarks:
+ * Not persistent after `bgfx::reset` call.
+ * Params:
+ * _id = View id.
+ * _handle = Frame buffer handle. Passing `BGFX_INVALID_HANDLE` as
+ * frame buffer handle will draw primitives from this view into
+ * default back buffer.
+ */
+ alias da_bgfx_set_view_frame_buffer = void function(bgfx_view_id_t _id, bgfx_frame_buffer_handle_t _handle);
+ da_bgfx_set_view_frame_buffer bgfx_set_view_frame_buffer;
+
+ /**
+ * Set view view and projection matrices, all draw primitives in this
+ * view will use these matrices.
+ * Params:
+ * _id = View id.
+ * _view = View matrix.
+ * _proj = Projection matrix.
+ */
+ alias da_bgfx_set_view_transform = void function(bgfx_view_id_t _id, const(void)* _view, const(void)* _proj);
+ da_bgfx_set_view_transform bgfx_set_view_transform;
+
+ /**
+ * Post submit view reordering.
+ * Params:
+ * _id = First view id.
+ * _num = Number of views to remap.
+ * _order = View remap id table. Passing `NULL` will reset view ids
+ * to default state.
+ */
+ alias da_bgfx_set_view_order = void function(bgfx_view_id_t _id, ushort _num, const(bgfx_view_id_t)* _order);
+ da_bgfx_set_view_order bgfx_set_view_order;
+
+ /**
+ * Begin submitting draw calls from thread.
+ * Params:
+ * _forThread = Explicitly request an encoder for a worker thread.
+ */
+ alias da_bgfx_encoder_begin = bgfx_encoder_t* function(bool _forThread);
+ da_bgfx_encoder_begin bgfx_encoder_begin;
+
+ /**
+ * End submitting draw calls from thread.
+ * Params:
+ * _encoder = Encoder.
+ */
+ alias da_bgfx_encoder_end = void function(bgfx_encoder_t* _encoder);
+ da_bgfx_encoder_end bgfx_encoder_end;
+
+ /**
+ * Sets a debug marker. This allows you to group graphics calls together for easy browsing in
+ * graphics debugging tools.
+ * Params:
+ * _marker = Marker string.
+ */
+ alias da_bgfx_encoder_set_marker = void function(bgfx_encoder_t* _this, const(char)* _marker);
+ da_bgfx_encoder_set_marker bgfx_encoder_set_marker;
+
+ /**
+ * Set render states for draw primitive.
+ * Remarks:
+ * 1. To setup more complex states use:
+ * `BGFX_STATE_ALPHA_REF(_ref)`,
+ * `BGFX_STATE_POINT_SIZE(_size)`,
+ * `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
+ * `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
+ * `BGFX_STATE_BLEND_EQUATION(_equation)`,
+ * `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
+ * 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
+ * equation is specified.
+ * Params:
+ * _state = State flags. Default state for primitive type is
+ * triangles. See: `BGFX_STATE_DEFAULT`.
+ * - `BGFX_STATE_DEPTH_TEST_*` - Depth test function.
+ * - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC.
+ * - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2.
+ * - `BGFX_STATE_CULL_*` - Backface culling mode.
+ * - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write.
+ * - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing.
+ * - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.
+ * _rgba = Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and
+ * `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
+ */
+ alias da_bgfx_encoder_set_state = void function(bgfx_encoder_t* _this, ulong _state, uint _rgba);
+ da_bgfx_encoder_set_state bgfx_encoder_set_state;
+
+ /**
+ * Set condition for rendering.
+ * Params:
+ * _handle = Occlusion query handle.
+ * _visible = Render if occlusion query is visible.
+ */
+ alias da_bgfx_encoder_set_condition = void function(bgfx_encoder_t* _this, bgfx_occlusion_query_handle_t _handle, bool _visible);
+ da_bgfx_encoder_set_condition bgfx_encoder_set_condition;
+
+ /**
+ * Set stencil test state.
+ * Params:
+ * _fstencil = Front stencil state.
+ * _bstencil = Back stencil state. If back is set to `BGFX_STENCIL_NONE`
+ * _fstencil is applied to both front and back facing primitives.
+ */
+ alias da_bgfx_encoder_set_stencil = void function(bgfx_encoder_t* _this, uint _fstencil, uint _bstencil);
+ da_bgfx_encoder_set_stencil bgfx_encoder_set_stencil;
+
+ /**
+ * Set scissor for draw primitive.
+ * Remarks:
+ * To scissor for all primitives in view see `bgfx::setViewScissor`.
+ * Params:
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _width = Width of view scissor region.
+ * _height = Height of view scissor region.
+ */
+ alias da_bgfx_encoder_set_scissor = ushort function(bgfx_encoder_t* _this, ushort _x, ushort _y, ushort _width, ushort _height);
+ da_bgfx_encoder_set_scissor bgfx_encoder_set_scissor;
+
+ /**
+ * Set scissor from cache for draw primitive.
+ * Remarks:
+ * To scissor for all primitives in view see `bgfx::setViewScissor`.
+ * Params:
+ * _cache = Index in scissor cache.
+ */
+ alias da_bgfx_encoder_set_scissor_cached = void function(bgfx_encoder_t* _this, ushort _cache);
+ da_bgfx_encoder_set_scissor_cached bgfx_encoder_set_scissor_cached;
+
+ /**
+ * Set model matrix for draw primitive. If it is not called,
+ * the model will be rendered with an identity model matrix.
+ * Params:
+ * _mtx = Pointer to first matrix in array.
+ * _num = Number of matrices in array.
+ */
+ alias da_bgfx_encoder_set_transform = uint function(bgfx_encoder_t* _this, const(void)* _mtx, ushort _num);
+ da_bgfx_encoder_set_transform bgfx_encoder_set_transform;
+
+ /**
+ * Set model matrix from matrix cache for draw primitive.
+ * Params:
+ * _cache = Index in matrix cache.
+ * _num = Number of matrices from cache.
+ */
+ alias da_bgfx_encoder_set_transform_cached = void function(bgfx_encoder_t* _this, uint _cache, ushort _num);
+ da_bgfx_encoder_set_transform_cached bgfx_encoder_set_transform_cached;
+
+ /**
+ * Reserve matrices in internal matrix cache.
+ * Attention: Pointer returned can be modifed until `bgfx::frame` is called.
+ * Params:
+ * _transform = Pointer to `Transform` structure.
+ * _num = Number of matrices.
+ */
+ alias da_bgfx_encoder_alloc_transform = uint function(bgfx_encoder_t* _this, bgfx_transform_t* _transform, ushort _num);
+ da_bgfx_encoder_alloc_transform bgfx_encoder_alloc_transform;
+
+ /**
+ * Set shader uniform parameter for draw primitive.
+ * Params:
+ * _handle = Uniform.
+ * _value = Pointer to uniform data.
+ * _num = Number of elements. Passing `UINT16_MAX` will
+ * use the _num passed on uniform creation.
+ */
+ alias da_bgfx_encoder_set_uniform = void function(bgfx_encoder_t* _this, bgfx_uniform_handle_t _handle, const(void)* _value, ushort _num);
+ da_bgfx_encoder_set_uniform bgfx_encoder_set_uniform;
+
+ /**
+ * Set index buffer for draw primitive.
+ * Params:
+ * _handle = Index buffer.
+ * _firstIndex = First index to render.
+ * _numIndices = Number of indices to render.
+ */
+ alias da_bgfx_encoder_set_index_buffer = void function(bgfx_encoder_t* _this, bgfx_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
+ da_bgfx_encoder_set_index_buffer bgfx_encoder_set_index_buffer;
+
+ /**
+ * Set index buffer for draw primitive.
+ * Params:
+ * _handle = Dynamic index buffer.
+ * _firstIndex = First index to render.
+ * _numIndices = Number of indices to render.
+ */
+ alias da_bgfx_encoder_set_dynamic_index_buffer = void function(bgfx_encoder_t* _this, bgfx_dynamic_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
+ da_bgfx_encoder_set_dynamic_index_buffer bgfx_encoder_set_dynamic_index_buffer;
+
+ /**
+ * Set index buffer for draw primitive.
+ * Params:
+ * _tib = Transient index buffer.
+ * _firstIndex = First index to render.
+ * _numIndices = Number of indices to render.
+ */
+ alias da_bgfx_encoder_set_transient_index_buffer = void function(bgfx_encoder_t* _this, const(bgfx_transient_index_buffer_t)* _tib, uint _firstIndex, uint _numIndices);
+ da_bgfx_encoder_set_transient_index_buffer bgfx_encoder_set_transient_index_buffer;
+
+ /**
+ * Set vertex buffer for draw primitive.
+ * Params:
+ * _stream = Vertex stream.
+ * _handle = Vertex buffer.
+ * _startVertex = First vertex to render.
+ * _numVertices = Number of vertices to render.
+ * _layoutHandle = Vertex layout for aliasing vertex buffer.
+ */
+ alias da_bgfx_encoder_set_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ da_bgfx_encoder_set_vertex_buffer bgfx_encoder_set_vertex_buffer;
+
+ /**
+ * Set vertex buffer for draw primitive.
+ * Params:
+ * _stream = Vertex stream.
+ * _handle = Dynamic vertex buffer.
+ * _startVertex = First vertex to render.
+ * _numVertices = Number of vertices to render.
+ * _layoutHandle = Vertex layout for aliasing vertex buffer.
+ */
+ alias da_bgfx_encoder_set_dynamic_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ da_bgfx_encoder_set_dynamic_vertex_buffer bgfx_encoder_set_dynamic_vertex_buffer;
+
+ /**
+ * Set vertex buffer for draw primitive.
+ * Params:
+ * _stream = Vertex stream.
+ * _tvb = Transient vertex buffer.
+ * _startVertex = First vertex to render.
+ * _numVertices = Number of vertices to render.
+ * _layoutHandle = Vertex layout for aliasing vertex buffer.
+ */
+ alias da_bgfx_encoder_set_transient_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ da_bgfx_encoder_set_transient_vertex_buffer bgfx_encoder_set_transient_vertex_buffer;
+
+ /**
+ * Set number of vertices for auto generated vertices use in conjuction
+ * with gl_VertexID.
+ * Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
+ * Params:
+ * _numVertices = Number of vertices.
+ */
+ alias da_bgfx_encoder_set_vertex_count = void function(bgfx_encoder_t* _this, uint _numVertices);
+ da_bgfx_encoder_set_vertex_count bgfx_encoder_set_vertex_count;
+
+ /**
+ * Set instance data buffer for draw primitive.
+ * Params:
+ * _idb = Transient instance data buffer.
+ * _start = First instance data.
+ * _num = Number of data instances.
+ */
+ alias da_bgfx_encoder_set_instance_data_buffer = void function(bgfx_encoder_t* _this, const(bgfx_instance_data_buffer_t)* _idb, uint _start, uint _num);
+ da_bgfx_encoder_set_instance_data_buffer bgfx_encoder_set_instance_data_buffer;
+
+ /**
+ * Set instance data buffer for draw primitive.
+ * Params:
+ * _handle = Vertex buffer.
+ * _startVertex = First instance data.
+ * _num = Number of data instances.
+ * Set instance data buffer for draw primitive.
+ */
+ alias da_bgfx_encoder_set_instance_data_from_vertex_buffer = void function(bgfx_encoder_t* _this, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
+ da_bgfx_encoder_set_instance_data_from_vertex_buffer bgfx_encoder_set_instance_data_from_vertex_buffer;
+
+ /**
+ * Set instance data buffer for draw primitive.
+ * Params:
+ * _handle = Dynamic vertex buffer.
+ * _startVertex = First instance data.
+ * _num = Number of data instances.
+ */
+ alias da_bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer = void function(bgfx_encoder_t* _this, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
+ da_bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer;
+
+ /**
+ * Set number of instances for auto generated instances use in conjuction
+ * with gl_InstanceID.
+ * Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
+ */
+ alias da_bgfx_encoder_set_instance_count = void function(bgfx_encoder_t* _this, uint _numInstances);
+ da_bgfx_encoder_set_instance_count bgfx_encoder_set_instance_count;
+
+ /**
+ * Set texture stage for draw primitive.
+ * Params:
+ * _stage = Texture unit.
+ * _sampler = Program sampler.
+ * _handle = Texture handle.
+ * _flags = Texture sampling mode. Default value UINT32_MAX uses
+ * texture sampling settings from the texture.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ */
+ alias da_bgfx_encoder_set_texture = void function(bgfx_encoder_t* _this, byte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
+ da_bgfx_encoder_set_texture bgfx_encoder_set_texture;
+
+ /**
+ * Submit an empty primitive for rendering. Uniforms and draw state
+ * will be applied but no geometry will be submitted.
+ * Remarks:
+ * These empty draw calls will sort before ordinary draw calls.
+ * Params:
+ * _id = View id.
+ */
+ alias da_bgfx_encoder_touch = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id);
+ da_bgfx_encoder_touch bgfx_encoder_touch;
+
+ /**
+ * Submit primitive for rendering.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _depth = Depth for sorting.
+ * _preserveState = Preserve internal draw state for next draw call submit.
+ */
+ alias da_bgfx_encoder_submit = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, bool _preserveState);
+ da_bgfx_encoder_submit bgfx_encoder_submit;
+
+ /**
+ * Submit primitive with occlusion query for rendering.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _occlusionQuery = Occlusion query.
+ * _depth = Depth for sorting.
+ * _preserveState = Preserve internal draw state for next draw call submit.
+ */
+ alias da_bgfx_encoder_submit_occlusion_query = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, bool _preserveState);
+ da_bgfx_encoder_submit_occlusion_query bgfx_encoder_submit_occlusion_query;
+
+ /**
+ * Submit primitive for rendering with index and instance data info from
+ * indirect buffer.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _indirectHandle = Indirect buffer.
+ * _start = First element in indirect buffer.
+ * _num = Number of dispatches.
+ * _depth = Depth for sorting.
+ * _preserveState = Preserve internal draw state for next draw call submit.
+ */
+ alias da_bgfx_encoder_submit_indirect = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, bool _preserveState);
+ da_bgfx_encoder_submit_indirect bgfx_encoder_submit_indirect;
+
+ /**
+ * Set compute index buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Index buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ alias da_bgfx_encoder_set_compute_index_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
+ da_bgfx_encoder_set_compute_index_buffer bgfx_encoder_set_compute_index_buffer;
+
+ /**
+ * Set compute vertex buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Vertex buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ alias da_bgfx_encoder_set_compute_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+ da_bgfx_encoder_set_compute_vertex_buffer bgfx_encoder_set_compute_vertex_buffer;
+
+ /**
+ * Set compute dynamic index buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Dynamic index buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ alias da_bgfx_encoder_set_compute_dynamic_index_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
+ da_bgfx_encoder_set_compute_dynamic_index_buffer bgfx_encoder_set_compute_dynamic_index_buffer;
+
+ /**
+ * Set compute dynamic vertex buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Dynamic vertex buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ alias da_bgfx_encoder_set_compute_dynamic_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+ da_bgfx_encoder_set_compute_dynamic_vertex_buffer bgfx_encoder_set_compute_dynamic_vertex_buffer;
+
+ /**
+ * Set compute indirect buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Indirect buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ alias da_bgfx_encoder_set_compute_indirect_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
+ da_bgfx_encoder_set_compute_indirect_buffer bgfx_encoder_set_compute_indirect_buffer;
+
+ /**
+ * Set compute image from texture.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Texture handle.
+ * _mip = Mip level.
+ * _access = Image access. See `Access::Enum`.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ */
+ alias da_bgfx_encoder_set_image = void function(bgfx_encoder_t* _this, byte _stage, bgfx_texture_handle_t _handle, byte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
+ da_bgfx_encoder_set_image bgfx_encoder_set_image;
+
+ /**
+ * Dispatch compute.
+ * Params:
+ * _id = View id.
+ * _program = Compute program.
+ * _numX = Number of groups X.
+ * _numY = Number of groups Y.
+ * _numZ = Number of groups Z.
+ */
+ alias da_bgfx_encoder_dispatch = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ);
+ da_bgfx_encoder_dispatch bgfx_encoder_dispatch;
+
+ /**
+ * Dispatch compute indirect.
+ * Params:
+ * _id = View id.
+ * _program = Compute program.
+ * _indirectHandle = Indirect buffer.
+ * _start = First element in indirect buffer.
+ * _num = Number of dispatches.
+ */
+ alias da_bgfx_encoder_dispatch_indirect = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num);
+ da_bgfx_encoder_dispatch_indirect bgfx_encoder_dispatch_indirect;
+
+ /**
+ * Discard all previously set state for draw or compute call.
+ */
+ alias da_bgfx_encoder_discard = void function(bgfx_encoder_t* _this);
+ da_bgfx_encoder_discard bgfx_encoder_discard;
+
+ /**
+ * Blit 2D texture region between two 2D textures.
+ * Attention: Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
+ * Attention: Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
+ * Params:
+ * _id = View id.
+ * _dst = Destination texture handle.
+ * _dstMip = Destination texture mip level.
+ * _dstX = Destination texture X position.
+ * _dstY = Destination texture Y position.
+ * _dstZ = If texture is 2D this argument should be 0. If destination texture is cube
+ * this argument represents destination texture cube face. For 3D texture this argument
+ * represents destination texture Z position.
+ * _src = Source texture handle.
+ * _srcMip = Source texture mip level.
+ * _srcX = Source texture X position.
+ * _srcY = Source texture Y position.
+ * _srcZ = If texture is 2D this argument should be 0. If source texture is cube
+ * this argument represents source texture cube face. For 3D texture this argument
+ * represents source texture Z position.
+ * _width = Width of region.
+ * _height = Height of region.
+ * _depth = If texture is 3D this argument represents depth of region, otherwise it's
+ * unused.
+ */
+ alias da_bgfx_encoder_blit = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_texture_handle_t _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
+ da_bgfx_encoder_blit bgfx_encoder_blit;
+
+ /**
+ * Request screen shot of window back buffer.
+ * Remarks:
+ * `bgfx::CallbackI::screenShot` must be implemented.
+ * Attention: Frame buffer handle must be created with OS' target native window handle.
+ * Params:
+ * _handle = Frame buffer handle. If handle is `BGFX_INVALID_HANDLE` request will be
+ * made for main window back buffer.
+ * _filePath = Will be passed to `bgfx::CallbackI::screenShot` callback.
+ */
+ alias da_bgfx_request_screen_shot = void function(bgfx_frame_buffer_handle_t _handle, const(char)* _filePath);
+ da_bgfx_request_screen_shot bgfx_request_screen_shot;
+
+ /**
+ * Render frame.
+ * Attention: `bgfx::renderFrame` is blocking call. It waits for
+ * `bgfx::frame` to be called from API thread to process frame.
+ * If timeout value is passed call will timeout and return even
+ * if `bgfx::frame` is not called.
+ * Warning: This call should be only used on platforms that don't
+ * allow creating separate rendering thread. If it is called before
+ * to bgfx::init, render thread won't be created by bgfx::init call.
+ * Params:
+ * _msecs = Timeout in milliseconds.
+ */
+ alias da_bgfx_render_frame = bgfx_render_frame_t function(int _msecs);
+ da_bgfx_render_frame bgfx_render_frame;
+
+ /**
+ * Set platform data.
+ * Warning: Must be called before `bgfx::init`.
+ * Params:
+ * _data = Platform data.
+ */
+ alias da_bgfx_set_platform_data = void function(const(bgfx_platform_data_t)* _data);
+ da_bgfx_set_platform_data bgfx_set_platform_data;
+
+ /**
+ * Get internal data for interop.
+ * Attention: It's expected you understand some bgfx internals before you
+ * use this call.
+ * Warning: Must be called only on render thread.
+ */
+ alias da_bgfx_get_internal_data = const(bgfx_internal_data_t)* function();
+ da_bgfx_get_internal_data bgfx_get_internal_data;
+
+ /**
+ * Override internal texture with externally created texture. Previously
+ * created internal texture will released.
+ * Attention: It's expected you understand some bgfx internals before you
+ * use this call.
+ * Warning: Must be called only on render thread.
+ * Params:
+ * _handle = Texture handle.
+ * _ptr = Native API pointer to texture.
+ */
+ alias da_bgfx_override_internal_texture_ptr = ulong function(bgfx_texture_handle_t _handle, ulong _ptr);
+ da_bgfx_override_internal_texture_ptr bgfx_override_internal_texture_ptr;
+
+ /**
+ * Override internal texture by creating new texture. Previously created
+ * internal texture will released.
+ * Attention: It's expected you understand some bgfx internals before you
+ * use this call.
+ * Returns: Native API pointer to texture. If result is 0, texture is not created yet from the
+ * main thread.
+ * Warning: Must be called only on render thread.
+ * Params:
+ * _handle = Texture handle.
+ * _width = Width.
+ * _height = Height.
+ * _numMips = Number of mip-maps.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ * _flags = Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`)
+ * flags. Default texture sampling mode is linear, and wrap mode is repeat.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ */
+ alias da_bgfx_override_internal_texture = ulong function(bgfx_texture_handle_t _handle, ushort _width, ushort _height, byte _numMips, bgfx_texture_format_t _format, ulong _flags);
+ da_bgfx_override_internal_texture bgfx_override_internal_texture;
+
+ /**
+ * Sets a debug marker. This allows you to group graphics calls together for easy browsing in
+ * graphics debugging tools.
+ * Params:
+ * _marker = Marker string.
+ */
+ alias da_bgfx_set_marker = void function(const(char)* _marker);
+ da_bgfx_set_marker bgfx_set_marker;
+
+ /**
+ * Set render states for draw primitive.
+ * Remarks:
+ * 1. To setup more complex states use:
+ * `BGFX_STATE_ALPHA_REF(_ref)`,
+ * `BGFX_STATE_POINT_SIZE(_size)`,
+ * `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
+ * `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
+ * `BGFX_STATE_BLEND_EQUATION(_equation)`,
+ * `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
+ * 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
+ * equation is specified.
+ * Params:
+ * _state = State flags. Default state for primitive type is
+ * triangles. See: `BGFX_STATE_DEFAULT`.
+ * - `BGFX_STATE_DEPTH_TEST_*` - Depth test function.
+ * - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC.
+ * - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2.
+ * - `BGFX_STATE_CULL_*` - Backface culling mode.
+ * - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write.
+ * - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing.
+ * - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.
+ * _rgba = Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and
+ * `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
+ */
+ alias da_bgfx_set_state = void function(ulong _state, uint _rgba);
+ da_bgfx_set_state bgfx_set_state;
+
+ /**
+ * Set condition for rendering.
+ * Params:
+ * _handle = Occlusion query handle.
+ * _visible = Render if occlusion query is visible.
+ */
+ alias da_bgfx_set_condition = void function(bgfx_occlusion_query_handle_t _handle, bool _visible);
+ da_bgfx_set_condition bgfx_set_condition;
+
+ /**
+ * Set stencil test state.
+ * Params:
+ * _fstencil = Front stencil state.
+ * _bstencil = Back stencil state. If back is set to `BGFX_STENCIL_NONE`
+ * _fstencil is applied to both front and back facing primitives.
+ */
+ alias da_bgfx_set_stencil = void function(uint _fstencil, uint _bstencil);
+ da_bgfx_set_stencil bgfx_set_stencil;
+
+ /**
+ * Set scissor for draw primitive.
+ * Remarks:
+ * To scissor for all primitives in view see `bgfx::setViewScissor`.
+ * Params:
+ * _x = Position x from the left corner of the window.
+ * _y = Position y from the top corner of the window.
+ * _width = Width of view scissor region.
+ * _height = Height of view scissor region.
+ */
+ alias da_bgfx_set_scissor = ushort function(ushort _x, ushort _y, ushort _width, ushort _height);
+ da_bgfx_set_scissor bgfx_set_scissor;
+
+ /**
+ * Set scissor from cache for draw primitive.
+ * Remarks:
+ * To scissor for all primitives in view see `bgfx::setViewScissor`.
+ * Params:
+ * _cache = Index in scissor cache.
+ */
+ alias da_bgfx_set_scissor_cached = void function(ushort _cache);
+ da_bgfx_set_scissor_cached bgfx_set_scissor_cached;
+
+ /**
+ * Set model matrix for draw primitive. If it is not called,
+ * the model will be rendered with an identity model matrix.
+ * Params:
+ * _mtx = Pointer to first matrix in array.
+ * _num = Number of matrices in array.
+ */
+ alias da_bgfx_set_transform = uint function(const(void)* _mtx, ushort _num);
+ da_bgfx_set_transform bgfx_set_transform;
+
+ /**
+ * Set model matrix from matrix cache for draw primitive.
+ * Params:
+ * _cache = Index in matrix cache.
+ * _num = Number of matrices from cache.
+ */
+ alias da_bgfx_set_transform_cached = void function(uint _cache, ushort _num);
+ da_bgfx_set_transform_cached bgfx_set_transform_cached;
+
+ /**
+ * Reserve matrices in internal matrix cache.
+ * Attention: Pointer returned can be modifed until `bgfx::frame` is called.
+ * Params:
+ * _transform = Pointer to `Transform` structure.
+ * _num = Number of matrices.
+ */
+ alias da_bgfx_alloc_transform = uint function(bgfx_transform_t* _transform, ushort _num);
+ da_bgfx_alloc_transform bgfx_alloc_transform;
+
+ /**
+ * Set shader uniform parameter for draw primitive.
+ * Params:
+ * _handle = Uniform.
+ * _value = Pointer to uniform data.
+ * _num = Number of elements. Passing `UINT16_MAX` will
+ * use the _num passed on uniform creation.
+ */
+ alias da_bgfx_set_uniform = void function(bgfx_uniform_handle_t _handle, const(void)* _value, ushort _num);
+ da_bgfx_set_uniform bgfx_set_uniform;
+
+ /**
+ * Set index buffer for draw primitive.
+ * Params:
+ * _handle = Index buffer.
+ * _firstIndex = First index to render.
+ * _numIndices = Number of indices to render.
+ */
+ alias da_bgfx_set_index_buffer = void function(bgfx_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
+ da_bgfx_set_index_buffer bgfx_set_index_buffer;
+
+ /**
+ * Set index buffer for draw primitive.
+ * Params:
+ * _handle = Dynamic index buffer.
+ * _firstIndex = First index to render.
+ * _numIndices = Number of indices to render.
+ */
+ alias da_bgfx_set_dynamic_index_buffer = void function(bgfx_dynamic_index_buffer_handle_t _handle, uint _firstIndex, uint _numIndices);
+ da_bgfx_set_dynamic_index_buffer bgfx_set_dynamic_index_buffer;
+
+ /**
+ * Set index buffer for draw primitive.
+ * Params:
+ * _tib = Transient index buffer.
+ * _firstIndex = First index to render.
+ * _numIndices = Number of indices to render.
+ */
+ alias da_bgfx_set_transient_index_buffer = void function(const(bgfx_transient_index_buffer_t)* _tib, uint _firstIndex, uint _numIndices);
+ da_bgfx_set_transient_index_buffer bgfx_set_transient_index_buffer;
+
+ /**
+ * Set vertex buffer for draw primitive.
+ * Params:
+ * _stream = Vertex stream.
+ * _handle = Vertex buffer.
+ * _startVertex = First vertex to render.
+ * _numVertices = Number of vertices to render.
+ */
+ alias da_bgfx_set_vertex_buffer = void function(byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
+ da_bgfx_set_vertex_buffer bgfx_set_vertex_buffer;
+
+ /**
+ * Set vertex buffer for draw primitive.
+ * Params:
+ * _stream = Vertex stream.
+ * _handle = Dynamic vertex buffer.
+ * _startVertex = First vertex to render.
+ * _numVertices = Number of vertices to render.
+ */
+ alias da_bgfx_set_dynamic_vertex_buffer = void function(byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
+ da_bgfx_set_dynamic_vertex_buffer bgfx_set_dynamic_vertex_buffer;
+
+ /**
+ * Set vertex buffer for draw primitive.
+ * Params:
+ * _stream = Vertex stream.
+ * _tvb = Transient vertex buffer.
+ * _startVertex = First vertex to render.
+ * _numVertices = Number of vertices to render.
+ */
+ alias da_bgfx_set_transient_vertex_buffer = void function(byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices);
+ da_bgfx_set_transient_vertex_buffer bgfx_set_transient_vertex_buffer;
+
+ /**
+ * Set number of vertices for auto generated vertices use in conjuction
+ * with gl_VertexID.
+ * Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
+ * Params:
+ * _numVertices = Number of vertices.
+ */
+ alias da_bgfx_set_vertex_count = void function(uint _numVertices);
+ da_bgfx_set_vertex_count bgfx_set_vertex_count;
+
+ /**
+ * Set instance data buffer for draw primitive.
+ * Params:
+ * _idb = Transient instance data buffer.
+ * _start = First instance data.
+ * _num = Number of data instances.
+ */
+ alias da_bgfx_set_instance_data_buffer = void function(const(bgfx_instance_data_buffer_t)* _idb, uint _start, uint _num);
+ da_bgfx_set_instance_data_buffer bgfx_set_instance_data_buffer;
+
+ /**
+ * Set instance data buffer for draw primitive.
+ * Params:
+ * _handle = Vertex buffer.
+ * _startVertex = First instance data.
+ * _num = Number of data instances.
+ * Set instance data buffer for draw primitive.
+ */
+ alias da_bgfx_set_instance_data_from_vertex_buffer = void function(bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
+ da_bgfx_set_instance_data_from_vertex_buffer bgfx_set_instance_data_from_vertex_buffer;
+
+ /**
+ * Set instance data buffer for draw primitive.
+ * Params:
+ * _handle = Dynamic vertex buffer.
+ * _startVertex = First instance data.
+ * _num = Number of data instances.
+ */
+ alias da_bgfx_set_instance_data_from_dynamic_vertex_buffer = void function(bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
+ da_bgfx_set_instance_data_from_dynamic_vertex_buffer bgfx_set_instance_data_from_dynamic_vertex_buffer;
+
+ /**
+ * Set number of instances for auto generated instances use in conjuction
+ * with gl_InstanceID.
+ * Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
+ */
+ alias da_bgfx_set_instance_count = void function(uint _numInstances);
+ da_bgfx_set_instance_count bgfx_set_instance_count;
+
+ /**
+ * Set texture stage for draw primitive.
+ * Params:
+ * _stage = Texture unit.
+ * _sampler = Program sampler.
+ * _handle = Texture handle.
+ * _flags = Texture sampling mode. Default value UINT32_MAX uses
+ * texture sampling settings from the texture.
+ * - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ * mode.
+ * - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ * sampling.
+ */
+ alias da_bgfx_set_texture = void function(byte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
+ da_bgfx_set_texture bgfx_set_texture;
+
+ /**
+ * Submit an empty primitive for rendering. Uniforms and draw state
+ * will be applied but no geometry will be submitted.
+ * Remarks:
+ * These empty draw calls will sort before ordinary draw calls.
+ * Params:
+ * _id = View id.
+ */
+ alias da_bgfx_touch = void function(bgfx_view_id_t _id);
+ da_bgfx_touch bgfx_touch;
+
+ /**
+ * Submit primitive for rendering.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _depth = Depth for sorting.
+ * _preserveState = Preserve internal draw state for next draw call submit.
+ */
+ alias da_bgfx_submit = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, bool _preserveState);
+ da_bgfx_submit bgfx_submit;
+
+ /**
+ * Submit primitive with occlusion query for rendering.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _occlusionQuery = Occlusion query.
+ * _depth = Depth for sorting.
+ * _preserveState = Preserve internal draw state for next draw call submit.
+ */
+ alias da_bgfx_submit_occlusion_query = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, bool _preserveState);
+ da_bgfx_submit_occlusion_query bgfx_submit_occlusion_query;
+
+ /**
+ * Submit primitive for rendering with index and instance data info from
+ * indirect buffer.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _indirectHandle = Indirect buffer.
+ * _start = First element in indirect buffer.
+ * _num = Number of dispatches.
+ * _depth = Depth for sorting.
+ * _preserveState = Preserve internal draw state for next draw call submit.
+ */
+ alias da_bgfx_submit_indirect = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, bool _preserveState);
+ da_bgfx_submit_indirect bgfx_submit_indirect;
+
+ /**
+ * Set compute index buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Index buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ alias da_bgfx_set_compute_index_buffer = void function(byte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
+ da_bgfx_set_compute_index_buffer bgfx_set_compute_index_buffer;
+
+ /**
+ * Set compute vertex buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Vertex buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ alias da_bgfx_set_compute_vertex_buffer = void function(byte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+ da_bgfx_set_compute_vertex_buffer bgfx_set_compute_vertex_buffer;
+
+ /**
+ * Set compute dynamic index buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Dynamic index buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ alias da_bgfx_set_compute_dynamic_index_buffer = void function(byte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
+ da_bgfx_set_compute_dynamic_index_buffer bgfx_set_compute_dynamic_index_buffer;
+
+ /**
+ * Set compute dynamic vertex buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Dynamic vertex buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ alias da_bgfx_set_compute_dynamic_vertex_buffer = void function(byte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+ da_bgfx_set_compute_dynamic_vertex_buffer bgfx_set_compute_dynamic_vertex_buffer;
+
+ /**
+ * Set compute indirect buffer.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Indirect buffer handle.
+ * _access = Buffer access. See `Access::Enum`.
+ */
+ alias da_bgfx_set_compute_indirect_buffer = void function(byte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
+ da_bgfx_set_compute_indirect_buffer bgfx_set_compute_indirect_buffer;
+
+ /**
+ * Set compute image from texture.
+ * Params:
+ * _stage = Compute stage.
+ * _handle = Texture handle.
+ * _mip = Mip level.
+ * _access = Image access. See `Access::Enum`.
+ * _format = Texture format. See: `TextureFormat::Enum`.
+ */
+ alias da_bgfx_set_image = void function(byte _stage, bgfx_texture_handle_t _handle, byte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
+ da_bgfx_set_image bgfx_set_image;
+
+ /**
+ * Dispatch compute.
+ * Params:
+ * _id = View id.
+ * _program = Compute program.
+ * _numX = Number of groups X.
+ * _numY = Number of groups Y.
+ * _numZ = Number of groups Z.
+ */
+ alias da_bgfx_dispatch = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ);
+ da_bgfx_dispatch bgfx_dispatch;
+
+ /**
+ * Dispatch compute indirect.
+ * Params:
+ * _id = View id.
+ * _program = Compute program.
+ * _indirectHandle = Indirect buffer.
+ * _start = First element in indirect buffer.
+ * _num = Number of dispatches.
+ */
+ alias da_bgfx_dispatch_indirect = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num);
+ da_bgfx_dispatch_indirect bgfx_dispatch_indirect;
+
+ /**
+ * Discard all previously set state for draw or compute call.
+ */
+ alias da_bgfx_discard = void function();
+ da_bgfx_discard bgfx_discard;
+
+ /**
+ * Blit 2D texture region between two 2D textures.
+ * Attention: Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
+ * Attention: Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
+ * Params:
+ * _id = View id.
+ * _dst = Destination texture handle.
+ * _dstMip = Destination texture mip level.
+ * _dstX = Destination texture X position.
+ * _dstY = Destination texture Y position.
+ * _dstZ = If texture is 2D this argument should be 0. If destination texture is cube
+ * this argument represents destination texture cube face. For 3D texture this argument
+ * represents destination texture Z position.
+ * _src = Source texture handle.
+ * _srcMip = Source texture mip level.
+ * _srcX = Source texture X position.
+ * _srcY = Source texture Y position.
+ * _srcZ = If texture is 2D this argument should be 0. If source texture is cube
+ * this argument represents source texture cube face. For 3D texture this argument
+ * represents source texture Z position.
+ * _width = Width of region.
+ * _height = Height of region.
+ * _depth = If texture is 3D this argument represents depth of region, otherwise it's
+ * unused.
+ */
+ alias da_bgfx_blit = void function(bgfx_view_id_t _id, bgfx_texture_handle_t _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
+ da_bgfx_blit bgfx_blit;
+
+ }
+}
diff --git a/3rdparty/bgfx/bindings/d/types.d b/3rdparty/bgfx/bindings/d/types.d
new file mode 100644
index 00000000000..52a4cfda806
--- /dev/null
+++ b/3rdparty/bgfx/bindings/d/types.d
@@ -0,0 +1,1028 @@
+/*
+ *
+ * AUTO GENERATED! DO NOT EDIT!
+ *
+ */
+
+module bindbc.bgfx.types;
+
+public import core.stdc.stdarg : va_list;
+
+extern(C) @nogc nothrow:
+
+enum uint BGFX_API_VERSION = 102;
+
+alias bgfx_view_id_t = ushort;
+
+/// Memory release callback.
+
+/// Color RGB/alpha/depth write. When it's not specified write will be disabled.
+enum ulong BGFX_STATE_WRITE_R = 0x0000000000000001; /// Enable R write.
+enum ulong BGFX_STATE_WRITE_G = 0x0000000000000002; /// Enable G write.
+enum ulong BGFX_STATE_WRITE_B = 0x0000000000000004; /// Enable B write.
+enum ulong BGFX_STATE_WRITE_A = 0x0000000000000008; /// Enable alpha write.
+enum ulong BGFX_STATE_WRITE_Z = 0x0000004000000000; /// Enable depth write.
+enum ulong BGFX_STATE_WRITE_RGB = 0x0000000000000007; /// Enable RGB write.
+enum ulong BGFX_STATE_WRITE_MASK = 0x000000400000000f; /// Write all channels mask.
+
+/// Depth test state. When `BGFX_STATE_DEPTH_` is not specified depth test will be disabled.
+enum ulong BGFX_STATE_DEPTH_TEST_LESS = 0x0000000000000010; /// Enable depth test, less.
+enum ulong BGFX_STATE_DEPTH_TEST_LEQUAL = 0x0000000000000020; /// Enable depth test, less or equal.
+enum ulong BGFX_STATE_DEPTH_TEST_EQUAL = 0x0000000000000030; /// Enable depth test, equal.
+enum ulong BGFX_STATE_DEPTH_TEST_GEQUAL = 0x0000000000000040; /// Enable depth test, greater or equal.
+enum ulong BGFX_STATE_DEPTH_TEST_GREATER = 0x0000000000000050; /// Enable depth test, greater.
+enum ulong BGFX_STATE_DEPTH_TEST_NOTEQUAL = 0x0000000000000060; /// Enable depth test, not equal.
+enum ulong BGFX_STATE_DEPTH_TEST_NEVER = 0x0000000000000070; /// Enable depth test, never.
+enum ulong BGFX_STATE_DEPTH_TEST_ALWAYS = 0x0000000000000080; /// Enable depth test, always.
+enum ulong BGFX_STATE_DEPTH_TEST_SHIFT = 4; /// Depth test state bit shift
+enum ulong BGFX_STATE_DEPTH_TEST_MASK = 0x00000000000000f0; /// Depth test state bit mask
+
+/**
+ * Use BGFX_STATE_BLEND_FUNC(_src, _dst) or BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)
+ * helper macros.
+ */
+enum ulong BGFX_STATE_BLEND_ZERO = 0x0000000000001000; /// 0, 0, 0, 0
+enum ulong BGFX_STATE_BLEND_ONE = 0x0000000000002000; /// 1, 1, 1, 1
+enum ulong BGFX_STATE_BLEND_SRC_COLOR = 0x0000000000003000; /// Rs, Gs, Bs, As
+enum ulong BGFX_STATE_BLEND_INV_SRC_COLOR = 0x0000000000004000; /// 1-Rs, 1-Gs, 1-Bs, 1-As
+enum ulong BGFX_STATE_BLEND_SRC_ALPHA = 0x0000000000005000; /// As, As, As, As
+enum ulong BGFX_STATE_BLEND_INV_SRC_ALPHA = 0x0000000000006000; /// 1-As, 1-As, 1-As, 1-As
+enum ulong BGFX_STATE_BLEND_DST_ALPHA = 0x0000000000007000; /// Ad, Ad, Ad, Ad
+enum ulong BGFX_STATE_BLEND_INV_DST_ALPHA = 0x0000000000008000; /// 1-Ad, 1-Ad, 1-Ad ,1-Ad
+enum ulong BGFX_STATE_BLEND_DST_COLOR = 0x0000000000009000; /// Rd, Gd, Bd, Ad
+enum ulong BGFX_STATE_BLEND_INV_DST_COLOR = 0x000000000000a000; /// 1-Rd, 1-Gd, 1-Bd, 1-Ad
+enum ulong BGFX_STATE_BLEND_SRC_ALPHA_SAT = 0x000000000000b000; /// f, f, f, 1; f = min(As, 1-Ad)
+enum ulong BGFX_STATE_BLEND_FACTOR = 0x000000000000c000; /// Blend factor
+enum ulong BGFX_STATE_BLEND_INV_FACTOR = 0x000000000000d000; /// 1-Blend factor
+enum ulong BGFX_STATE_BLEND_SHIFT = 12; /// Blend state bit shift
+enum ulong BGFX_STATE_BLEND_MASK = 0x000000000ffff000; /// Blend state bit mask
+
+/**
+ * Use BGFX_STATE_BLEND_EQUATION(_equation) or BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)
+ * helper macros.
+ */
+enum ulong BGFX_STATE_BLEND_EQUATION_ADD = 0x0000000000000000; /// Blend add: src + dst.
+enum ulong BGFX_STATE_BLEND_EQUATION_SUB = 0x0000000010000000; /// Blend subtract: src - dst.
+enum ulong BGFX_STATE_BLEND_EQUATION_REVSUB = 0x0000000020000000; /// Blend reverse subtract: dst - src.
+enum ulong BGFX_STATE_BLEND_EQUATION_MIN = 0x0000000030000000; /// Blend min: min(src, dst).
+enum ulong BGFX_STATE_BLEND_EQUATION_MAX = 0x0000000040000000; /// Blend max: max(src, dst).
+enum ulong BGFX_STATE_BLEND_EQUATION_SHIFT = 28; /// Blend equation bit shift
+enum ulong BGFX_STATE_BLEND_EQUATION_MASK = 0x00000003f0000000; /// Blend equation bit mask
+
+/// Cull state. When `BGFX_STATE_CULL_*` is not specified culling will be disabled.
+enum ulong BGFX_STATE_CULL_CW = 0x0000001000000000; /// Cull clockwise triangles.
+enum ulong BGFX_STATE_CULL_CCW = 0x0000002000000000; /// Cull counter-clockwise triangles.
+enum ulong BGFX_STATE_CULL_SHIFT = 36; /// Culling mode bit shift
+enum ulong BGFX_STATE_CULL_MASK = 0x0000003000000000; /// Culling mode bit mask
+
+/// Alpha reference value.
+enum ulong BGFX_STATE_ALPHA_REF_SHIFT = 40; /// Alpha reference bit shift
+enum ulong BGFX_STATE_ALPHA_REF_MASK = 0x0000ff0000000000; /// Alpha reference bit mask
+ulong BGFX_STATE_ALPHA_REF (ulong v) { return (v << BGFX_STATE_ALPHA_REF_SHIFT) & BGFX_STATE_ALPHA_REF_MASK; }
+
+enum ulong BGFX_STATE_PT_TRISTRIP = 0x0001000000000000; /// Tristrip.
+enum ulong BGFX_STATE_PT_LINES = 0x0002000000000000; /// Lines.
+enum ulong BGFX_STATE_PT_LINESTRIP = 0x0003000000000000; /// Line strip.
+enum ulong BGFX_STATE_PT_POINTS = 0x0004000000000000; /// Points.
+enum ulong BGFX_STATE_PT_SHIFT = 48; /// Primitive type bit shift
+enum ulong BGFX_STATE_PT_MASK = 0x0007000000000000; /// Primitive type bit mask
+
+/// Point size value.
+enum ulong BGFX_STATE_POINT_SIZE_SHIFT = 52; /// Point size bit shift
+enum ulong BGFX_STATE_POINT_SIZE_MASK = 0x00f0000000000000; /// Point size bit mask
+ulong BGFX_STATE_POINT_SIZE (ulong v) { return (v << BGFX_STATE_POINT_SIZE_SHIFT) & BGFX_STATE_POINT_SIZE_MASK; }
+
+/**
+ * Enable MSAA write when writing into MSAA frame buffer.
+ * This flag is ignored when not writing into MSAA frame buffer.
+ */
+enum ulong BGFX_STATE_MSAA = 0x0100000000000000; /// Enable MSAA rasterization.
+enum ulong BGFX_STATE_LINEAA = 0x0200000000000000; /// Enable line AA rasterization.
+enum ulong BGFX_STATE_CONSERVATIVE_RASTER = 0x0400000000000000; /// Enable conservative rasterization.
+enum ulong BGFX_STATE_NONE = 0x0000000000000000; /// No state.
+enum ulong BGFX_STATE_FRONT_CCW = 0x0000008000000000; /// Front counter-clockwise (default is clockwise).
+enum ulong BGFX_STATE_BLEND_INDEPENDENT = 0x0000000400000000; /// Enable blend independent.
+enum ulong BGFX_STATE_BLEND_ALPHA_TO_COVERAGE = 0x0000000800000000; /// Enable alpha to coverage.
+/**
+ * Default state is write to RGB, alpha, and depth with depth test less enabled, with clockwise
+ * culling and MSAA (when writing into MSAA frame buffer, otherwise this flag is ignored).
+ */
+enum ulong BGFX_STATE_DEFAULT = BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A | BGFX_STATE_WRITE_Z | BGFX_STATE_DEPTH_TEST_LESS | BGFX_STATE_CULL_CW | BGFX_STATE_MSAA;
+enum ulong BGFX_STATE_MASK = 0xffffffffffffffff; /// State bit mask
+
+/// Do not use!
+enum ulong BGFX_STATE_RESERVED_SHIFT = 61;
+enum ulong BGFX_STATE_RESERVED_MASK = 0xe000000000000000;
+
+/// Set stencil ref value.
+enum uint BGFX_STENCIL_FUNC_REF_SHIFT = 0;
+enum uint BGFX_STENCIL_FUNC_REF_MASK = 0x000000ff;
+uint BGFX_STENCIL_FUNC_REF (uint v) { return (v << BGFX_STENCIL_FUNC_REF_SHIFT) & BGFX_STENCIL_FUNC_REF_MASK; }
+
+/// Set stencil rmask value.
+enum uint BGFX_STENCIL_FUNC_RMASK_SHIFT = 8;
+enum uint BGFX_STENCIL_FUNC_RMASK_MASK = 0x0000ff00;
+uint BGFX_STENCIL_FUNC_RMASK (uint v) { return (v << BGFX_STENCIL_FUNC_RMASK_SHIFT) & BGFX_STENCIL_FUNC_RMASK_MASK; }
+
+enum uint BGFX_STENCIL_NONE = 0x00000000;
+enum uint BGFX_STENCIL_MASK = 0xffffffff;
+enum uint BGFX_STENCIL_DEFAULT = 0x00000000;
+
+enum uint BGFX_STENCIL_TEST_LESS = 0x00010000; /// Enable stencil test, less.
+enum uint BGFX_STENCIL_TEST_LEQUAL = 0x00020000; /// Enable stencil test, less or equal.
+enum uint BGFX_STENCIL_TEST_EQUAL = 0x00030000; /// Enable stencil test, equal.
+enum uint BGFX_STENCIL_TEST_GEQUAL = 0x00040000; /// Enable stencil test, greater or equal.
+enum uint BGFX_STENCIL_TEST_GREATER = 0x00050000; /// Enable stencil test, greater.
+enum uint BGFX_STENCIL_TEST_NOTEQUAL = 0x00060000; /// Enable stencil test, not equal.
+enum uint BGFX_STENCIL_TEST_NEVER = 0x00070000; /// Enable stencil test, never.
+enum uint BGFX_STENCIL_TEST_ALWAYS = 0x00080000; /// Enable stencil test, always.
+enum uint BGFX_STENCIL_TEST_SHIFT = 16; /// Stencil test bit shift
+enum uint BGFX_STENCIL_TEST_MASK = 0x000f0000; /// Stencil test bit mask
+
+enum uint BGFX_STENCIL_OP_FAIL_S_ZERO = 0x00000000; /// Zero.
+enum uint BGFX_STENCIL_OP_FAIL_S_KEEP = 0x00100000; /// Keep.
+enum uint BGFX_STENCIL_OP_FAIL_S_REPLACE = 0x00200000; /// Replace.
+enum uint BGFX_STENCIL_OP_FAIL_S_INCR = 0x00300000; /// Increment and wrap.
+enum uint BGFX_STENCIL_OP_FAIL_S_INCRSAT = 0x00400000; /// Increment and clamp.
+enum uint BGFX_STENCIL_OP_FAIL_S_DECR = 0x00500000; /// Decrement and wrap.
+enum uint BGFX_STENCIL_OP_FAIL_S_DECRSAT = 0x00600000; /// Decrement and clamp.
+enum uint BGFX_STENCIL_OP_FAIL_S_INVERT = 0x00700000; /// Invert.
+enum uint BGFX_STENCIL_OP_FAIL_S_SHIFT = 20; /// Stencil operation fail bit shift
+enum uint BGFX_STENCIL_OP_FAIL_S_MASK = 0x00f00000; /// Stencil operation fail bit mask
+
+enum uint BGFX_STENCIL_OP_FAIL_Z_ZERO = 0x00000000; /// Zero.
+enum uint BGFX_STENCIL_OP_FAIL_Z_KEEP = 0x01000000; /// Keep.
+enum uint BGFX_STENCIL_OP_FAIL_Z_REPLACE = 0x02000000; /// Replace.
+enum uint BGFX_STENCIL_OP_FAIL_Z_INCR = 0x03000000; /// Increment and wrap.
+enum uint BGFX_STENCIL_OP_FAIL_Z_INCRSAT = 0x04000000; /// Increment and clamp.
+enum uint BGFX_STENCIL_OP_FAIL_Z_DECR = 0x05000000; /// Decrement and wrap.
+enum uint BGFX_STENCIL_OP_FAIL_Z_DECRSAT = 0x06000000; /// Decrement and clamp.
+enum uint BGFX_STENCIL_OP_FAIL_Z_INVERT = 0x07000000; /// Invert.
+enum uint BGFX_STENCIL_OP_FAIL_Z_SHIFT = 24; /// Stencil operation depth fail bit shift
+enum uint BGFX_STENCIL_OP_FAIL_Z_MASK = 0x0f000000; /// Stencil operation depth fail bit mask
+
+enum uint BGFX_STENCIL_OP_PASS_Z_ZERO = 0x00000000; /// Zero.
+enum uint BGFX_STENCIL_OP_PASS_Z_KEEP = 0x10000000; /// Keep.
+enum uint BGFX_STENCIL_OP_PASS_Z_REPLACE = 0x20000000; /// Replace.
+enum uint BGFX_STENCIL_OP_PASS_Z_INCR = 0x30000000; /// Increment and wrap.
+enum uint BGFX_STENCIL_OP_PASS_Z_INCRSAT = 0x40000000; /// Increment and clamp.
+enum uint BGFX_STENCIL_OP_PASS_Z_DECR = 0x50000000; /// Decrement and wrap.
+enum uint BGFX_STENCIL_OP_PASS_Z_DECRSAT = 0x60000000; /// Decrement and clamp.
+enum uint BGFX_STENCIL_OP_PASS_Z_INVERT = 0x70000000; /// Invert.
+enum uint BGFX_STENCIL_OP_PASS_Z_SHIFT = 28; /// Stencil operation depth pass bit shift
+enum uint BGFX_STENCIL_OP_PASS_Z_MASK = 0xf0000000; /// Stencil operation depth pass bit mask
+
+enum ushort BGFX_CLEAR_NONE = 0x0000; /// No clear flags.
+enum ushort BGFX_CLEAR_COLOR = 0x0001; /// Clear color.
+enum ushort BGFX_CLEAR_DEPTH = 0x0002; /// Clear depth.
+enum ushort BGFX_CLEAR_STENCIL = 0x0004; /// Clear stencil.
+enum ushort BGFX_CLEAR_DISCARD_COLOR_0 = 0x0008; /// Discard frame buffer attachment 0.
+enum ushort BGFX_CLEAR_DISCARD_COLOR_1 = 0x0010; /// Discard frame buffer attachment 1.
+enum ushort BGFX_CLEAR_DISCARD_COLOR_2 = 0x0020; /// Discard frame buffer attachment 2.
+enum ushort BGFX_CLEAR_DISCARD_COLOR_3 = 0x0040; /// Discard frame buffer attachment 3.
+enum ushort BGFX_CLEAR_DISCARD_COLOR_4 = 0x0080; /// Discard frame buffer attachment 4.
+enum ushort BGFX_CLEAR_DISCARD_COLOR_5 = 0x0100; /// Discard frame buffer attachment 5.
+enum ushort BGFX_CLEAR_DISCARD_COLOR_6 = 0x0200; /// Discard frame buffer attachment 6.
+enum ushort BGFX_CLEAR_DISCARD_COLOR_7 = 0x0400; /// Discard frame buffer attachment 7.
+enum ushort BGFX_CLEAR_DISCARD_DEPTH = 0x0800; /// Discard frame buffer depth attachment.
+enum ushort BGFX_CLEAR_DISCARD_STENCIL = 0x1000; /// Discard frame buffer stencil attachment.
+enum ushort BGFX_CLEAR_DISCARD_COLOR_MASK = 0x07f8;
+enum ushort BGFX_CLEAR_DISCARD_MASK = 0x1ff8;
+
+enum uint BGFX_DEBUG_NONE = 0x00000000; /// No debug.
+enum uint BGFX_DEBUG_WIREFRAME = 0x00000001; /// Enable wireframe for all primitives.
+/**
+ * Enable infinitely fast hardware test. No draw calls will be submitted to driver.
+ * It's useful when profiling to quickly assess bottleneck between CPU and GPU.
+ */
+enum uint BGFX_DEBUG_IFH = 0x00000002;
+enum uint BGFX_DEBUG_STATS = 0x00000004; /// Enable statistics display.
+enum uint BGFX_DEBUG_TEXT = 0x00000008; /// Enable debug text display.
+enum uint BGFX_DEBUG_PROFILER = 0x00000010; /// Enable profiler.
+
+enum ushort BGFX_BUFFER_COMPUTE_FORMAT_8X1 = 0x0001; /// 1 8-bit value
+enum ushort BGFX_BUFFER_COMPUTE_FORMAT_8X2 = 0x0002; /// 2 8-bit values
+enum ushort BGFX_BUFFER_COMPUTE_FORMAT_8X4 = 0x0003; /// 4 8-bit values
+enum ushort BGFX_BUFFER_COMPUTE_FORMAT_16X1 = 0x0004; /// 1 16-bit value
+enum ushort BGFX_BUFFER_COMPUTE_FORMAT_16X2 = 0x0005; /// 2 16-bit values
+enum ushort BGFX_BUFFER_COMPUTE_FORMAT_16X4 = 0x0006; /// 4 16-bit values
+enum ushort BGFX_BUFFER_COMPUTE_FORMAT_32X1 = 0x0007; /// 1 32-bit value
+enum ushort BGFX_BUFFER_COMPUTE_FORMAT_32X2 = 0x0008; /// 2 32-bit values
+enum ushort BGFX_BUFFER_COMPUTE_FORMAT_32X4 = 0x0009; /// 4 32-bit values
+enum ushort BGFX_BUFFER_COMPUTE_FORMAT_SHIFT = 0;
+enum ushort BGFX_BUFFER_COMPUTE_FORMAT_MASK = 0x000f;
+
+enum ushort BGFX_BUFFER_COMPUTE_TYPE_INT = 0x0010; /// Type `int`.
+enum ushort BGFX_BUFFER_COMPUTE_TYPE_UINT = 0x0020; /// Type `uint`.
+enum ushort BGFX_BUFFER_COMPUTE_TYPE_FLOAT = 0x0030; /// Type `float`.
+enum ushort BGFX_BUFFER_COMPUTE_TYPE_SHIFT = 4;
+enum ushort BGFX_BUFFER_COMPUTE_TYPE_MASK = 0x0030;
+
+enum ushort BGFX_BUFFER_NONE = 0x0000;
+enum ushort BGFX_BUFFER_COMPUTE_READ = 0x0100; /// Buffer will be read by shader.
+enum ushort BGFX_BUFFER_COMPUTE_WRITE = 0x0200; /// Buffer will be used for writing.
+enum ushort BGFX_BUFFER_DRAW_INDIRECT = 0x0400; /// Buffer will be used for storing draw indirect commands.
+enum ushort BGFX_BUFFER_ALLOW_RESIZE = 0x0800; /// Allow dynamic index/vertex buffer resize during update.
+enum ushort BGFX_BUFFER_INDEX32 = 0x1000; /// Index buffer contains 32-bit indices.
+enum ushort BGFX_BUFFER_COMPUTE_READ_WRITE = 0x0300;
+
+enum ulong BGFX_TEXTURE_NONE = 0x0000000000000000;
+enum ulong BGFX_TEXTURE_MSAA_SAMPLE = 0x0000000800000000; /// Texture will be used for MSAA sampling.
+enum ulong BGFX_TEXTURE_RT = 0x0000001000000000; /// Render target no MSAA.
+enum ulong BGFX_TEXTURE_COMPUTE_WRITE = 0x0000100000000000; /// Texture will be used for compute write.
+enum ulong BGFX_TEXTURE_SRGB = 0x0000200000000000; /// Sample texture as sRGB.
+enum ulong BGFX_TEXTURE_BLIT_DST = 0x0000400000000000; /// Texture will be used as blit destination.
+enum ulong BGFX_TEXTURE_READ_BACK = 0x0000800000000000; /// Texture will be used for read back from GPU.
+
+enum ulong BGFX_TEXTURE_RT_MSAA_X2 = 0x0000002000000000; /// Render target MSAAx2 mode.
+enum ulong BGFX_TEXTURE_RT_MSAA_X4 = 0x0000003000000000; /// Render target MSAAx4 mode.
+enum ulong BGFX_TEXTURE_RT_MSAA_X8 = 0x0000004000000000; /// Render target MSAAx8 mode.
+enum ulong BGFX_TEXTURE_RT_MSAA_X16 = 0x0000005000000000; /// Render target MSAAx16 mode.
+enum ulong BGFX_TEXTURE_RT_MSAA_SHIFT = 36;
+enum ulong BGFX_TEXTURE_RT_MSAA_MASK = 0x0000007000000000;
+
+enum ulong BGFX_TEXTURE_RT_WRITE_ONLY = 0x0000008000000000; /// Render target will be used for writing
+enum ulong BGFX_TEXTURE_RT_SHIFT = 36;
+enum ulong BGFX_TEXTURE_RT_MASK = 0x000000f000000000;
+
+/// Sampler flags.
+enum uint BGFX_SAMPLER_U_MIRROR = 0x00000001; /// Wrap U mode: Mirror
+enum uint BGFX_SAMPLER_U_CLAMP = 0x00000002; /// Wrap U mode: Clamp
+enum uint BGFX_SAMPLER_U_BORDER = 0x00000003; /// Wrap U mode: Border
+enum uint BGFX_SAMPLER_U_SHIFT = 0;
+enum uint BGFX_SAMPLER_U_MASK = 0x00000003;
+
+enum uint BGFX_SAMPLER_V_MIRROR = 0x00000004; /// Wrap V mode: Mirror
+enum uint BGFX_SAMPLER_V_CLAMP = 0x00000008; /// Wrap V mode: Clamp
+enum uint BGFX_SAMPLER_V_BORDER = 0x0000000c; /// Wrap V mode: Border
+enum uint BGFX_SAMPLER_V_SHIFT = 2;
+enum uint BGFX_SAMPLER_V_MASK = 0x0000000c;
+
+enum uint BGFX_SAMPLER_W_MIRROR = 0x00000010; /// Wrap W mode: Mirror
+enum uint BGFX_SAMPLER_W_CLAMP = 0x00000020; /// Wrap W mode: Clamp
+enum uint BGFX_SAMPLER_W_BORDER = 0x00000030; /// Wrap W mode: Border
+enum uint BGFX_SAMPLER_W_SHIFT = 4;
+enum uint BGFX_SAMPLER_W_MASK = 0x00000030;
+
+enum uint BGFX_SAMPLER_MIN_POINT = 0x00000040; /// Min sampling mode: Point
+enum uint BGFX_SAMPLER_MIN_ANISOTROPIC = 0x00000080; /// Min sampling mode: Anisotropic
+enum uint BGFX_SAMPLER_MIN_SHIFT = 6;
+enum uint BGFX_SAMPLER_MIN_MASK = 0x000000c0;
+
+enum uint BGFX_SAMPLER_MAG_POINT = 0x00000100; /// Mag sampling mode: Point
+enum uint BGFX_SAMPLER_MAG_ANISOTROPIC = 0x00000200; /// Mag sampling mode: Anisotropic
+enum uint BGFX_SAMPLER_MAG_SHIFT = 8;
+enum uint BGFX_SAMPLER_MAG_MASK = 0x00000300;
+
+enum uint BGFX_SAMPLER_MIP_POINT = 0x00000400; /// Mip sampling mode: Point
+enum uint BGFX_SAMPLER_MIP_SHIFT = 10;
+enum uint BGFX_SAMPLER_MIP_MASK = 0x00000400;
+
+enum uint BGFX_SAMPLER_COMPARE_LESS = 0x00010000; /// Compare when sampling depth texture: less.
+enum uint BGFX_SAMPLER_COMPARE_LEQUAL = 0x00020000; /// Compare when sampling depth texture: less or equal.
+enum uint BGFX_SAMPLER_COMPARE_EQUAL = 0x00030000; /// Compare when sampling depth texture: equal.
+enum uint BGFX_SAMPLER_COMPARE_GEQUAL = 0x00040000; /// Compare when sampling depth texture: greater or equal.
+enum uint BGFX_SAMPLER_COMPARE_GREATER = 0x00050000; /// Compare when sampling depth texture: greater.
+enum uint BGFX_SAMPLER_COMPARE_NOTEQUAL = 0x00060000; /// Compare when sampling depth texture: not equal.
+enum uint BGFX_SAMPLER_COMPARE_NEVER = 0x00070000; /// Compare when sampling depth texture: never.
+enum uint BGFX_SAMPLER_COMPARE_ALWAYS = 0x00080000; /// Compare when sampling depth texture: always.
+enum uint BGFX_SAMPLER_COMPARE_SHIFT = 16;
+enum uint BGFX_SAMPLER_COMPARE_MASK = 0x000f0000;
+
+enum uint BGFX_SAMPLER_BORDER_COLOR_SHIFT = 24;
+enum uint BGFX_SAMPLER_BORDER_COLOR_MASK = 0x0f000000;
+uint BGFX_SAMPLER_BORDER_COLOR (uint v) { return (v << BGFX_SAMPLER_BORDER_COLOR_SHIFT) & BGFX_SAMPLER_BORDER_COLOR_MASK; }
+
+enum uint BGFX_SAMPLER_RESERVED_SHIFT = 28;
+enum uint BGFX_SAMPLER_RESERVED_MASK = 0xf0000000;
+
+enum uint BGFX_SAMPLER_NONE = 0x00000000;
+enum uint BGFX_SAMPLER_SAMPLE_STENCIL = 0x00100000; /// Sample stencil instead of depth.
+enum uint BGFX_SAMPLER_POINT = BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_MIP_POINT;
+enum uint BGFX_SAMPLER_UVW_MIRROR = BGFX_SAMPLER_U_MIRROR | BGFX_SAMPLER_V_MIRROR | BGFX_SAMPLER_W_MIRROR;
+enum uint BGFX_SAMPLER_UVW_CLAMP = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP | BGFX_SAMPLER_W_CLAMP;
+enum uint BGFX_SAMPLER_UVW_BORDER = BGFX_SAMPLER_U_BORDER | BGFX_SAMPLER_V_BORDER | BGFX_SAMPLER_W_BORDER;
+enum uint BGFX_SAMPLER_BITS_MASK = BGFX_SAMPLER_U_MASK | BGFX_SAMPLER_V_MASK | BGFX_SAMPLER_W_MASK | BGFX_SAMPLER_MIN_MASK | BGFX_SAMPLER_MAG_MASK | BGFX_SAMPLER_MIP_MASK | BGFX_SAMPLER_COMPARE_MASK;
+
+enum uint BGFX_RESET_MSAA_X2 = 0x00000010; /// Enable 2x MSAA.
+enum uint BGFX_RESET_MSAA_X4 = 0x00000020; /// Enable 4x MSAA.
+enum uint BGFX_RESET_MSAA_X8 = 0x00000030; /// Enable 8x MSAA.
+enum uint BGFX_RESET_MSAA_X16 = 0x00000040; /// Enable 16x MSAA.
+enum uint BGFX_RESET_MSAA_SHIFT = 4;
+enum uint BGFX_RESET_MSAA_MASK = 0x00000070;
+
+enum uint BGFX_RESET_NONE = 0x00000000; /// No reset flags.
+enum uint BGFX_RESET_FULLSCREEN = 0x00000001; /// Not supported yet.
+enum uint BGFX_RESET_VSYNC = 0x00000080; /// Enable V-Sync.
+enum uint BGFX_RESET_MAXANISOTROPY = 0x00000100; /// Turn on/off max anisotropy.
+enum uint BGFX_RESET_CAPTURE = 0x00000200; /// Begin screen capture.
+enum uint BGFX_RESET_FLUSH_AFTER_RENDER = 0x00002000; /// Flush rendering after submitting to GPU.
+/**
+ * This flag specifies where flip occurs. Default behavior is that flip occurs
+ * before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
+ */
+enum uint BGFX_RESET_FLIP_AFTER_RENDER = 0x00004000;
+enum uint BGFX_RESET_SRGB_BACKBUFFER = 0x00008000; /// Enable sRGB backbuffer.
+enum uint BGFX_RESET_HDR10 = 0x00010000; /// Enable HDR10 rendering.
+enum uint BGFX_RESET_HIDPI = 0x00020000; /// Enable HiDPI rendering.
+enum uint BGFX_RESET_DEPTH_CLAMP = 0x00040000; /// Enable depth clamp.
+enum uint BGFX_RESET_SUSPEND = 0x00080000; /// Suspend rendering.
+
+enum uint BGFX_RESET_FULLSCREEN_SHIFT = 0;
+enum uint BGFX_RESET_FULLSCREEN_MASK = 0x00000001;
+
+enum uint BGFX_RESET_RESERVED_SHIFT = 31; /// Internal bit shift
+enum uint BGFX_RESET_RESERVED_MASK = 0x80000000; /// Internal bit mask
+
+enum ulong BGFX_CAPS_ALPHA_TO_COVERAGE = 0x0000000000000001; /// Alpha to coverage is supported.
+enum ulong BGFX_CAPS_BLEND_INDEPENDENT = 0x0000000000000002; /// Blend independent is supported.
+enum ulong BGFX_CAPS_COMPUTE = 0x0000000000000004; /// Compute shaders are supported.
+enum ulong BGFX_CAPS_CONSERVATIVE_RASTER = 0x0000000000000008; /// Conservative rasterization is supported.
+enum ulong BGFX_CAPS_DRAW_INDIRECT = 0x0000000000000010; /// Draw indirect is supported.
+enum ulong BGFX_CAPS_FRAGMENT_DEPTH = 0x0000000000000020; /// Fragment depth is accessible in fragment shader.
+enum ulong BGFX_CAPS_FRAGMENT_ORDERING = 0x0000000000000040; /// Fragment ordering is available in fragment shader.
+enum ulong BGFX_CAPS_FRAMEBUFFER_RW = 0x0000000000000080; /// Read/Write frame buffer attachments are supported.
+enum ulong BGFX_CAPS_GRAPHICS_DEBUGGER = 0x0000000000000100; /// Graphics debugger is present.
+enum ulong BGFX_CAPS_RESERVED = 0x0000000000000200;
+enum ulong BGFX_CAPS_HDR10 = 0x0000000000000400; /// HDR10 rendering is supported.
+enum ulong BGFX_CAPS_HIDPI = 0x0000000000000800; /// HiDPI rendering is supported.
+enum ulong BGFX_CAPS_INDEX32 = 0x0000000000001000; /// 32-bit indices are supported.
+enum ulong BGFX_CAPS_INSTANCING = 0x0000000000002000; /// Instancing is supported.
+enum ulong BGFX_CAPS_OCCLUSION_QUERY = 0x0000000000004000; /// Occlusion query is supported.
+enum ulong BGFX_CAPS_RENDERER_MULTITHREADED = 0x0000000000008000; /// Renderer is on separate thread.
+enum ulong BGFX_CAPS_SWAP_CHAIN = 0x0000000000010000; /// Multiple windows are supported.
+enum ulong BGFX_CAPS_TEXTURE_2D_ARRAY = 0x0000000000020000; /// 2D texture array is supported.
+enum ulong BGFX_CAPS_TEXTURE_3D = 0x0000000000040000; /// 3D textures are supported.
+enum ulong BGFX_CAPS_TEXTURE_BLIT = 0x0000000000080000; /// Texture blit is supported.
+enum ulong BGFX_CAPS_TEXTURE_COMPARE_RESERVED = 0x0000000000100000; /// All texture compare modes are supported.
+enum ulong BGFX_CAPS_TEXTURE_COMPARE_LEQUAL = 0x0000000000200000; /// Texture compare less equal mode is supported.
+enum ulong BGFX_CAPS_TEXTURE_CUBE_ARRAY = 0x0000000000400000; /// Cubemap texture array is supported.
+enum ulong BGFX_CAPS_TEXTURE_DIRECT_ACCESS = 0x0000000000800000; /// CPU direct access to GPU texture memory.
+enum ulong BGFX_CAPS_TEXTURE_READ_BACK = 0x0000000001000000; /// Read-back texture is supported.
+enum ulong BGFX_CAPS_VERTEX_ATTRIB_HALF = 0x0000000002000000; /// Vertex attribute half-float is supported.
+enum ulong BGFX_CAPS_VERTEX_ATTRIB_UINT10 = 0x0000000004000000; /// Vertex attribute 10_10_10_2 is supported.
+enum ulong BGFX_CAPS_VERTEX_ID = 0x0000000008000000; /// Rendering with VertexID only is supported.
+enum ulong BGFX_CAPS_TEXTURE_COMPARE_ALL = 0x0000000000300000; /// All texture compare modes are supported.
+
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_NONE = 0x0000; /// Texture format is not supported.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_2D = 0x0001; /// Texture format is supported.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB = 0x0002; /// Texture as sRGB format is supported.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_2D_EMULATED = 0x0004; /// Texture format is emulated.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_3D = 0x0008; /// Texture format is supported.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB = 0x0010; /// Texture as sRGB format is supported.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_3D_EMULATED = 0x0020; /// Texture format is emulated.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_CUBE = 0x0040; /// Texture format is supported.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB = 0x0080; /// Texture as sRGB format is supported.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_CUBE_EMULATED = 0x0100; /// Texture format is emulated.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_VERTEX = 0x0200; /// Texture format can be used from vertex shader.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_IMAGE = 0x0400; /// Texture format can be used as image from compute shader.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER = 0x0800; /// Texture format can be used as frame buffer.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA = 0x1000; /// Texture format can be used as MSAA frame buffer.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_MSAA = 0x2000; /// Texture can be sampled as MSAA.
+enum ushort BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN = 0x4000; /// Texture format supports auto-generated mips.
+
+enum ubyte BGFX_RESOLVE_NONE = 0x00; /// No resolve flags.
+enum ubyte BGFX_RESOLVE_AUTO_GEN_MIPS = 0x01; /// Auto-generate mip maps on resolve.
+
+enum ushort BGFX_PCI_ID_NONE = 0x0000; /// Autoselect adapter.
+enum ushort BGFX_PCI_ID_SOFTWARE_RASTERIZER = 0x0001; /// Software rasterizer.
+enum ushort BGFX_PCI_ID_AMD = 0x1002; /// AMD adapter.
+enum ushort BGFX_PCI_ID_INTEL = 0x8086; /// Intel adapter.
+enum ushort BGFX_PCI_ID_NVIDIA = 0x10de; /// nVidia adapter.
+
+enum ubyte BGFX_CUBE_MAP_POSITIVE_X = 0x00; /// Cubemap +x.
+enum ubyte BGFX_CUBE_MAP_NEGATIVE_X = 0x01; /// Cubemap -x.
+enum ubyte BGFX_CUBE_MAP_POSITIVE_Y = 0x02; /// Cubemap +y.
+enum ubyte BGFX_CUBE_MAP_NEGATIVE_Y = 0x03; /// Cubemap -y.
+enum ubyte BGFX_CUBE_MAP_POSITIVE_Z = 0x04; /// Cubemap +z.
+enum ubyte BGFX_CUBE_MAP_NEGATIVE_Z = 0x05; /// Cubemap -z.
+
+/// Fatal error enum.
+enum bgfx_fatal_t
+{
+ BGFX_FATAL_DEBUGCHECK,
+ BGFX_FATAL_INVALIDSHADER,
+ BGFX_FATAL_UNABLETOINITIALIZE,
+ BGFX_FATAL_UNABLETOCREATETEXTURE,
+ BGFX_FATAL_DEVICELOST,
+
+ BGFX_FATAL_COUNT
+}
+
+/// Renderer backend type enum.
+enum bgfx_renderer_type_t
+{
+ BGFX_RENDERER_TYPE_NOOP, /// No rendering.
+ BGFX_RENDERER_TYPE_DIRECT3D9, /// Direct3D 9.0
+ BGFX_RENDERER_TYPE_DIRECT3D11, /// Direct3D 11.0
+ BGFX_RENDERER_TYPE_DIRECT3D12, /// Direct3D 12.0
+ BGFX_RENDERER_TYPE_GNM, /// GNM
+ BGFX_RENDERER_TYPE_METAL, /// Metal
+ BGFX_RENDERER_TYPE_NVN, /// NVN
+ BGFX_RENDERER_TYPE_OPENGLES, /// OpenGL ES 2.0+
+ BGFX_RENDERER_TYPE_OPENGL, /// OpenGL 2.1+
+ BGFX_RENDERER_TYPE_VULKAN, /// Vulkan
+
+ BGFX_RENDERER_TYPE_COUNT
+}
+
+/// Access mode enum.
+enum bgfx_access_t
+{
+ BGFX_ACCESS_READ, /// Read.
+ BGFX_ACCESS_WRITE, /// Write.
+ BGFX_ACCESS_READWRITE, /// Read and write.
+
+ BGFX_ACCESS_COUNT
+}
+
+/// Vertex attribute enum.
+enum bgfx_attrib_t
+{
+ BGFX_ATTRIB_POSITION, /// a_position
+ BGFX_ATTRIB_NORMAL, /// a_normal
+ BGFX_ATTRIB_TANGENT, /// a_tangent
+ BGFX_ATTRIB_BITANGENT, /// a_bitangent
+ BGFX_ATTRIB_COLOR0, /// a_color0
+ BGFX_ATTRIB_COLOR1, /// a_color1
+ BGFX_ATTRIB_COLOR2, /// a_color2
+ BGFX_ATTRIB_COLOR3, /// a_color3
+ BGFX_ATTRIB_INDICES, /// a_indices
+ BGFX_ATTRIB_WEIGHT, /// a_weight
+ BGFX_ATTRIB_TEXCOORD0, /// a_texcoord0
+ BGFX_ATTRIB_TEXCOORD1, /// a_texcoord1
+ BGFX_ATTRIB_TEXCOORD2, /// a_texcoord2
+ BGFX_ATTRIB_TEXCOORD3, /// a_texcoord3
+ BGFX_ATTRIB_TEXCOORD4, /// a_texcoord4
+ BGFX_ATTRIB_TEXCOORD5, /// a_texcoord5
+ BGFX_ATTRIB_TEXCOORD6, /// a_texcoord6
+ BGFX_ATTRIB_TEXCOORD7, /// a_texcoord7
+
+ BGFX_ATTRIB_COUNT
+}
+
+/// Vertex attribute type enum.
+enum bgfx_attrib_type_t
+{
+ BGFX_ATTRIB_TYPE_UINT8, /// Uint8
+ BGFX_ATTRIB_TYPE_UINT10, /// Uint10, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_UINT10`.
+ BGFX_ATTRIB_TYPE_INT16, /// Int16
+ BGFX_ATTRIB_TYPE_HALF, /// Half, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_HALF`.
+ BGFX_ATTRIB_TYPE_FLOAT, /// Float
+
+ BGFX_ATTRIB_TYPE_COUNT
+}
+
+/**
+ * Texture format enum.
+ * Notation:
+ * RGBA16S
+ * ^ ^ ^
+ * | | +-- [ ]Unorm
+ * | | [F]loat
+ * | | [S]norm
+ * | | [I]nt
+ * | | [U]int
+ * | +---- Number of bits per component
+ * +-------- Components
+ * @attention Availability depends on Caps (see: formats).
+ */
+enum bgfx_texture_format_t
+{
+ BGFX_TEXTURE_FORMAT_BC1, /// DXT1 R5G6B5A1
+ BGFX_TEXTURE_FORMAT_BC2, /// DXT3 R5G6B5A4
+ BGFX_TEXTURE_FORMAT_BC3, /// DXT5 R5G6B5A8
+ BGFX_TEXTURE_FORMAT_BC4, /// LATC1/ATI1 R8
+ BGFX_TEXTURE_FORMAT_BC5, /// LATC2/ATI2 RG8
+ BGFX_TEXTURE_FORMAT_BC6H, /// BC6H RGB16F
+ BGFX_TEXTURE_FORMAT_BC7, /// BC7 RGB 4-7 bits per color channel, 0-8 bits alpha
+ BGFX_TEXTURE_FORMAT_ETC1, /// ETC1 RGB8
+ BGFX_TEXTURE_FORMAT_ETC2, /// ETC2 RGB8
+ BGFX_TEXTURE_FORMAT_ETC2A, /// ETC2 RGBA8
+ BGFX_TEXTURE_FORMAT_ETC2A1, /// ETC2 RGB8A1
+ BGFX_TEXTURE_FORMAT_PTC12, /// PVRTC1 RGB 2BPP
+ BGFX_TEXTURE_FORMAT_PTC14, /// PVRTC1 RGB 4BPP
+ BGFX_TEXTURE_FORMAT_PTC12A, /// PVRTC1 RGBA 2BPP
+ BGFX_TEXTURE_FORMAT_PTC14A, /// PVRTC1 RGBA 4BPP
+ BGFX_TEXTURE_FORMAT_PTC22, /// PVRTC2 RGBA 2BPP
+ BGFX_TEXTURE_FORMAT_PTC24, /// PVRTC2 RGBA 4BPP
+ BGFX_TEXTURE_FORMAT_ATC, /// ATC RGB 4BPP
+ BGFX_TEXTURE_FORMAT_ATCE, /// ATCE RGBA 8 BPP explicit alpha
+ BGFX_TEXTURE_FORMAT_ATCI, /// ATCI RGBA 8 BPP interpolated alpha
+ BGFX_TEXTURE_FORMAT_ASTC4X4, /// ASTC 4x4 8.0 BPP
+ BGFX_TEXTURE_FORMAT_ASTC5X5, /// ASTC 5x5 5.12 BPP
+ BGFX_TEXTURE_FORMAT_ASTC6X6, /// ASTC 6x6 3.56 BPP
+ BGFX_TEXTURE_FORMAT_ASTC8X5, /// ASTC 8x5 3.20 BPP
+ BGFX_TEXTURE_FORMAT_ASTC8X6, /// ASTC 8x6 2.67 BPP
+ BGFX_TEXTURE_FORMAT_ASTC10X5, /// ASTC 10x5 2.56 BPP
+ BGFX_TEXTURE_FORMAT_UNKNOWN, /// Compressed formats above.
+ BGFX_TEXTURE_FORMAT_R1,
+ BGFX_TEXTURE_FORMAT_A8,
+ BGFX_TEXTURE_FORMAT_R8,
+ BGFX_TEXTURE_FORMAT_R8I,
+ BGFX_TEXTURE_FORMAT_R8U,
+ BGFX_TEXTURE_FORMAT_R8S,
+ BGFX_TEXTURE_FORMAT_R16,
+ BGFX_TEXTURE_FORMAT_R16I,
+ BGFX_TEXTURE_FORMAT_R16U,
+ BGFX_TEXTURE_FORMAT_R16F,
+ BGFX_TEXTURE_FORMAT_R16S,
+ BGFX_TEXTURE_FORMAT_R32I,
+ BGFX_TEXTURE_FORMAT_R32U,
+ BGFX_TEXTURE_FORMAT_R32F,
+ BGFX_TEXTURE_FORMAT_RG8,
+ BGFX_TEXTURE_FORMAT_RG8I,
+ BGFX_TEXTURE_FORMAT_RG8U,
+ BGFX_TEXTURE_FORMAT_RG8S,
+ BGFX_TEXTURE_FORMAT_RG16,
+ BGFX_TEXTURE_FORMAT_RG16I,
+ BGFX_TEXTURE_FORMAT_RG16U,
+ BGFX_TEXTURE_FORMAT_RG16F,
+ BGFX_TEXTURE_FORMAT_RG16S,
+ BGFX_TEXTURE_FORMAT_RG32I,
+ BGFX_TEXTURE_FORMAT_RG32U,
+ BGFX_TEXTURE_FORMAT_RG32F,
+ BGFX_TEXTURE_FORMAT_RGB8,
+ BGFX_TEXTURE_FORMAT_RGB8I,
+ BGFX_TEXTURE_FORMAT_RGB8U,
+ BGFX_TEXTURE_FORMAT_RGB8S,
+ BGFX_TEXTURE_FORMAT_RGB9E5F,
+ BGFX_TEXTURE_FORMAT_BGRA8,
+ BGFX_TEXTURE_FORMAT_RGBA8,
+ BGFX_TEXTURE_FORMAT_RGBA8I,
+ BGFX_TEXTURE_FORMAT_RGBA8U,
+ BGFX_TEXTURE_FORMAT_RGBA8S,
+ BGFX_TEXTURE_FORMAT_RGBA16,
+ BGFX_TEXTURE_FORMAT_RGBA16I,
+ BGFX_TEXTURE_FORMAT_RGBA16U,
+ BGFX_TEXTURE_FORMAT_RGBA16F,
+ BGFX_TEXTURE_FORMAT_RGBA16S,
+ BGFX_TEXTURE_FORMAT_RGBA32I,
+ BGFX_TEXTURE_FORMAT_RGBA32U,
+ BGFX_TEXTURE_FORMAT_RGBA32F,
+ BGFX_TEXTURE_FORMAT_R5G6B5,
+ BGFX_TEXTURE_FORMAT_RGBA4,
+ BGFX_TEXTURE_FORMAT_RGB5A1,
+ BGFX_TEXTURE_FORMAT_RGB10A2,
+ BGFX_TEXTURE_FORMAT_RG11B10F,
+ BGFX_TEXTURE_FORMAT_UNKNOWNDEPTH, /// Depth formats below.
+ BGFX_TEXTURE_FORMAT_D16,
+ BGFX_TEXTURE_FORMAT_D24,
+ BGFX_TEXTURE_FORMAT_D24S8,
+ BGFX_TEXTURE_FORMAT_D32,
+ BGFX_TEXTURE_FORMAT_D16F,
+ BGFX_TEXTURE_FORMAT_D24F,
+ BGFX_TEXTURE_FORMAT_D32F,
+ BGFX_TEXTURE_FORMAT_D0S8,
+
+ BGFX_TEXTURE_FORMAT_COUNT
+}
+
+/// Uniform type enum.
+enum bgfx_uniform_type_t
+{
+ BGFX_UNIFORM_TYPE_SAMPLER, /// Sampler.
+ BGFX_UNIFORM_TYPE_END, /// Reserved, do not use.
+ BGFX_UNIFORM_TYPE_VEC4, /// 4 floats vector.
+ BGFX_UNIFORM_TYPE_MAT3, /// 3x3 matrix.
+ BGFX_UNIFORM_TYPE_MAT4, /// 4x4 matrix.
+
+ BGFX_UNIFORM_TYPE_COUNT
+}
+
+/// Backbuffer ratio enum.
+enum bgfx_backbuffer_ratio_t
+{
+ BGFX_BACKBUFFER_RATIO_EQUAL, /// Equal to backbuffer.
+ BGFX_BACKBUFFER_RATIO_HALF, /// One half size of backbuffer.
+ BGFX_BACKBUFFER_RATIO_QUARTER, /// One quarter size of backbuffer.
+ BGFX_BACKBUFFER_RATIO_EIGHTH, /// One eighth size of backbuffer.
+ BGFX_BACKBUFFER_RATIO_SIXTEENTH, /// One sixteenth size of backbuffer.
+ BGFX_BACKBUFFER_RATIO_DOUBLE, /// Double size of backbuffer.
+
+ BGFX_BACKBUFFER_RATIO_COUNT
+}
+
+/// Occlusion query result.
+enum bgfx_occlusion_query_result_t
+{
+ BGFX_OCCLUSION_QUERY_RESULT_INVISIBLE, /// Query failed test.
+ BGFX_OCCLUSION_QUERY_RESULT_VISIBLE, /// Query passed test.
+ BGFX_OCCLUSION_QUERY_RESULT_NORESULT, /// Query result is not available yet.
+
+ BGFX_OCCLUSION_QUERY_RESULT_COUNT
+}
+
+/// Primitive topology.
+enum bgfx_topology_t
+{
+ BGFX_TOPOLOGY_TRILIST, /// Triangle list.
+ BGFX_TOPOLOGY_TRISTRIP, /// Triangle strip.
+ BGFX_TOPOLOGY_LINELIST, /// Line list.
+ BGFX_TOPOLOGY_LINESTRIP, /// Line strip.
+ BGFX_TOPOLOGY_POINTLIST, /// Point list.
+
+ BGFX_TOPOLOGY_COUNT
+}
+
+/// Topology conversion function.
+enum bgfx_topology_convert_t
+{
+ BGFX_TOPOLOGY_CONVERT_TRILISTFLIPWINDING, /// Flip winding order of triangle list.
+ BGFX_TOPOLOGY_CONVERT_TRISTRIPFLIPWINDING, /// Flip winding order of trinagle strip.
+ BGFX_TOPOLOGY_CONVERT_TRILISTTOLINELIST, /// Convert triangle list to line list.
+ BGFX_TOPOLOGY_CONVERT_TRISTRIPTOTRILIST, /// Convert triangle strip to triangle list.
+ BGFX_TOPOLOGY_CONVERT_LINESTRIPTOLINELIST, /// Convert line strip to line list.
+
+ BGFX_TOPOLOGY_CONVERT_COUNT
+}
+
+/// Topology sort order.
+enum bgfx_topology_sort_t
+{
+ BGFX_TOPOLOGY_SORT_DIRECTIONFRONTTOBACKMIN,
+ BGFX_TOPOLOGY_SORT_DIRECTIONFRONTTOBACKAVG,
+ BGFX_TOPOLOGY_SORT_DIRECTIONFRONTTOBACKMAX,
+ BGFX_TOPOLOGY_SORT_DIRECTIONBACKTOFRONTMIN,
+ BGFX_TOPOLOGY_SORT_DIRECTIONBACKTOFRONTAVG,
+ BGFX_TOPOLOGY_SORT_DIRECTIONBACKTOFRONTMAX,
+ BGFX_TOPOLOGY_SORT_DISTANCEFRONTTOBACKMIN,
+ BGFX_TOPOLOGY_SORT_DISTANCEFRONTTOBACKAVG,
+ BGFX_TOPOLOGY_SORT_DISTANCEFRONTTOBACKMAX,
+ BGFX_TOPOLOGY_SORT_DISTANCEBACKTOFRONTMIN,
+ BGFX_TOPOLOGY_SORT_DISTANCEBACKTOFRONTAVG,
+ BGFX_TOPOLOGY_SORT_DISTANCEBACKTOFRONTMAX,
+
+ BGFX_TOPOLOGY_SORT_COUNT
+}
+
+/// View mode sets draw call sort order.
+enum bgfx_view_mode_t
+{
+ BGFX_VIEW_MODE_DEFAULT, /// Default sort order.
+ BGFX_VIEW_MODE_SEQUENTIAL, /// Sort in the same order in which submit calls were called.
+ BGFX_VIEW_MODE_DEPTHASCENDING, /// Sort draw call depth in ascending order.
+ BGFX_VIEW_MODE_DEPTHDESCENDING, /// Sort draw call depth in descending order.
+
+ BGFX_VIEW_MODE_COUNT
+}
+
+/// Render frame enum.
+enum bgfx_render_frame_t
+{
+ BGFX_RENDER_FRAME_NOCONTEXT, /// Renderer context is not created yet.
+ BGFX_RENDER_FRAME_RENDER, /// Renderer context is created and rendering.
+ BGFX_RENDER_FRAME_TIMEOUT, /// Renderer context wait for main thread signal timed out without rendering.
+ BGFX_RENDER_FRAME_EXITING, /// Renderer context is getting destroyed.
+
+ BGFX_RENDER_FRAME_COUNT
+}
+
+/// GPU info.
+struct bgfx_caps_gpu_t
+{
+ ushort vendorId; /// Vendor PCI id. See `BGFX_PCI_ID_*`.
+ ushort deviceId; /// Device id.
+}
+
+/// Renderer capabilities limits.
+struct bgfx_caps_limits_t
+{
+ uint maxDrawCalls; /// Maximum number of draw calls.
+ uint maxBlits; /// Maximum number of blit calls.
+ uint maxTextureSize; /// Maximum texture size.
+ uint maxTextureLayers; /// Maximum texture layers.
+ uint maxViews; /// Maximum number of views.
+ uint maxFrameBuffers; /// Maximum number of frame buffer handles.
+ uint maxFBAttachments; /// Maximum number of frame buffer attachments.
+ uint maxPrograms; /// Maximum number of program handles.
+ uint maxShaders; /// Maximum number of shader handles.
+ uint maxTextures; /// Maximum number of texture handles.
+ uint maxTextureSamplers; /// Maximum number of texture samplers.
+ uint maxComputeBindings; /// Maximum number of compute bindings.
+ uint maxVertexLayouts; /// Maximum number of vertex format layouts.
+ uint maxVertexStreams; /// Maximum number of vertex streams.
+ uint maxIndexBuffers; /// Maximum number of index buffer handles.
+ uint maxVertexBuffers; /// Maximum number of vertex buffer handles.
+ uint maxDynamicIndexBuffers; /// Maximum number of dynamic index buffer handles.
+ uint maxDynamicVertexBuffers; /// Maximum number of dynamic vertex buffer handles.
+ uint maxUniforms; /// Maximum number of uniform handles.
+ uint maxOcclusionQueries; /// Maximum number of occlusion query handles.
+ uint maxEncoders; /// Maximum number of encoder threads.
+ uint transientVbSize; /// Maximum transient vertex buffer size.
+ uint transientIbSize; /// Maximum transient index buffer size.
+}
+
+/// Renderer capabilities.
+struct bgfx_caps_t
+{
+ bgfx_renderer_type_t rendererType; /// Renderer backend type. See: `bgfx::RendererType`
+
+ /**
+ * Supported functionality.
+ * @attention See BGFX_CAPS_* flags at https://bkaradzic.github.io/bgfx/bgfx.html#available-caps
+ */
+ ulong supported;
+ ushort vendorId; /// Selected GPU vendor PCI id.
+ ushort deviceId; /// Selected GPU device id.
+ bool homogeneousDepth; /// True when NDC depth is in [-1, 1] range, otherwise its [0, 1].
+ bool originBottomLeft; /// True when NDC origin is at bottom left.
+ byte numGPUs; /// Number of enumerated GPUs.
+ bgfx_caps_gpu_t[4] gpu; /// Enumerated GPUs.
+ bgfx_caps_limits_t limits;
+
+ /**
+ * Supported texture format capabilities flags:
+ * - `BGFX_CAPS_FORMAT_TEXTURE_NONE` - Texture format is not supported.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_2D` - Texture format is supported.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB` - Texture as sRGB format is supported.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_2D_EMULATED` - Texture format is emulated.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_3D` - Texture format is supported.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB` - Texture as sRGB format is supported.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_3D_EMULATED` - Texture format is emulated.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_CUBE` - Texture format is supported.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB` - Texture as sRGB format is supported.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_CUBE_EMULATED` - Texture format is emulated.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_VERTEX` - Texture format can be used from vertex shader.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_IMAGE` - Texture format can be used as image from compute
+ * shader.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER` - Texture format can be used as frame
+ * buffer.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA` - Texture format can be used as MSAA
+ * frame buffer.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_MSAA` - Texture can be sampled as MSAA.
+ * - `BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN` - Texture format supports auto-generated
+ * mips.
+ */
+ ushort[bgfx_texture_format_t.BGFX_TEXTURE_FORMAT_COUNT] formats;
+}
+
+/// Internal data.
+struct bgfx_internal_data_t
+{
+ const(bgfx_caps_t)* caps; /// Renderer capabilities.
+ void* context; /// GL context, or D3D device.
+}
+
+/// Platform data.
+struct bgfx_platform_data_t
+{
+ void* ndt; /// Native display type.
+ void* nwh; /// Native window handle.
+ void* context; /// GL context, or D3D device.
+ void* backBuffer; /// GL backbuffer, or D3D render target view.
+ void* backBufferDS; /// Backbuffer depth/stencil.
+}
+
+/// Backbuffer resolution and reset parameters.
+struct bgfx_resolution_t
+{
+ bgfx_texture_format_t format; /// Backbuffer format.
+ uint width; /// Backbuffer width.
+ uint height; /// Backbuffer height.
+ uint reset; /// Reset parameters.
+ byte numBackBuffers; /// Number of back buffers.
+ byte maxFrameLatency; /// Maximum frame latency.
+}
+
+struct bgfx_init_limits_t
+{
+ ushort maxEncoders; /// Maximum number of encoder threads.
+ uint transientVbSize; /// Maximum transient vertex buffer size.
+ uint transientIbSize; /// Maximum transient index buffer size.
+}
+
+/// Initialization parameters used by `bgfx::init`.
+struct bgfx_init_t
+{
+
+ /**
+ * Select rendering backend. When set to RendererType::Count
+ * a default rendering backend will be selected appropriate to the platform.
+ * See: `bgfx::RendererType`
+ */
+ bgfx_renderer_type_t type;
+
+ /**
+ * Vendor PCI id. If set to `BGFX_PCI_ID_NONE` it will select the first
+ * device.
+ * - `BGFX_PCI_ID_NONE` - Autoselect adapter.
+ * - `BGFX_PCI_ID_SOFTWARE_RASTERIZER` - Software rasterizer.
+ * - `BGFX_PCI_ID_AMD` - AMD adapter.
+ * - `BGFX_PCI_ID_INTEL` - Intel adapter.
+ * - `BGFX_PCI_ID_NVIDIA` - nVidia adapter.
+ */
+ ushort vendorId;
+
+ /**
+ * Device id. If set to 0 it will select first device, or device with
+ * matching id.
+ */
+ ushort deviceId;
+ bool debug_; /// Enable device for debuging.
+ bool profile; /// Enable device for profiling.
+ bgfx_platform_data_t platformData; /// Platform data.
+ bgfx_resolution_t resolution; /// Backbuffer resolution and reset parameters. See: `bgfx::Resolution`.
+ bgfx_init_limits_t limits;
+
+ /**
+ * Provide application specific callback interface.
+ * See: `bgfx::CallbackI`
+ */
+ void* callback;
+
+ /**
+ * Custom allocator. When a custom allocator is not
+ * specified, bgfx uses the CRT allocator. Bgfx assumes
+ * custom allocator is thread safe.
+ */
+ void* allocator;
+}
+
+/**
+ * Memory must be obtained by calling `bgfx::alloc`, `bgfx::copy`, or `bgfx::makeRef`.
+ * @attention It is illegal to create this structure on stack and pass it to any bgfx API.
+ */
+struct bgfx_memory_t
+{
+ byte* data; /// Pointer to data.
+ uint size; /// Data size.
+}
+
+/// Transient index buffer.
+struct bgfx_transient_index_buffer_t
+{
+ byte* data; /// Pointer to data.
+ uint size; /// Data size.
+ uint startIndex; /// First index.
+ bgfx_index_buffer_handle_t handle; /// Index buffer handle.
+}
+
+/// Transient vertex buffer.
+struct bgfx_transient_vertex_buffer_t
+{
+ byte* data; /// Pointer to data.
+ uint size; /// Data size.
+ uint startVertex; /// First vertex.
+ ushort stride; /// Vertex stride.
+ bgfx_vertex_buffer_handle_t handle; /// Vertex buffer handle.
+ bgfx_vertex_layout_handle_t layoutHandle; /// Vertex layout handle.
+}
+
+/// Instance data buffer info.
+struct bgfx_instance_data_buffer_t
+{
+ byte* data; /// Pointer to data.
+ uint size; /// Data size.
+ uint offset; /// Offset in vertex buffer.
+ uint num; /// Number of instances.
+ ushort stride; /// Vertex buffer stride.
+ bgfx_vertex_buffer_handle_t handle; /// Vertex buffer object handle.
+}
+
+/// Texture info.
+struct bgfx_texture_info_t
+{
+ bgfx_texture_format_t format; /// Texture format.
+ uint storageSize; /// Total amount of bytes required to store texture.
+ ushort width; /// Texture width.
+ ushort height; /// Texture height.
+ ushort depth; /// Texture depth.
+ ushort numLayers; /// Number of layers in texture array.
+ byte numMips; /// Number of MIP maps.
+ byte bitsPerPixel; /// Format bits per pixel.
+ bool cubeMap; /// Texture is cubemap.
+}
+
+/// Uniform info.
+struct bgfx_uniform_info_t
+{
+ char[256] name; /// Uniform name.
+ bgfx_uniform_type_t type; /// Uniform type.
+ ushort num; /// Number of elements in array.
+}
+
+/// Frame buffer texture attachment info.
+struct bgfx_attachment_t
+{
+ bgfx_access_t access; /// Attachement access. See `Access::Enum`.
+ bgfx_texture_handle_t handle; /// Render target texture handle.
+ ushort mip; /// Mip level.
+ ushort layer; /// Cubemap side or depth layer/slice.
+ byte resolve; /// Resolve flags. See: `BGFX_RESOLVE_*`
+}
+
+/// Transform data.
+struct bgfx_transform_t
+{
+ float* data; /// Pointer to first 4x4 matrix.
+ ushort num; /// Number of matrices.
+}
+
+/// View stats.
+struct bgfx_view_stats_t
+{
+ char[256] name; /// View name.
+ bgfx_view_id_t view; /// View id.
+ long cpuTimeBegin; /// CPU (submit) begin time.
+ long cpuTimeEnd; /// CPU (submit) end time.
+ long gpuTimeBegin; /// GPU begin time.
+ long gpuTimeEnd; /// GPU end time.
+}
+
+/// Encoder stats.
+struct bgfx_encoder_stats_t
+{
+ long cpuTimeBegin; /// Encoder thread CPU submit begin time.
+ long cpuTimeEnd; /// Encoder thread CPU submit end time.
+}
+
+/**
+ * Renderer statistics data.
+ * @remarks All time values are high-resolution timestamps, while
+ * time frequencies define timestamps-per-second for that hardware.
+ */
+struct bgfx_stats_t
+{
+ long cpuTimeFrame; /// CPU time between two `bgfx::frame` calls.
+ long cpuTimeBegin; /// Render thread CPU submit begin time.
+ long cpuTimeEnd; /// Render thread CPU submit end time.
+ long cpuTimerFreq; /// CPU timer frequency. Timestamps-per-second
+ long gpuTimeBegin; /// GPU frame begin time.
+ long gpuTimeEnd; /// GPU frame end time.
+ long gpuTimerFreq; /// GPU timer frequency.
+ long waitRender; /// Time spent waiting for render backend thread to finish issuing draw commands to underlying graphics API.
+ long waitSubmit; /// Time spent waiting for submit thread to advance to next frame.
+ uint numDraw; /// Number of draw calls submitted.
+ uint numCompute; /// Number of compute calls submitted.
+ uint numBlit; /// Number of blit calls submitted.
+ uint maxGpuLatency; /// GPU driver latency.
+ ushort numDynamicIndexBuffers; /// Number of used dynamic index buffers.
+ ushort numDynamicVertexBuffers; /// Number of used dynamic vertex buffers.
+ ushort numFrameBuffers; /// Number of used frame buffers.
+ ushort numIndexBuffers; /// Number of used index buffers.
+ ushort numOcclusionQueries; /// Number of used occlusion queries.
+ ushort numPrograms; /// Number of used programs.
+ ushort numShaders; /// Number of used shaders.
+ ushort numTextures; /// Number of used textures.
+ ushort numUniforms; /// Number of used uniforms.
+ ushort numVertexBuffers; /// Number of used vertex buffers.
+ ushort numVertexLayouts; /// Number of used vertex layouts.
+ long textureMemoryUsed; /// Estimate of texture memory used.
+ long rtMemoryUsed; /// Estimate of render target memory used.
+ int transientVbUsed; /// Amount of transient vertex buffer used.
+ int transientIbUsed; /// Amount of transient index buffer used.
+ uint[bgfx_topology_t.BGFX_TOPOLOGY_COUNT] numPrims; /// Number of primitives rendered.
+ long gpuMemoryMax; /// Maximum available GPU memory for application.
+ long gpuMemoryUsed; /// Amount of GPU memory used by the application.
+ ushort width; /// Backbuffer width in pixels.
+ ushort height; /// Backbuffer height in pixels.
+ ushort textWidth; /// Debug text width in characters.
+ ushort textHeight; /// Debug text height in characters.
+ ushort numViews; /// Number of view stats.
+ bgfx_view_stats_t* viewStats; /// Array of View stats.
+ byte numEncoders; /// Number of encoders used during frame.
+ bgfx_encoder_stats_t* encoderStats; /// Array of encoder stats.
+}
+
+/// Vertex layout.
+struct bgfx_vertex_layout_t
+{
+ uint hash; /// Hash.
+ ushort stride; /// Stride.
+ ushort[bgfx_attrib_t.BGFX_ATTRIB_COUNT] offset; /// Attribute offsets.
+ ushort[bgfx_attrib_t.BGFX_ATTRIB_COUNT] attributes; /// Used attributes.
+}
+
+/**
+ * Encoders are used for submitting draw calls from multiple threads. Only one encoder
+ * per thread should be used. Use `bgfx::begin()` to obtain an encoder for a thread.
+ */
+struct bgfx_encoder_t
+{
+}
+
+struct bgfx_dynamic_index_buffer_handle_t { ushort idx; }
+
+struct bgfx_dynamic_vertex_buffer_handle_t { ushort idx; }
+
+struct bgfx_frame_buffer_handle_t { ushort idx; }
+
+struct bgfx_index_buffer_handle_t { ushort idx; }
+
+struct bgfx_indirect_buffer_handle_t { ushort idx; }
+
+struct bgfx_occlusion_query_handle_t { ushort idx; }
+
+struct bgfx_program_handle_t { ushort idx; }
+
+struct bgfx_shader_handle_t { ushort idx; }
+
+struct bgfx_texture_handle_t { ushort idx; }
+
+struct bgfx_uniform_handle_t { ushort idx; }
+
+struct bgfx_vertex_buffer_handle_t { ushort idx; }
+
+struct bgfx_vertex_layout_handle_t { ushort idx; }
+
diff --git a/3rdparty/bgfx/examples/common/entry/entry.cpp b/3rdparty/bgfx/examples/common/entry/entry.cpp
index 98b1a40577e..89409f000f2 100644
--- a/3rdparty/bgfx/examples/common/entry/entry.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry.cpp
@@ -352,9 +352,6 @@ BX_PRAGMA_DIAGNOSTIC_POP();
{ entry::Key::GamepadStart, entry::Modifier::None, 1, NULL, "graphics stats" },
{ entry::Key::F1, entry::Modifier::LeftShift, 1, NULL, "graphics stats 0\ngraphics text 0" },
{ entry::Key::F3, entry::Modifier::None, 1, NULL, "graphics wireframe" },
- { entry::Key::F4, entry::Modifier::None, 1, NULL, "graphics hmd" },
- { entry::Key::F4, entry::Modifier::LeftShift, 1, NULL, "graphics hmdrecenter" },
- { entry::Key::F4, entry::Modifier::LeftCtrl, 1, NULL, "graphics hmddbg" },
{ entry::Key::F6, entry::Modifier::None, 1, NULL, "graphics profiler" },
{ entry::Key::F7, entry::Modifier::None, 1, NULL, "graphics vsync" },
{ entry::Key::F8, entry::Modifier::None, 1, NULL, "graphics msaa" },
diff --git a/3rdparty/bgfx/examples/common/example-glue.cpp b/3rdparty/bgfx/examples/common/example-glue.cpp
index 0c4f84f93c6..ad4507c4f81 100644
--- a/3rdparty/bgfx/examples/common/example-glue.cpp
+++ b/3rdparty/bgfx/examples/common/example-glue.cpp
@@ -438,8 +438,10 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
ImGui::Text("%3d %3d %s", pos, viewStats.view, viewStats.name);
const float maxWidth = 30.0f*scale;
- const float cpuWidth = bx::clamp(float(viewStats.cpuTimeElapsed*toCpuMs)*scale, 1.0f, maxWidth);
- const float gpuWidth = bx::clamp(float(viewStats.gpuTimeElapsed*toGpuMs)*scale, 1.0f, maxWidth);
+ const float cpuTimeElapsed = float((viewStats.cpuTimeEnd - viewStats.cpuTimeBegin) * toCpuMs);
+ const float gpuTimeElapsed = float((viewStats.gpuTimeEnd - viewStats.gpuTimeBegin) * toGpuMs);
+ const float cpuWidth = bx::clamp(cpuTimeElapsed*scale, 1.0f, maxWidth);
+ const float gpuWidth = bx::clamp(gpuTimeElapsed*scale, 1.0f, maxWidth);
ImGui::SameLine(64.0f);
@@ -448,7 +450,7 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
ImGui::SetTooltip("View %d \"%s\", CPU: %f [ms]"
, pos
, viewStats.name
- , viewStats.cpuTimeElapsed*toCpuMs
+ , cpuTimeElapsed
);
}
@@ -458,7 +460,7 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
ImGui::SetTooltip("View: %d \"%s\", GPU: %f [ms]"
, pos
, viewStats.name
- , viewStats.gpuTimeElapsed*toGpuMs
+ , gpuTimeElapsed
);
}
}
diff --git a/3rdparty/bgfx/examples/common/shaderlib.sh b/3rdparty/bgfx/examples/common/shaderlib.sh
index f0aee192493..3bd7b12e4c1 100644
--- a/3rdparty/bgfx/examples/common/shaderlib.sh
+++ b/3rdparty/bgfx/examples/common/shaderlib.sh
@@ -10,10 +10,10 @@ vec4 encodeRE8(float _r)
{
float exponent = ceil(log2(_r) );
return vec4(_r / exp2(exponent)
- , 0.0
- , 0.0
- , (exponent + 128.0) / 255.0
- );
+ , 0.0
+ , 0.0
+ , (exponent + 128.0) / 255.0
+ );
}
float decodeRE8(vec4 _re8)
@@ -62,9 +62,9 @@ vec3 decodeNormalSphereMap(vec2 _encodedNormal)
vec2 octahedronWrap(vec2 _val)
{
- // Reference:
- // Octahedron normal vector encoding
- // http://kriscg.blogspot.com/2014/04/octahedron-normal-vector-encoding.html
+ // Reference(s):
+ // - Octahedron normal vector encoding
+ // https://web.archive.org/web/20191027010600/https://knarkowicz.wordpress.com/2014/04/16/octahedron-normal-vector-encoding/comment-page-1/
return (1.0 - abs(_val.yx) )
* mix(vec2_splat(-1.0), vec2_splat(1.0), vec2(greaterThanEqual(_val.xy, vec2_splat(0.0) ) ) );
}
@@ -89,9 +89,9 @@ vec3 decodeNormalOctahedron(vec2 _encodedNormal)
vec3 convertRGB2XYZ(vec3 _rgb)
{
- // Reference:
- // RGB/XYZ Matrices
- // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
+ // Reference(s):
+ // - RGB/XYZ Matrices
+ // https://web.archive.org/web/20191027010220/http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
vec3 xyz;
xyz.x = dot(vec3(0.4124564, 0.3575761, 0.1804375), _rgb);
xyz.y = dot(vec3(0.2126729, 0.7151522, 0.0721750), _rgb);
@@ -110,16 +110,18 @@ vec3 convertXYZ2RGB(vec3 _xyz)
vec3 convertXYZ2Yxy(vec3 _xyz)
{
- // Reference:
- // http://www.brucelindbloom.com/index.html?Eqn_XYZ_to_xyY.html
+ // Reference(s):
+ // - XYZ to xyY
+ // https://web.archive.org/web/20191027010144/http://www.brucelindbloom.com/index.html?Eqn_XYZ_to_xyY.html
float inv = 1.0/dot(_xyz, vec3(1.0, 1.0, 1.0) );
return vec3(_xyz.y, _xyz.x*inv, _xyz.y*inv);
}
vec3 convertYxy2XYZ(vec3 _Yxy)
{
- // Reference:
- // http://www.brucelindbloom.com/index.html?Eqn_xyY_to_XYZ.html
+ // Reference(s):
+ // - xyY to XYZ
+ // https://web.archive.org/web/20191027010036/http://www.brucelindbloom.com/index.html?Eqn_xyY_to_XYZ.html
vec3 xyz;
xyz.x = _Yxy.x*_Yxy.y/_Yxy.z;
xyz.y = _Yxy.x;
@@ -248,9 +250,9 @@ vec4 toFilmic(vec4 _rgba)
vec3 toAcesFilmic(vec3 _rgb)
{
- // Reference:
- // ACES Filmic Tone Mapping Curve
- // https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/
+ // Reference(s):
+ // - ACES Filmic Tone Mapping Curve
+ // https://web.archive.org/web/20191027010704/https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/
float aa = 2.51f;
float bb = 0.03f;
float cc = 2.43f;
@@ -369,9 +371,9 @@ float random(vec2 _uv)
vec3 fixCubeLookup(vec3 _v, float _lod, float _topLevelCubeSize)
{
- // Reference:
- // Seamless cube-map filtering
- // http://the-witness.net/news/2012/02/seamless-cube-map-filtering/
+ // Reference(s):
+ // - Seamless cube-map filtering
+ // https://web.archive.org/web/20190411181934/http://the-witness.net/news/2012/02/seamless-cube-map-filtering/
float ax = abs(_v.x);
float ay = abs(_v.y);
float az = abs(_v.z);
@@ -392,22 +394,23 @@ vec2 texture2DBc5(sampler2D _sampler, vec2 _uv)
#endif
}
-mat3 cofactor( mat4 _m )
+mat3 cofactor(mat4 _m)
{
// Reference:
// Cofactor of matrix. Use to transform normals. The code assumes the last column of _m is [0,0,0,1].
// https://www.shadertoy.com/view/3s33zj
// https://github.com/graphitemaster/normals_revisited
- return mat3(
- _m[1][1]*_m[2][2]-_m[1][2]*_m[2][1],
- _m[1][2]*_m[2][0]-_m[1][0]*_m[2][2],
- _m[1][0]*_m[2][1]-_m[1][1]*_m[2][0],
- _m[0][2]*_m[2][1]-_m[0][1]*_m[2][2],
- _m[0][0]*_m[2][2]-_m[0][2]*_m[2][0],
- _m[0][1]*_m[2][0]-_m[0][0]*_m[2][1],
- _m[0][1]*_m[1][2]-_m[0][2]*_m[1][1],
- _m[0][2]*_m[1][0]-_m[0][0]*_m[1][2],
- _m[0][0]*_m[1][1]-_m[0][1]*_m[1][0] );
+ return mat3(
+ _m[1][1]*_m[2][2]-_m[1][2]*_m[2][1],
+ _m[1][2]*_m[2][0]-_m[1][0]*_m[2][2],
+ _m[1][0]*_m[2][1]-_m[1][1]*_m[2][0],
+ _m[0][2]*_m[2][1]-_m[0][1]*_m[2][2],
+ _m[0][0]*_m[2][2]-_m[0][2]*_m[2][0],
+ _m[0][1]*_m[2][0]-_m[0][0]*_m[2][1],
+ _m[0][1]*_m[1][2]-_m[0][2]*_m[1][1],
+ _m[0][2]*_m[1][0]-_m[0][0]*_m[1][2],
+ _m[0][0]*_m[1][1]-_m[0][1]*_m[1][0]
+ );
}
#endif // __SHADERLIB_SH__
diff --git a/3rdparty/bgfx/include/bgfx/bgfx.h b/3rdparty/bgfx/include/bgfx/bgfx.h
index e34aaf406a3..98c26d45097 100644
--- a/3rdparty/bgfx/include/bgfx/bgfx.h
+++ b/3rdparty/bgfx/include/bgfx/bgfx.h
@@ -911,8 +911,10 @@ namespace bgfx
{
char name[256]; //!< View name.
ViewId view; //!< View id.
- int64_t cpuTimeElapsed; //!< CPU (submit) time elapsed.
- int64_t gpuTimeElapsed; //!< GPU time elapsed.
+ int64_t cpuTimeBegin; //!< CPU (submit) begin time.
+ int64_t cpuTimeEnd; //!< CPU (submit) end time.
+ int64_t gpuTimeBegin; //!< GPU begin time.
+ int64_t gpuTimeEnd; //!< GPU end time.
};
/// Encoder stats.
diff --git a/3rdparty/bgfx/include/bgfx/c99/bgfx.h b/3rdparty/bgfx/include/bgfx/c99/bgfx.h
index 71287b60384..2a9fe94c41b 100644
--- a/3rdparty/bgfx/include/bgfx/c99/bgfx.h
+++ b/3rdparty/bgfx/include/bgfx/c99/bgfx.h
@@ -1,13 +1,14 @@
/*
* Copyright 2011-2019 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
- *
- * vim: set tabstop=4 expandtab:
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
/*
*
- * AUTO GENERATED! DO NOT EDIT! ( source : temp.bgfx.h )
+ * AUTO GENERATED FROM IDL! DO NOT EDIT! (source : temp.bgfx.h)
+ *
+ * More info about IDL:
+ * https://gist.github.com/bkaradzic/05a1c86a6dd57bf86e2d828878e88dc2#bgfx-is-switching-to-idl-to-generate-api
*
*/
@@ -782,8 +783,10 @@ typedef struct bgfx_view_stats_s
{
char name[256]; /** View name. */
bgfx_view_id_t view; /** View id. */
- int64_t cpuTimeElapsed; /** CPU (submit) time elapsed. */
- int64_t gpuTimeElapsed; /** GPU time elapsed. */
+ int64_t cpuTimeBegin; /** CPU (submit) begin time. */
+ int64_t cpuTimeEnd; /** CPU (submit) end time. */
+ int64_t gpuTimeBegin; /** GPU begin time. */
+ int64_t gpuTimeEnd; /** GPU end time. */
} bgfx_view_stats_t;
diff --git a/3rdparty/bgfx/include/bgfx/defines.h b/3rdparty/bgfx/include/bgfx/defines.h
index bbf0c71a0d5..863b507047d 100644
--- a/3rdparty/bgfx/include/bgfx/defines.h
+++ b/3rdparty/bgfx/include/bgfx/defines.h
@@ -3,10 +3,19 @@
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
+/*
+ *
+ * AUTO GENERATED FROM IDL! DO NOT EDIT! (source : temp.defines.h)
+ *
+ * More info about IDL:
+ * https://gist.github.com/bkaradzic/05a1c86a6dd57bf86e2d828878e88dc2#bgfx-is-switching-to-idl-to-generate-api
+ *
+ */
+
#ifndef BGFX_DEFINES_H_HEADER_GUARD
#define BGFX_DEFINES_H_HEADER_GUARD
-#define BGFX_API_VERSION UINT32_C(100)
+#define BGFX_API_VERSION UINT32_C(102)
/**
* Color RGB/alpha/depth write. When it's not specified write will be disabled.
@@ -122,6 +131,7 @@
#define BGFX_STATE_LINEAA UINT64_C(0x0200000000000000) //!< Enable line AA rasterization.
#define BGFX_STATE_CONSERVATIVE_RASTER UINT64_C(0x0400000000000000) //!< Enable conservative rasterization.
#define BGFX_STATE_NONE UINT64_C(0x0000000000000000) //!< No state.
+#define BGFX_STATE_FRONT_CCW UINT64_C(0x0000008000000000) //!< Front counter-clockwise (default is clockwise).
#define BGFX_STATE_BLEND_INDEPENDENT UINT64_C(0x0000000400000000) //!< Enable blend independent.
#define BGFX_STATE_BLEND_ALPHA_TO_COVERAGE UINT64_C(0x0000000800000000) //!< Enable alpha to coverage.
/// Default state is write to RGB, alpha, and depth with depth test less enabled, with clockwise
diff --git a/3rdparty/bgfx/scripts/bgfx.idl b/3rdparty/bgfx/scripts/bgfx.idl
index 23a1ecee285..e02d257de65 100644
--- a/3rdparty/bgfx/scripts/bgfx.idl
+++ b/3rdparty/bgfx/scripts/bgfx.idl
@@ -1,7 +1,7 @@
-- vim: syntax=lua
-- bgfx interface
-version(100)
+version(102)
typedef "bool"
typedef "char"
@@ -79,18 +79,18 @@ flag.StateBlendEquation { bits = 64, shift = 28, range = 6, base = 0, desc = "Bl
--- Cull state. When `BGFX_STATE_CULL_*` is not specified culling will be disabled.
flag.StateCull { bits = 64, shift = 36, range = 2, base = 1, desc = "Culling mode" }
- .Cw --- Cull clockwise triangles.
- .Ccw --- Cull counter-clockwise triangles.
+ .Cw --- Cull clockwise triangles.
+ .Ccw --- Cull counter-clockwise triangles.
()
--- Alpha reference value.
flag.StateAlphaRef { bits = 64, shift = 40, range = 8, desc = "Alpha reference", "helper" }
flag.StatePt { bits = 64, shift = 48, range = 3, base = 1, desc = "Primitive type" }
- .Tristrip --- Tristrip.
- .Lines --- Lines.
- .Linestrip --- Line strip.
- .Points --- Points.
+ .Tristrip --- Tristrip.
+ .Lines --- Lines.
+ .Linestrip --- Line strip.
+ .Points --- Points.
()
--- Point size value.
@@ -99,16 +99,16 @@ flag.StatePointSize { bits = 64, shift = 52, range = 4, desc = "Point size", "he
--- Enable MSAA write when writing into MSAA frame buffer.
--- This flag is ignored when not writing into MSAA frame buffer.
flag.State { bits = 64 , range = 64 , desc = "State" }
- .Msaa (57) --- Enable MSAA rasterization.
- .Lineaa (58) --- Enable line AA rasterization.
- .ConservativeRaster (59) --- Enable conservative rasterization.
- .None (0) --- No state.
- .BlendIndependent(35) --- Enable blend independent.
- .BlendAlphaToCoverage (36) --- Enable alpha to coverage.
+ .Msaa (57) --- Enable MSAA rasterization.
+ .Lineaa (58) --- Enable line AA rasterization.
+ .ConservativeRaster (59) --- Enable conservative rasterization.
+ .None (0) --- No state.
+ .FrontCcw(40) --- Front counter-clockwise (default is clockwise).
+ .BlendIndependent(35) --- Enable blend independent.
+ .BlendAlphaToCoverage (36) --- Enable alpha to coverage.
.Default { "WriteRgb", "WriteA", "WriteZ", "DepthTestLess", "CullCw", "Msaa" }
- --- Default state is write to RGB, alpha, and depth with depth test less enabled, with clockwise
- --- culling and MSAA (when writing into MSAA frame buffer, otherwise this flag is ignored).
-
+ --- Default state is write to RGB, alpha, and depth with depth test less enabled, with clockwise
+ --- culling and MSAA (when writing into MSAA frame buffer, otherwise this flag is ignored).
--- Do not use!
flag.StateReserved { bits = 64, shift = 61, range = 3 }
@@ -120,69 +120,69 @@ flag.StencilFuncRef { bits = 32, shift = 0, range = 8, "helper" }
flag.StencilFuncRmask { bits = 32, shift = 8, range = 8, "helper" }
flag.Stencil { bits = 32, const }
- .None (0x00000000)
- .Mask (0xffffffff)
- .Default (0x00000000)
+ .None (0x00000000)
+ .Mask (0xffffffff)
+ .Default (0x00000000)
flag.StencilTest { bits = 32, shift = 16, range = 4 , base = 1, desc = "Stencil test" }
- .Less --- Enable stencil test, less.
- .Lequal --- Enable stencil test, less or equal.
- .Equal --- Enable stencil test, equal.
- .Gequal --- Enable stencil test, greater or equal.
- .Greater --- Enable stencil test, greater.
- .Notequal --- Enable stencil test, not equal.
- .Never --- Enable stencil test, never.
- .Always --- Enable stencil test, always.
+ .Less --- Enable stencil test, less.
+ .Lequal --- Enable stencil test, less or equal.
+ .Equal --- Enable stencil test, equal.
+ .Gequal --- Enable stencil test, greater or equal.
+ .Greater --- Enable stencil test, greater.
+ .Notequal --- Enable stencil test, not equal.
+ .Never --- Enable stencil test, never.
+ .Always --- Enable stencil test, always.
()
flag.StencilOpFailS { bits = 32, shift = 20, range = 4, base = 0, desc = "Stencil operation fail" }
- .Zero --- Zero.
- .Keep --- Keep.
- .Replace --- Replace.
- .Incr --- Increment and wrap.
- .Incrsat --- Increment and clamp.
- .Decr --- Decrement and wrap.
- .Decrsat --- Decrement and clamp.
- .Invert --- Invert.
+ .Zero --- Zero.
+ .Keep --- Keep.
+ .Replace --- Replace.
+ .Incr --- Increment and wrap.
+ .Incrsat --- Increment and clamp.
+ .Decr --- Decrement and wrap.
+ .Decrsat --- Decrement and clamp.
+ .Invert --- Invert.
()
flag.StencilOpFailZ { bits = 32, shift = 24, range = 4, base = 0, desc = "Stencil operation depth fail" }
- .Zero --- Zero.
- .Keep --- Keep.
- .Replace --- Replace.
- .Incr --- Increment and wrap.
- .Incrsat --- Increment and clamp.
- .Decr --- Decrement and wrap.
- .Decrsat --- Decrement and clamp.
- .Invert --- Invert.
+ .Zero --- Zero.
+ .Keep --- Keep.
+ .Replace --- Replace.
+ .Incr --- Increment and wrap.
+ .Incrsat --- Increment and clamp.
+ .Decr --- Decrement and wrap.
+ .Decrsat --- Decrement and clamp.
+ .Invert --- Invert.
()
flag.StencilOpPassZ { bits = 32, shift = 28, range = 4 , base = 0, desc = "Stencil operation depth pass" }
- .Zero --- Zero.
- .Keep --- Keep.
- .Replace --- Replace.
- .Incr --- Increment and wrap.
- .Incrsat --- Increment and clamp.
- .Decr --- Decrement and wrap.
- .Decrsat --- Decrement and clamp.
- .Invert --- Invert.
+ .Zero --- Zero.
+ .Keep --- Keep.
+ .Replace --- Replace.
+ .Incr --- Increment and wrap.
+ .Incrsat --- Increment and clamp.
+ .Decr --- Decrement and wrap.
+ .Decrsat --- Decrement and clamp.
+ .Invert --- Invert.
()
flag.Clear { bits = 16 }
- .None --- No clear flags.
- .Color --- Clear color.
- .Depth --- Clear depth.
- .Stencil --- Clear stencil.
- .DiscardColor_0 --- Discard frame buffer attachment 0.
- .DiscardColor_1 --- Discard frame buffer attachment 1.
- .DiscardColor_2 --- Discard frame buffer attachment 2.
- .DiscardColor_3 --- Discard frame buffer attachment 3.
- .DiscardColor_4 --- Discard frame buffer attachment 4.
- .DiscardColor_5 --- Discard frame buffer attachment 5.
- .DiscardColor_6 --- Discard frame buffer attachment 6.
- .DiscardColor_7 --- Discard frame buffer attachment 7.
- .DiscardDepth --- Discard frame buffer depth attachment.
- .DiscardStencil --- Discard frame buffer stencil attachment.
+ .None --- No clear flags.
+ .Color --- Clear color.
+ .Depth --- Clear depth.
+ .Stencil --- Clear stencil.
+ .DiscardColor_0 --- Discard frame buffer attachment 0.
+ .DiscardColor_1 --- Discard frame buffer attachment 1.
+ .DiscardColor_2 --- Discard frame buffer attachment 2.
+ .DiscardColor_3 --- Discard frame buffer attachment 3.
+ .DiscardColor_4 --- Discard frame buffer attachment 4.
+ .DiscardColor_5 --- Discard frame buffer attachment 5.
+ .DiscardColor_6 --- Discard frame buffer attachment 6.
+ .DiscardColor_7 --- Discard frame buffer attachment 7.
+ .DiscardDepth --- Discard frame buffer depth attachment.
+ .DiscardStencil --- Discard frame buffer stencil attachment.
.DiscardColorMask {
"DiscardColor_0",
"DiscardColor_1",
@@ -200,31 +200,31 @@ flag.Clear { bits = 16 }
}
flag.Debug { bits = 32 }
- .None --- No debug.
- .Wireframe --- Enable wireframe for all primitives.
- .Ifh --- Enable infinitely fast hardware test. No draw calls will be submitted to driver.
- --- It's useful when profiling to quickly assess bottleneck between CPU and GPU.
- .Stats --- Enable statistics display.
- .Text --- Enable debug text display.
- .Profiler --- Enable profiler.
+ .None --- No debug.
+ .Wireframe --- Enable wireframe for all primitives.
+ .Ifh --- Enable infinitely fast hardware test. No draw calls will be submitted to driver.
+ --- It's useful when profiling to quickly assess bottleneck between CPU and GPU.
+ .Stats --- Enable statistics display.
+ .Text --- Enable debug text display.
+ .Profiler --- Enable profiler.
()
flag.BufferComputeFormat { bits = 16, shift = 0, range = 4, base = 1 }
- ._8x1 --- 1 8-bit value
- ._8x2 --- 2 8-bit values
- ._8x4 --- 4 8-bit values
- ._16x1 --- 1 16-bit value
- ._16x2 --- 2 16-bit values
- ._16x4 --- 4 16-bit values
- ._32x1 --- 1 32-bit value
- ._32x2 --- 2 32-bit values
- ._32x4 --- 4 32-bit values
+ ._8x1 --- 1 8-bit value
+ ._8x2 --- 2 8-bit values
+ ._8x4 --- 4 8-bit values
+ ._16x1 --- 1 16-bit value
+ ._16x2 --- 2 16-bit values
+ ._16x4 --- 4 16-bit values
+ ._32x1 --- 1 32-bit value
+ ._32x2 --- 2 32-bit values
+ ._32x4 --- 4 32-bit values
()
flag.BufferComputeType { bits = 16, shift = 4, range = 2, base = 1 }
- .Int --- Type `int`.
- .Uint --- Type `uint`.
- .Float --- Type `float`.
+ .Int --- Type `int`.
+ .Uint --- Type `uint`.
+ .Float --- Type `float`.
()
flag.Buffer { bits = 16, base = 8 }
@@ -239,66 +239,66 @@ flag.Buffer { bits = 16, base = 8 }
flag.Texture { bits = 64 }
.None (0)
- .MsaaSample (36) --- Texture will be used for MSAA sampling.
- .Rt (37) --- Render target no MSAA.
- .ComputeWrite (45) --- Texture will be used for compute write.
- .Srgb (46) --- Sample texture as sRGB.
- .BlitDst (47) --- Texture will be used as blit destination.
- .ReadBack (48) --- Texture will be used for read back from GPU.
+ .MsaaSample (36) --- Texture will be used for MSAA sampling.
+ .Rt (37) --- Render target no MSAA.
+ .ComputeWrite (45) --- Texture will be used for compute write.
+ .Srgb (46) --- Sample texture as sRGB.
+ .BlitDst (47) --- Texture will be used as blit destination.
+ .ReadBack (48) --- Texture will be used for read back from GPU.
()
flag.TextureRtMsaa { bits = 64, shift = 36, range = 3 , base = 2 }
- .X2 --- Render target MSAAx2 mode.
- .X4 --- Render target MSAAx4 mode.
- .X8 --- Render target MSAAx8 mode.
- .X16 --- Render target MSAAx16 mode.
+ .X2 --- Render target MSAAx2 mode.
+ .X4 --- Render target MSAAx4 mode.
+ .X8 --- Render target MSAAx8 mode.
+ .X16 --- Render target MSAAx16 mode.
()
flag.TextureRt { bits = 64, shift = 36, range = 4 }
- .WriteOnly (9) --- Render target will be used for writing
+ .WriteOnly (9) --- Render target will be used for writing
--- Sampler flags.
flag.SamplerU { bits = 32, shift = 0, range = 2, base = 1 }
- .Mirror --- Wrap U mode: Mirror
- .Clamp --- Wrap U mode: Clamp
- .Border --- Wrap U mode: Border
+ .Mirror --- Wrap U mode: Mirror
+ .Clamp --- Wrap U mode: Clamp
+ .Border --- Wrap U mode: Border
()
flag.SamplerV { bits = 32, shift = 2, range = 2, base = 1 }
- .Mirror --- Wrap V mode: Mirror
- .Clamp --- Wrap V mode: Clamp
- .Border --- Wrap V mode: Border
+ .Mirror --- Wrap V mode: Mirror
+ .Clamp --- Wrap V mode: Clamp
+ .Border --- Wrap V mode: Border
()
flag.SamplerW { bits = 32, shift = 4, range = 2, base = 1 }
- .Mirror --- Wrap W mode: Mirror
- .Clamp --- Wrap W mode: Clamp
- .Border --- Wrap W mode: Border
+ .Mirror --- Wrap W mode: Mirror
+ .Clamp --- Wrap W mode: Clamp
+ .Border --- Wrap W mode: Border
()
flag.SamplerMin { bits = 32, shift = 6, range = 2, base = 1 }
- .Point --- Min sampling mode: Point
- .Anisotropic --- Min sampling mode: Anisotropic
+ .Point --- Min sampling mode: Point
+ .Anisotropic --- Min sampling mode: Anisotropic
()
flag.SamplerMag { bits = 32, shift = 8, range = 2, base = 1 }
- .Point --- Mag sampling mode: Point
- .Anisotropic --- Mag sampling mode: Anisotropic
+ .Point --- Mag sampling mode: Point
+ .Anisotropic --- Mag sampling mode: Anisotropic
()
flag.SamplerMip { bits = 32, shift = 10, range = 1, base = 1 }
- .Point --- Mip sampling mode: Point
+ .Point --- Mip sampling mode: Point
()
flag.SamplerCompare { bits = 32 , shift = 16, range = 4, base = 1 }
- .Less --- Compare when sampling depth texture: less.
- .Lequal --- Compare when sampling depth texture: less or equal.
- .Equal --- Compare when sampling depth texture: equal.
- .Gequal --- Compare when sampling depth texture: greater or equal.
- .Greater --- Compare when sampling depth texture: greater.
- .Notequal --- Compare when sampling depth texture: not equal.
- .Never --- Compare when sampling depth texture: never.
- .Always --- Compare when sampling depth texture: always.
+ .Less --- Compare when sampling depth texture: less.
+ .Lequal --- Compare when sampling depth texture: less or equal.
+ .Equal --- Compare when sampling depth texture: equal.
+ .Gequal --- Compare when sampling depth texture: greater or equal.
+ .Greater --- Compare when sampling depth texture: greater.
+ .Notequal --- Compare when sampling depth texture: not equal.
+ .Never --- Compare when sampling depth texture: never.
+ .Always --- Compare when sampling depth texture: always.
()
flag.SamplerBorderColor { bits = 32, shift = 24, range = 4, "helper" }
@@ -307,35 +307,43 @@ flag.SamplerReserved { bits = 32, shift = 28, range = 4 }
flag.Sampler { bits = 32 }
.None
.SampleStencil (21) --- Sample stencil instead of depth.
- .Point { "MinPoint", "MagPoint", "MipPoint" }
- .UvwMirror { "UMirror", "VMirror", "WMirror" }
- .UvwClamp { "UClamp", "VClamp", "WClamp" }
- .UvwBorder { "UBorder", "VBorder", "WBorder" }
- .BitsMask { "UMask", "VMask", "WMask", "MinMask", "MagMask", "MipMask", "CompareMask" }
+ .Point { "MinPoint", "MagPoint", "MipPoint" }
+ .UvwMirror { "UMirror", "VMirror", "WMirror" }
+ .UvwClamp { "UClamp", "VClamp", "WClamp" }
+ .UvwBorder { "UBorder", "VBorder", "WBorder" }
+ .BitsMask {
+ "UMask",
+ "VMask",
+ "WMask",
+ "MinMask",
+ "MagMask",
+ "MipMask",
+ "CompareMask"
+ }
()
flag.ResetMsaa { bits = 32, shift = 4, range = 3, base = 1 }
- .X2 --- Enable 2x MSAA.
- .X4 --- Enable 4x MSAA.
- .X8 --- Enable 8x MSAA.
- .X16 --- Enable 16x MSAA.
+ .X2 --- Enable 2x MSAA.
+ .X4 --- Enable 4x MSAA.
+ .X8 --- Enable 8x MSAA.
+ .X16 --- Enable 16x MSAA.
()
flag.Reset { bits = 32 }
- .None (0) --- No reset flags.
- .Fullscreen (1) --- Not supported yet.
- .Vsync (8) --- Enable V-Sync.
- .Maxanisotropy (9) --- Turn on/off max anisotropy.
- .Capture (10) --- Begin screen capture.
- .FlushAfterRender (14) --- Flush rendering after submitting to GPU.
- .FlipAfterRender (15) --- This flag specifies where flip occurs. Default behavior is that flip occurs
- --- before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
- .SrgbBackbuffer (16) --- Enable sRGB backbuffer.
- .Hdr10 (17) --- Enable HDR10 rendering.
- .Hidpi (18) --- Enable HiDPI rendering.
- .DepthClamp (19) --- Enable depth clamp.
- .Suspend (20) --- Suspend rendering.
+ .None ( 0) --- No reset flags.
+ .Fullscreen ( 1) --- Not supported yet.
+ .Vsync ( 8) --- Enable V-Sync.
+ .Maxanisotropy ( 9) --- Turn on/off max anisotropy.
+ .Capture (10) --- Begin screen capture.
+ .FlushAfterRender (14) --- Flush rendering after submitting to GPU.
+ .FlipAfterRender (15) --- This flag specifies where flip occurs. Default behavior is that flip occurs
+ --- before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
+ .SrgbBackbuffer (16) --- Enable sRGB backbuffer.
+ .Hdr10 (17) --- Enable HDR10 rendering.
+ .Hidpi (18) --- Enable HiDPI rendering.
+ .DepthClamp (19) --- Enable depth clamp.
+ .Suspend (20) --- Suspend rendering.
()
flag.ResetFullscreen { bits = 32, shift = 0, range = 1, base = 1 }
@@ -852,8 +860,10 @@ struct.Transform
struct.ViewStats
.name "char[256]" --- View name.
.view "ViewId" --- View id.
- .cpuTimeElapsed "int64_t" --- CPU (submit) time elapsed.
- .gpuTimeElapsed "int64_t" --- GPU time elapsed.
+ .cpuTimeBegin "int64_t" --- CPU (submit) begin time.
+ .cpuTimeEnd "int64_t" --- CPU (submit) end time.
+ .gpuTimeBegin "int64_t" --- GPU begin time.
+ .gpuTimeEnd "int64_t" --- GPU end time.
--- Encoder stats.
struct.EncoderStats
diff --git a/3rdparty/bgfx/scripts/bindings-cs.lua b/3rdparty/bgfx/scripts/bindings-cs.lua
index 8e6bfc47b1a..6a006fe694e 100644
--- a/3rdparty/bgfx/scripts/bindings-cs.lua
+++ b/3rdparty/bgfx/scripts/bindings-cs.lua
@@ -415,6 +415,7 @@ function gen.write(codes, outputfile)
local out = assert(io.open(outputfile, "wb"))
out:write(codes)
out:close()
+ print("Generating: " .. outputfile)
end
if (...) == nil then
diff --git a/3rdparty/bgfx/scripts/bindings-d.lua b/3rdparty/bgfx/scripts/bindings-d.lua
new file mode 100644
index 00000000000..9858e4974bb
--- /dev/null
+++ b/3rdparty/bgfx/scripts/bindings-d.lua
@@ -0,0 +1,414 @@
+local codegen = require "codegen"
+local idl = codegen.idl "bgfx.idl"
+
+local d_types_template = [[
+/*
+ *
+ * AUTO GENERATED! DO NOT EDIT!
+ *
+ */
+
+module bindbc.bgfx.types;
+
+public import core.stdc.stdarg : va_list;
+
+extern(C) @nogc nothrow:
+
+$version
+
+alias bgfx_view_id_t = ushort;
+
+$types
+]]
+
+local d_funcs_template = [[
+/*
+ *
+ * AUTO GENERATED! DO NOT EDIT!
+ *
+ */
+
+module bindbc.bgfx.funcs;
+
+private import bindbc.bgfx.types;
+
+extern(C) @nogc nothrow:
+
+version(BindBgfx_Static)
+{
+ $funcs_static
+}
+else
+{
+ __gshared
+ {
+ $funcs_dynamic
+ }
+}
+]]
+
+local function hasPrefix(str, prefix)
+ return prefix == "" or str:sub(1, #prefix) == prefix
+end
+
+local function hasSuffix(str, suffix)
+ return suffix == "" or str:sub(-#suffix) == suffix
+end
+
+local function to_underscorecase(name)
+ local tmp = {}
+ for v in name:gmatch "[_%u][%l%d]*" do
+ if v:byte() == 95 then -- '_'
+ v = v:sub(2) -- remove _
+ end
+ tmp[#tmp+1] = v
+ end
+ return table.concat(tmp, "_")
+end
+
+local function convert_array(member)
+ if string.find(member.array, "::") then
+ local name = "bgfx_" .. to_underscorecase(string.gsub(member.array, "::.*", "")):lower() .. "_t"
+ return "[" .. name .. ".BGFX_" .. to_underscorecase(member.array):upper() .. "]"
+ else
+ return member.array
+ end
+end
+
+local function convert_type(arg)
+ local ctype = arg.ctype:gsub("%s%*", "*")
+ if arg.fulltype == "bx::AllocatorI*" or arg.fulltype == "CallbackI*" or arg.fulltype == "ReleaseFn" then
+ ctype = "void*"
+ elseif hasPrefix(ctype, "uint64_t") then
+ ctype = ctype:gsub("uint64_t", "ulong")
+ elseif hasPrefix(ctype, "int64_t") then
+ ctype = ctype:gsub("int64_t", "long")
+ elseif hasPrefix(ctype, "uint32_t") then
+ ctype = ctype:gsub("uint32_t", "uint")
+ elseif hasPrefix(ctype, "int32_t") then
+ ctype = ctype:gsub("int32_t", "int")
+ elseif hasPrefix(ctype, "uint16_t") then
+ ctype = ctype:gsub("uint16_t", "ushort")
+ elseif hasPrefix(ctype, "uint8_t") then
+ ctype = ctype:gsub("uint8_t", "byte")
+ elseif hasPrefix(ctype, "uintptr_t") then
+ ctype = ctype:gsub("uintptr_t", "ulong")
+ elseif hasPrefix(ctype, "const ") and hasSuffix(ctype, "*") then
+ ctype = "const(" .. string.sub(ctype:gsub("const ", "", 1), 1, -2) .. ")*"
+ end
+
+ if arg.array ~= nil then
+ ctype = ctype .. convert_array(arg)
+ end
+
+ return ctype
+end
+
+local function convert_struct_type(arg)
+ return convert_type(arg)
+end
+
+local function convert_ret_type(arg)
+ return convert_type(arg)
+end
+
+local function convert_name(arg)
+ if arg == "debug" then
+ return arg .. "_"
+ end
+ return arg
+end
+
+local function convert_struct_member(member)
+ return convert_struct_type(member) .. " " .. convert_name(member.name)
+end
+
+local function gen_version()
+ return "enum uint BGFX_API_VERSION = " .. (idl._version or 0) .. ";"
+end
+
+local converter = {}
+local yield = coroutine.yield
+local gen = {}
+
+function gen.gen(template)
+ local indent = ""
+ local idx = 1;
+ local r = template:gsub("$([a-zA-Z_]+)", function(what)
+ local tmp = {}
+
+ local ind_end = template:find("$"..what, idx, true)
+ local ind_start = ind_end
+ for j = 1, ind_end-1 do
+ local i = 1+ind_end-1-j
+ local c = string.sub(template, i, i)
+ if c ~= ' ' and c ~= '\t' then
+ ind_start = i
+ break
+ end
+ end
+
+ indent = string.sub(template, ind_start+1, ind_end-1)
+
+ local what_idl = what:gsub("funcs_dynamic", "funcs"):gsub("funcs_static", "funcs")
+
+ if (what == "version") then
+ return gen_version()
+ end
+
+ for _, object in ipairs(idl[what_idl]) do
+ local co = coroutine.create(converter[what])
+ local any
+ while true do
+ local ok, v = coroutine.resume(co, object)
+ assert(ok, debug.traceback(co, v))
+ if not v then
+ break
+ end
+ table.insert(tmp, v)
+ any = true
+ end
+ if any and tmp[#tmp] ~= "" then
+ table.insert(tmp, "")
+ end
+ end
+ return table.concat(tmp, "\n" .. indent)
+ end)
+ return r
+end
+
+function gen.gen_types()
+ return gen.gen(d_types_template)
+end
+
+function gen.gen_funcs()
+ return gen.gen(d_funcs_template)
+end
+
+function converter.types(typ)
+ if typ.comments ~= nil then
+ if #typ.comments == 1 then
+ yield("/// " .. typ.comments[1])
+ else
+ yield("/**")
+ for _, comment in ipairs(typ.comments) do
+ yield(" * " .. comment)
+ end
+ yield(" */")
+ end
+ end
+
+ if typ.handle then
+ yield("struct " .. typ.cname .. " { ushort idx; }")
+ elseif typ.enum then
+ local prefix = "BGFX_" .. to_underscorecase(string.gsub(typ.name, "::Enum", "")):upper()
+ yield("enum " .. typ.cname)
+ yield("{")
+ for idx, enum in ipairs(typ.enum) do
+ local comments = ""
+ if enum.comment ~= nil then
+ if #enum.comment == 1 then
+ comments = " /// " .. enum.comment[1];
+ else
+ yield("\t/**")
+ for _, comment in ipairs(enum.comment) do
+ yield("\t * " .. comment)
+ end
+ yield("\t */")
+ end
+ end
+
+ local enumname
+ if enum.underscore then
+ enumname = to_underscorecase(enum.name):upper()
+ else
+ enumname = enum.name:upper()
+ end
+
+ yield("\t" .. prefix .. "_" .. enumname .. "," .. comments)
+ end
+ yield("");
+ --yield("\t" .. prefix .. "_COUNT = " .. #typ.enum)
+ yield("\t" .. prefix .. "_COUNT")
+ yield("}")
+
+ elseif typ.bits ~= nil then
+ local prefix = "BGFX_" .. to_underscorecase(typ.name):upper()
+ local enumType = "uint"
+ format = "%u"
+ if typ.bits == 64 then
+ format = "0x%016x"
+ enumType = "ulong"
+ elseif typ.bits == 32 then
+ format = "0x%08x"
+ enumType = "uint"
+ elseif typ.bits == 16 then
+ format = "0x%04x"
+ enumType = "ushort"
+ elseif typ.bits == 8 then
+ format = "0x%02x"
+ enumType = "ubyte"
+ end
+
+ for idx, flag in ipairs(typ.flag) do
+ local value = flag.value
+ if value ~= nil then
+ value = string.format(flag.format or format, value)
+ else
+ for _, name in ipairs(flag) do
+ local fixedname = prefix .. "_" .. to_underscorecase(name):upper()
+ if value ~= nil then
+ value = value .. " | " .. fixedname
+ else
+ value = fixedname
+ end
+ end
+ end
+ local comments = ""
+ if flag.comment ~= nil then
+ if #flag.comment == 1 then
+ comments = " /// " .. flag.comment[1]
+ else
+ yield("/**")
+ for _, comment in ipairs(flag.comment) do
+ yield(" * " .. comment)
+ end
+ yield(" */")
+ end
+ end
+ yield("enum " .. enumType .. " " .. prefix .. "_" .. to_underscorecase(flag.name):upper() .. " = " .. value .. ";" .. comments)
+ end
+
+ if typ.shift then
+ local name = prefix .. "_SHIFT"
+ local value = typ.shift
+ local comments = ""
+ if typ.desc then
+ comments = string.format(" /// %s bit shift", typ.desc)
+ end
+ yield("enum " .. enumType .. " " .. name .. " = " .. value .. ";" .. comments)
+ end
+ if typ.range then
+ local name = prefix .. "_MASK"
+ local value = string.format(format, typ.mask)
+ local comments = ""
+ if typ.desc then
+ comments = string.format(" /// %s bit mask", typ.desc)
+ end
+ yield("enum " .. enumType .. " " .. name .. " = " .. value .. ";" .. comments)
+ end
+
+ if typ.helper then
+ yield(string.format(
+ "%s %s (%s v) { return (v << %s) & %s; }",
+ enumType,
+ prefix,
+ enumType,
+ (prefix .. "_SHIFT"),
+ (prefix .. "_MASK")))
+ end
+ elseif typ.struct ~= nil then
+ yield("struct " .. typ.cname)
+ yield("{")
+
+ for _, member in ipairs(typ.struct) do
+ local comments = ""
+ if member.comment ~= nil then
+ if #member.comment == 1 then
+ comments = " /// " .. member.comment[1]
+ else
+ yield("\n\t/**")
+ for _, comment in ipairs(member.comment) do
+ yield("\t * " .. comment)
+ end
+ yield("\t */")
+ end
+ end
+ yield("\t" .. convert_struct_member(member) .. ";" .. comments)
+ end
+
+ yield("}")
+ end
+end
+
+function converter.funcs_static(func)
+ return converter.funcs(func, true)
+end
+
+function converter.funcs_dynamic(func)
+ return converter.funcs(func, false)
+end
+
+function converter.funcs(func, static)
+ if func.cpponly then
+ return
+ end
+
+ if func.comments ~= nil then
+ yield("/**")
+ for _, line in ipairs(func.comments) do
+ local line = line:gsub("@remarks", "Remarks:")
+ line = line:gsub("@remark", "Remarks:")
+ line = line:gsub("@(%l)(%l+)", function(a, b) return a:upper()..b..":" end)
+ yield(" * " .. line)
+ end
+
+ local hasParamsComments = false
+ for _, arg in ipairs(func.args) do
+ if arg.comment ~= nil then
+ hasParamsComments = true
+ break
+ end
+ end
+
+ if hasParamsComments then
+ yield(" * Params:")
+ end
+
+ for _, arg in ipairs(func.args) do
+ if arg.comment ~= nil then
+ yield(" * " .. convert_name(arg.name) .. " = " .. arg.comment[1])
+ for i, comment in ipairs(arg.comment) do
+ if (i > 1) then
+ yield(" * " .. comment)
+ end
+ end
+ end
+ end
+
+ yield(" */")
+ end
+
+ local args = {}
+ if func.this ~= nil then
+ args[1] = convert_type(func.this_type) .. " _this"
+ end
+ for _, arg in ipairs(func.args) do
+ table.insert(args, convert_type(arg) .. " " .. convert_name(arg.name))
+ end
+
+ if static then
+ yield(convert_ret_type(func.ret) .. " bgfx_" .. func.cname .. "(" .. table.concat(args, ", ") .. ");")
+ else
+ yield("alias da_bgfx_" .. func.cname .. " = " .. convert_ret_type(func.ret) .. " function(" .. table.concat(args, ", ") .. ");")
+ yield("da_bgfx_" .. func.cname .. " bgfx_" .. func.cname .. ";")
+ end
+end
+
+-- printtable("idl types", idl.types)
+-- printtable("idl funcs", idl.funcs)
+
+function gen.write(codes, outputfile)
+ local out = assert(io.open(outputfile, "wb"))
+ out:write(codes)
+ out:close()
+ print("Generating: " .. outputfile)
+end
+
+if (...) == nil then
+ -- run `lua bindings-d.lua` in command line
+ print(gen.gen_types())
+ print(gen.gen_funcs())
+end
+
+return gen
diff --git a/3rdparty/bgfx/scripts/genie.lua b/3rdparty/bgfx/scripts/genie.lua
index 516833df6dc..d6d10a4d841 100644
--- a/3rdparty/bgfx/scripts/genie.lua
+++ b/3rdparty/bgfx/scripts/genie.lua
@@ -69,6 +69,10 @@ newaction {
do
local csgen = require "bindings-cs"
csgen.write(csgen.gen(), "../bindings/cs/bgfx.cs")
+
+ local dgen = require "bindings-d"
+ dgen.write(dgen.gen_types(), "../bindings/d/types.d")
+ dgen.write(dgen.gen_funcs(), "../bindings/d/funcs.d")
end
os.exit()
diff --git a/3rdparty/bgfx/scripts/temp.bgfx.h b/3rdparty/bgfx/scripts/temp.bgfx.h
index e1dde4ccf6b..736845cf6aa 100644
--- a/3rdparty/bgfx/scripts/temp.bgfx.h
+++ b/3rdparty/bgfx/scripts/temp.bgfx.h
@@ -1,13 +1,14 @@
/*
* Copyright 2011-2019 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
- *
- * vim: set tabstop=4 expandtab:
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
/*
*
- * AUTO GENERATED! DO NOT EDIT! ( source : $source )
+ * AUTO GENERATED FROM IDL! DO NOT EDIT! (source : $source)
+ *
+ * More info about IDL:
+ * https://gist.github.com/bkaradzic/05a1c86a6dd57bf86e2d828878e88dc2#bgfx-is-switching-to-idl-to-generate-api
*
*/
diff --git a/3rdparty/bgfx/scripts/temp.bgfx.idl.inl b/3rdparty/bgfx/scripts/temp.bgfx.idl.inl
index 63e180c2748..0a7b7228b01 100644
--- a/3rdparty/bgfx/scripts/temp.bgfx.idl.inl
+++ b/3rdparty/bgfx/scripts/temp.bgfx.idl.inl
@@ -1,10 +1,14 @@
/*
+ * Copyright 2011-2019 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
/*
*
- * AUTO GENERATED! DO NOT EDIT!
+ * AUTO GENERATED FROM IDL! DO NOT EDIT! (source : $source)
+ *
+ * More info about IDL:
+ * https://gist.github.com/bkaradzic/05a1c86a6dd57bf86e2d828878e88dc2#bgfx-is-switching-to-idl-to-generate-api
*
*/
diff --git a/3rdparty/bgfx/scripts/temp.defines.h b/3rdparty/bgfx/scripts/temp.defines.h
index 4437bfa7894..6806ed8409f 100644
--- a/3rdparty/bgfx/scripts/temp.defines.h
+++ b/3rdparty/bgfx/scripts/temp.defines.h
@@ -3,6 +3,15 @@
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
+/*
+ *
+ * AUTO GENERATED FROM IDL! DO NOT EDIT! (source : $source)
+ *
+ * More info about IDL:
+ * https://gist.github.com/bkaradzic/05a1c86a6dd57bf86e2d828878e88dc2#bgfx-is-switching-to-idl-to-generate-api
+ *
+ */
+
#ifndef BGFX_DEFINES_H_HEADER_GUARD
#define BGFX_DEFINES_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/src/bgfx.cpp b/3rdparty/bgfx/src/bgfx.cpp
index 7d8734bea5b..7a8986c500c 100644
--- a/3rdparty/bgfx/src/bgfx.cpp
+++ b/3rdparty/bgfx/src/bgfx.cpp
@@ -5153,35 +5153,37 @@ BX_STATIC_ASSERT(FLAGS_MASK_TEST(0
) );
BX_STATIC_ASSERT( (0
- | BGFX_STATE_WRITE_MASK
- | BGFX_STATE_DEPTH_TEST_MASK
- | BGFX_STATE_BLEND_MASK
+ | BGFX_STATE_ALPHA_REF_MASK
+ | BGFX_STATE_BLEND_ALPHA_TO_COVERAGE
| BGFX_STATE_BLEND_EQUATION_MASK
| BGFX_STATE_BLEND_INDEPENDENT
- | BGFX_STATE_BLEND_ALPHA_TO_COVERAGE
+ | BGFX_STATE_BLEND_MASK
+ | BGFX_STATE_CONSERVATIVE_RASTER
| BGFX_STATE_CULL_MASK
- | BGFX_STATE_ALPHA_REF_MASK
- | BGFX_STATE_PT_MASK
- | BGFX_STATE_POINT_SIZE_MASK
- | BGFX_STATE_MSAA
+ | BGFX_STATE_DEPTH_TEST_MASK
+ | BGFX_STATE_FRONT_CCW
| BGFX_STATE_LINEAA
- | BGFX_STATE_CONSERVATIVE_RASTER
+ | BGFX_STATE_MSAA
+ | BGFX_STATE_POINT_SIZE_MASK
+ | BGFX_STATE_PT_MASK
| BGFX_STATE_RESERVED_MASK
+ | BGFX_STATE_WRITE_MASK
) == (0
- ^ BGFX_STATE_WRITE_MASK
- ^ BGFX_STATE_DEPTH_TEST_MASK
- ^ BGFX_STATE_BLEND_MASK
+ ^ BGFX_STATE_ALPHA_REF_MASK
+ ^ BGFX_STATE_BLEND_ALPHA_TO_COVERAGE
^ BGFX_STATE_BLEND_EQUATION_MASK
^ BGFX_STATE_BLEND_INDEPENDENT
- ^ BGFX_STATE_BLEND_ALPHA_TO_COVERAGE
+ ^ BGFX_STATE_BLEND_MASK
+ ^ BGFX_STATE_CONSERVATIVE_RASTER
^ BGFX_STATE_CULL_MASK
- ^ BGFX_STATE_ALPHA_REF_MASK
- ^ BGFX_STATE_PT_MASK
- ^ BGFX_STATE_POINT_SIZE_MASK
- ^ BGFX_STATE_MSAA
+ ^ BGFX_STATE_DEPTH_TEST_MASK
+ ^ BGFX_STATE_FRONT_CCW
^ BGFX_STATE_LINEAA
- ^ BGFX_STATE_CONSERVATIVE_RASTER
+ ^ BGFX_STATE_MSAA
+ ^ BGFX_STATE_POINT_SIZE_MASK
+ ^ BGFX_STATE_PT_MASK
^ BGFX_STATE_RESERVED_MASK
+ ^ BGFX_STATE_WRITE_MASK
) );
BX_STATIC_ASSERT(FLAGS_MASK_TEST(BGFX_CAPS_TEXTURE_COMPARE_LEQUAL, BGFX_CAPS_TEXTURE_COMPARE_ALL) );
diff --git a/3rdparty/bgfx/src/bgfx.idl.inl b/3rdparty/bgfx/src/bgfx.idl.inl
index 03acfae93b9..4dc2bfa35c0 100644
--- a/3rdparty/bgfx/src/bgfx.idl.inl
+++ b/3rdparty/bgfx/src/bgfx.idl.inl
@@ -1,10 +1,14 @@
/*
+ * Copyright 2011-2019 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
/*
*
- * AUTO GENERATED! DO NOT EDIT!
+ * AUTO GENERATED FROM IDL! DO NOT EDIT! (source : temp.bgfx.idl.inl)
+ *
+ * More info about IDL:
+ * https://gist.github.com/bkaradzic/05a1c86a6dd57bf86e2d828878e88dc2#bgfx-is-switching-to-idl-to-generate-api
*
*/
diff --git a/3rdparty/bgfx/src/bgfx_p.h b/3rdparty/bgfx/src/bgfx_p.h
index 2e422bf6542..b27f7126779 100644
--- a/3rdparty/bgfx/src/bgfx_p.h
+++ b/3rdparty/bgfx/src/bgfx_p.h
@@ -534,7 +534,7 @@ namespace bgfx
if (_hasMips)
{
const uint32_t max = bx::max(_width, _height, _depth);
- const uint32_t num = 1 + uint32_t(bx::log2(float(max) ) );
+ const uint32_t num = 1 + uint32_t(bx::log2<int32_t>(max) );
return uint8_t(num);
}
diff --git a/3rdparty/bgfx/src/bgfx_shader.sh b/3rdparty/bgfx/src/bgfx_shader.sh
index 5349404311d..6f87c405c97 100644
--- a/3rdparty/bgfx/src/bgfx_shader.sh
+++ b/3rdparty/bgfx/src/bgfx_shader.sh
@@ -29,11 +29,11 @@
#endif // BGFX_SHADER_LANGUAGE_HLSL > 3 && BGFX_SHADER_TYPE_FRAGMENT
#if BGFX_SHADER_LANGUAGE_GLSL
-# define ARRAY_BEGIN(_type, _name, _count) _type _name[_count] = _type[](
-# define ARRAY_END() )
+# define ARRAY_BEGIN(_type, _name, _count) _type _name[_count] = _type[](
+# define ARRAY_END() )
#else
-# define ARRAY_BEGIN(_type, _name, _count) _type _name[_count] = {
-# define ARRAY_END() }
+# define ARRAY_BEGIN(_type, _name, _count) _type _name[_count] = {
+# define ARRAY_END() }
#endif // BGFX_SHADER_LANGUAGE_GLSL
#if BGFX_SHADER_LANGUAGE_HLSL \
@@ -593,7 +593,6 @@ mat4 mtxFromRows(vec4 _0, vec4 _1, vec4 _2, vec4 _3)
return mat4(_0, _1, _2, _3);
#endif // BGFX_SHADER_LANGUAGE_GLSL
}
-
mat4 mtxFromCols(vec4 _0, vec4 _1, vec4 _2, vec4 _3)
{
#if BGFX_SHADER_LANGUAGE_GLSL
@@ -602,7 +601,14 @@ mat4 mtxFromCols(vec4 _0, vec4 _1, vec4 _2, vec4 _3)
return transpose(mat4(_0, _1, _2, _3) );
#endif // BGFX_SHADER_LANGUAGE_GLSL
}
-
+mat3 mtxFromRows(vec3 _0, vec3 _1, vec3 _2)
+{
+#if BGFX_SHADER_LANGUAGE_GLSL
+ return transpose(mat3(_0, _1, _2) );
+#else
+ return mat3(_0, _1, _2);
+#endif // BGFX_SHADER_LANGUAGE_GLSL
+}
mat3 mtxFromCols(vec3 _0, vec3 _1, vec3 _2)
{
#if BGFX_SHADER_LANGUAGE_GLSL
@@ -612,6 +618,18 @@ mat3 mtxFromCols(vec3 _0, vec3 _1, vec3 _2)
#endif // BGFX_SHADER_LANGUAGE_GLSL
}
+#if BGFX_SHADER_LANGUAGE_GLSL
+#define mtxFromRows3(_0, _1, _2) transpose(mat3(_0, _1, _2) )
+#define mtxFromRows4(_0, _1, _2, _3) transpose(mat4(_0, _1, _2, _3) )
+#define mtxFromCols3(_0, _1, _2) mat3(_0, _1, _2)
+#define mtxFromCols4(_0, _1, _2, _3) mat4(_0, _1, _2, _3)
+#else
+#define mtxFromRows3(_0, _1, _2) mat3(_0, _1, _2)
+#define mtxFromRows4(_0, _1, _2, _3) mat4(_0, _1, _2, _3)
+#define mtxFromCols3(_0, _1, _2) transpose(mat3(_0, _1, _2) )
+#define mtxFromCols4(_0, _1, _2, _3) transpose(mat4(_0, _1, _2, _3) )
+#endif // BGFX_SHADER_LANGUAGE_GLSL
+
uniform vec4 u_viewRect;
uniform vec4 u_viewTexel;
uniform mat4 u_view;
diff --git a/3rdparty/bgfx/src/config.h b/3rdparty/bgfx/src/config.h
index 8e3f53f954c..1d3652cda88 100644
--- a/3rdparty/bgfx/src/config.h
+++ b/3rdparty/bgfx/src/config.h
@@ -311,9 +311,9 @@ BX_STATIC_ASSERT(bx::isPowerOf2(BGFX_CONFIG_MAX_VIEWS), "BGFX_CONFIG_MAX_VIEWS m
# define BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT 5
#endif // BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT
-#ifndef BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE
+#ifndef BGFX_CONFIG_MAX_COLOR_PALETTE
# define BGFX_CONFIG_MAX_COLOR_PALETTE 16
-#endif // BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE
+#endif // BGFX_CONFIG_MAX_COLOR_PALETTE
#define BGFX_CONFIG_DRAW_INDIRECT_STRIDE 32
diff --git a/3rdparty/bgfx/src/renderer.h b/3rdparty/bgfx/src/renderer.h
index 025c6f7e927..ff298d80cc1 100644
--- a/3rdparty/bgfx/src/renderer.h
+++ b/3rdparty/bgfx/src/renderer.h
@@ -499,7 +499,7 @@ namespace bgfx
if (m_enabled)
{
ViewStats& viewStats = m_frame->m_perfStats.viewStats[m_numViews];
- viewStats.cpuTimeElapsed = -bx::getHPCounter();
+ viewStats.cpuTimeBegin = bx::getHPCounter();
m_queryIdx = m_gpuTimer.begin(_view);
@@ -521,8 +521,9 @@ namespace bgfx
ViewStats& viewStats = m_frame->m_perfStats.viewStats[m_numViews];
const typename Ty::Result& result = m_gpuTimer.m_result[viewStats.view];
- viewStats.cpuTimeElapsed += bx::getHPCounter();
- viewStats.gpuTimeElapsed = result.m_end - result.m_begin;
+ viewStats.cpuTimeEnd = bx::getHPCounter();
+ viewStats.gpuTimeBegin = result.m_begin;
+ viewStats.gpuTimeEnd = result.m_end;
++m_numViews;
m_queryIdx = UINT32_MAX;
diff --git a/3rdparty/bgfx/src/renderer_d3d11.cpp b/3rdparty/bgfx/src/renderer_d3d11.cpp
index bf1f13622b9..c098730e32e 100644
--- a/3rdparty/bgfx/src/renderer_d3d11.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d11.cpp
@@ -2846,6 +2846,7 @@ namespace bgfx { namespace d3d11
| BGFX_STATE_MSAA
| BGFX_STATE_LINEAA
| BGFX_STATE_CONSERVATIVE_RASTER
+ | BGFX_STATE_FRONT_CCW
;
_state |= _wireframe ? BGFX_STATE_PT_LINES : BGFX_STATE_NONE;
_state |= _scissor ? BGFX_STATE_RESERVED_MASK : 0;
@@ -2862,7 +2863,7 @@ namespace bgfx { namespace d3d11
D3D11_RASTERIZER_DESC2 desc;
desc.FillMode = _wireframe ? D3D11_FILL_WIREFRAME : D3D11_FILL_SOLID;
desc.CullMode = s_cullMode[cull];
- desc.FrontCounterClockwise = false;
+ desc.FrontCounterClockwise = !!(_state&BGFX_STATE_FRONT_CCW);
desc.DepthBias = 0;
desc.DepthBiasClamp = 0.0f;
desc.SlopeScaledDepthBias = 0.0f;
diff --git a/3rdparty/bgfx/src/renderer_d3d12.cpp b/3rdparty/bgfx/src/renderer_d3d12.cpp
index 64b43d0b9df..aadd4dc6af1 100644
--- a/3rdparty/bgfx/src/renderer_d3d12.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d12.cpp
@@ -2557,8 +2557,8 @@ namespace bgfx { namespace d3d12
? D3D12_FILL_MODE_WIREFRAME
: D3D12_FILL_MODE_SOLID
;
- _desc.CullMode = s_cullMode[cull];
- _desc.FrontCounterClockwise = false;
+ _desc.CullMode = s_cullMode[cull];
+ _desc.FrontCounterClockwise = !!(_state&BGFX_STATE_FRONT_CCW);;
_desc.DepthBias = 0;
_desc.DepthBiasClamp = 0.0f;
_desc.SlopeScaledDepthBias = 0.0f;
diff --git a/3rdparty/bgfx/src/renderer_d3d9.cpp b/3rdparty/bgfx/src/renderer_d3d9.cpp
index 3f4273a778b..e638991af01 100644
--- a/3rdparty/bgfx/src/renderer_d3d9.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d9.cpp
@@ -3024,10 +3024,6 @@ namespace bgfx { namespace d3d9
uint32_t size = useMipSize ? mip.m_size : mipSize;
switch (m_textureFormat)
{
- case TextureFormat::RGB5A1:
- bimg::imageConvert(bits, 16, bx::packBgr5a1, mip.m_data, bx::unpackRgb5a1, size);
- break;
-
case TextureFormat::RGBA4:
bimg::imageConvert(bits, 16, bx::packBgra4, mip.m_data, bx::unpackRgba4, size);
break;
@@ -3089,10 +3085,6 @@ namespace bgfx { namespace d3d9
{
switch (m_textureFormat)
{
- case TextureFormat::RGB5A1:
- bimg::imageConvert(dst, 16, bx::packBgr5a1, src, bx::unpackRgb5a1, rectpitch);
- break;
-
case TextureFormat::RGBA4:
bimg::imageConvert(dst, 16, bx::packBgra4, src, bx::unpackRgba4, rectpitch);
break;
diff --git a/3rdparty/bgfx/src/renderer_gl.cpp b/3rdparty/bgfx/src/renderer_gl.cpp
index 3fe8afcba0f..dadfb5c2dd4 100644
--- a/3rdparty/bgfx/src/renderer_gl.cpp
+++ b/3rdparty/bgfx/src/renderer_gl.cpp
@@ -185,97 +185,98 @@ namespace bgfx { namespace gl
GLenum m_internalFmt;
GLenum m_internalFmtSrgb;
GLenum m_fmt;
+ GLenum m_fmtSrgb;
GLenum m_type;
bool m_supported;
};
static TextureFormatInfo s_textureFormat[] =
{
- { GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_ZERO, false }, // BC1
- { GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_ZERO, false }, // BC2
- { GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_ZERO, false }, // BC3
- { GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_ZERO, GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_ZERO, false }, // BC4
- { GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_ZERO, GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_ZERO, false }, // BC5
- { GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_ZERO, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_ZERO, false }, // BC6H
- { GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_ZERO, GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_ZERO, false }, // BC7
- { GL_ETC1_RGB8_OES, GL_ZERO, GL_ETC1_RGB8_OES, GL_ZERO, false }, // ETC1
- { GL_COMPRESSED_RGB8_ETC2, GL_ZERO, GL_COMPRESSED_RGB8_ETC2, GL_ZERO, false }, // ETC2
- { GL_COMPRESSED_RGBA8_ETC2_EAC, GL_COMPRESSED_SRGB8_ETC2, GL_COMPRESSED_RGBA8_ETC2_EAC, GL_ZERO, false }, // ETC2A
- { GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_ZERO, false }, // ETC2A1
- { GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT, GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_ZERO, false }, // PTC12
- { GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT, GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_ZERO, false }, // PTC14
- { GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT, GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_ZERO, false }, // PTC12A
- { GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_ZERO, false }, // PTC14A
- { GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_ZERO, GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_ZERO, false }, // PTC22
- { GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_ZERO, GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_ZERO, false }, // PTC24
- { GL_ATC_RGB_AMD, GL_ZERO, GL_ATC_RGB_AMD, GL_ZERO, false }, // ATC
- { GL_ATC_RGBA_EXPLICIT_ALPHA_AMD, GL_ZERO, GL_ATC_RGBA_EXPLICIT_ALPHA_AMD, GL_ZERO, false }, // ATCE
- { GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD, GL_ZERO, GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD, GL_ZERO, false }, // ATCI
- { GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_SRGB8_ASTC_4x4_KHR, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_ZERO, false }, // ASTC4x4
- { GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_COMPRESSED_SRGB8_ASTC_5x5_KHR, GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_ZERO, false }, // ASTC5x5
- { GL_COMPRESSED_RGBA_ASTC_6x6_KHR, GL_COMPRESSED_SRGB8_ASTC_6x6_KHR, GL_COMPRESSED_RGBA_ASTC_6x6_KHR, GL_ZERO, false }, // ASTC6x6
- { GL_COMPRESSED_RGBA_ASTC_8x5_KHR, GL_COMPRESSED_SRGB8_ASTC_8x5_KHR, GL_COMPRESSED_RGBA_ASTC_8x5_KHR, GL_ZERO, false }, // ASTC8x5
- { GL_COMPRESSED_RGBA_ASTC_8x6_KHR, GL_COMPRESSED_SRGB8_ASTC_8x6_KHR, GL_COMPRESSED_RGBA_ASTC_8x6_KHR, GL_ZERO, false }, // ASTC8x6
- { GL_COMPRESSED_RGBA_ASTC_10x5_KHR, GL_COMPRESSED_SRGB8_ASTC_10x5_KHR, GL_COMPRESSED_RGBA_ASTC_10x5_KHR, GL_ZERO, false }, // ASTC10x5
- { GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false }, // Unknown
- { GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false }, // R1
- { GL_ALPHA, GL_ZERO, GL_ALPHA, GL_UNSIGNED_BYTE, false }, // A8
- { GL_R8, GL_ZERO, GL_RED, GL_UNSIGNED_BYTE, false }, // R8
- { GL_R8I, GL_ZERO, GL_RED, GL_BYTE, false }, // R8I
- { GL_R8UI, GL_ZERO, GL_RED, GL_UNSIGNED_BYTE, false }, // R8U
- { GL_R8_SNORM, GL_ZERO, GL_RED, GL_BYTE, false }, // R8S
- { GL_R16, GL_ZERO, GL_RED, GL_UNSIGNED_SHORT, false }, // R16
- { GL_R16I, GL_ZERO, GL_RED, GL_SHORT, false }, // R16I
- { GL_R16UI, GL_ZERO, GL_RED, GL_UNSIGNED_SHORT, false }, // R16U
- { GL_R16F, GL_ZERO, GL_RED, GL_HALF_FLOAT, false }, // R16F
- { GL_R16_SNORM, GL_ZERO, GL_RED, GL_SHORT, false }, // R16S
- { GL_R32I, GL_ZERO, GL_RED, GL_INT, false }, // R32I
- { GL_R32UI, GL_ZERO, GL_RED, GL_UNSIGNED_INT, false }, // R32U
- { GL_R32F, GL_ZERO, GL_RED, GL_FLOAT, false }, // R32F
- { GL_RG8, GL_ZERO, GL_RG, GL_UNSIGNED_BYTE, false }, // RG8
- { GL_RG8I, GL_ZERO, GL_RG, GL_BYTE, false }, // RG8I
- { GL_RG8UI, GL_ZERO, GL_RG, GL_UNSIGNED_BYTE, false }, // RG8U
- { GL_RG8_SNORM, GL_ZERO, GL_RG, GL_BYTE, false }, // RG8S
- { GL_RG16, GL_ZERO, GL_RG, GL_UNSIGNED_SHORT, false }, // RG16
- { GL_RG16I, GL_ZERO, GL_RG, GL_SHORT, false }, // RG16I
- { GL_RG16UI, GL_ZERO, GL_RG, GL_UNSIGNED_SHORT, false }, // RG16U
- { GL_RG16F, GL_ZERO, GL_RG, GL_FLOAT, false }, // RG16F
- { GL_RG16_SNORM, GL_ZERO, GL_RG, GL_SHORT, false }, // RG16S
- { GL_RG32I, GL_ZERO, GL_RG, GL_INT, false }, // RG32I
- { GL_RG32UI, GL_ZERO, GL_RG, GL_UNSIGNED_INT, false }, // RG32U
- { GL_RG32F, GL_ZERO, GL_RG, GL_FLOAT, false }, // RG32F
- { GL_RGB8, GL_SRGB8, GL_RGB, GL_UNSIGNED_BYTE, false }, // RGB8
- { GL_RGB8I, GL_ZERO, GL_RGB, GL_BYTE, false }, // RGB8I
- { GL_RGB8UI, GL_ZERO, GL_RGB, GL_UNSIGNED_BYTE, false }, // RGB8U
- { GL_RGB8_SNORM, GL_ZERO, GL_RGB, GL_BYTE, false }, // RGB8S
- { GL_RGB9_E5, GL_ZERO, GL_RGB, GL_UNSIGNED_INT_5_9_9_9_REV, false }, // RGB9E5F
- { GL_RGBA8, GL_SRGB8_ALPHA8, GL_BGRA, GL_UNSIGNED_BYTE, false }, // BGRA8
- { GL_RGBA8, GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, false }, // RGBA8
- { GL_RGBA8I, GL_ZERO, GL_RGBA, GL_BYTE, false }, // RGBA8I
- { GL_RGBA8UI, GL_ZERO, GL_RGBA, GL_UNSIGNED_BYTE, false }, // RGBA8U
- { GL_RGBA8_SNORM, GL_ZERO, GL_RGBA, GL_BYTE, false }, // RGBA8S
- { GL_RGBA16, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT, false }, // RGBA16
- { GL_RGBA16I, GL_ZERO, GL_RGBA, GL_SHORT, false }, // RGBA16I
- { GL_RGBA16UI, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT, false }, // RGBA16U
- { GL_RGBA16F, GL_ZERO, GL_RGBA, GL_HALF_FLOAT, false }, // RGBA16F
- { GL_RGBA16_SNORM, GL_ZERO, GL_RGBA, GL_SHORT, false }, // RGBA16S
- { GL_RGBA32I, GL_ZERO, GL_RGBA, GL_INT, false }, // RGBA32I
- { GL_RGBA32UI, GL_ZERO, GL_RGBA, GL_UNSIGNED_INT, false }, // RGBA32U
- { GL_RGBA32F, GL_ZERO, GL_RGBA, GL_FLOAT, false }, // RGBA32F
- { GL_RGB565, GL_ZERO, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, false }, // R5G6B5
- { GL_RGBA4, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4_REV, false }, // RGBA4
- { GL_RGB5_A1, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, false }, // RGB5A1
- { GL_RGB10_A2, GL_ZERO, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, false }, // RGB10A2
- { GL_R11F_G11F_B10F, GL_ZERO, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, false }, // RG11B10F
- { GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false }, // UnknownDepth
- { GL_DEPTH_COMPONENT16, GL_ZERO, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false }, // D16
- { GL_DEPTH_COMPONENT24, GL_ZERO, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, false }, // D24
- { GL_DEPTH24_STENCIL8, GL_ZERO, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, false }, // D24S8
- { GL_DEPTH_COMPONENT32, GL_ZERO, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, false }, // D32
- { GL_DEPTH_COMPONENT32F, GL_ZERO, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D16F
- { GL_DEPTH_COMPONENT32F, GL_ZERO, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D24F
- { GL_DEPTH_COMPONENT32F, GL_ZERO, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D32F
- { GL_STENCIL_INDEX8, GL_ZERO, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, false }, // D0S8
+ { GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_ZERO, false }, // BC1
+ { GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_ZERO, false }, // BC2
+ { GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_ZERO, false }, // BC3
+ { GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_ZERO, GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_ZERO, false }, // BC4
+ { GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_ZERO, GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_ZERO, false }, // BC5
+ { GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_ZERO, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_ZERO, false }, // BC6H
+ { GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_ZERO, GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_ZERO, false }, // BC7
+ { GL_ETC1_RGB8_OES, GL_ZERO, GL_ETC1_RGB8_OES, GL_ETC1_RGB8_OES, GL_ZERO, false }, // ETC1
+ { GL_COMPRESSED_RGB8_ETC2, GL_ZERO, GL_COMPRESSED_RGB8_ETC2, GL_COMPRESSED_RGB8_ETC2, GL_ZERO, false }, // ETC2
+ { GL_COMPRESSED_RGBA8_ETC2_EAC, GL_COMPRESSED_SRGB8_ETC2, GL_COMPRESSED_RGBA8_ETC2_EAC, GL_COMPRESSED_RGBA8_ETC2_EAC, GL_ZERO, false }, // ETC2A
+ { GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_ZERO, false }, // ETC2A1
+ { GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT, GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_ZERO, false }, // PTC12
+ { GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT, GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_ZERO, false }, // PTC14
+ { GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT, GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_ZERO, false }, // PTC12A
+ { GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_ZERO, false }, // PTC14A
+ { GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_ZERO, GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_ZERO, false }, // PTC22
+ { GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_ZERO, GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_ZERO, false }, // PTC24
+ { GL_ATC_RGB_AMD, GL_ZERO, GL_ATC_RGB_AMD, GL_ATC_RGB_AMD, GL_ZERO, false }, // ATC
+ { GL_ATC_RGBA_EXPLICIT_ALPHA_AMD, GL_ZERO, GL_ATC_RGBA_EXPLICIT_ALPHA_AMD, GL_ATC_RGBA_EXPLICIT_ALPHA_AMD, GL_ZERO, false }, // ATCE
+ { GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD, GL_ZERO, GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD, GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD, GL_ZERO, false }, // ATCI
+ { GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_SRGB8_ASTC_4x4_KHR, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_ZERO, false }, // ASTC4x4
+ { GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_COMPRESSED_SRGB8_ASTC_5x5_KHR, GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_ZERO, false }, // ASTC5x5
+ { GL_COMPRESSED_RGBA_ASTC_6x6_KHR, GL_COMPRESSED_SRGB8_ASTC_6x6_KHR, GL_COMPRESSED_RGBA_ASTC_6x6_KHR, GL_COMPRESSED_RGBA_ASTC_6x6_KHR, GL_ZERO, false }, // ASTC6x6
+ { GL_COMPRESSED_RGBA_ASTC_8x5_KHR, GL_COMPRESSED_SRGB8_ASTC_8x5_KHR, GL_COMPRESSED_RGBA_ASTC_8x5_KHR, GL_COMPRESSED_RGBA_ASTC_8x5_KHR, GL_ZERO, false }, // ASTC8x5
+ { GL_COMPRESSED_RGBA_ASTC_8x6_KHR, GL_COMPRESSED_SRGB8_ASTC_8x6_KHR, GL_COMPRESSED_RGBA_ASTC_8x6_KHR, GL_COMPRESSED_RGBA_ASTC_8x6_KHR, GL_ZERO, false }, // ASTC8x6
+ { GL_COMPRESSED_RGBA_ASTC_10x5_KHR, GL_COMPRESSED_SRGB8_ASTC_10x5_KHR, GL_COMPRESSED_RGBA_ASTC_10x5_KHR, GL_COMPRESSED_RGBA_ASTC_10x5_KHR, GL_ZERO, false }, // ASTC10x5
+ { GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false }, // Unknown
+ { GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false }, // R1
+ { GL_ALPHA, GL_ZERO, GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, false }, // A8
+ { GL_R8, GL_ZERO, GL_RED, GL_RED, GL_UNSIGNED_BYTE, false }, // R8
+ { GL_R8I, GL_ZERO, GL_RED, GL_RED, GL_BYTE, false }, // R8I
+ { GL_R8UI, GL_ZERO, GL_RED, GL_RED, GL_UNSIGNED_BYTE, false }, // R8U
+ { GL_R8_SNORM, GL_ZERO, GL_RED, GL_RED, GL_BYTE, false }, // R8S
+ { GL_R16, GL_ZERO, GL_RED, GL_RED, GL_UNSIGNED_SHORT, false }, // R16
+ { GL_R16I, GL_ZERO, GL_RED, GL_RED, GL_SHORT, false }, // R16I
+ { GL_R16UI, GL_ZERO, GL_RED, GL_RED, GL_UNSIGNED_SHORT, false }, // R16U
+ { GL_R16F, GL_ZERO, GL_RED, GL_RED, GL_HALF_FLOAT, false }, // R16F
+ { GL_R16_SNORM, GL_ZERO, GL_RED, GL_RED, GL_SHORT, false }, // R16S
+ { GL_R32I, GL_ZERO, GL_RED, GL_RED, GL_INT, false }, // R32I
+ { GL_R32UI, GL_ZERO, GL_RED, GL_RED, GL_UNSIGNED_INT, false }, // R32U
+ { GL_R32F, GL_ZERO, GL_RED, GL_RED, GL_FLOAT, false }, // R32F
+ { GL_RG8, GL_ZERO, GL_RG, GL_RG, GL_UNSIGNED_BYTE, false }, // RG8
+ { GL_RG8I, GL_ZERO, GL_RG, GL_RG, GL_BYTE, false }, // RG8I
+ { GL_RG8UI, GL_ZERO, GL_RG, GL_RG, GL_UNSIGNED_BYTE, false }, // RG8U
+ { GL_RG8_SNORM, GL_ZERO, GL_RG, GL_RG, GL_BYTE, false }, // RG8S
+ { GL_RG16, GL_ZERO, GL_RG, GL_RG, GL_UNSIGNED_SHORT, false }, // RG16
+ { GL_RG16I, GL_ZERO, GL_RG, GL_RG, GL_SHORT, false }, // RG16I
+ { GL_RG16UI, GL_ZERO, GL_RG, GL_RG, GL_UNSIGNED_SHORT, false }, // RG16U
+ { GL_RG16F, GL_ZERO, GL_RG, GL_RG, GL_FLOAT, false }, // RG16F
+ { GL_RG16_SNORM, GL_ZERO, GL_RG, GL_RG, GL_SHORT, false }, // RG16S
+ { GL_RG32I, GL_ZERO, GL_RG, GL_RG, GL_INT, false }, // RG32I
+ { GL_RG32UI, GL_ZERO, GL_RG, GL_RG, GL_UNSIGNED_INT, false }, // RG32U
+ { GL_RG32F, GL_ZERO, GL_RG, GL_RG, GL_FLOAT, false }, // RG32F
+ { GL_RGB8, GL_SRGB8, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, false }, // RGB8
+ { GL_RGB8I, GL_ZERO, GL_RGB, GL_RGB, GL_BYTE, false }, // RGB8I
+ { GL_RGB8UI, GL_ZERO, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, false }, // RGB8U
+ { GL_RGB8_SNORM, GL_ZERO, GL_RGB, GL_RGB, GL_BYTE, false }, // RGB8S
+ { GL_RGB9_E5, GL_ZERO, GL_RGB, GL_RGB, GL_UNSIGNED_INT_5_9_9_9_REV, false }, // RGB9E5F
+ { GL_RGBA8, GL_SRGB8_ALPHA8, GL_BGRA, GL_BGRA, GL_UNSIGNED_BYTE, false }, // BGRA8
+ { GL_RGBA8, GL_SRGB8_ALPHA8, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, false }, // RGBA8
+ { GL_RGBA8I, GL_ZERO, GL_RGBA, GL_RGBA, GL_BYTE, false }, // RGBA8I
+ { GL_RGBA8UI, GL_ZERO, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, false }, // RGBA8U
+ { GL_RGBA8_SNORM, GL_ZERO, GL_RGBA, GL_RGBA, GL_BYTE, false }, // RGBA8S
+ { GL_RGBA16, GL_ZERO, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT, false }, // RGBA16
+ { GL_RGBA16I, GL_ZERO, GL_RGBA, GL_RGBA, GL_SHORT, false }, // RGBA16I
+ { GL_RGBA16UI, GL_ZERO, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT, false }, // RGBA16U
+ { GL_RGBA16F, GL_ZERO, GL_RGBA, GL_RGBA, GL_HALF_FLOAT, false }, // RGBA16F
+ { GL_RGBA16_SNORM, GL_ZERO, GL_RGBA, GL_RGBA, GL_SHORT, false }, // RGBA16S
+ { GL_RGBA32I, GL_ZERO, GL_RGBA, GL_RGBA, GL_INT, false }, // RGBA32I
+ { GL_RGBA32UI, GL_ZERO, GL_RGBA, GL_RGBA, GL_UNSIGNED_INT, false }, // RGBA32U
+ { GL_RGBA32F, GL_ZERO, GL_RGBA, GL_RGBA, GL_FLOAT, false }, // RGBA32F
+ { GL_RGB565, GL_ZERO, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, false }, // R5G6B5
+ { GL_RGBA4, GL_ZERO, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4_REV, false }, // RGBA4
+ { GL_RGB5_A1, GL_ZERO, GL_BGRA, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, false }, // RGB5A1
+ { GL_RGB10_A2, GL_ZERO, GL_RGBA, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, false }, // RGB10A2
+ { GL_R11F_G11F_B10F, GL_ZERO, GL_RGB, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, false }, // RG11B10F
+ { GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false }, // UnknownDepth
+ { GL_DEPTH_COMPONENT16, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false }, // D16
+ { GL_DEPTH_COMPONENT24, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, false }, // D24
+ { GL_DEPTH24_STENCIL8, GL_ZERO, GL_DEPTH_STENCIL, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, false }, // D24S8
+ { GL_DEPTH_COMPONENT32, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, false }, // D32
+ { GL_DEPTH_COMPONENT32F, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D16F
+ { GL_DEPTH_COMPONENT32F, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D24F
+ { GL_DEPTH_COMPONENT32F, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D32F
+ { GL_STENCIL_INDEX8, GL_ZERO, GL_STENCIL_INDEX, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, false }, // D0S8
};
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
@@ -584,6 +585,7 @@ namespace bgfx { namespace gl
EXT_texture_type_2_10_10_10_REV,
EXT_timer_query,
EXT_unpack_subimage,
+ EXT_sRGB,
GOOGLE_depth_texture,
@@ -794,6 +796,7 @@ namespace bgfx { namespace gl
{ "EXT_texture_type_2_10_10_10_REV", false, true },
{ "EXT_timer_query", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
{ "EXT_unpack_subimage", false, true },
+ { "EXT_sRGB", false, true }, // GLES2 extension.
{ "GOOGLE_depth_texture", false, true },
@@ -1177,9 +1180,17 @@ namespace bgfx { namespace gl
TextureFormatInfo& tfi = s_textureFormat[_format];
tfi.m_internalFmt = _internalFmt;
tfi.m_fmt = _fmt;
+ tfi.m_fmtSrgb = _fmt;
tfi.m_type = _type;
}
+ void setTextureFormatSrgb(TextureFormat::Enum _format, GLenum _internalFmtSrgb, GLenum _fmtSrgb)
+ {
+ TextureFormatInfo& tfi = s_textureFormat[_format];
+ tfi.m_internalFmtSrgb = _internalFmtSrgb;
+ tfi.m_fmtSrgb = _fmtSrgb;
+ }
+
static void texSubImage(
GLenum _target
, GLint _level
@@ -1432,6 +1443,10 @@ namespace bgfx { namespace gl
? tfi.m_internalFmtSrgb
: tfi.m_internalFmt
;
+ GLenum fmt = _srgb
+ ? tfi.m_fmtSrgb
+ : tfi.m_fmt
+ ;
GLsizei bpp = bimg::getBitsPerPixel(bimg::TextureFormat::Enum(_format) );
GLsizei size = (_dim*_dim*bpp)/8;
@@ -1473,7 +1488,7 @@ namespace bgfx { namespace gl
{
dim = bx::uint32_max(1, dim);
size = (dim*dim*bpp)/8;
- texImage(target, 0, ii, internalFmt, dim, dim, 0, 0, tfi.m_fmt, tfi.m_type, data);
+ texImage(target, 0, ii, internalFmt, dim, dim, 0, 0, fmt, tfi.m_type, data);
err |= getGlError();
}
}
@@ -1514,7 +1529,7 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
if (_array)
{
glTexStorage3D(target
- , 1 + GLsizei(bx::log2(float(_dim) ) )
+ , 1 + GLsizei(bx::log2((int32_t)_dim) )
, internalFmt
, _dim
, _dim
@@ -2048,6 +2063,12 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
setTextureFormat(TextureFormat::RGBA4, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4_REV);
setTextureFormat(TextureFormat::RGB5A1, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV);
+ if (s_extension[Extension::EXT_sRGB].m_supported)
+ {
+ setTextureFormatSrgb(TextureFormat::RGBA8, GL_SRGB_ALPHA_EXT, GL_SRGB_ALPHA_EXT);
+ setTextureFormatSrgb(TextureFormat::RGB8, GL_SRGB_EXT, GL_SRGB_EXT);
+ }
+
if (s_extension[Extension::OES_texture_half_float].m_supported
|| s_extension[Extension::OES_texture_float ].m_supported)
{
@@ -4630,7 +4651,13 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
GL_CHECK(glPixelStorei(GL_UNPACK_ALIGNMENT, 1) );
const TextureFormatInfo& tfi = s_textureFormat[m_textureFormat];
- m_fmt = tfi.m_fmt;
+
+ const GLenum fmt = srgb
+ ? s_textureFormat[m_textureFormat].m_fmt
+ : s_textureFormat[m_textureFormat].m_fmtSrgb
+ ;
+
+ m_fmt = fmt;
m_type = tfi.m_type;
const bool swizzle = true
@@ -4823,6 +4850,10 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
? s_textureFormat[m_textureFormat].m_internalFmtSrgb
: s_textureFormat[m_textureFormat].m_internalFmt
;
+ const GLenum fmt = srgb
+ ? s_textureFormat[m_textureFormat].m_fmtSrgb
+ : s_textureFormat[m_textureFormat].m_fmt
+ ;
const bool swizzle = true
&& TextureFormat::BGRA8 == m_requestedFormat
@@ -4926,7 +4957,7 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
, height
, depth
, 0
- , m_fmt
+ , fmt
, m_type
, data
) );
@@ -4962,7 +4993,7 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
, height
, depth
, 0
- , m_fmt
+ , fmt
, m_type
, NULL
) );
@@ -6861,8 +6892,14 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
| BGFX_STATE_MSAA
| BGFX_STATE_LINEAA
| BGFX_STATE_CONSERVATIVE_RASTER
+ | BGFX_STATE_FRONT_CCW
) & changedFlags)
{
+ if (BGFX_STATE_FRONT_CCW & changedFlags)
+ {
+ GL_CHECK(glFrontFace((BGFX_STATE_FRONT_CCW & newFlags) ? GL_CCW : GL_CW) );
+ }
+
if (BGFX_STATE_CULL_MASK & changedFlags)
{
if (BGFX_STATE_CULL_CCW & newFlags)
diff --git a/3rdparty/bgfx/src/renderer_gl.h b/3rdparty/bgfx/src/renderer_gl.h
index e8d653c93ce..3c224d325d2 100644
--- a/3rdparty/bgfx/src/renderer_gl.h
+++ b/3rdparty/bgfx/src/renderer_gl.h
@@ -556,6 +556,14 @@ typedef uint64_t GLuint64;
# define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F
#endif // GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB
+#ifndef GL_SRGB_EXT
+# define GL_SRGB_EXT 0x8C40
+#endif // GL_SRGB_EXT
+
+#ifndef GL_SRGB_ALPHA_EXT
+# define GL_SRGB_ALPHA_EXT 0x8C42
+#endif // GL_SRGB_ALPHA_EXT
+
#ifndef GL_SRGB8_ALPHA8
# define GL_SRGB8_ALPHA8 0x8C43
#endif // GL_SRGB8_ALPHA8
diff --git a/3rdparty/bgfx/src/renderer_mtl.mm b/3rdparty/bgfx/src/renderer_mtl.mm
index 2cbb902f566..aecac0fee40 100644
--- a/3rdparty/bgfx/src/renderer_mtl.mm
+++ b/3rdparty/bgfx/src/renderer_mtl.mm
@@ -3942,6 +3942,14 @@ namespace bgfx { namespace mtl
vp.zfar = 1.0f;
rce.setViewport(vp);
+ MTLScissorRect sciRect = {
+ viewState.m_rect.m_x,
+ viewState.m_rect.m_y,
+ viewState.m_rect.m_width,
+ viewState.m_rect.m_height
+ };
+ rce.setScissorRect(sciRect);
+
if (BGFX_CLEAR_NONE != (clr.m_flags & BGFX_CLEAR_MASK)
&& !clearWithRenderPass)
{
@@ -4219,8 +4227,14 @@ namespace bgfx { namespace mtl
| BGFX_STATE_CULL_MASK
| BGFX_STATE_ALPHA_REF_MASK
| BGFX_STATE_PT_MASK
+ | BGFX_STATE_FRONT_CCW
) & changedFlags)
{
+ if (BGFX_STATE_FRONT_CCW & changedFlags)
+ {
+ rce.setFrontFacingWinding((newFlags&BGFX_STATE_FRONT_CCW) ? MTLWindingCounterClockwise : MTLWindingClockwise);
+ }
+
if (BGFX_STATE_CULL_MASK & changedFlags)
{
const uint64_t pt = newFlags&BGFX_STATE_CULL_MASK;
diff --git a/3rdparty/bgfx/src/renderer_vk.cpp b/3rdparty/bgfx/src/renderer_vk.cpp
index 61ff5862d27..3840c7ad82b 100644
--- a/3rdparty/bgfx/src/renderer_vk.cpp
+++ b/3rdparty/bgfx/src/renderer_vk.cpp
@@ -216,7 +216,7 @@ VK_IMPORT_DEVICE
{ VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED }, // RGBA32F
{ VK_FORMAT_B5G6R5_UNORM_PACK16, VK_FORMAT_B5G6R5_UNORM_PACK16, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED }, // R5G6B5
{ VK_FORMAT_B4G4R4A4_UNORM_PACK16, VK_FORMAT_B4G4R4A4_UNORM_PACK16, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED }, // RGBA4
- { VK_FORMAT_B5G5R5A1_UNORM_PACK16, VK_FORMAT_B5G5R5A1_UNORM_PACK16, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED }, // RGB5A1
+ { VK_FORMAT_A1R5G5B5_UNORM_PACK16, VK_FORMAT_A1R5G5B5_UNORM_PACK16, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED }, // RGB5A1
{ VK_FORMAT_A2R10G10B10_UNORM_PACK32, VK_FORMAT_A2R10G10B10_UNORM_PACK32, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED }, // RGB10A2
{ VK_FORMAT_B10G11R11_UFLOAT_PACK32, VK_FORMAT_B10G11R11_UFLOAT_PACK32, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED }, // RG11B10F
{ VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED }, // UnknownDepth
@@ -2761,45 +2761,49 @@ VK_IMPORT_DEVICE
releaseSwapchainFramebuffer();
releaseSwapchain();
-#if 1
uint32_t numPresentModes(10);
VkPresentModeKHR presentModes[10];
vkGetPhysicalDeviceSurfacePresentModesKHR(m_physicalDevice, m_surface, &numPresentModes, presentModes);
- // find the best match...
uint32_t presentModeIdx = numPresentModes;
- VkPresentModeKHR preferredPresentMode[] = {
+ static const VkPresentModeKHR preferredPresentMode[] =
+ {
VK_PRESENT_MODE_FIFO_KHR,
VK_PRESENT_MODE_FIFO_RELAXED_KHR,
VK_PRESENT_MODE_MAILBOX_KHR,
VK_PRESENT_MODE_IMMEDIATE_KHR,
};
- bool has_vsync[] = {true, true, true, false};
- bool vsync = (flags & BGFX_RESET_VSYNC ? true : false);
+ static const bool hasVsync[] = { true, true, true, false };
+ BX_STATIC_ASSERT(BX_COUNTOF(preferredPresentMode) == BX_COUNTOF(hasVsync) );
+
+ const bool vsync = !!(flags & BGFX_RESET_VSYNC);
for (uint32_t ii = 0; ii < BX_COUNTOF(preferredPresentMode); ++ii)
{
for (uint32_t jj = 0; jj < numPresentModes; ++jj)
{
- if ((presentModes[jj] == preferredPresentMode[ii]) && (vsync == has_vsync[ii]))
+ if (presentModes[jj] == preferredPresentMode[ii]
+ && vsync == hasVsync[ii])
{
presentModeIdx = jj;
- BX_TRACE("present mode: %d", (int)preferredPresentMode[ii]);
+ BX_TRACE("present mode: %d", preferredPresentMode[ii]);
break;
}
}
+
if (presentModeIdx < numPresentModes)
{
break;
}
}
+
if (presentModeIdx == numPresentModes)
{
presentModeIdx = 0;
}
+
m_sci.presentMode = presentModes[presentModeIdx];
- //bx::printf("%d %d %d %d %d\n", flags, BGFX_RESET_VSYNC, presentModeIdx, presentModes[presentModeIdx], numPresentModes);
-#endif
+
VkSurfaceCapabilitiesKHR surfaceCapabilities;
VK_CHECK(vkGetPhysicalDeviceSurfaceCapabilitiesKHR(m_physicalDevice, m_surface, &surfaceCapabilities) );
@@ -3113,7 +3117,7 @@ VK_IMPORT_DEVICE
: VK_POLYGON_MODE_FILL
;
_desc.cullMode = s_cullMode[cull];
- _desc.frontFace = VK_FRONT_FACE_CLOCKWISE;
+ _desc.frontFace = (_state&BGFX_STATE_FRONT_CCW) ? VK_FRONT_FACE_COUNTER_CLOCKWISE : VK_FRONT_FACE_CLOCKWISE;
_desc.depthBiasEnable = VK_FALSE;
_desc.depthBiasConstantFactor = 0.0f;
_desc.depthBiasClamp = 0.0f;
diff --git a/3rdparty/bimg/3rdparty/tinyexr/tinyexr.h b/3rdparty/bimg/3rdparty/tinyexr/tinyexr.h
index cda32f456c9..a02b913e694 100644
--- a/3rdparty/bimg/3rdparty/tinyexr/tinyexr.h
+++ b/3rdparty/bimg/3rdparty/tinyexr/tinyexr.h
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2014 - 2018, Syoyo Fujita and many contributors.
+Copyright (c) 2014 - 2019, Syoyo Fujita and many contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -111,13 +111,13 @@ extern "C" {
#define TINYEXR_ERROR_INVALID_ARGUMENT (-3)
#define TINYEXR_ERROR_INVALID_DATA (-4)
#define TINYEXR_ERROR_INVALID_FILE (-5)
-#define TINYEXR_ERROR_INVALID_PARAMETER (-5)
-#define TINYEXR_ERROR_CANT_OPEN_FILE (-6)
-#define TINYEXR_ERROR_UNSUPPORTED_FORMAT (-7)
-#define TINYEXR_ERROR_INVALID_HEADER (-8)
-#define TINYEXR_ERROR_UNSUPPORTED_FEATURE (-9)
-#define TINYEXR_ERROR_CANT_WRITE_FILE (-10)
-#define TINYEXR_ERROR_SERIALZATION_FAILED (-11)
+#define TINYEXR_ERROR_INVALID_PARAMETER (-6)
+#define TINYEXR_ERROR_CANT_OPEN_FILE (-7)
+#define TINYEXR_ERROR_UNSUPPORTED_FORMAT (-8)
+#define TINYEXR_ERROR_INVALID_HEADER (-9)
+#define TINYEXR_ERROR_UNSUPPORTED_FEATURE (-10)
+#define TINYEXR_ERROR_CANT_WRITE_FILE (-11)
+#define TINYEXR_ERROR_SERIALZATION_FAILED (-12)
// @note { OpenEXR file format: http://www.openexr.com/openexrfilelayout.pdf }
@@ -276,7 +276,8 @@ extern int LoadEXR(float **out_rgba, int *width, int *height,
// @deprecated { to be removed. }
// Simple wrapper API for ParseEXRHeaderFromFile.
// checking given file is a EXR file(by just look up header)
-// @return TINYEXR_SUCCEES for EXR image, TINYEXR_ERROR_INVALID_HEADER for others
+// @return TINYEXR_SUCCEES for EXR image, TINYEXR_ERROR_INVALID_HEADER for
+// others
extern int IsEXR(const char *filename);
// @deprecated { to be removed. }
@@ -469,9 +470,10 @@ extern int LoadEXRFromMemory(float **out_rgba, int *width, int *height,
#include <cstdio>
#include <cstdlib>
#include <cstring>
-#include <iostream>
#include <sstream>
+//#include <iostream> // debug
+
#include <limits>
#include <string>
#include <vector>
@@ -557,6 +559,10 @@ namespace miniz {
#pragma clang diagnostic ignored "-Wtautological-constant-compare"
#endif
+#if __has_warning("-Wextra-semi-stmt")
+#pragma clang diagnostic ignored "-Wextra-semi-stmt"
+#endif
+
#endif
/* miniz.c v1.15 - public domain deflate/inflate, zlib-subset, ZIP
@@ -2551,10 +2557,10 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r,
tinfl_status status = TINFL_STATUS_FAILED;
mz_uint32 num_bits, dist, counter, num_extra;
tinfl_bit_buf_t bit_buf;
- const mz_uint8 *pIn_buf_cur = pIn_buf_next,
- *const pIn_buf_end = pIn_buf_next + *pIn_buf_size;
- mz_uint8 *pOut_buf_cur = pOut_buf_next,
- *const pOut_buf_end = pOut_buf_next + *pOut_buf_size;
+ const mz_uint8 *pIn_buf_cur = pIn_buf_next, *const pIn_buf_end =
+ pIn_buf_next + *pIn_buf_size;
+ mz_uint8 *pOut_buf_cur = pOut_buf_next, *const pOut_buf_end =
+ pOut_buf_next + *pOut_buf_size;
size_t out_buf_size_mask =
(decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)
? (size_t)-1
@@ -2971,8 +2977,9 @@ void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len,
tinfl_status status = tinfl_decompress(
&decomp, (const mz_uint8 *)pSrc_buf + src_buf_ofs, &src_buf_size,
(mz_uint8 *)pBuf, pBuf ? (mz_uint8 *)pBuf + *pOut_len : NULL,
- &dst_buf_size, (flags & ~TINFL_FLAG_HAS_MORE_INPUT) |
- TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF);
+ &dst_buf_size,
+ (flags & ~TINFL_FLAG_HAS_MORE_INPUT) |
+ TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF);
if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT)) {
MZ_FREE(pBuf);
*pOut_len = 0;
@@ -3025,9 +3032,8 @@ int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size,
tinfl_status status =
tinfl_decompress(&decomp, (const mz_uint8 *)pIn_buf + in_buf_ofs,
&in_buf_size, pDict, pDict + dict_ofs, &dst_buf_size,
- (flags &
- ~(TINFL_FLAG_HAS_MORE_INPUT |
- TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)));
+ (flags & ~(TINFL_FLAG_HAS_MORE_INPUT |
+ TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)));
in_buf_ofs += in_buf_size;
if ((dst_buf_size) &&
(!(*pPut_buf_func)(pDict + dict_ofs, (int)dst_buf_size, pPut_buf_user)))
@@ -3152,7 +3158,9 @@ static const mz_uint8 s_tdefl_large_dist_extra[128] = {
// Radix sorts tdefl_sym_freq[] array by 16-bit key m_key. Returns ptr to sorted
// values.
-typedef struct { mz_uint16 m_key, m_sym_index; } tdefl_sym_freq;
+typedef struct {
+ mz_uint16 m_key, m_sym_index;
+} tdefl_sym_freq;
static tdefl_sym_freq *tdefl_radix_sort_syms(mz_uint num_syms,
tdefl_sym_freq *pSyms0,
tdefl_sym_freq *pSyms1) {
@@ -5296,9 +5304,10 @@ mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index,
n = MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS);
n = MZ_MIN(n, MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE - 1);
pStat->m_comment_size = n;
- memcpy(pStat->m_comment, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE +
- MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) +
- MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS),
+ memcpy(pStat->m_comment,
+ p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE +
+ MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) +
+ MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS),
n);
pStat->m_comment[n] = '\0';
@@ -7022,6 +7031,11 @@ static void swap2(unsigned short *val) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
#endif
+
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
+#endif
static void cpy4(int *dst_val, const int *src_val) {
unsigned char *dst = reinterpret_cast<unsigned char *>(dst_val);
const unsigned char *src = reinterpret_cast<const unsigned char *>(src_val);
@@ -7051,11 +7065,14 @@ static void cpy4(float *dst_val, const float *src_val) {
dst[2] = src[2];
dst[3] = src[3];
}
-
#ifdef __clang__
#pragma clang diagnostic pop
#endif
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
static void swap4(unsigned int *val) {
#ifdef MINIZ_LITTLE_ENDIAN
(void)val;
@@ -7626,6 +7643,9 @@ static bool DecompressZip(unsigned char *dst,
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wsign-conversion"
+#if __has_warning("-Wextra-semi-stmt")
+#pragma clang diagnostic ignored "-Wextra-semi-stmt"
+#endif
#endif
#ifdef _MSC_VER
@@ -7710,7 +7730,8 @@ static int rleUncompress(int inLength, int maxLength, const signed char in[],
int count = -(static_cast<int>(*in++));
inLength -= count + 1;
- if (0 > (maxLength -= count)) return 0;
+ // Fixes #116: Add bounds check to in buffer.
+ if ((0 > (maxLength -= count)) || (inLength < 0)) return 0;
memcpy(out, in, count);
out += count;
@@ -7804,13 +7825,19 @@ static void CompressRle(unsigned char *dst,
}
}
-static void DecompressRle(unsigned char *dst,
+static bool DecompressRle(unsigned char *dst,
const unsigned long uncompressed_size,
const unsigned char *src, unsigned long src_size) {
if (uncompressed_size == src_size) {
// Data is not compressed(Issue 40).
memcpy(dst, src, src_size);
- return;
+ return true;
+ }
+
+ // Workaround for issue #112.
+ // TODO(syoyo): Add more robust out-of-bounds check in `rleUncompress`.
+ if (src_size <= 2) {
+ return false;
}
std::vector<unsigned char> tmpBuf(uncompressed_size);
@@ -7819,8 +7846,9 @@ static void DecompressRle(unsigned char *dst,
static_cast<int>(uncompressed_size),
reinterpret_cast<const signed char *>(src),
reinterpret_cast<char *>(&tmpBuf.at(0)));
- assert(ret == static_cast<int>(uncompressed_size));
- (void)ret;
+ if (ret != static_cast<int>(uncompressed_size)) {
+ return false;
+ }
//
// Apply EXR-specific? postprocess. Grabbed from OpenEXR's
@@ -7859,6 +7887,8 @@ static void DecompressRle(unsigned char *dst,
break;
}
}
+
+ return true;
}
#if TINYEXR_USE_PIZ
@@ -7877,6 +7907,10 @@ static void DecompressRle(unsigned char *dst,
#pragma clang diagnostic ignored "-Wcast-qual"
#endif
+#if __has_warning("-Wextra-semi-stmt")
+#pragma clang diagnostic ignored "-Wextra-semi-stmt"
+#endif
+
#endif
//
@@ -8570,7 +8604,7 @@ static bool hufUnpackEncTable(
int lc = 0;
for (; im <= iM; im++) {
- if (p - *pcode > ni) {
+ if (p - *pcode >= ni) {
return false;
}
@@ -9362,6 +9396,10 @@ static bool DecompressPiz(unsigned char *outPtr, const unsigned char *inPtr,
tinyexr::cpy4(&length, reinterpret_cast<const int *>(ptr));
ptr += sizeof(int);
+ if (size_t((ptr - inPtr) + length) > inLen) {
+ return false;
+ }
+
std::vector<unsigned short> tmpBuffer(tmpBufSize);
hufUncompress(reinterpret_cast<const char *>(ptr), length, &tmpBuffer);
@@ -9656,8 +9694,9 @@ static bool DecodePixelData(/* out */ unsigned char **out_images,
reinterpret_cast<unsigned char *>(&outBuf.at(0)), data_ptr, tmpBufLen,
data_len, static_cast<int>(num_channels), channels, width, num_lines);
- assert(ret);
- (void)ret;
+ if (!ret) {
+ return false;
+ }
// For PIZ_COMPRESSION:
// pixel sample data for channel 0 for scanline 0
@@ -9702,16 +9741,18 @@ static bool DecodePixelData(/* out */ unsigned char **out_images,
} else { // HALF -> FLOAT
FP32 f32 = half_to_float(hf);
float *image = reinterpret_cast<float **>(out_images)[c];
+ size_t offset = 0;
if (line_order == 0) {
- image += (static_cast<size_t>(line_no) + v) *
+ offset = (static_cast<size_t>(line_no) + v) *
static_cast<size_t>(x_stride) +
u;
} else {
- image += static_cast<size_t>(
+ offset = static_cast<size_t>(
(height - 1 - (line_no + static_cast<int>(v)))) *
static_cast<size_t>(x_stride) +
u;
}
+ image += offset;
*image = f32.f;
}
}
@@ -9838,16 +9879,19 @@ static bool DecodePixelData(/* out */ unsigned char **out_images,
} else { // HALF -> FLOAT
tinyexr::FP32 f32 = half_to_float(hf);
float *image = reinterpret_cast<float **>(out_images)[c];
+ size_t offset = 0;
if (line_order == 0) {
- image += (static_cast<size_t>(line_no) + v) *
+ offset = (static_cast<size_t>(line_no) + v) *
static_cast<size_t>(x_stride) +
u;
} else {
- image += (static_cast<size_t>(height) - 1U -
+ offset = (static_cast<size_t>(height) - 1U -
(static_cast<size_t>(line_no) + v)) *
static_cast<size_t>(x_stride) +
u;
}
+ image += offset;
+
*image = f32.f;
}
}
@@ -9920,10 +9964,15 @@ static bool DecodePixelData(/* out */ unsigned char **out_images,
pixel_data_size);
unsigned long dstLen = static_cast<unsigned long>(outBuf.size());
- assert(dstLen > 0);
- tinyexr::DecompressRle(reinterpret_cast<unsigned char *>(&outBuf.at(0)),
+ if (dstLen == 0) {
+ return false;
+ }
+
+ if (!tinyexr::DecompressRle(reinterpret_cast<unsigned char *>(&outBuf.at(0)),
dstLen, data_ptr,
- static_cast<unsigned long>(data_len));
+ static_cast<unsigned long>(data_len))) {
+ return false;
+ }
// For RLE_COMPRESSION:
// pixel sample data for channel 0 for scanline 0
@@ -10753,12 +10802,28 @@ static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header,
if ((data_width < 0) || (data_height < 0)) {
if (err) {
std::stringstream ss;
- ss << "Invalid data width or data height: " << data_width << ", " << data_height << std::endl;
+ ss << "Invalid data width or data height: " << data_width << ", "
+ << data_height << std::endl;
(*err) += ss.str();
}
return TINYEXR_ERROR_INVALID_DATA;
}
+ // Do not allow too large data_width and data_height. header invalid?
+ {
+ const int threshold = 1024 * 8192; // heuristics
+ if ((data_width > threshold) || (data_height > threshold)) {
+ if (err) {
+ std::stringstream ss;
+ ss << "data_with or data_height too large. data_width: " << data_width
+ << ", "
+ << "data_height = " << data_height << std::endl;
+ (*err) += ss.str();
+ }
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+ }
+
size_t num_blocks = offsets.size();
std::vector<size_t> channel_offset_list;
@@ -10776,6 +10841,25 @@ static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header,
bool invalid_data = false; // TODO(LTE): Use atomic lock for MT safety.
if (exr_header->tiled) {
+ // value check
+ if (exr_header->tile_size_x < 0) {
+ if (err) {
+ std::stringstream ss;
+ ss << "Invalid tile size x : " << exr_header->tile_size_x << "\n";
+ (*err) += ss.str();
+ }
+ return TINYEXR_ERROR_INVALID_HEADER;
+ }
+
+ if (exr_header->tile_size_y < 0) {
+ if (err) {
+ std::stringstream ss;
+ ss << "Invalid tile size y : " << exr_header->tile_size_y << "\n";
+ (*err) += ss.str();
+ }
+ return TINYEXR_ERROR_INVALID_HEADER;
+ }
+
size_t num_tiles = offsets.size(); // = # of blocks
exr_image->tiles = static_cast<EXRTile *>(
@@ -10854,12 +10938,17 @@ static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header,
}
} else { // scanline format
- // Don't allow too large image(256GB * pixel_data_size or more). Workaround for #104.
- size_t data_len0 = size_t(data_width) * size_t(data_height) * size_t(num_channels);
- if ((data_len0 == 0) || (data_len0 >= 0x4000000000)) {
+ // Don't allow too large image(256GB * pixel_data_size or more). Workaround
+ // for #104.
+ size_t total_data_len =
+ size_t(data_width) * size_t(data_height) * size_t(num_channels);
+ const bool total_data_len_overflown = sizeof(void*) == 8 ? (total_data_len >= 0x4000000000) : false;
+ if ((total_data_len == 0) || total_data_len_overflown ) {
if (err) {
std::stringstream ss;
- ss << "Image data size is zero or too large: width = " << data_width << ", height = " << data_height << ", channels = " << num_channels << std::endl;
+ ss << "Image data size is zero or too large: width = " << data_width
+ << ", height = " << data_height << ", channels = " << num_channels
+ << std::endl;
(*err) += ss.str();
}
return TINYEXR_ERROR_INVALID_DATA;
@@ -10894,12 +10983,21 @@ static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header,
if (size_t(data_len) > data_size) {
invalid_data = true;
+
+ } else if ((line_no > (2 << 20)) || (line_no < -(2 << 20))) {
+ // Too large value. Assume this is invalid
+ // 2**20 = 1048576 = heuristic value.
+ invalid_data = true;
+ } else if (data_len == 0) {
+ // TODO(syoyo): May be ok to raise the threshold for example `data_len
+ // < 4`
+ invalid_data = true;
} else {
+ // line_no may be negative.
int end_line_no = (std::min)(line_no + num_scanline_blocks,
(exr_header->data_window[3] + 1));
int num_lines = end_line_no - line_no;
- // assert(num_lines > 0);
if (num_lines <= 0) {
invalid_data = true;
@@ -10908,7 +11006,16 @@ static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header,
data_ptr += 8;
// Adjust line_no with data_window.bmin.y
- line_no -= exr_header->data_window[1];
+
+ // overflow check
+ tinyexr_int64 lno = static_cast<tinyexr_int64>(line_no) - static_cast<tinyexr_int64>(exr_header->data_window[1]);
+ if (lno > std::numeric_limits<int>::max()) {
+ line_no = -1; // invalid
+ } else if (lno < -std::numeric_limits<int>::max()) {
+ line_no = -1; // invalid
+ } else {
+ line_no -= exr_header->data_window[1];
+ }
if (line_no < 0) {
invalid_data = true;
@@ -10933,6 +11040,10 @@ static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header,
}
if (invalid_data) {
+ if (err) {
+ std::stringstream ss;
+ (*err) += "Invalid data found when decoding pixels.\n";
+ }
return TINYEXR_ERROR_INVALID_DATA;
}
@@ -11009,7 +11120,7 @@ static int DecodeEXRImage(EXRImage *exr_image, const EXRHeader *exr_header,
int data_width = exr_header->data_window[2] - exr_header->data_window[0];
if (data_width >= std::numeric_limits<int>::max()) {
// Issue 63
- tinyexr::SetErrorMessage("Invalid data window value", err);
+ tinyexr::SetErrorMessage("Invalid data width value", err);
return TINYEXR_ERROR_INVALID_DATA;
}
data_width++;
@@ -11022,10 +11133,23 @@ static int DecodeEXRImage(EXRImage *exr_image, const EXRHeader *exr_header,
data_height++;
if ((data_width < 0) || (data_height < 0)) {
- tinyexr::SetErrorMessage("data window or data height is negative.", err);
+ tinyexr::SetErrorMessage("data width or data height is negative.", err);
return TINYEXR_ERROR_INVALID_DATA;
}
+ // Do not allow too large data_width and data_height. header invalid?
+ {
+ const int threshold = 1024 * 8192; // heuristics
+ if (data_width > threshold) {
+ tinyexr::SetErrorMessage("data width too large.", err);
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+ if (data_height > threshold) {
+ tinyexr::SetErrorMessage("data height too large.", err);
+ return TINYEXR_ERROR_INVALID_DATA;
+ }
+ }
+
// Read offset tables.
size_t num_blocks = 0;
@@ -11204,7 +11328,6 @@ int LoadEXR(float **out_rgba, int *width, int *height, const char *filename,
static_cast<size_t>(exr_image.height)));
if (exr_header.tiled) {
-
for (int it = 0; it < exr_image.num_tiles; it++) {
for (int j = 0; j < exr_header.tile_size_y; j++) {
for (int i = 0; i < exr_header.tile_size_x; i++) {
@@ -11448,7 +11571,6 @@ int LoadEXRFromMemory(float **out_rgba, int *width, int *height,
static_cast<size_t>(exr_image.height)));
if (exr_header.tiled) {
-
for (int it = 0; it < exr_image.num_tiles; it++) {
for (int j = 0; j < exr_header.tile_size_y; j++) {
for (int i = 0; i < exr_header.tile_size_x; i++) {
@@ -12129,7 +12251,7 @@ size_t SaveEXRImageToMemory(const EXRImage *exr_image,
sizeof(tinyexr::tinyexr_uint64) * static_cast<size_t>(num_blocks));
}
- if ( memory.size() == 0 ) {
+ if (memory.size() == 0) {
tinyexr::SetErrorMessage("Output memory size is zero", err);
return 0;
}
@@ -12300,6 +12422,9 @@ int LoadDeepEXR(DeepImage *deep_image, const char *filename, const char **err) {
size_t marker_size;
if (!tinyexr::ReadAttribute(&attr_name, &attr_type, &data, &marker_size,
marker, size)) {
+ std::stringstream ss;
+ ss << "Failed to parse attribute\n";
+ tinyexr::SetErrorMessage(ss.str(), err);
return TINYEXR_ERROR_INVALID_DATA;
}
marker += marker_size;
diff --git a/3rdparty/bimg/src/bimg_p.h b/3rdparty/bimg/src/bimg_p.h
index a9a4b2ae42f..557bcaa22df 100644
--- a/3rdparty/bimg/src/bimg_p.h
+++ b/3rdparty/bimg/src/bimg_p.h
@@ -48,7 +48,7 @@ namespace bimg
if (_hasMips)
{
const uint32_t max = bx::max(_width, _height, _depth);
- const uint32_t num = 1 + uint32_t(bx::log2(float(max) ) );
+ const uint32_t num = 1 + uint32_t(bx::log2((int32_t)max) );
return uint8_t(num);
}
diff --git a/3rdparty/bx/include/bx/inline/math.inl b/3rdparty/bx/include/bx/inline/math.inl
index 81ce759ec99..6f946e1f82a 100644
--- a/3rdparty/bx/include/bx/inline/math.inl
+++ b/3rdparty/bx/include/bx/inline/math.inl
@@ -10,6 +10,7 @@
#endif // BX_MATH_H_HEADER_GUARD
#include <bx/simd_t.h>
+#include <bx/uint32_t.h>
namespace bx
{
@@ -126,6 +127,11 @@ namespace bx
return _a + (_b - _a) * _t;
}
+ inline BX_CONSTEXPR_FUNC float invLerp(float _a, float _b, float _value)
+ {
+ return (_value - _a) / (_b - _a);
+ }
+
inline BX_CONSTEXPR_FUNC float sign(float _a)
{
return _a < 0.0f ? -1.0f : 1.0f;
@@ -191,11 +197,18 @@ namespace bx
return pow(2.0f, _a);
}
+ template<>
inline BX_CONST_FUNC float log2(float _a)
{
return log(_a) * kInvLogNat2;
}
+ template<>
+ inline BX_CONST_FUNC int32_t log2(int32_t _a)
+ {
+ return 31 - uint32_cntlz(_a);
+ }
+
inline BX_CONST_FUNC float rsqrtRef(float _a)
{
return pow(_a, -0.5f);
diff --git a/3rdparty/bx/include/bx/math.h b/3rdparty/bx/include/bx/math.h
index 6e28839a35f..ebd06625102 100644
--- a/3rdparty/bx/include/bx/math.h
+++ b/3rdparty/bx/include/bx/math.h
@@ -146,6 +146,10 @@ namespace bx
///
BX_CONSTEXPR_FUNC float lerp(float _a, float _b, float _t);
+ /// Returns inverse linear interpolation of _value between two values _a and _b.
+ ///
+ BX_CONSTEXPR_FUNC float invLerp(float _a, float _b, float _value);
+
/// Returns the sign of _a.
///
BX_CONSTEXPR_FUNC float sign(float _a);
@@ -225,7 +229,8 @@ namespace bx
/// Returns the base 2 logarithm of _a.
///
- BX_CONST_FUNC float log2(float _a);
+ template<typename Ty>
+ BX_CONST_FUNC Ty log2(Ty _a);
/// Returns the square root of _a.
///
diff --git a/3rdparty/bx/include/bx/platform.h b/3rdparty/bx/include/bx/platform.h
index 8195cfe36c8..d4445d3a3b9 100644
--- a/3rdparty/bx/include/bx/platform.h
+++ b/3rdparty/bx/include/bx/platform.h
@@ -30,6 +30,7 @@
// C Runtime
#define BX_CRT_BIONIC 0
+#define BX_CRT_BSD 0
#define BX_CRT_GLIBC 0
#define BX_CRT_LIBCXX 0
#define BX_CRT_MINGW 0
@@ -242,9 +243,13 @@
# elif defined(__apple_build_version__) || defined(__ORBIS__) || defined(__EMSCRIPTEN__) || defined(__llvm__) || defined(__HAIKU__)
# undef BX_CRT_LIBCXX
# define BX_CRT_LIBCXX 1
+# elif BX_PLATFORM_BSD
+# undef BX_CRT_BSD
+# define BX_CRT_BSD 1
# endif //
# if !BX_CRT_BIONIC \
+ && !BX_CRT_BSD \
&& !BX_CRT_GLIBC \
&& !BX_CRT_LIBCXX \
&& !BX_CRT_MINGW \
@@ -413,6 +418,8 @@
#if BX_CRT_BIONIC
# define BX_CRT_NAME "Bionic libc"
+#elif BX_CRT_BSD
+# define BX_CRT_NAME "BSD libc"
#elif BX_CRT_GLIBC
# define BX_CRT_NAME "GNU C Library"
#elif BX_CRT_MSVC
diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua
index 18eeb91a832..e9b336e6e7d 100644
--- a/3rdparty/bx/scripts/toolchain.lua
+++ b/3rdparty/bx/scripts/toolchain.lua
@@ -1037,6 +1037,7 @@ function toolchain(_buildDir, _libDir)
"-msse2",
"-Wunused-value",
"-Wundef",
+ "-target x86_64-apple-macos" .. (#macosPlatform > 0 and macosPlatform or "10.11"),
}
includedirs { path.join(bxDir, "include/compat/osx") }
diff --git a/3rdparty/bx/src/mutex.cpp b/3rdparty/bx/src/mutex.cpp
index 48f09d0be3e..2fe5eaf33d4 100644
--- a/3rdparty/bx/src/mutex.cpp
+++ b/3rdparty/bx/src/mutex.cpp
@@ -12,6 +12,7 @@
# include <bx/cpu.h>
# include "crt0.h"
#elif BX_PLATFORM_ANDROID \
+ || BX_PLATFORM_BSD \
|| BX_PLATFORM_HAIKU \
|| BX_PLATFORM_LINUX \
|| BX_PLATFORM_IOS \
diff --git a/3rdparty/bx/src/thread.cpp b/3rdparty/bx/src/thread.cpp
index 7969d7852ae..952510569b1 100644
--- a/3rdparty/bx/src/thread.cpp
+++ b/3rdparty/bx/src/thread.cpp
@@ -15,6 +15,7 @@
#if BX_CRT_NONE
# include "crt0.h"
#elif BX_PLATFORM_ANDROID \
+ || BX_PLATFORM_BSD \
|| BX_PLATFORM_HAIKU \
|| BX_PLATFORM_LINUX \
|| BX_PLATFORM_IOS \
diff --git a/3rdparty/bx/tests/math_test.cpp b/3rdparty/bx/tests/math_test.cpp
index 84bec2c1b10..00a73b283ce 100644
--- a/3rdparty/bx/tests/math_test.cpp
+++ b/3rdparty/bx/tests/math_test.cpp
@@ -31,6 +31,33 @@ TEST_CASE("log2", "")
{
log2_test(0.0f);
log2_test(256.0f);
+
+ REQUIRE(0.0f == bx::log2(1.0f) );
+ REQUIRE(0 == bx::log2(1) );
+
+ REQUIRE(1.0f == bx::log2(2.0f) );
+ REQUIRE(1 == bx::log2(2) );
+
+ REQUIRE(2.0f == bx::log2(4.0f) );
+ REQUIRE(2 == bx::log2(4) );
+
+ REQUIRE(3.0f == bx::log2(8.0f) );
+ REQUIRE(3 == bx::log2(8) );
+
+ REQUIRE(4.0f == bx::log2(16.0f) );
+ REQUIRE(4 == bx::log2(16) );
+
+ REQUIRE(5.0f == bx::log2(32.0f) );
+ REQUIRE(5 == bx::log2(32) );
+
+ REQUIRE(6.0f == bx::log2(64.0f) );
+ REQUIRE(6 == bx::log2(64) );
+
+ REQUIRE(7.0f == bx::log2(128.0f) );
+ REQUIRE(7 == bx::log2(128) );
+
+ REQUIRE(8.0f == bx::log2(256.0f) );
+ REQUIRE(8 == bx::log2(256) );
}
TEST_CASE("libm", "")
diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_chroma.bin b/bgfx/shaders/dx11/chains/hlsl/fs_chroma.bin
index babc5ee8386..ac2d5fd2137 100644
--- a/bgfx/shaders/dx11/chains/hlsl/fs_chroma.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/fs_chroma.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_color.bin b/bgfx/shaders/dx11/chains/hlsl/fs_color.bin
index 8785c5d9f78..cccd8c132ad 100644
--- a/bgfx/shaders/dx11/chains/hlsl/fs_color.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/fs_color.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_deconverge.bin b/bgfx/shaders/dx11/chains/hlsl/fs_deconverge.bin
index 19fb7397184..682ffdda441 100644
--- a/bgfx/shaders/dx11/chains/hlsl/fs_deconverge.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/fs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_defocus.bin b/bgfx/shaders/dx11/chains/hlsl/fs_defocus.bin
index ac75d27b43c..d042dc61bc0 100644
--- a/bgfx/shaders/dx11/chains/hlsl/fs_defocus.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/fs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_distortion.bin b/bgfx/shaders/dx11/chains/hlsl/fs_distortion.bin
index ae674619f5e..6d2dca1800f 100644
--- a/bgfx/shaders/dx11/chains/hlsl/fs_distortion.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/fs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_ntsc_decode.bin b/bgfx/shaders/dx11/chains/hlsl/fs_ntsc_decode.bin
index ce25750f7db..2d3ff557078 100644
--- a/bgfx/shaders/dx11/chains/hlsl/fs_ntsc_decode.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/fs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_ntsc_encode.bin b/bgfx/shaders/dx11/chains/hlsl/fs_ntsc_encode.bin
index 8a0c8afed62..1a50d4e3403 100644
--- a/bgfx/shaders/dx11/chains/hlsl/fs_ntsc_encode.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/fs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_phosphor.bin b/bgfx/shaders/dx11/chains/hlsl/fs_phosphor.bin
index affa983f920..82a3d935243 100644
--- a/bgfx/shaders/dx11/chains/hlsl/fs_phosphor.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/fs_phosphor.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_post.bin b/bgfx/shaders/dx11/chains/hlsl/fs_post.bin
index b455d3dbf59..0166a4ef318 100644
--- a/bgfx/shaders/dx11/chains/hlsl/fs_post.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/fs_post.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_prescale.bin b/bgfx/shaders/dx11/chains/hlsl/fs_prescale.bin
index c73f029b4bb..284ed423773 100644
--- a/bgfx/shaders/dx11/chains/hlsl/fs_prescale.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/fs_prescale.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_scanline.bin b/bgfx/shaders/dx11/chains/hlsl/fs_scanline.bin
index e51bfe7350d..695bc8f0c2e 100644
--- a/bgfx/shaders/dx11/chains/hlsl/fs_scanline.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/fs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/vs_chroma.bin b/bgfx/shaders/dx11/chains/hlsl/vs_chroma.bin
index d97141ff5f2..624fecd4577 100644
--- a/bgfx/shaders/dx11/chains/hlsl/vs_chroma.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/vs_chroma.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/vs_color.bin b/bgfx/shaders/dx11/chains/hlsl/vs_color.bin
index d97141ff5f2..624fecd4577 100644
--- a/bgfx/shaders/dx11/chains/hlsl/vs_color.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/vs_color.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/vs_deconverge.bin b/bgfx/shaders/dx11/chains/hlsl/vs_deconverge.bin
index cb09c52a296..1a54bcca7da 100644
--- a/bgfx/shaders/dx11/chains/hlsl/vs_deconverge.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/vs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/vs_defocus.bin b/bgfx/shaders/dx11/chains/hlsl/vs_defocus.bin
index d97141ff5f2..624fecd4577 100644
--- a/bgfx/shaders/dx11/chains/hlsl/vs_defocus.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/vs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/vs_distortion.bin b/bgfx/shaders/dx11/chains/hlsl/vs_distortion.bin
index d97141ff5f2..624fecd4577 100644
--- a/bgfx/shaders/dx11/chains/hlsl/vs_distortion.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/vs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/vs_ntsc_decode.bin b/bgfx/shaders/dx11/chains/hlsl/vs_ntsc_decode.bin
index d97141ff5f2..624fecd4577 100644
--- a/bgfx/shaders/dx11/chains/hlsl/vs_ntsc_decode.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/vs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/vs_ntsc_encode.bin b/bgfx/shaders/dx11/chains/hlsl/vs_ntsc_encode.bin
index d97141ff5f2..624fecd4577 100644
--- a/bgfx/shaders/dx11/chains/hlsl/vs_ntsc_encode.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/vs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/vs_phosphor.bin b/bgfx/shaders/dx11/chains/hlsl/vs_phosphor.bin
index d97141ff5f2..624fecd4577 100644
--- a/bgfx/shaders/dx11/chains/hlsl/vs_phosphor.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/vs_phosphor.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/vs_post.bin b/bgfx/shaders/dx11/chains/hlsl/vs_post.bin
index d97141ff5f2..624fecd4577 100644
--- a/bgfx/shaders/dx11/chains/hlsl/vs_post.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/vs_post.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/vs_prescale.bin b/bgfx/shaders/dx11/chains/hlsl/vs_prescale.bin
index d97141ff5f2..624fecd4577 100644
--- a/bgfx/shaders/dx11/chains/hlsl/vs_prescale.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/vs_prescale.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/chains/hlsl/vs_scanline.bin b/bgfx/shaders/dx11/chains/hlsl/vs_scanline.bin
index d97141ff5f2..624fecd4577 100644
--- a/bgfx/shaders/dx11/chains/hlsl/vs_scanline.bin
+++ b/bgfx/shaders/dx11/chains/hlsl/vs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_chroma.bin b/bgfx/shaders/dx9/chains/hlsl/fs_chroma.bin
index 00438717467..04511eb6d9e 100644
--- a/bgfx/shaders/dx9/chains/hlsl/fs_chroma.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/fs_chroma.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_color.bin b/bgfx/shaders/dx9/chains/hlsl/fs_color.bin
index a18e1172202..576f05700a3 100644
--- a/bgfx/shaders/dx9/chains/hlsl/fs_color.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/fs_color.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_deconverge.bin b/bgfx/shaders/dx9/chains/hlsl/fs_deconverge.bin
index 0ab6394acd5..84ac626adf1 100644
--- a/bgfx/shaders/dx9/chains/hlsl/fs_deconverge.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/fs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_defocus.bin b/bgfx/shaders/dx9/chains/hlsl/fs_defocus.bin
index a515b5848fb..51e71128577 100644
--- a/bgfx/shaders/dx9/chains/hlsl/fs_defocus.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/fs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_distortion.bin b/bgfx/shaders/dx9/chains/hlsl/fs_distortion.bin
index d51e155c845..2f237e67b7d 100644
--- a/bgfx/shaders/dx9/chains/hlsl/fs_distortion.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/fs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_ntsc_decode.bin b/bgfx/shaders/dx9/chains/hlsl/fs_ntsc_decode.bin
index 8e56468b860..3add3b9fa27 100644
--- a/bgfx/shaders/dx9/chains/hlsl/fs_ntsc_decode.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/fs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_ntsc_encode.bin b/bgfx/shaders/dx9/chains/hlsl/fs_ntsc_encode.bin
index 5187e2552ce..c0d3877ca98 100644
--- a/bgfx/shaders/dx9/chains/hlsl/fs_ntsc_encode.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/fs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_phosphor.bin b/bgfx/shaders/dx9/chains/hlsl/fs_phosphor.bin
index 98921deabc5..2efb89415da 100644
--- a/bgfx/shaders/dx9/chains/hlsl/fs_phosphor.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/fs_phosphor.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_post.bin b/bgfx/shaders/dx9/chains/hlsl/fs_post.bin
index caadf337fab..736d9b16b0e 100644
--- a/bgfx/shaders/dx9/chains/hlsl/fs_post.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/fs_post.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_prescale.bin b/bgfx/shaders/dx9/chains/hlsl/fs_prescale.bin
index 88b40ce3b16..4356d472b82 100644
--- a/bgfx/shaders/dx9/chains/hlsl/fs_prescale.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/fs_prescale.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_scanline.bin b/bgfx/shaders/dx9/chains/hlsl/fs_scanline.bin
index 00f33632d2b..f30ad187672 100644
--- a/bgfx/shaders/dx9/chains/hlsl/fs_scanline.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/fs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_chroma.bin b/bgfx/shaders/dx9/chains/hlsl/vs_chroma.bin
index 923fba0a293..a93bf727629 100644
--- a/bgfx/shaders/dx9/chains/hlsl/vs_chroma.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/vs_chroma.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_color.bin b/bgfx/shaders/dx9/chains/hlsl/vs_color.bin
index 923fba0a293..a93bf727629 100644
--- a/bgfx/shaders/dx9/chains/hlsl/vs_color.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/vs_color.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_deconverge.bin b/bgfx/shaders/dx9/chains/hlsl/vs_deconverge.bin
index 4d967273115..9e3cc407a02 100644
--- a/bgfx/shaders/dx9/chains/hlsl/vs_deconverge.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/vs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_defocus.bin b/bgfx/shaders/dx9/chains/hlsl/vs_defocus.bin
index 923fba0a293..a93bf727629 100644
--- a/bgfx/shaders/dx9/chains/hlsl/vs_defocus.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/vs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_distortion.bin b/bgfx/shaders/dx9/chains/hlsl/vs_distortion.bin
index 923fba0a293..a93bf727629 100644
--- a/bgfx/shaders/dx9/chains/hlsl/vs_distortion.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/vs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_decode.bin b/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_decode.bin
index 923fba0a293..a93bf727629 100644
--- a/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_decode.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_encode.bin b/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_encode.bin
index 923fba0a293..a93bf727629 100644
--- a/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_encode.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_phosphor.bin b/bgfx/shaders/dx9/chains/hlsl/vs_phosphor.bin
index 923fba0a293..a93bf727629 100644
--- a/bgfx/shaders/dx9/chains/hlsl/vs_phosphor.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/vs_phosphor.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_post.bin b/bgfx/shaders/dx9/chains/hlsl/vs_post.bin
index 923fba0a293..a93bf727629 100644
--- a/bgfx/shaders/dx9/chains/hlsl/vs_post.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/vs_post.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_prescale.bin b/bgfx/shaders/dx9/chains/hlsl/vs_prescale.bin
index 923fba0a293..a93bf727629 100644
--- a/bgfx/shaders/dx9/chains/hlsl/vs_prescale.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/vs_prescale.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_scanline.bin b/bgfx/shaders/dx9/chains/hlsl/vs_scanline.bin
index 923fba0a293..a93bf727629 100644
--- a/bgfx/shaders/dx9/chains/hlsl/vs_scanline.bin
+++ b/bgfx/shaders/dx9/chains/hlsl/vs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/fs_chroma.bin b/bgfx/shaders/essl/chains/hlsl/fs_chroma.bin
index 6a4f6bedc52..d361b6ea763 100644
--- a/bgfx/shaders/essl/chains/hlsl/fs_chroma.bin
+++ b/bgfx/shaders/essl/chains/hlsl/fs_chroma.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_chroma.bin b/bgfx/shaders/metal/chains/hlsl/fs_chroma.bin
index c66a63eca60..83c569e13c1 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_chroma.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_chroma.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_color.bin b/bgfx/shaders/metal/chains/hlsl/fs_color.bin
index 830ca99ee07..745b1b09554 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_color.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_color.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_deconverge.bin b/bgfx/shaders/metal/chains/hlsl/fs_deconverge.bin
index 3a7522f410c..c1903f2eb81 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_deconverge.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_defocus.bin b/bgfx/shaders/metal/chains/hlsl/fs_defocus.bin
index a871417427c..e02dfce4b54 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_defocus.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_distortion.bin b/bgfx/shaders/metal/chains/hlsl/fs_distortion.bin
index 7ab3866c883..84e6b00b197 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_distortion.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_ntsc_decode.bin b/bgfx/shaders/metal/chains/hlsl/fs_ntsc_decode.bin
index fe4a7fe65ec..4708bfb311f 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_ntsc_decode.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_ntsc_encode.bin b/bgfx/shaders/metal/chains/hlsl/fs_ntsc_encode.bin
index 0d4c9da04a0..8aa8ddde751 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_ntsc_encode.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_phosphor.bin b/bgfx/shaders/metal/chains/hlsl/fs_phosphor.bin
index d0f4d1b98d6..cb3288b3c9c 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_phosphor.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_phosphor.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_post.bin b/bgfx/shaders/metal/chains/hlsl/fs_post.bin
index f3f5e502e03..87cb7cf5f40 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_post.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_post.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_prescale.bin b/bgfx/shaders/metal/chains/hlsl/fs_prescale.bin
index d05a15336cb..c046861ef88 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_prescale.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_prescale.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin b/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin
index c43dc275b77..548f0c44f75 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/vs_chroma.bin b/bgfx/shaders/metal/chains/hlsl/vs_chroma.bin
index 304299d80c2..b889561ae71 100644
--- a/bgfx/shaders/metal/chains/hlsl/vs_chroma.bin
+++ b/bgfx/shaders/metal/chains/hlsl/vs_chroma.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/vs_color.bin b/bgfx/shaders/metal/chains/hlsl/vs_color.bin
index 304299d80c2..b889561ae71 100644
--- a/bgfx/shaders/metal/chains/hlsl/vs_color.bin
+++ b/bgfx/shaders/metal/chains/hlsl/vs_color.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/vs_deconverge.bin b/bgfx/shaders/metal/chains/hlsl/vs_deconverge.bin
index 79ec1e7ebe1..edb390eea5f 100644
--- a/bgfx/shaders/metal/chains/hlsl/vs_deconverge.bin
+++ b/bgfx/shaders/metal/chains/hlsl/vs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/vs_defocus.bin b/bgfx/shaders/metal/chains/hlsl/vs_defocus.bin
index 304299d80c2..b889561ae71 100644
--- a/bgfx/shaders/metal/chains/hlsl/vs_defocus.bin
+++ b/bgfx/shaders/metal/chains/hlsl/vs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/vs_distortion.bin b/bgfx/shaders/metal/chains/hlsl/vs_distortion.bin
index 304299d80c2..b889561ae71 100644
--- a/bgfx/shaders/metal/chains/hlsl/vs_distortion.bin
+++ b/bgfx/shaders/metal/chains/hlsl/vs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/vs_ntsc_decode.bin b/bgfx/shaders/metal/chains/hlsl/vs_ntsc_decode.bin
index 304299d80c2..b889561ae71 100644
--- a/bgfx/shaders/metal/chains/hlsl/vs_ntsc_decode.bin
+++ b/bgfx/shaders/metal/chains/hlsl/vs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/vs_ntsc_encode.bin b/bgfx/shaders/metal/chains/hlsl/vs_ntsc_encode.bin
index 304299d80c2..b889561ae71 100644
--- a/bgfx/shaders/metal/chains/hlsl/vs_ntsc_encode.bin
+++ b/bgfx/shaders/metal/chains/hlsl/vs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/vs_phosphor.bin b/bgfx/shaders/metal/chains/hlsl/vs_phosphor.bin
index 304299d80c2..b889561ae71 100644
--- a/bgfx/shaders/metal/chains/hlsl/vs_phosphor.bin
+++ b/bgfx/shaders/metal/chains/hlsl/vs_phosphor.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/vs_post.bin b/bgfx/shaders/metal/chains/hlsl/vs_post.bin
index 304299d80c2..b889561ae71 100644
--- a/bgfx/shaders/metal/chains/hlsl/vs_post.bin
+++ b/bgfx/shaders/metal/chains/hlsl/vs_post.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/vs_prescale.bin b/bgfx/shaders/metal/chains/hlsl/vs_prescale.bin
index 304299d80c2..b889561ae71 100644
--- a/bgfx/shaders/metal/chains/hlsl/vs_prescale.bin
+++ b/bgfx/shaders/metal/chains/hlsl/vs_prescale.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/vs_scanline.bin b/bgfx/shaders/metal/chains/hlsl/vs_scanline.bin
index 304299d80c2..b889561ae71 100644
--- a/bgfx/shaders/metal/chains/hlsl/vs_scanline.bin
+++ b/bgfx/shaders/metal/chains/hlsl/vs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_chroma.bin b/bgfx/shaders/spirv/chains/hlsl/fs_chroma.bin
index f8545210ab1..e133d273a45 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_chroma.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_chroma.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_color.bin b/bgfx/shaders/spirv/chains/hlsl/fs_color.bin
index dc1e227a91a..e76e093f505 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_color.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_color.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_deconverge.bin b/bgfx/shaders/spirv/chains/hlsl/fs_deconverge.bin
index 6b666c4e752..6950101aeb9 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_deconverge.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_defocus.bin b/bgfx/shaders/spirv/chains/hlsl/fs_defocus.bin
index f854d95a7e9..c0dd649f20c 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_defocus.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_distortion.bin b/bgfx/shaders/spirv/chains/hlsl/fs_distortion.bin
index 50e47513a73..2892c54e4eb 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_distortion.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_decode.bin b/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_decode.bin
index b7007202b70..e64f2ccf47c 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_decode.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_encode.bin b/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_encode.bin
index 1394a2c5c72..7518ea3f152 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_encode.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_phosphor.bin b/bgfx/shaders/spirv/chains/hlsl/fs_phosphor.bin
index e1aaead4cee..83f3c97eaea 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_phosphor.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_phosphor.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_post.bin b/bgfx/shaders/spirv/chains/hlsl/fs_post.bin
index 593979dd174..2bcdab49196 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_post.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_post.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_prescale.bin b/bgfx/shaders/spirv/chains/hlsl/fs_prescale.bin
index 4d7f3f3287d..8c096618198 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_prescale.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_prescale.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_scanline.bin b/bgfx/shaders/spirv/chains/hlsl/fs_scanline.bin
index 703d9c198ef..e50a1a04b02 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_scanline.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_chroma.bin b/bgfx/shaders/spirv/chains/hlsl/vs_chroma.bin
index 49f68528d2c..7d21cea1f97 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_chroma.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_chroma.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_color.bin b/bgfx/shaders/spirv/chains/hlsl/vs_color.bin
index 49f68528d2c..7d21cea1f97 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_color.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_color.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_deconverge.bin b/bgfx/shaders/spirv/chains/hlsl/vs_deconverge.bin
index 2e9eac9c9f3..60323d055ec 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_deconverge.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_defocus.bin b/bgfx/shaders/spirv/chains/hlsl/vs_defocus.bin
index 49f68528d2c..7d21cea1f97 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_defocus.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_distortion.bin b/bgfx/shaders/spirv/chains/hlsl/vs_distortion.bin
index 49f68528d2c..7d21cea1f97 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_distortion.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.bin b/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.bin
index 49f68528d2c..7d21cea1f97 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.bin b/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.bin
index 49f68528d2c..7d21cea1f97 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_phosphor.bin b/bgfx/shaders/spirv/chains/hlsl/vs_phosphor.bin
index 49f68528d2c..7d21cea1f97 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_phosphor.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_phosphor.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_post.bin b/bgfx/shaders/spirv/chains/hlsl/vs_post.bin
index 49f68528d2c..7d21cea1f97 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_post.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_post.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_prescale.bin b/bgfx/shaders/spirv/chains/hlsl/vs_prescale.bin
index 49f68528d2c..7d21cea1f97 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_prescale.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_prescale.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_scanline.bin b/bgfx/shaders/spirv/chains/hlsl/vs_scanline.bin
index 49f68528d2c..7d21cea1f97 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_scanline.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_scanline.bin
Binary files differ
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc
index c0d8ba07ac7..2c11ac8499b 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc
@@ -23,19 +23,11 @@ void main()
vec4 cout = vec4(0.0, 0.0, 0.0, cin.a);
mat3 xy = mat3(u_chroma_a.xyz, u_chroma_b.xyz, u_chroma_c.xyz);
-#ifdef TRANSPOSED_XYZ_TO_sRGB
- const mat3 XYZ_TO_sRGB = mat3(
- 3.2406, -0.9689, 0.0557,
- -1.5372, 1.8758, -0.2040,
- -0.4986, 0.0415, 1.0570
+ mat3 XYZ_TO_sRGB = mtxFromRows3(
+ vec3( 3.2406, -1.5372, -0.4986),
+ vec3(-0.9689, 1.8758, 0.0415),
+ vec3( 0.0557, -0.2040, 1.0570)
);
-#else
- const mat3 XYZ_TO_sRGB = mat3(
- 3.2406, -1.5372, -0.4986,
- -0.9689, 1.8758, 0.0415,
- 0.0557, -0.2040, 1.0570
- );
-#endif
for (int i = 0; i < 3; ++i) {
float Y = u_y_gain[i] * cin[i];
diff --git a/src/osd/modules/render/bgfx/shaders/shader.mk b/src/osd/modules/render/bgfx/shaders/shader.mk
index b9cf2f47cef..e7db3cdc242 100644
--- a/src/osd/modules/render/bgfx/shaders/shader.mk
+++ b/src/osd/modules/render/bgfx/shaders/shader.mk
@@ -43,24 +43,24 @@ SHADER_PATH=shaders/dx11/$(SHADERS_DIR)
else
ifeq ($(TARGET), 2)
VS_FLAGS=--platform nacl
-FS_FLAGS=--platform nacl --define TRANSPOSED_XYZ_TO_sRGB
+FS_FLAGS=--platform nacl
SHADER_PATH=shaders/essl/$(SHADERS_DIR)
else
ifeq ($(TARGET), 3)
VS_FLAGS=--platform android
-FS_FLAGS=--platform android --define TRANSPOSED_XYZ_TO_sRGB
+FS_FLAGS=--platform android
CS_FLAGS=--platform android
SHADER_PATH=shaders/essl/$(SHADERS_DIR)
else
ifeq ($(TARGET), 4)
VS_FLAGS=--platform linux -p 120
-FS_FLAGS=--platform linux -p 120 --define TRANSPOSED_XYZ_TO_sRGB
+FS_FLAGS=--platform linux -p 120
CS_FLAGS=--platform linux -p 430
SHADER_PATH=shaders/glsl/$(SHADERS_DIR)
else
ifeq ($(TARGET), 5)
VS_FLAGS=--platform osx -p metal
-FS_FLAGS=--platform osx -p metal --define TRANSPOSED_XYZ_TO_sRGB
+FS_FLAGS=--platform osx -p metal
CS_FLAGS=--platform osx -p metal
SHADER_PATH=shaders/metal/$(SHADERS_DIR)
else